ORA-12545 TNS: Host or Object Does not Exist
上週五下午在客戶那正開著會,忽然接到一個電話,是樓下的那個專案經理打來的,說他的客戶端連不了oracle資料庫了。我問其報什麼錯誤沒有,那個專案經理說報 ORA-12545主機或目標不存在的錯誤。 聽到這個錯誤後,一般是由於連結rac資料庫時,客戶端沒有在其windows的hosts檔案裡寫上資料庫伺服器的主機名,或者是寫了,但是被360防毒軟體註釋了,這個問題這兩年經常有開發人員問我,然後通過此法解決,因此我也讓其將資料庫主機名寫到hosts檔案裡。掛了電話繼續接著開會,不一會,那個專案經理又打電話過來說,他在hosts檔案裡添了伺服器主機名後,還是報相同的錯誤,然後我問其應用伺服器連資料庫有沒有問題,他說沒有,這樣系統還是可以使用,只是他自己連不了,因此我說等會開完會過去幫其看看。
傍晚來到他的專案組,分析了一下原因,發現確實還存在這個問題,因此就上metalink上查了一下:
Client Connection to RAC Intermittently Fails-ORA-12545 TNS: Host or Object Does not Exist [ID 364855.1]
Applies to:
Oracle Net Services - Version: 9.2.0.8.0 to 11.2.0.3 - Release: 9.2 to 11.2
Information in this document applies to any platform.
Checked for relevance on 30-SEP-2011.
When attempting to connect to a RAC service name, the connection intermittently fails with an ORA-12545 error: TNS: Host or object doesn't exist. The expected behavior. is that the connection would be redirected to any of the listener in the cluster where the listener is running on the VIP. This is normal under RAC Cluster node load balancing.
However, when the server side listener endpoints are not correctly configured OR the client cannot resolve all forms of the VIP hostname, this error can get thrown.
This is likely a new installation of RAC cluster.
Whe LOCAL_LISTENER is not set at all or is not set correctly, PMON can register both the VIP hostname and the physical hostname with the REMOTE_LISTENER. This is incorrect in RAC but if it does occur, the client can intermittently be routed to a listener endpoint on either of these addresses. If the client is unable to resolve the physical hostname or even the vip hostname, the connection will fail with ORA-12545.
And important first set is to check the output for : lsnrctl services
You should not see the physical hostname in the handler information for your RAC instances. Here's an example of an incorrect lsnrctl services
lsnrctl services oracle_rac_listener
Service "oracle.oracle.com" has 2 instance(s).
Instance "orcl1", status READY, has 2 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
REMOTE SERVER
(ADDRESS=(PROTOCOL=TCP)(HOST=myphysicalhost1)(PORT=1521))
"DEDICATED" established:326 refused:0 state:ready
LOCAL SERVER
Instance "orcl2", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:394371 refused:0 state:ready
REMOTE SERVER
(ADDRESS=(PROTOCOL=TCP)(HOST=myphysicalhost2)(PORT=1521))
Here's an example of what it ought to look like when LOCAL_LISTENER is configured correctly:
lsnrctl services oracle_rac_listener
Service "oracle.oracle.com" has 2 instance(s).
Instance "orcl1", status READY, has 2 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
REMOTE SERVER
(ADDRESS=(PROTOCOL=TCP)(HOST=myVIP_host1)(PORT=1521))
"DEDICATED" established:326 refused:0 state:ready
LOCAL SERVER
Instance "orcl2", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:394371 refused:0 state:ready
REMOTE SERVER
(ADDRESS=(PROTOCOL=TCP)(HOST=myVIP_host2)(PORT=1521))
Log in with privileges to the instance and issue the following commands so that LOCAL_LISTENER is set correctly:
alter system set LOCAL_LISTENER="(address=(protocol=tcp)(port=1521)(host=
Do the same for the 2nd instance where host is set to the
alter system set LOCAL_LISTENER="(address=(protocol=tcp)(port=1521)(host=
Now the correct address using the VIP hostname will be registered against the listeners in the cluster.
The client should be able to resolve all forms of the VIP host via their /etc/hosts file. i.e. short name and fully qualified.
這貌似是oracle的一個bug,按照此文件設定local_listener引數後,客戶端連結正常,問題解決。
今天下午又有一個大學同學在群裡問及此問題,我讓其按照此辦法設定後,問題也解決了。看來這個問題比較普遍,因此寫此日記記錄之。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/12129601/viewspace-712267/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ORA-04043: object DBA_DATA_FILES does not existObject
- PSQLexception: ERROR : type "signed" does not existSQLExceptionError
- Property [title] does not exist on this collection instance
- Waring: /dev/centos/swap does not existdevCentOS
- 問題解決:TNS-12543: TNS:destination host unreachable
- Property 'context' does not exist on type 'NodeRequire'.ts(2339)ContextUI
- Laravel Class env does not exist 問題排查Laravel
- [20221012]TNS-12543 TNSdestination host unreachable.txt
- [20211231]ORA-01418 specified index does not exist.txtIndex
- [20221014]TNS-12543 TNSdestination host unreachable(補充).txt
- dcat-admin 表單 Field type [autocomplete] does not exist.
- ORA-12514:TNS:listener does not currently know of service requested in connect descriptor
- ORA-30012 undo tablespace 'UNDOTBS3' does not exist or of wrong typeS3
- The operation, ‘DecodeJpeg/contents‘, does not exist in the graph.錯誤解決方法
- yii2接入pgSQL(查詢不到表The table does not exist: {{%user}})SQL
- Android解決The APK file app-debug.apk does not exist on disk.AndroidAPKAPP
- streamlit run執行報錯,Invalid value: File does not exist: XXX.py
- 靜默安裝Oracle建庫時報Template General Purpose does not existOracle
- Error: The directory named as part of the path ./log/supervisord.log does not exist解決方案Error
- Error message Object BOM does not allow filter on MAST.STLNRErrorObjectFilterAST
- Eclipse裡Tomcat報錯:Document base ……does not exist or is not a readable directory(圖文詳解)...EclipseTomcat
- git中出現”the requested upstream branch ‘origin/master‘ does not exist“問題的解決GitAST
- Hadoop的mapreduce出現問題,報錯The auxService:mapreduce_shuffle does not existHadoopUX
- 安裝kernel...src.rpm錯誤:warning: user mockbuild does not exist - using rootMockUI
- Your host does not meet minimum requirements to run VMware workstation with hyper-v or device/credenUIREMdev
- ABAP 資料結構啟用時的錯誤訊息 - combination reference table field does not exist資料結構
- pgsql 執行建庫指令碼時候出現ERROR: relation "xxx_id_seq" does not existSQL指令碼Error
- mac scrcpy 報錯 does not exist or is not a regular file,ERROR: Server connection failed(scrcpy mac與極空間衝突)MacErrorServerAI
- Oracle案例04——TNS-12547: TNS:lost contactOracle
- SAP對工單做101收貨,報錯- Check table TFBEFU_CR entry 10 does not exist–對策
- SAP MM 對採購訂單執行收貨,報錯 - Table T169P entry ZNMI does not exist -
- ORACLE TNS Io異常End of TNS data channel&ORA-12518Oracle
- proxy_set _header Host $host;Header
- SQL not exist out joinSQL
- Oracle TNS報錯大全Oracle
- net core 的Generic Host 之Generic Host BuilderUI
- ‘map’ does not name a type
- What does -> do in clojure?
- does not support SSL connections