The following procedure describes the steps involved in creating a standby database on a different host without the instance configured.
Before You Begin
LOG_ARCHIVE_DEST_1='LOCATION=C:\Oracle\Oradata\TSH1\Archive MANDATORY REOPEN=30'
LOG_ARCHIVE_DEST_2='SERVICE=stby1 LGWR SYNC AFFIRM'
*.log_archive_dest_1='LOCATION=/ LOCATION_OF_DESTINATION_DB_ARCHIVELOG /arch'
*.STANDBY_ARCHIVE_DEST='/ LOCATION_OF_STANDBY_DB_ARCHIVELOG /stdbyarch'
*.STANDBY_FILE_MANAGEMENT=auto
DB_FILE_NAME_CONVERT=('/DATA_FILE_PATH_ON_SOURCE_MACHINE/stdby', '/ORACLE_DATA_FILE_PATH_ON_STANDBY_MACHINE/stdby/')
LOG_FILE_NAME_CONVERT=('/ DATA_FILE_PATH_ON_SOURCE_MACHINE /stdby', '/ ORACLE_DATA_FILE_PATH_ON_STANDBY_MACHINE /stdby/')
For example, set up the listener and configure the destination computer's $TNS_ADMIN/tnsnames.ora file for the standby database.
On Source computer:
<Standbydb1_use_diff_connection_string> =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = destination_host_name)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = <standbydb_use_same_db_name_as_primary>)
(UR = A)
)
)
<Standbydb_primary> =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = primary_host_name)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = <standbydb_same_as_destination><)
)
)
On standby computer:
<standbydb1_destination_connection_string> =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = destination_standby_host_name)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = <standbydb_destination_db_name_same_as_primary>)
(UR = A)
)
)
<standbydb_primary_connection> =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = primary_host_name)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = <standbydb_primary_db>)
)
)
run {
allocate auxiliary channel ch1 type 'sbt_tape'
PARMS="SBT_LIBRARY=<destination_software_install_path>/Base/libobk.so,BLKSIZE=262144,ENV=(CvInstanceName=<destination_instance_name>,CvClientName=<destination_host_name>,CvOraSID=<destination_oracle_sid>)"
TRACE 0;
set until scn ##### ;
duplicate target database for standby
dorecover
;}
For Oracle 10g or higher, ensure that you set the Standby Role Initialization parameter,
DB_FILE_NAME_CONVERT,to add all the temp data files from the primary database
location to the standby database location, as follows:
DB_FILE_NAME_CONVERT='<primary_database_temp_datafile_old _location>','<standby_database_temp_datafile_new_location>' If this parameter is not set, restore will fail with the following error message: temporary file TEMP01.DBF conflicts with file used by target database |
Required Capability: See Capabilities and Permitted Actions
To create a standby database on a different host without the instance configured:
Alter database recover managed standby database disconnect;