当前位置:   article > 正文

ORA-12545: Connect failed because target host or object does not exist

ora-12545: connect failed because target host or object does not exist

11.2.0.4的  data guard,配制了broker,从主库切换到备库的时候,正常。再从备库切换到主库的时候。出现问题。

  1. DGMGRL> switchover to testogg;
  2. Performing switchover NOW, please wait...
  3. Operation requires a connection to instance "testogg" on database "testogg"
  4. Connecting to instance "testogg"...
  5. Connected.
  6. New primary database "testogg" is opening...
  7. Operation requires startup of instance "testogg_stdby" on database "testogg_stdby"
  8. Starting instance "testogg_stdby"...
  9. Unable to connect to database
  10. ORA-12545: Connect failed because target host or object does not exist
  11. Failed.
  12. Warning: You are no longer connected to ORACLE.
  13. Please complete the following steps to finish switchover:
  14. start up instance "testogg_stdby" of database "testogg_stdby"
  15. DGMGRL>

查看alert log日志,提示log_archive_dest_2 是invalid的 。并且提示db_unique_name不对。

  1. Switchover: Primary highest seen SCN set to 0x0.0x1a410d
  2. ARCH: Noswitch archival of thread 1, sequence 113
  3. ARCH: End-Of-Redo Branch archival of thread 1 sequence 113
  4. ARCH: LGWR is actively archiving destination LOG_ARCHIVE_DEST_3
  5. ARCH: Standby redo logfile selected for thread 1 sequence 113 for destination LOG_ARCHIVE_DEST_3
  6. Archived Log entry 32 added for thread 1 sequence 113 ID 0xe0779467 dest 1:
  7. ARCH: Archiving is disabled due to current logfile archival
  8. Primary will check for some target standby to have received alls redo
  9. Final check for a synchronized target standby. Check will be made once.
  10. Archive destination LOG_ARCHIVE_DEST_2 invalidated
  11. DB_UNIQUE_NAME tesgogg is not in the Data Guard configuration
  12. LOG_ARCHIVE_DEST_3 is a potential Physical Standby switchover target
  13. Active, synchronized target has been identified
  14. Target has also received all redo

检查log_archive_dest_2的设置,发现db_unique_name的确有问题,更改,提示和log_archive_dest_3因为值相同有冲突。

  1. SYS@testogg_stdby>alter system set log_archive_dest_2= 'SERVICE=tesgogg ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=testogg';
  2. alter system set log_archive_dest_2= 'SERVICE=tesgogg ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=testogg'
  3. *
  4. ERROR at line 1:
  5. ORA-02097: parameter cannot be modified because specified value is invalid
  6. ORA-16021: session LOG_ARCHIVE_DEST_3 destination cannot be the same as session
  7. LOG_ARCHIVE_DEST_2 destination

查看log_archive_dest_3,发现的确配置了log_archive_dest_3。但是搭建data guard的时候,并没有设置这个参数。该参数是配置broker后,broker自己生成的。清空后,设置log_archive_dest_2.

  1. SYS@testogg_stdby>show parameter log_archive_dest_3
  2. NAME TYPE VALUE
  3. ------------------------------------ ----------- ------------------------------
  4. log_archive_dest_3 string service="testogg", LGWR ASYNC
  5. NOAFFIRM delay=0 optional comp
  6. ression=disable max_failure=0
  7. max_connections=1 reopen=300 d
  8. b_unique_name="testogg" net_ti
  9. meout=30, valid_for=(all_logfi
  10. les,primary_role)
  11. log_archive_dest_30 string
  12. log_archive_dest_31 string
  13. SYS@testogg_stdby>alter system set log_archive_dest_3='';
  14. System altered.
  15. SYS@testogg_stdby>alter system set log_archive_dest_2= 'SERVICE=tesgogg ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=testogg';
  16. System altered.

设置完毕后,还是存在无法切换data guard的问题。检查broker的配置。发现数据库的配置中,连接的host是hostname,而不是IP地址。

  1. DGMGRL> show database verbose testogg_stdby;
  2. Database - testogg_stdby
  3. Role: PHYSICAL STANDBY
  4. Intended State: APPLY-ON
  5. Transport Lag: (unknown)
  6. Apply Lag: (unknown)
  7. Apply Rate: (unknown)
  8. Real Time Query: OFF
  9. Instance(s):
  10. testogg_stdby
  11. Properties:
  12. DGConnectIdentifier = 'testogg_stdby'
  13. ObserverConnectIdentifier = ''
  14. LogXptMode = 'ASYNC'
  15. DelayMins = '0'
  16. Binding = 'OPTIONAL'
  17. MaxFailure = '0'
  18. MaxConnections = '1'
  19. ReopenSecs = '300'
  20. NetTimeout = '30'
  21. RedoCompression = 'DISABLE'
  22. LogShipping = 'ON'
  23. PreferredApplyInstance = ''
  24. ApplyInstanceTimeout = '0'
  25. ApplyParallel = 'AUTO'
  26. StandbyFileManagement = 'AUTO'
  27. ArchiveLagTarget = '0'
  28. LogArchiveMaxProcesses = '4'
  29. LogArchiveMinSucceedDest = '1'
  30. DbFileNameConvert = '/u01/app/oracle/oradata/testogg/, /u01/app/oracle/oradata/testogg_stdby/'
  31. LogFileNameConvert = '/u01/app/oracle/oradata/testogg/, /u01/app/oracle/oradata/testogg_stdby/'
  32. FastStartFailoverTarget = ''
  33. InconsistentProperties = '(monitor)'
  34. InconsistentLogXptProps = '(monitor)'
  35. SendQEntries = '(monitor)'
  36. LogXptStatus = '(monitor)'
  37. RecvQEntries = '(monitor)'
  38. ApplyLagThreshold = '0'
  39. TransportLagThreshold = '0'
  40. TransportDisconnectedThreshold = '30'
  41. SidName = 'testogg_stdby'
  42. StaticConnectIdentifier = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dbtrain)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=testogg_stdby_DGMGRL)(INSTANCE_NAME=testogg_stdby)(SERVER=DEDICATED)))'
  43. StandbyArchiveLocation = '/archive_log/'
  44. AlternateLocation = ''
  45. LogArchiveTrace = '0'
  46. LogArchiveFormat = '%t_%s_%r.dbf'
  47. TopWaitEvents = '(monitor)'
  48. Database Status:
  49. DGM-17016: failed to retrieve status for database "testogg_stdby"
  50. ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
  51. ORA-16625: cannot reach database "testogg_stdby"
  52. DGMGRL>

检查主备库的hosts文件,发现里面没有对方的地址。添加。再次在dgmgrl命令行下执行切换。主备切换正常。

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

END

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/菜鸟追梦旅行/article/detail/590326
推荐阅读
相关标签
  

闽ICP备14008679号