|
1)在主库上执行切换操作
DGMGRL> SWITCHOVER TO devdb
Performing switchover NOW, please wait...
Operation requires a connection to instance "devdb1" on database "devdb"
Connecting to instance "devdb1"...
Connected.
New primary database "devdb" is opening...
Operation requires startup of instance "devdb" on database "devdbdg"
Starting instance "devdb"...
Unable to connect to database
ORA-12545: Connect failed because target host or object does not exist
Failed.
Warning: You are no longer connected to ORACLE.
Please complete the following steps to finish switchover:
start up instance "devdb" of database "devdbdg"
主切换的时候需要会报错,需要手段启动数据库,是什么问题。
2)主库的监听配置
[grid@node1 admin]$ vi listener.ora
LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))) # line added by Agent
LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))) # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agent
#下面为新增部分,devdb_DGMGRL是数据库名devdb加上固定_DGMGRL,/u01/app/11.2.0/grid是grid用户的home目录,devdb1是节点一的实例名
SID_LIST_LISTENER=
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = devdb_DGMGRL)
(ORACLE_HOME = /u01/app/11.2.0/grid)
(SID_NAME = devdb1)
)
)
[grid@node1 admin]$ lsnrctl reload
LSNRCTL for Linux: Version file:///C:\Users\HSIT\AppData\Local\Temp\`7_{~]GF$3{MOQ4V_}PH]YC.png11.2.0.4.0 - Production on 13-JUL-2016 14:40:27
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
The command completed successfully
[grid@node1 admin]$ lsnrctl status
LSNRCTL for Linux: Version file:///C:\Users\HSIT\AppData\Local\Temp\`7_{~]GF$3{MOQ4V_}PH]YC.png11.2.0.4.0 - Production on 13-JUL-2016 14:52:28
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version file:///C:\Users\HSIT\AppData\Local\Temp\`7_{~]GF$3{MOQ4V_}PH]YC.png11.2.0.4.0 - Production
Start Date 13-JUL-2016 14:44:23
Uptime 0 days 0 hr. 8 min. 5 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/11.2.0/grid/network/admin/listener.ora
Listener Log File /u01/app/grid/diag/tnslsnr/node1/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=file:///C:\Users\HSIT\AppData\Local\Temp\%W@GJ$ACOF(TYDYECOKVDYB.png192.168.2.121)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=file:///C:\Users\HSIT\AppData\Local\Temp\%W@GJ$ACOF(TYDYECOKVDYB.png192.168.2.123)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "devdb" has 1 instance(s).
Instance "devdb1", status READY, has 1 handler(s) for this service...
Service "devdbXDB" has 1 instance(s).
Instance "devdb1", status READY, has 1 handler(s) for this service...
Service "devdb_DGB" has 1 instance(s).
Instance "devdb1", status READY, has 1 handler(s) for this service...
Service "devdb_DGMGRL" has 1 instance(s).
Instance "devdb1", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[grid@node1 admin]$
3)备库的监听配置
devdbdg-> vi listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = file:///C:\Users\HSIT\AppData\Local\Temp\%W@GJ$ACOF(TYDYECOKVDYB.png192.168.2.184)(PORT = 1521))
)
)
SID_LIST_LISTENER=
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = devdbdg_DGMGRL)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = devdb)
)
(SID_DESC =
(GLOBAL_DBNAME = devdb)
(ORACLE_HOME =/u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = devdb)
)
)
ADR_BASE_LISTENER = /u01/app/oracle
devdbdg-> lsnrctl reload
LSNRCTL for Linux: Version file:///C:\Users\HSIT\AppData\Local\Temp\`7_{~]GF$3{MOQ4V_}PH]YC.png11.2.0.4.0 - Production on 13-JUL-2016 14:01:58
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=file:///C:\Users\HSIT\AppData\Local\Temp\%W@GJ$ACOF(TYDYECOKVDYB.png192.168.2.184)(PORT=1521)))
The command completed successfully
devdbdg-> lsnrctl status
LSNRCTL for Linux: Version file:///C:\Users\HSIT\AppData\Local\Temp\`7_{~]GF$3{MOQ4V_}PH]YC.png11.2.0.4.0 - Production on 13-JUL-2016 14:02:08
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=file:///C:\Users\HSIT\AppData\Local\Temp\%W@GJ$ACOF(TYDYECOKVDYB.png192.168.2.184)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version file:///C:\Users\HSIT\AppData\Local\Temp\`7_{~]GF$3{MOQ4V_}PH]YC.png11.2.0.4.0 - Production
Start Date 13-JUL-2016 13:57:42
Uptime 0 days 0 hr. 4 min. 26 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/devdbdg/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=file:///C:\Users\HSIT\AppData\Local\Temp\%W@GJ$ACOF(TYDYECOKVDYB.png192.168.2.184)(PORT=1521)))
Services Summary...
Service "devdb" has 1 instance(s).
Instance "devdb", status UNKNOWN, has 1 handler(s) for this service...
Service "devdbXDB" has 1 instance(s).
Instance "devdb", status READY, has 1 handler(s) for this service...
Service "devdbdg" has 1 instance(s).
Instance "devdb", status READY, has 1 handler(s) for this service...
Service "devdbdg_DGB" has 1 instance(s).
Instance "devdb", status READY, has 1 handler(s) for this service...
Service "devdbdg_DGMGRL" has 1 instance(s).
Instance "devdb", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
主库跟备库都配置了静态监听
|
|