oracle的dataguard physical standby转 snapshot standby操作文档

oracle的dataguard physical standby转 snapshot standby操作文档

一 physical standby 转 snapshot

1.1 查看 fast recovery area 是否配置

show parameter db_recovery_file_dest

如果未设置或者设置太小,则需要调整
alter system set db_recovery_file_dest='+DATA' scope=both;
alter system set db_recovery_file_dest_size=1T scope=both;

1.2 查看备库是否开启数据库闪回

--已开启归档模式下可以在线修改
SQL> select open_mode,log_mode,flashback_on from v$database;
SQL> alter database flashback on;

1.3 转换为snapshot standby

alter database recover managed standby database cancel;
shutdown immediate;
startup mount;
alter database convert to snapshot standby;

1.4 open前先清理dest 路径,防止给异地dg\生产主库 传归档日志

alter system set log_archive_dest_2='';
alter system set log_archive_dest_3='';

1.5 启动到open状态

alter database open;
select open_mode,database_role from v$database;

1.6 确认日志是否正常传输到备库

--查询主库
 select  max(sequence#) from v$archived_log;
 
--查询备库
select  max(sequence#) from v$archived_log;

二 snapshot 转 physical standby

2.1 转换为physical standby

shutdown immediate
 
startup mount
alter database convert to physical standby;
 
shutdown immediate
startup

select open_mode, database_role from v$database;

2.2 开启日志应用

alter database recover managed standby database using current logfile disconnect from session;

2.3 查看同步

set line 300
select * from v$dataguard_stats;

并查看备库alert日志,要有in transit 字样

2.4 关闭备库数据库闪回

SQL> select open_mode,log_mode,flashback_on from v$database;
SQL> alter database flashback off;

你可能感兴趣的:(oracle,oracle,数据库,运维)