CREATING PRIMARY AND STANDBY DATABASE ON THE SAME MACHINE
You are setting up a Standby database environment in the same machine
as the primary database.
1. You issue.....
alter database create standby controlfile as '$HOME/standby.ctl';
alter system archive log current;
2. copy this generated controlfile to directory where you intend to place
the standby database
3. Make a copy of the init.ora file to be used by the standby database
and include the appropriate initialization parameters to point to
where where the primary database files reside, followed by the
directory path where the (test) standby database will reside:
Oracle7 -- db_file_standby_name_convert and log_file_standby_name_convert
Oracle8 -- db_file_name_convert and log_file_name_convert
Also edit the control_files parameter to point to the standby
4. With the primary database shutdown, copy the redo log files
and database files to the standby directory
5. With the primary database now up, you try to mount the standby:
SVRMGR> alter database mount standby database;
alter database mount standby database
ORA-01102: cannot mount database in EXCLUSIVE mode
6. If you shut the primary database down, the command succeeds but then
you get the same error when trying to open the primary database.
7. Deleting the lk file made no difference - but maybe that was
because it was not really deleted as it was being held open by some
The failure is because shared memory has already been
created for this ORACLE SID, and you are attempting to create the same
shared memory for the same ORACLE SID.
Solution: SET INIT.ORA PARAMETER ON STANDBY DATABASE
1. Shutdown the standby database
2. Starting with Oracle Release 7.3.3:
add _standby_lock_name_space= in the init.ora of standby database
Starting with Oracle Release 8.0.X:
add lock_name_space= in the init.ora of standby database
where is a name other than the primary's database name,
up to 8 characters long
You can use a naming convention like:
If Primary db_name = DB1
set lock_name_space = DB1s
3. startup nomount standby database
4. alter database mount standby database
The above solution works for TESTING standby databases on the
same machine as the Primary Database.
Do not, however, use the same machine to keep an actual standby
database. This defeats the purpose of a standby if your entire
machine were to crash.
01-02-2001, 01:02 PM
I think this will answer your question:
you are just doing a generic string substitution, not renaming every file. you only get one shot at it, as you have discovered.
if your filesystems are not similar --on our primary we have 7 logical file systems and the standby has 2 logical filesystems [*note: not by *my* design ;) ]-- you have to rename the files in the controlfile (normal methodolgy except this is done after ALTER DATABASE MOUNT STANDBY DATABASE ) or as they are added
CREATE DATABASE CREATE DATAFILE 'primaryname' AS 'standbyname';