重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2580|回复: 0
打印 上一主题 下一主题

[安装] DG broker swithover报 :ORA-12514

[复制链接]
跳转到指定楼层
楼主
发表于 2016-11-17 20:35:56 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
在使用dgmgrl进行主备切换时,老是报 ora-12514错误:

DGMGRL>  SWITCHOVER TO sbdb1;
Performing switchover NOW, please wait...
New primary database "sbdb1" is opening...
Operation requires shutdown of instance "prod1" on database "prod1"
Shutting down instance "prod1"...
ORACLE instance shut down.
Operation requires startup of instance "prod1" on database "prod1"
Starting instance "prod1"...
Unable to connect to database
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
Failed.
Warning: You are no longer connected to ORACLE.
Please complete the following steps to finish switchover:
        start up instance "prod1" of database "prod1"

切换回来,不会报错:

DGMGRL> SWITCHOVER TO prod1;
Performing switchover NOW, please wait...
New primary database "prod1" is opening...
Operation requires shutdown of instance "sbdb1" on database "sbdb1"
Shutting down instance "sbdb1"...
ORACLE instance shut down.
Operation requires startup of instance "sbdb1" on database "sbdb1"
Starting instance "sbdb1"...
ORACLE instance started.
Database mounted.
Database opened.
Switchover succeeded, new primary is "prod1"

查看 prod1的配置:

DGMGRL> show database verbose prod1
Database - prod1
  Enterprise Manager Name: prod1.us.oracle.com
  Role:                    PHYSICAL STANDBY
  Intended State:          APPLY-ON
  Transport Lag:           0 seconds
  Apply Lag:               0 seconds
  Real Time Query:         ON
  Instance(s):
    prod1
  Properties:
    DGConnectIdentifier             = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=edbj2p1.example.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=prod1.us.oracle.com)(SERVER=DEDICATED)))'
    ObserverConnectIdentifier       = ''
    LogXptMode                      = 'SYNC'
    DelayMins                       = '0'
    Binding                         = 'optional'
    MaxFailure                      = '0'
    MaxConnections                  = '1'
    ReopenSecs                      = '300'
    NetTimeout                      = '30'
    RedoCompression                 = 'DISABLE'
    LogShipping                     = 'ON'
    PreferredApplyInstance          = ''
    ApplyInstanceTimeout            = '0'
    ApplyParallel                   = 'AUTO'
    StandbyFileManagement           = 'AUTO'
    ArchiveLagTarget                = '0'
    LogArchiveMaxProcesses          = '4'
    LogArchiveMinSucceedDest        = '1'
    DbFileNameConvert               = ''
    LogFileNameConvert              = ''
    FastStartFailoverTarget         = ''
    InconsistentProperties          = '(monitor)'
    InconsistentLogXptProps         = '(monitor)'
    SendQEntries                    = '(monitor)'
    LogXptStatus                    = '(monitor)'
    RecvQEntries                    = '(monitor)'
    SidName                         = 'prod1'
    StaticConnectIdentifier         = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=edbj2p1.example.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=prod1_DGMGRL.us.oracle.com)(INSTANCE_NAME=prod1)(SERVER=DEDICATED)))'
    StandbyArchiveLocation          = '/u01/app/oracle/arch'
    AlternateLocation               = ''
    LogArchiveTrace                 = '0'
    LogArchiveFormat                = '%t_%s_%r.dbf'
    TopWaitEvents                   = '(monitor)'
Database Status:
SUCCESS

检查切换后的监听,没有这个服务的监听 :

LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=edbj2p1.example.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date                17-NOV-2016 14:44:06
Uptime                    0 days 5 hr. 39 min. 6 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/edbj2p1/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=edbj2p1.example.com)(PORT=1521)))
Services Summary...
Service "prod1.us.oracle.com" has 2 instance(s).
  Instance "prod1", status UNKNOWN, has 1 handler(s) for this service...
  Instance "prod1", status READY, has 1 handler(s) for this service...
Service "prod1XDB.us.oracle.com" has 1 instance(s).
  Instance "prod1", status READY, has 1 handler(s) for this service...
Service "prod1_DGB.us.oracle.com" has 1 instance(s).
  Instance "prod1", status READY, has 1 handler(s) for this service...
Service "prod2" has 1 instance(s).
  Instance "prod2", status READY, has 1 handler(s) for this service...
Service "prod2XDB" has 1 instance(s).
  Instance "prod2", status READY, has 1 handler(s) for this service...
Service "prod2_DGB" has 1 instance(s).
  Instance "prod2", status READY, has 1 handler(s) for this service...
The command completed successfully

修改监听配置文件,增加对dgmgrl服务的静态监听:
[oracle@edbj2p1 admin]$ vi listener.ora
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = prod1_DGMGRL.us.oracle.com)
      (ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
      (SID_NAME = prod1)
    )
  )

LSNRCTL> reload
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=edbj2p1.example.com)(PORT=1521)))
The command completed successfully
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=edbj2p1.example.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date                17-NOV-2016 14:44:06
Uptime                    0 days 5 hr. 39 min. 16 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/edbj2p1/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=edbj2p1.example.com)(PORT=1521)))
Services Summary...
Service "prod1.us.oracle.com" has 1 instance(s).
  Instance "prod1", status READY, has 1 handler(s) for this service...
Service "prod1XDB.us.oracle.com" has 1 instance(s).
  Instance "prod1", status READY, has 1 handler(s) for this service...
Service "prod1_DGB.us.oracle.com" has 1 instance(s).
  Instance "prod1", status READY, has 1 handler(s) for this service...
Service "prod1_DGMGRL.us.oracle.com" has 1 instance(s).
  Instance "prod1", status UNKNOWN, has 1 handler(s) for this service...
Service "prod2" has 1 instance(s).
  Instance "prod2", status READY, has 1 handler(s) for this service...
Service "prod2XDB" has 1 instance(s).
  Instance "prod2", status READY, has 1 handler(s) for this service...
Service "prod2_DGB" has 1 instance(s).
  Instance "prod2", status READY, has 1 handler(s) for this service...
The command completed successfully

再去切换测试:

DGMGRL>  SWITCHOVER TO sbdb1;
Performing switchover NOW, please wait...
New primary database "sbdb1" is opening...
Operation requires shutdown of instance "prod1" on database "prod1"
Shutting down instance "prod1"...
ORACLE instance shut down.
Operation requires startup of instance "prod1" on database "prod1"
Starting instance "prod1"...
ORACLE instance started.
Database mounted.
Database opened.
Switchover succeeded, new primary is "sbdb1"
DGMGRL>

这次成功了.

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

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

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-11-28 06:28 , Processed in 0.105253 second(s), 20 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

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