ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 主库历经open resetlogs后,如何redo apply 物理备库_flashback physical standby db

主库历经open resetlogs后,如何redo apply 物理备库_flashback physical standby db

原创 Linux操作系统 作者:wisdomone1 时间:2010-01-27 10:25:44 0 删除 编辑

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 4.

  • 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博客 ” ,链接:https://blog.itpub.net/9240380/viewspace-626119/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
提供针对oracle初学者及进阶的数据库培训,欢迎大家咨询: 微信: wisdomone 微信公众号: lovedb 工作经历: 中国普天 北京科蓝 北京云和恩墨 北京神州新桥

注册时间:2008-04-04

  • 博文量
    2189
  • 访问量
    12689917