本文主要描述Oracle 10g的备库开启闪回后,以read write方式打开,进行数据查询,写入等测试操作。之后再将备库闪回到open read write之前的状态,继续做主库的备库。
欢迎转载,请注明作者、出处。
作者:张正
blog:http://space.itpub.net/26355921
QQ:176036317
如有疑问,欢迎联系。
需求说明:
需要将备库以open read write 方式打开,进行读写测试等操作,之后再将备库还原,重新作为主库的备库。
1.备库开启闪回:
alter database recover managed standby database cancel;
alter system set db_recovery_file_dest_size=10G;
alter system set db_recovery_file_dest='/u01/app/oracle/flashback/test';
alter database flashback on;
2.创建闪回点:
create restore point p1 guarantee flashback database;
3.主库停止给该备库传输日志:
alter system archive log current;
alter system set log_archive_dest_state_2=defer;
4.备库激活read write模式:
alter database activate standby database;
shutdown immediate
startup mount
SQL> alter database open;
Database altered.
SQL> select open_mode from v$database;
OPEN_MODE
----------
READ WRITE
5.现在即可对备库进行读写测试操作,操作完成后再将备库闪回,重新作为主库的备库。
6.以mount打开,并闪回:
shutdown immediate
startup mount
flashback database to restore point p1;
7.将备库的状态重新置为备库:
alter database convert to physical standby;
shutdown immediate
startup mount
8.启动恢复:
alter database recover managed standby database disconnect from session;
9.主库恢复给备库传输日志:
alter system set log_archive_dest_state_2=enable;
需要将备库以open read write 方式打开,进行读写测试等操作,之后再将备库还原,重新作为主库的备库。
1.备库开启闪回:
alter database recover managed standby database cancel;
alter system set db_recovery_file_dest_size=10G;
alter system set db_recovery_file_dest='/u01/app/oracle/flashback/test';
alter database flashback on;
2.创建闪回点:
create restore point p1 guarantee flashback database;
3.主库停止给该备库传输日志:
alter system archive log current;
alter system set log_archive_dest_state_2=defer;
4.备库激活read write模式:
alter database activate standby database;
shutdown immediate
startup mount
SQL> alter database open;
Database altered.
SQL> select open_mode from v$database;
OPEN_MODE
----------
READ WRITE
5.现在即可对备库进行读写测试操作,操作完成后再将备库闪回,重新作为主库的备库。
6.以mount打开,并闪回:
shutdown immediate
startup mount
flashback database to restore point p1;
7.将备库的状态重新置为备库:
alter database convert to physical standby;
shutdown immediate
startup mount
8.启动恢复:
alter database recover managed standby database disconnect from session;
9.主库恢复给备库传输日志:
alter system set log_archive_dest_state_2=enable;
本文转自ITPUB博客84223932的博客,原文链接:Oracle 10G使用类似snapshot standby的功能,备库闪回,如需转载请自行联系原博主。