When the application redo log is started, the redo log is canceled when the application is disabled:
8.1 Starting Up and Shutting Down a Physical Standby Database
This section describes the SQL * Plus statements used to start up and shut down a physical standby database.
8.1.1Starting Up a Physical Standby Database8.1.1 start the Physical Standby Database
To start a physical standby database, use SQL * Plus to connect to the database with administrator privileges, and then use either the SQL * PlusSTARTUP
OrSTARTUP
MOUNT
Statement. When used on a physical standby database:
TheSTARTUP
Statement starts the database, mounts the database as a physical standby database, and opens the database for read-only access.
TheSTARTUP MOUNT
Statement starts and mounts the database as a physical standby database, but does not open the database.
Once mounted, the database can receive archived redo data from the primary database. you then have the option of either starting Redo Apply or real-time apply, or opening the database for read-only access.
Once the database is loaded, the database can receive archived redo logs from the master database. Then, you can enable application Redo or real-time application, or access the database in read-only mode.
For example:
Start and mount the physical standby database:
SQL> STARTUP MOUNT;
Start Redo Apply or real-time apply:
To start Redo Apply, issue the following statement:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE2> DISCONNECT FROM SESSION; ######################################## ################################# Sat Mar 29 11:48:57 2014 ALTER DATABASE recover managed standby database disconnect from SESSIONSat Mar 29 11:48:57 2014 Attempt to start background Managed Standby Recovery process (PRODSTD) MRP0 started with pid = 54, OS id = 3158Sat Mar 29 11:48:57 2014MRP0: Background Managed Standby Recovery process started (PRODSTD) managed Standby Recovery not using Real Time ApplyMedia Recovery Waiting for thread 1 sequence 29Sat Mar 29 11:49:03 2014 Completed: alter database recover managed standby database disconnect from session ############################### ######################################## #####To start real-time apply, issue the following statement:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE2> USING CURRENT LOGFILE;
On the primary database, queryRECOVERY_MODE
Column inV$ARCHIVE_DEST_STATUS
View, which displays the standby database's operationMANAGED_RECOVERY
For Redo Apply andMANAGED REAL TIME APPLY
For real-time apply.
On the master database, you can queryRECOVERY_MODE column, which shows the operations performed on the standby database.
MANAGED_RECOVERY redo application or managed real time apply real-TIME application.
SeeSection 6.3for information about Redo Apply, Section 6.2.1for information about real-time apply, andSection 8.2for information about opening a physical standby database for read-only or read/write access.
Note:
When you first start Redo Apply on a newly created physical standby database that has not yet has Ed any redo data from the primary database,
ORA-01112
Message may be returned. this indicates that Redo Apply is unable to determine the starting sequence number for media recovery. if this occurs, you must either manually retrieve and register an archived redo log file on the standby database, or wait for the automatic IC archiving to occur before restarting Redo Apply. when you redo the application for the first time in a new physical standby database, the master database does not archive the log to the standby database, so the error ORA-01112 is reported. this means that the redo application cannot provide a log serial number for media restoration. If this happens, you must manually generate an archive log on the slave database or automatically archive the log before redoing the application.
8.1.2Shutting Down a Physical Standby Database
Toshut down a physical standby database and stop Redo Apply, use the SQL * PlusSHUTDOWN
Statement. Control is not returned to the session that initiates a database shutdown until shutdown is complete.
Disable the physical standby database and the redo application.SHUTDOWN
Statement.
If the primary database is up and running, defer the destination on the primary database and perform a log switch before shutting down the standby database.
If the master database is running, the destination is postponed on the master database and the log switch is executed before the slave database is closed.
To stop Redo Apply before shutting down the database, use the following steps:
Stop redo the application before closing the database. follow these steps:
Issue the following query to find out if the standby database is refreshing Redo Apply or real-time apply. If the MRP0 or MRP process exists, then the standby database is applying redo.
1. Check whether the standby database is redoing the application or real-time application through the following query. If the MRP0 or MRP process exists, the Standby database is redoing the application.
SQL> SELECT PROCESS, STATUS FROM V $ MANAGED_STANDBY; ######################################## ####################################### PROCESS STATUS --------- ------------ arch connectedarch CONNECTEDMRP0 WAIT_FOR_LOGRFS idlerfs idle ############################### ######################################## ########
If Redo Apply is running, cancel it as shown in the following example:
2. If the redo application is running, use the following example to cancel it.
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL; ######################################## ####################################### Sat mar 29 11:49:40 2014 alter database recover managed standby database CANCELSat Mar 29 11:49:42 2014MRP0: background Media Recovery canceled with status 16037Sat Mar 29 11:49:42 2014 Errors in file/u01/app/Oracle/admin/PRODSTD/bdump/prodstd_mrp0_3158.trc: ORA- 16037: user requested cancel of managed recovery operationRecovery interrupted! Sat Mar 29 11:49:43 2014 Waiting for MRP0 pid 3158 to terminateWaiting for MRP0 pid 3158 to terminateWaiting for MRP0 pid 3158 to terminateSat Mar 29 11:49:45 2014 Errors in file/u01/app/oracle/admin/ PRODSTD/bdump/prodstd_mrp0_3158.trc: ORA-16037: user requested cancel of managed recovery operationSat Mar 29 11:49:45 2014MRP0: Background Media Recovery process shutdown (PRODSTD) Sat Mar 29 11:49:46 20 14 Managed Standby Recovery Canceled (PRODSTD) Completed: After alter database recover managed standby database cancel cancels the log application, there is no MRP0 process. ######################################## #######################################
Shut down the standby database.
3. Close the slave database.
SQL> SHUTDOWN IMMEDIATE;
Recommended reading:
RMAN: Configure an archive log deletion policy
Basic Oracle tutorial-copying a database through RMAN
Reference for RMAN backup policy formulation
RMAN backup learning notes
Oracle Database Backup encryption RMAN Encryption