Chinaunix首页 | 论坛 | 博客
  • 博客访问: 219572
  • 博文数量: 70
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 735
  • 用 户 组: 普通用户
  • 注册时间: 2014-10-25 13:37
个人简介

对我认真的人,我会加倍珍惜

文章分类

全部博文(70)

文章存档

2016年(1)

2015年(15)

2014年(54)

分类: Oracle

2014-11-04 17:26:11

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

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

 

阅读(1110) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~