主庫歷經open resetlogs後,如何redo apply 物理備庫_flashback physical standby db

wisdomone1發表於2010-01-27

Flashing Back a Physical Standby Database to a Specific Point-in-Time

The following steps describe how to avoid re-creating a physical standby database after you issued the OPEN RESETLOGS statement on the primary database.


Step 1   Determine the SCN before the RESETLOGS operation occurred.

On the primary database, use the following query to obtain the value of the system change number (SCN) that is 2 SCNs before the RESETLOGS operation occurred on the primary database:

SQL> SELECT TO_CHAR(RESETLOGS_CHANGE# - 2) FROM V$DATABASE;

Step 2   Obtain the current SCN on the standby database.

On the standby database, obtain the current SCN with the following query:

SQL> SELECT TO_CHAR(CURRENT_SCN) FROM V$DATABASE;

Step 3   Determine if it is necessary to flash back the database.

If the value of CURRENT_SCN is larger than the value of resetlogs_change# - 2, issue the following statement to flash back the standby database.

SQL> FLASHBACK STANDBY DATABASE TO SCN resetlogs_change# -2;
  • If the value of CURRENT_SCN is less than the value of the resetlogs_change# - 2, skip to Step .

  • If the standby database's SCN is far enough behind the primary database's SCN, log apply services will be able to continue through the OPEN RESETLOGS statement without stopping. In this case, flashing back the database is unnecessary because log apply services do not stop upon reaching the OPEN RESETLOGS statement in the redo data.




補註:
1,備庫在啟用flashback前,須配置db_recovery_file_dest[_size],此二個引數為依賴性引數,少一不可
2,主庫的alter database open resetlogs,須是主庫經歷不完全恢復,現在想出如何模擬此種情景
3,開啟備庫flashback,就是為了主庫open resetlogs後,避免重構備庫

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-626119/,如需轉載,請註明出處,否則將追究法律責任。

相關文章