DG 查询/切换的相关命令

发布时间:2020-07-30 09:42:39 作者:新梦传奇
来源:网络 阅读:682

 查看数据库可进行的角色转换

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%';

DG 查询/切换的相关命令启动数据库节点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


推荐阅读:
  1. Python中怎么创建一个系统监控程序
  2. 掉电引起的ORA-1172错误解决过程(一)

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

相关命令 dg %d

上一篇:如何替换php关键词

下一篇:查看mongodb是否安装成功的方

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》