设为首页收藏本站

Botang唐波's Oracle Station

查看: 614|回复: 1

DG Broker主备切换的时候需要会报错,需要手段启动数据库,是什么问题

[复制链接]

1

主题

1

帖子

15

积分

新手上路

Rank: 1

积分
15
发表于 2016-7-13 17:31:41 | 显示全部楼层 |阅读模式
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
主库跟备库都配置了静态监听



回复

使用道具 举报

624

主题

967

帖子

7059

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
7059
发表于 2016-7-18 10:54:44 | 显示全部楼层
既然监听器配了,口令文件有问题吗。11g dg的口令文件要:
Usage: orapwd file=<fname> entries=<users> force=<y/n> ignorecase=<y/n> nosysdba=<y/n>

  where
    file - name of password file (required),
    password - password for SYS will be prompted if not specified at command line,
    entries - maximum number of distinct DBA (optional),
    force - whether to overwrite existing file (optional),
    ignorecase - passwords are case-insensitive (optional),
    nosysdba - whether to shut out the SYSDBA logon (optional Database Vault only).
   
  There must be no spaces around the equal-to (=) character.
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Botang唐波's Oracle Station   

GMT+8, 2018-4-23 01:47 , Processed in 0.125018 second(s), 23 queries .

快速回复 返回顶部 返回列表