--确保standby数据库置于flashback on 状态
--设置闪回恢复区
alter system set db_recovery_dest_size=2g;
alter system set db_recovery_file_dest='+DATA';
--取消备库的自动恢复状态
alter database recover managed standby database cancel;
--创建一个还原点
create restore point restore_point_test
--在主库归档当前日志,确保前一步创建还原点的scn的归档日志已经传到备库
alter system archive log current;
--将主库到备库的归档目的地状态设置为defer
alter system set log_archive_dest_state_2=defer;
--激活备库到read/write状态
alter database activate standby database;
alter database open;
--在备库上创建数据
create table t1 as select * from dba_objects where rownum<=10;
drop table t1;
--将数据库flashback回原来保存的还原点
startup mount force;
flashback database to restore point restore_point_test;
--转换成备库
alter database convert to physical standby;
--将备库至于自动恢复状态
startup mount force;
alter database recover managed;
--将主库到备库的归档目的地状设置为enable
alter system set log_archive_dest_state_2=enable;
--检查主库状态
select dest_name,status from v$archive_dest;
--检查备库状态
select process,status from managed_standby;
--设置闪回恢复区
alter system set db_recovery_dest_size=2g;
alter system set db_recovery_file_dest='+DATA';
--取消备库的自动恢复状态
alter database recover managed standby database cancel;
--创建一个还原点
create restore point restore_point_test
--在主库归档当前日志,确保前一步创建还原点的scn的归档日志已经传到备库
alter system archive log current;
--将主库到备库的归档目的地状态设置为defer
alter system set log_archive_dest_state_2=defer;
--激活备库到read/write状态
alter database activate standby database;
alter database open;
--在备库上创建数据
create table t1 as select * from dba_objects where rownum<=10;
drop table t1;
--将数据库flashback回原来保存的还原点
startup mount force;
flashback database to restore point restore_point_test;
--转换成备库
alter database convert to physical standby;
--将备库至于自动恢复状态
startup mount force;
alter database recover managed;
--将主库到备库的归档目的地状设置为enable
alter system set log_archive_dest_state_2=enable;
--检查主库状态
select dest_name,status from v$archive_dest;
--检查备库状态
select process,status from managed_standby;