1. 程式人生 > >Oracle Data Guard_啟動和關閉物理備庫

Oracle Data Guard_啟動和關閉物理備庫

8.1.1Starting Up a Physical Standby Database

8.1.1 啟動物理備庫

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:

  1. Start and mount the physical standby database:

    SQL> STARTUP MOUNT;
  2. Start Redo Apply or real-time apply:

    To start Redo Apply, issue the following statement:

    SQL>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE   2>DISCONNECT FROM SESSION;
    ######################################################################### Sat Mar 29 11:48:57 2014 ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION Sat Mar 29 11:48:57 2014 Attempt to start background Managed Standby Recovery process (PRODSTD) MRP0 started with pid=54, OS id=3158 Sat Mar 29 11:48:57 2014 MRP0: Background Managed Standby Recovery process started (PRODSTD) Managed Standby Recovery not using Real Time Apply Media Recovery Waiting for thread 1 sequence 29 Sat 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 DATABASE   2>USING CURRENT LOGFILE;

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, anORA-01112message 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. 當你在一個新建立的物理備庫上第一次應用重做時,主庫並沒有歸檔日誌傳輸到備庫來,於是報錯ORA-01112.這意味著重做應用無法為介質恢復提供一個日誌序號。如果這個情況發生,你必須手動在備庫上生成一個歸檔日誌,或者在重做應用之前自動歸檔。