启动时应用重做日志,关闭时取消重做日志:
8.1Starting Up and Shutting Down a Physical Standby DatabaseThis section describes the SQL*Plus statements used to start up and shut down a 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*PlusSTARTUPorSTARTUPMOUNTstatement. When used on a physical standby database:
-
TheSTARTUPstatement starts the database, mounts the database as a physical standby database, and opens the database for read-only access.
-
TheSTARTUP MOUNTstatement 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.
一旦数据库装载后,数据库就能从主库接收归档重做日志。然后,你可以选择启用应用重做或者实时应用,再或者以只读方式打开数据库来访问。
For example:
Start and mount the physical standby database:
Start Redo Apply or real-time apply:
To start Redo Apply, issue the following statement:
To start real-time apply, issue the following statement:
On the primary database, query theRECOVERY_MODEcolumn in theV$ARCHIVE_DEST_STATUSview, which displays the standby database's operation asMANAGED_RECOVERYfor Redo Apply andMANAGED REAL TIME APPLYfor real-time apply.
在主库上,你可以查询V$ARCHIVE_DEST_STATUS的RECOVERY_MODE列,可以显示出备库的操作是MANAGED_RECOVERY 重做应用还是MANAGED REAL TIME APPLY实时应用。
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 received any redo data from the primary database, anmessage 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 archiving to occur before restarting Redo Apply.Toshut down a physical standby database and stop Redo Apply, use the SQL*PlusSHUTDOWNstatement. Control is not returned to the session that initiates a database shutdown until shutdown is complete.
关闭物理备库以及关闭重做应用,使用SHUTDOWN 语句。
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.
如果主库正在运行,在主数据库上推迟目的地以及在关闭备库之前先执行日志切换。
To stop Redo Apply before shutting down the database, use the following steps:
在关闭数据库之前要先停止重做应用,使用一下步骤:
Issue the following query to find out if the standby database is performing Redo Apply or real-time apply. If the MRP0 or MRP process exists, then the standby database is applying redo.
1.通过如下查询找出备库是在重做应用还是实时应用,如果MRP0或者MRP进程存在,那么备库正在应用重做。
If Redo Apply is running, cancel it as shown in the following example:
2.如果重做应用正在运行,用如下例子来取消它。
Shut down the standby database.
3.关闭备库。
推荐阅读:
RMAN 配置归档日志删除策略
Oracle基础教程之通过RMAN复制数据库
RMAN备份策略制定参考内容
RMAN备份学习笔记
Oracle数据库备份加密 RMAN加密