查看数据库可进行的角色转换
创新互联专注于企业成都全网营销推广、网站重做改版、平武网站定制设计、自适应品牌网站建设、HTML5建站、商城建设、集团公司官网建设、外贸网站制作、高端网站制作、响应式网页设计等建站业务,价格优惠性价比高,为平武等各大城市提供网站开发制作服务。
1. $sqlplus / as sysdba
2. SQL> select switchover_status from gv$database;
查询主备库同步情况
3. select unique thread# as thread,max(sequence#) over(partition by thread#) as last from gv$archived_log;
4. select thread# ,low_sequence#,high_sequence# from gv$archive_gap;
将主库切换为备库
5. alter database commit to switchover to physical standby with session shutdown ;
6. select switchover_status from gv$database;
将备库切换为主库
7. select open_mode from gv$database;
8. select switchover_status from gv$database;
9. select unique thread# as thread,max(sequence#) over(partition by thread#) as last from gv$archived_log;
10 $ srvctl stop instance –i ebiz2 –d ebizsh
11.SQL> alter database commit to switchover to primary with
session shutdown ;
12. alter database open;
13. $ srvctl start instance –i ebiz2 –d ebizsh
原主库转备库后开始应用日志
14. SQL> alter database recover managed standby database using current logfile disconnect from session;
15. $ srvctl start instance -d ebiz -i ebiz2
16. SQL> select open_mode from gv$database;
(7) Oracle登录数据库服务器,原同城备库需要在黑龙江和上海主备切换后重新启动日志应用
17. SQL> alter database recover managed standby database
using current logfile disconnect from session;
18. SQL> select status from v$managed_standby where
process like 'MRP%';
只启动数据库节点1实例
19. $ srvctl start instance –i ebiz1 –d ebiz
20. $ srvctl stop instance –i ebiz2 –d ebiz
继续进行redo apply
21. SQL> alter database recover managed standby database
using current logfile disconnect;
直至日志同步完毕,SCN号不变,同时检查 gv$archived_log视图,序列号达到源端最大值
22. SQL> select current_scn from gv$database;
23. SQL>select unique thread# as thread,max(sequence#)
over(partition by thread#) as last from gv$archived_log;
24. $asmcmd
25. Cp +DATA_DG/ebiz/archivelog/YYYYMMDD/XXXX
/rman/backup/ --拷贝至文件系统
ftp或scp至上海
注册归档日志文件
26. SQL > ALTER DATABASE REGISTER PHYSICAL LOGFILE
'XXXX';
27. Database altered.
然后进行redo apply
28. SQL> alter database recover managed standby database using current logfile disconnect;
29. SQL> alter database commit to switchover to primary with
session shutdown ;
30. SQL> alter database open; SQL> select open_mode from
gv$database;
31. SQL> select switchover_status from gv$database;
32. $ srvctl start instance –i ebiz2 –d ebizsh