Professional Documents
Culture Documents
STBY =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = standby_host )(PORT = 1512))
)
(CONNECT_DATA =
(SERVICE_NAME = standby_sid)
)
)
Assuming your database in already in ARCHIVELOG mode the first four of the following init.ora paramters will already be set.
Add the last two entires:
log_archive_start = true
log_archive_dest_1 = "location=C:\Oracle\oradata\ORCL\archive"
log_archive_dest_state_1 = enable
log_archive_format = %%ORACLE_SID%%T%TS%S.ARC
Copy the production backup files to the standby server (parameter file, password file,data files, redo log files)
Copy the standby controlfile to the standby server.
log_archive_start = true
log_archive_dest_1 = "location=C:\Oracle\oradata\ORCL\archive"
log_archive_dest_state_1 = enable
log_archive_format = %%ORACLE_SID%%T%TS%S.ARC
log_archive_dest_2 = "service=STBY optional reopen=5"
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = ntfm451)(PORT = 1512))
)
STANDBY_LISTENER = (ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(PORT=1512)(HOST=standby_server))
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = standby_server)(PORT = 1521))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = standby_server)(PORT = 1512))
)
)
(DESCRIPTION =
(PROTOCOL_STACK =
(PRESENTATION = GIOP)
(SESSION = RAW)
)
(ADDRESS = (PROTOCOL = TCP)(HOST = standby_server)(PORT = 2481))
)
)
STANDBY_LISTENER = (ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp) (PORT=1512) (HOST=standby_server))
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = C:\Oracle\Ora81)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(ORACLE_HOME = C:\Oracle\Ora81)
(SID_NAME = orcl)
)
)
SID_LIST_STANDBY_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = standby_sid)
(ORACLE_HOME = C:\Oracle\Ora81)
)
)
Reload the listener file using lsnrctl reload from the command prompt.
Add the following entry into the tnsnames.ora file:
STBY =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = standby_server)(PORT = 1512))
)
(CONNECT_DATA =
(SERVICE_NAME = standby_sid)
)
)
Regular recovery requires archive logs to be copied manually between the server and user initiation of the recovery process.
Copy all archive logs from the primary to the standby server.
From sqlplus do the following:
During managed recovery the transfer of archivelogs is controlled by the servers without user intervention.
Copy all archive logs from the primary to the standby server. This is the only time you should need to do this.
From sqlplus do the following:
As logs are archived from the primary, they will be applied to the standby. There is no indication in the recovery session that logs are being
applied. In order to monitor progress, check the standby aler.log. For example
This window will then hang indefinitely while it continues to look for archive logs to apply. To stop the recovery open another sqlplus
session and type:
The standby database can be opened in read only mode at any point. While open in this mode new archive logs are not applied to the
database.
Backups of the standby database can only be performed if the database is shut down or in read only mode. Read only mode is best for
managed recovery systems as archive logs will still be transfered during the backup process, thus preventing gap sequences. Once the
server is in the desired mode simple copy the appropriate database files.
Standby server not available for a period
Copy all archive logs from the primary to the standby server which were not copied and use following
Standby database will recover all new-copied files immediately and wait for next.
Alert log file display the following message
To activate the standby, first try to copy the most recent archive logs over to the standby, and apply them, then use
Then shutdown the standby to reset file headers and clear all buffers. You can’t copy only redo logs from the primary to the standby.
The standby is dismounted when activated.
The standby bit in the controlfile is no set, so you can never go back – the standby is now your primary database. Since redo log sequence
was reset when the standby was opened, it is a good idea to take a full backup at this point.
Miscellaneous
Sustained recovery will NOT retrospectively apply archive log, which have already been generated on the standby host. For example, the
primary may have already archived a number of logs to the remote (standby) host. If the standby is put into sustained recovery mode after
the logs have been archived, and the logs are required for roll forward, the recovery session will sit there forever (unless the timeout
parameter is specified).
Solution: Ensure all logs already archived to the standby host have been applied before starting a sustained recovery session. This can be
achieved by first performing non-sustained recovery.