加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Flashing Back a Failed Primary Database into a Physical Stan

发布时间:2020-12-15 18:03:43 所属栏目:百科 来源:网络整理
导读:The following steps assume that a failover has been performed to aphysical standby database and that Flashback Database was enabled on the oldprimary database at the time of the failover. This procedure brings the oldprimary database back

The following steps assume that a failover has been performed to aphysical standby database and that Flashback Database was enabled on the oldprimary database at the time of the failover. This procedure brings the oldprimary database back into the Data Guard configuration as a physical standbydatabase.

?

Step 1???Determine theSCN at which the old standby database became the primary database.

On the new primary database,issue the following query to determinethe SCN at which the old standby database became the new primary database:

?

SQL>? SELECT TO_CHAR(STANDBY_BECAME_PRIMARY_SCN)FROM V$DATABASE;

?

TO_CHAR(STANDBY_BECAME_PRIMARY_SCN)

----------------------------------------

1095159

Step 2???Flash backthe failed primary database.

Shut down the old primary database (if necessary),mountit,and flash it back to the value for STANDBY_BECAME_PRIMARY_SCN that wasdetermined in Step1.

SQL> shutdownimmediate;

SQL> STARTUPMOUNT;

SQL> FLASHBACKDATABASE TO SCN 1095159;

?

Step 3???Convert thedatabase to a physical standby database.

Perform the following steps on the old primary database:

  1. Issue the following statement on the old primary database:

SQL> ALTERDATABASE CONVERT TO PHYSICAL STANDBY;

Database altered.

?

This statement will dismount the database after successfullyconverting the control file to a standby control file.

?

  1. Shut down and restart the database:

SQL>shutdown immediate;

SQL>startup mount;

?

Step 4???Starttransporting redo to the new physical standby database.

Perform the following steps on the new primary database:

  1. Issue the following query to see the current state of the archive destinations:

SQL> col ERRORfor a20

SQL> colDESTINATION for a20

SQL> colDEST_NAME for a20

SQL> SELECTDEST_ID,DEST_NAME,STATUS,PROTECTION_MODE,DESTINATION,ERROR,SRL FROMV$ARCHIVE_DEST_STATUS;

?

  1. If necessary,enable the destination:

SQL> ALTER SYSTEMSET LOG_ARCHIVE_DEST_STATE_n=ENABLE;

?

  1. Perform a log switch to ensure the standby database begins receiving redo data from the new primary database,and verify it was sent successfully. Issue the following SQL statements on the new primary database:

SQL>? ALTER SYSTEM SWITCH LOGFILE;

SQL> SELECTDEST_ID,SRL FROMV$ARCHIVE_DEST_STATUS;

?

Step 5???Start RedoApply on the new physical standby database.

Issue the following SQL statement on the new physical standbydatabase:

?

SQL> alterdatabase recover managed standby database using current logfile disconnect fromsession;

?

Redo Apply automatically stops each time it encounters a redo recordthat is generated as the result of a role transition,so Redo Apply will needto be restarted one or more times until it has applied beyond the SCN at whichthe new primary database became the primary database. Once the failed primarydatabase is restored and is running in the standby role,you can optionallyperform a switchover to transition the databases to their original(pre-failure) roles.


转载请注明作者出处及原文链接,否则将追究法律责任:

作者:xiangsir

原文链接:http://blog.csdn.net/xiangsir/article/details/9206877

QQ:444367417

MSN:xiangsir@hotmail.com

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读