当前位置:   article > 正文

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

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
  • 3
  • 4
  • 5

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

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

1.3 转换为snapshot standby

alter database recover managed standby database cancel;
shutdown immediate;
startup mount;
alter database convert to snapshot standby;
  • 1
  • 2
  • 3
  • 4

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

alter system set log_archive_dest_2='';
alter system set log_archive_dest_3='';
  • 1
  • 2

1.5 启动到open状态

alter database open;
select open_mode,database_role from v$database;
  • 1
  • 2

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

--查询主库
 select  max(sequence#) from v$archived_log;
 
--查询备库
select  max(sequence#) from v$archived_log;
  • 1
  • 2
  • 3
  • 4
  • 5

二 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;
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

2.2 开启日志应用

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

2.3 查看同步

set line 300
select * from v$dataguard_stats;
  • 1
  • 2

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

2.4 关闭备库数据库闪回

SQL> select open_mode,log_mode,flashback_on from v$database;
SQL> alter database flashback off;
  • 1
  • 2
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/代码探险家/article/detail/1005898
推荐阅读
相关标签
  

闽ICP备14008679号