博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Oracle11gr2_ADG管理之switchover实战
阅读量:5036 次
发布时间:2019-06-12

本文共 4536 字,大约阅读时间需要 15 分钟。

. 环境

db_primary db_stanby 备注
db版本 11.2.0.4.0 11.2.0.4.0
os版本 centos 6.4 centos 6.4
db_unique_name newtest snewtest
db name newtest newtest
ip 10.10.0.23 10.10.0.24

1 主库上查询状态

[oracle@localhost dbs]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.4.0 Production on Mon Mar 26 22:53:39 2018Copyright (c) 1982, 2013, Oracle.  All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL> select open_mode ,database_role from v$database;OPEN_MODE            DATABASE_ROLE-------------------- ----------------READ WRITE           PRIMARY

2 备库上查询状态

[oracle@localhost trace]$ sqlplus  / as sysdbaSQL*Plus: Release 11.2.0.4.0 Production on Mon Mar 26 22:55:23 2018Copyright (c) 1982, 2013, Oracle.  All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL> select open_mode ,database_role from v$database;OPEN_MODE            DATABASE_ROLE-------------------- ----------------READ ONLY WITH APPLY PHYSICAL STANDBY

3.备库上swichover

[oracle@localhost trace]$ dgmgrl /DGMGRL for Linux: Version 11.2.0.4.0 - 64bit ProductionCopyright (c) 2000, 2009, Oracle. All rights reserved.Welcome to DGMGRL, type "help" for information.Connected.DGMGRL> switchover to snewtest;Performing switchover NOW, please wait...New primary database "snewtest" is opening...Operation requires startup of instance "newtest" on database "newtest"Starting instance "newtest"...Unable to connect to databaseORA-12514: TNS:listener does not currently know of service requested in connect descriptorFailed.Warning: You are no longer connected to ORACLE.Please complete the following steps to finish switchover:        start up instance "newtest" of database "newtest"

4.新备库上开启数据库

[oracle@localhost dbs]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.4.0 Production on Mon Mar 26 22:56:29 2018Copyright (c) 1982, 2013, Oracle.  All rights reserved.Connected to an idle instance.SQL> startupORACLE instance started.Total System Global Area  784998400 bytesFixed Size                  2257352 bytesVariable Size             478154296 bytesDatabase Buffers          301989888 bytesRedo Buffers                2596864 bytesDatabase mounted.Database opened.

5. 新备库上查询状态

SQL> select open_mode ,database_role from v$database;OPEN_MODE            DATABASE_ROLE-------------------- ----------------READ ONLY            PHYSICAL STANDBY

6.我们看到数据库打开了adg 但是 状态还是readonly,此时还没应用redo**
[oracle@localhost dbs]$ dgmgrl /
DGMGRL for Linux: Version 11.2.0.4.0 - 64bit Production

Copyright (c) 2000, 2009, Oracle. All rights reserved.Welcome to DGMGRL, type "help" for information.Connected.DGMGRL> edit database newtest set state='ONLINE'> ;Succeeded.DGMGRL> exit

7.再次查看新备库的状态

[oracle@localhost dbs]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.4.0 Production on Mon Mar 26 22:57:35 2018Copyright (c) 1982, 2013, Oracle.  All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL> select open_mode ,database_role from v$database;OPEN_MODE            DATABASE_ROLE-------------------- ----------------READ ONLY WITH APPLY PHYSICAL STANDBY

8.查看新主库的数据库状态以及dgbroke的状态

[oracle@localhost trace]$ sqlplus  / as sysdbaSQL*Plus: Release 11.2.0.4.0 Production on Mon Mar 26 22:57:24 2018Copyright (c) 1982, 2013, Oracle.  All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL> select open_mode ,database_role from v$database;OPEN_MODE            DATABASE_ROLE-------------------- ----------------READ WRITE           PRIMARYSQL> exitDisconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options[oracle@localhost trace]$ dgmgrl /DGMGRL for Linux: Version 11.2.0.4.0 - 64bit ProductionCopyright (c) 2000, 2009, Oracle. All rights reserved.Welcome to DGMGRL, type "help" for information.Connected.DGMGRL> show configuration;Configuration - dg_newtest  Protection Mode: MaxPerformance  Databases:    snewtest - Primary database    newtest  - Physical standby databaseFast-Start Failover: DISABLEDConfiguration Status:SUCCESS

转载于:https://www.cnblogs.com/chinesern/p/8687088.html

你可能感兴趣的文章
第三章 TCP/IP
查看>>
【cocos2d-x制作别踩白块儿】第一期:游戏介绍
查看>>
发现的最大数量
查看>>
Ubuntu12.04环境搭建遇到的问题和建议(一个)
查看>>
19.最经济app发短信的方法
查看>>
从零開始学android<SeekBar滑动组件.二十二.>
查看>>
教你用笔记本破解无线路由器password
查看>>
网络编程学习小结
查看>>
JS面向对象
查看>>
excel VLOOKUP函数的用法
查看>>
设计模式
查看>>
orm介绍
查看>>
一个简单程序快速入门JDBC
查看>>
DBA_Oracle基本体系内存和进程结构(概念)
查看>>
unisynedit 在Delphi 2010下的编译问题
查看>>
每日定理3
查看>>
在公司就职时应该注意的事项
查看>>
springMVC整合jedis+redis
查看>>
Python基础之 一 文件操作
查看>>
java学习之switch 等值判断
查看>>