当前位置:   article > 正文

DG Broker switchover的过程_ora-16778

ora-16778


12c Dataguard Switchover Best Practices using DGMGRL(Dataguard Broker Command Prompt) (文档 ID 1582837.1)
DGMGRL>switchover to <standby> Fails with ORA-12514 (文档 ID 1582927.1)


1. switchover 主—>备

使用dgmgrl进行切换时,连接dgmgrl时使用TNS的方式连接,不要使用<dgmgrl />的方式连接,因为<dgmgrl />不能连接到备库执行相应操作。

  1. [oracle@12cr2 ~]$ dgmgrl sys/oracle@newcdb
  2. DGMGRL for Linux: Release 12.2.0.1.0 - Production on Mon Jul 3 20:59:39 2017
  3. Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved.
  4. Welcome to DGMGRL, type "help" for information.
  5. Connected to "newcdb"
  6. Connected as SYSDBA.
  7. DGMGRL> SHOW CONFIGURATION;
  8. Configuration - dg_newcdb
  9. Protection Mode: MaxPerformance
  10. Members:
  11. newcdb - Primary database
  12. newcdbdg - Physical standby database
  13. frasync - Far sync instance
  14. Fast-Start Failover: DISABLED
  15. Configuration Status:
  16. SUCCESS (status updated 56 seconds ago)

  1. DGMGRL> switchover to newcdbdg
  2. Performing switchover NOW, please wait...
  3. Operation requires a connection to database "newcdbdg"
  4. Connecting ...
  5. Connected to "newcdbdg"
  6. Connected as SYSDBA.
  7. New primary database "newcdbdg" is opening...
  8. Operation requires start up of instance "newcdb" on database "newcdb"
  9. Starting instance "newcdb"...
  10. Unable to connect to database using (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.16.81)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=newcdb_DGMGRL)(INSTANCE_NAME=newcdb)(SERVER=DEDICATED)))
  11. ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
  12. Failed.
  13. Warning: You are no longer connected to ORACLE.
  14. Please complete the following steps to finish switchover:
  15. start up instance "newcdb" of database "newcdb"

切换的过程出现警告,以下是解决方法:
第一种解决方法:

手动启动192.168.16.81节点上的数据库

  1. DGMGRL> SHOW CONFIGURATION;
  2. Configuration - dg_newcdb
  3. Protection Mode: MaxPerformance
  4. Members:
  5. newcdbdg - Primary database
  6. Error: ORA-16778: redo transport error for one or more members
  7. newcdb - Physical standby database
  8. Error: ORA-1034: ORACLE not available
  9. frasync - Far sync instance
  10. Fast-Start Failover: DISABLED
  11. Configuration Status:
  12. ERROR (status updated 30 seconds ago)

  1. [oracle@12cr2 ~]$ sqlplus / as sysdba
  2. SQL*Plus: Release 12.2.0.1.0 Production on Mon Jul 3 21:08:51 2017
  3. Copyright (c) 1982, 2016, Oracle. All rights reserved.
  4. Connected to an idle instance.
  5. SQL> startup
  6. ORACLE instance started.
  7. Total System Global Area 838860800 bytes
  8. Fixed Size 8798312 bytes
  9. Variable Size 322965400 bytes
  10. Database Buffers 503316480 bytes
  11. Redo Buffers 3780608 bytes
  12. Database mounted.
  13. Database opened.

  1. DGMGRL> SHOW CONFIGURATION;
  2. Configuration - dg_newcdb
  3. Protection Mode: MaxPerformance
  4. Members:
  5. newcdbdg - Primary database
  6. newcdb - Physical standby database
  7. frasync - Far sync instance
  8. Fast-Start Failover: DISABLED
  9. Configuration Status:
  10. SUCCESS (status updated 50 seconds ago)

DGMGRL>switchover to <standby> Fails with ORA-12514 (文档 ID 1582927.1)
SOLUTION 1  : Modify the staticconnectidentifier to available listener service
----------------

Primary db_unique_name is boston
Standby db_unique_name is chicago
Check the listener services.
 
On both primary and standby,
 $ lsnrctl services
Now edit the staticconnectidentifier to any available services of respective database.
1. Connect to DGMGRL,

DGMGRL> edit database chicago set property staticconnectidentifier='(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(PORT=1521)(HOST=nirmala-desk1.idc.oracle.com))(CONNECT_DATA=(SERVICE_NAME=chicago)(INSTANCE_NAME=chicago)(SERVER=DEDICATED)))';
NOTE : edit boston value for any future role transition,
DGMGRL> edit database boston set property staticconnectidentifier='(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(PORT=1521)(HOST=nirmala-desk1.idc.oracle.com))(CONNECT_DATA=(SERVICE_NAME=boston)(INSTANCE_NAME=boston)(SERVER=DEDICATED)))';

2. DGMGRL>show configuration;

For switchover reference,

<<1582837.1>> - 12c Dataguard Switchover Best Practices using DGMGRL(Dataguard Broker Command Prompt)


第二种解决方法:
修改dgmgrl的staticconnectidentifier参数

  1. DGMGRL> SHOW DATABASE VERBOSE newcdb
  2. StaticConnectIdentifier = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.16.81)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=newcdb_DGMGRL)(INSTANCE_NAME=newcdb)(SERVER=DEDICATED)))'
  3. DGMGRL> edit database newcdb set property staticconnectidentifier='(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.16.81)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=newcdb)(INSTANCE_NAME=newcdb)(SERVER=DEDICATED)))';
  4. Property "staticconnectidentifier" updated
  5. DGMGRL> edit database newcdbdg set property staticconnectidentifier='(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.16.130)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=newcdbdg)(INSTANCE_NAME=newcdb)(SERVER=DEDICATED)))';
  6. Property "staticconnectidentifier" updated

  1. DGMGRL> switchover to newcdbdg
  2. Performing switchover NOW, please wait...
  3. Operation requires a connection to database "newcdbdg"
  4. Connecting ...
  5. Connected to "newcdbdg"
  6. Connected as SYSDBA.
  7. New primary database "newcdbdg" is opening...
  8. Operation requires start up of instance "newcdb" on database "newcdb"
  9. Starting instance "newcdb"...
  10. ORACLE instance started.
  11. Database mounted.
  12. Database opened.
  13. Connected to "newcdb"
  14. Switchover succeeded, new primary is "newcdbdg"

SOLUTION 2 : Add static listener entry with the name mentioned in staticconnectidentifier i.e default service taken by DGMGRL which add configuration with the service_name of <SID>_DGMGRL
------------

Modify static entry on listener.ora of current Standby.

1. Standby (chicago)server,

vi /$ORACLE_HOME/network/admin/listener.ora
    (SID_DESC =
      (GLOBAL_DBNAME = chicago_DGMGRL)   <----------------add _DGMGRL 
      (ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_1)
      (SID_NAME = chicago)
    )

2. Same way change the static entry of current primary also for feature role transition.


第三种解决方法:
修改主库和备库的listener.ora文件,添加<DB_UNIQUE_NAME>_dgmgrl

修改主库的listener.ora文件,添加newcdb_dgmgrl一段,GLOBAL_DBNAME的格式是<DB_UNIQUE_NAME>_dgmgrl

  1. [oracle@12cr2 admin]$ cat listener.ora
  2. # listener.ora Network Configuration File: /u01/app/oracle/product/12.2.0/db_1/network/admin/listener.ora
  3. # Generated by Oracle configuration tools.
  4. SID_LIST_LISTENER =
  5. (SID_LIST =
  6. (SID_DESC =
  7. (GLOBAL_DBNAME = newcdb)
  8. (ORACLE_HOME = /u01/app/oracle/product/12.2.0/db_1)
  9. (SID_NAME = newcdb)
  10. )
  11. (SID_DESC =
  12. (GLOBAL_DBNAME = newcdb_DGMGRL)
  13. (ORACLE_HOME = /u01/app/oracle/product/12.2.0/db_1)
  14. (SID_NAME = newcdb)
  15. )
  16. )
  17. LISTENER =
  18. (DESCRIPTION =
  19. (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.16.81)(PORT = 1521))
  20. )
  21. ADR_BASE_LISTENER = /u01/app/oracle

修改备库的listener.ora文件,添加newcdbdg_dgmgrl一段, GLOBAL_DBNAME的格式是<DB_UNIQUE_NAME>_dgmgrl

  1. [oracle@oracle admin]$ cat listener.ora
  2. # listener.ora Network Configuration File: /u01/app/oracle/product/12.2.0/db_1/network/admin/listener.ora
  3. # Generated by Oracle configuration tools.
  4. SID_LIST_LISTENER =
  5. (SID_LIST =
  6. (SID_DESC =
  7. (GLOBAL_DBNAME = newcdb)
  8. (ORACLE_HOME = /u01/app/oracle/product/12.2.0/db_1)
  9. (SID_NAME = newcdb)
  10. )
  11. (SID_DESC =
  12. (GLOBAL_DBNAME = newcdbdg_dgmgrl)
  13. (ORACLE_HOME = /u01/app/oracle/product/12.2.0/db_1)
  14. (SID_NAME = newcdb)
  15. )
  16. )
  17. LISTENER =
  18. (DESCRIPTION =
  19. (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.16.130)(PORT = 1521))
  20. )
  21. ADR_BASE_LISTENER = /u01/app/oracle

主端和备端重启监听服务

  1. [oracle@12cr2 ~]$ dgmgrl sys/oracle@newcdb
  2. DGMGRL for Linux: Release 12.2.0.1.0 - Production on Tue Jul 4 22:24:36 2017
  3. Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved.
  4. Welcome to DGMGRL, type "help" for information.
  5. Connected to "newcdb"
  6. Connected as SYSDBA.
  7. DGMGRL> switchover to newcdbdg
  8. Performing switchover NOW, please wait...
  9. Operation requires a connection to database "newcdbdg"
  10. Connecting ...
  11. Connected to "newcdbdg"
  12. Connected as SYSDBA.
  13. New primary database "newcdbdg" is opening...
  14. Operation requires start up of instance "newcdb" on database "newcdb"
  15. Starting instance "newcdb"...
  16. ORACLE instance started.
  17. Database mounted.
  18. Database opened.
  19. Connected to "newcdb"
  20. Switchover succeeded, new primary is "newcdbdg"
  21. DGMGRL> SHOW CONFIGURATION
  22. Configuration - dg_newcdb
  23. Protection Mode: MaxPerformance
  24. Members:
  25. newcdbdg - Primary database
  26. newcdb - Physical standby database
  27. frasync - Far sync instance
  28. Fast-Start Failover: DISABLED
  29. Configuration Status:
  30. SUCCESS (status updated 9 seconds ago)

2 switchover 备—>主

  1. [oracle@12cr2 ~]$ dgmgrl sys/oracle@newcdb
  2. DGMGRL> switchover to newcdb
  3. Performing switchover NOW, please wait...
  4. Operation requires a connection to database "newcdb"
  5. Connecting ...
  6. Connected to "newcdb"
  7. Connected as SYSDBA.
  8. New primary database "newcdb" is opening...
  9. Operation requires start up of instance "newcdb" on database "newcdbdg"
  10. Starting instance "newcdb"...
  11. ORACLE instance started.
  12. Database mounted.
  13. Database opened.
  14. Connected to "newcdbdg"
  15. Switchover succeeded, new primary is "newcdb"
  16. DGMGRL> SHOW CONFIGURATION
  17. Configuration - dg_newcdb
  18. Protection Mode: MaxPerformance
  19. Members:
  20. newcdb - Primary database
  21. newcdbdg - Physical standby database
  22. frasync - Far sync instance
  23. Fast-Start Failover: DISABLED
  24. Configuration Status:
  25. SUCCESS (status updated 0 seconds ago)


声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/凡人多烦事01/article/detail/415743?site
推荐阅读