. 环境
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