How to Create a Standby Database
1 Copy the init.ora file from the primary server to the standby database. Edit
the following init.ora parameters for the standby database:
CONTROL_FILES, DB_FILE_NAME_CONVERT, and
LOG_FILE_NAME_CONVERT
You may also need to change parameters such as LOG_ARCHIVE_DEST,
LOG_ARCHIVE_FORMAT, BACKGROUND_DUMP_DEST,and
USER_DUMP_DEST which provide the file locations to reflect the file and
directory layout on the standby.
2 Create the control file for the standby database by issuing the following
command on the primary database
SQL> alter database create standby controlfile as <filename>;
This command creates a copy of the primary database’s control file. Copy the
control file specified above to the standby server at the appropriate location
specified by the CONTROL_FILES parameter of standby database.
3 Back up the data files belonging to the primary database. You can take the
backups while the database is online or offline. You can use the online
tablespace backup methodology if you are using online backup. Otherwise, shut
down the primary database cleanly and back up data files. Use this backup and
copy them to the appropriate location in the standby database server.
4 If you have used online backup in step 3, archive the current online logs of the
primary database by issuing:
SQL> alter system archive log current;
This forces a log switch to archive the current log to guarantee complete recovery
can be performed on the standby database. Copy the archive logs to the standby
database server.
5 Start the standby database in Nomount mode.
SQL> startup pfile=$HOME/initsndby.ora nomount
6 Mount the database using the following command:
SQL> alter database mount standby database;
7 Issue the recover command and apply the archived logs to the standby database
to synchronize it with the primary database by using a special recover command:
SQL> recover standby database;