Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stand By Database File Locations Different 2

Status
Not open for further replies.

Michael42

Programmer
Oct 8, 2001
1,454
US
Hey,

In trying clarify the creation of a Stand By Database,
I have copied:
1. All my datafiles (tablespace).
2. ALTER DATABASE CREATE STANDBY CONTROLFILE...
3. Copied my Archived Redo Logs

I am not sure how to handle the SPFILE. My Stand By location has different paths for the Archive Logs.

Can you please suggest how to deal with the SPFILE differences between Primary and Stand By concerming file locations? I think I need this part spelled out. :)

Also, I see no mention in any Oracle docs on how to handle dirs like: bdump, udump etc. I imagine the soluton for the above can be applied here too.

Thanks,

Michael42
 
You may create a text pfile on the primary and copy it over to standby:

Code:
create pfile=<filename> from spfile;

Copy this over to standby, modify as needed.

For standby databases specifically, there are parameters that address the different path names for datafiles and archive logs:

db_file_name_convert=('<primary path>','<standby path>')
log_file_name_convert=....
standby_archive_dest
log_archive_dest_1

Later, you can again create spfile on standby from this pfile:

Code:
create spfile=<filename> from pfile;
 
Hey, thanks for the post - that helped. :)

I have been reading EVERYTHING I can find on Physical Stand By Database and feel I am really close to understanding it. With your help I have:
Code:
1. Copied all the required files (datafiles, ALTER DATABASE CREATE STANDBY CONTROLFILE..., Archived Redo Logs) to the Stand By.

2. Recreated my initStandBy.ora adding the syntax to accomodate the different locations of the files.

My questions:
1. What else needs to be done before performing: ALTER DATABASE MOUNT STANDBY DATABASE;?

I think I need to make a listener.ora entry at the Stand By location. Again, this is NOT a managed environment (not possible with this one). I'll be doing an FTP from cron to copy the Archive Logs to the Stand By.

2. Also, I am wondering exactly what makes this physical duplicate database a "Stand By" database, i .e. where it ingests the Archive Logs rather than writing them. Is it just the command: ALTER DATABASE MOUNT STANDBY DATABASE?


Thanks very much for making this clearer. :)

Michael42
 
I believe it knows it is a standby because of the standby control file you generated on the primary and moved to the standby. I wrote this into one of our technical reference manuals - Hope this helps...:

2.13.1 Creating a Standby Database -
Assumes you will be able to create the standby database with the exact same directory structure on a separate set of hardware! (You cannot run a standby database on two servers that use a netapps storage for their database files. Both servers would attempt to use the exact same files.)

Ensure that the two servers are setup to perform rsh and rcp (.rhosts, /etc/hosts, /etc/resolv.conf OR ssh, these are for automated method of moving the archivelogs)

1. Create hot backup of primary database or shutdown the database for a cold backup.
2. On primary database enter (svrmgrl or sqlplus /nolog then connect /as sysdba or however you have it set up.):
2.1. alter database create standby controlfile as 'standby_<SID>.ctl'; #where SID is your oracle sid
2.2. alter system archive log current;
3. Transfer all of the files (datafiles, control files, logfiles) to standby server
3.1. Place files into the same directory structure!!! Rename the backup control file to the correct control file names and to the appropriate directories.
3.1.1. Make sure you have all the files in the correct locations, including control files. These files MUST be in the exact same locations as the Primary database's files. There can be only two modifications made, one for ALL datafiles and One for ALL logfiles. Note: there was some strange behavior with control file names for the 2nd and 3rd control file directories being exchanged.
Example:
DB_FILE_STANDBY_NAME_CONVERT=" /share/ora_db", "/share/ora_db1" will rename every datafile that starts with /share/ora_db to /share/ora_db1 INCLUDING any datafile that may be named /share/ora_dbbk to /share/ora_db1bk !!! (The database will open in standby mode, BUT when you shut it down after activation, it will fail on startup because the naming convention was not correct. )
3.1.2. Update init<SID>.ora file
3.1.2.1. DB_FILE_STANDBY_NAME_CONVERT=" ", " " # only if you can change ALL of the datafile locations.
3.1.2.2. LOG_FILE_STANDBY_NAME_CONVERT=" ", " " # only if you can change ALL of the log file locations.
4. On the standby server:
( assume you would have a typical install of oracle at the same release as the primary, with a listener, etc. Really, if this is for Disaster Recovery, it should be identical in those respects, setup exactly like the primary.)
4.1. Export the sid of the standby database
4.2. Ensure that ORACLE_HOME is pointing to the correct oracle binaries.
4.3. Copy all of the log files into the log file directory.
4.4. Start the standby database in NOMOUNT mode:
4.4.1. startup nomount
4.4.2. alter database mount standby database exclusive;
4.4.3. set autorecovery on
4.4.4. recover standby database

5. To keep the servers in sync
5.1. On the primary, force a logfile archive
5.1.1. alter system archive log current;
5.2. Transfer the archived log file to the standby (oracle 7.3.4 or manual methods), if you are 8i, then this can be done via the tnsnames.ora entry, automatically.)

5.3. To Recover Logfile on the standby Enter (svrmgrl):
5.3.1. set autorecovery on
5.3.2. recover standby database
 
dbtoo2001,

Thanks for posting. That was very useful :)

For me, I do not know why it took me sooooo long to really understand Stand By Database. Again, your post and other's in this forum are what made the difference. :)

Thanks,

Michael42
 
u can also use

SQL> Recover managed standby database disconnect from session;

which will allow u to disconnect your telnet session and apply the logs automatically!

hth


Sy UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top