【故障處理】ORA-12545: Connect failed because target host
【故障處理】ORA-12545: Connect failed because target host or object does not exist
1 BLOG文件結構圖
2 前言部分
2.1 導讀和注意事項
各位技術愛好者,看完本文後,你可以掌握如下的技能,也可以學到一些其它你所不知道的知識,~O(∩_∩)O~:
① 錯誤ORA-12545: Connect failed because target host or object does not exist的一種問題解決
Tips:
① 本文在ITpub(http://blog.itpub.net/26736162)、部落格園(http://www.cnblogs.com/lhrbest)和微信公眾號(xiaomaimiaolhr)有同步更新
② 文章中用到的所有程式碼,相關軟體,相關資料請前往小麥苗的雲盤下載(http://blog.itpub.net/26736162/viewspace-1624453/)
③ 若文章程式碼格式有錯亂,推薦使用搜狗、360或QQ瀏覽器,也可以下載pdf格式的文件來檢視,pdf文件下載地址:http://blog.itpub.net/26736162/viewspace-1624453/,另外itpub格式顯示有問題,可以去部落格園地址閱讀
④ 本篇BLOG中命令的輸出部分需要特別關注的地方我都用灰色背景和粉紅色字型來表示,比如下邊的例子中,thread 1的最大歸檔日誌號為33,thread 2的最大歸檔日誌號為43是需要特別關注的地方;而命令一般使用黃色背景和紅色字型標注;對程式碼或程式碼輸出部分的注釋一般採用藍色字型表示。
List of Archived Logs in backup set 11
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- ------------------- ---------- ---------
1 32 1621589 2015-05-29 11:09:52 1625242 2015-05-29 11:15:48
1 33 1625242 2015-05-29 11:15:48 1625293 2015-05-29 11:15:58
2 42 1613951 2015-05-29 10:41:18 1625245 2015-05-29 11:15:49
2 43 1625245 2015-05-29 11:15:49 1625253 2015-05-29 11:15:53
[ZHLHRDB1:root]:/>lsvg -o
T_XDESK_APP1_vg
rootvg
[ZHLHRDB1:root]:/>
00:27:22 SQL> alter tablespace idxtbs read write;
====》2097152*512/1024/1024/1024=1G
本文如有錯誤或不完善的地方請大家多多指正,ITPUB留言或QQ皆可,您的批評指正是我寫作的最大動力。
3 故障分析及解決過程
3.1 故障環境介紹
專案 |
source db |
db 型別 |
RAC |
db version |
11.2.0.3 |
db 儲存 |
ASM |
OS版本及kernel版本 |
AIX 64位 6.1.0.0 |
3.2 故障發生現象及報錯資訊
同事過來找我說資料庫不能連線,如下情況:
cssp@ZFZHLHRDB1:/cssp$ sqlplus tacc/tacc
SQL*Plus: Release 11.2.0.3.0 Production on Fri Aug 12 16:35:42 2016
Copyright (c) 1982, 2011, Oracle. All rights reserved.
ERROR:
ORA-12545: Connect failed because target host or object does not exist
Enter user-name:
ERROR:
ORA-12545: Connect failed because target host or object does not exist
注意:以上的連線方式採用了TWO_TASK這個環境變數,在Unix和Linux環境下,可以設定TWO_TASK環境變數,當使用者連線資料庫且沒有指定服務名時,會自動利用TWO_TASK的設定作為環境變數連線資料庫。有關這個環境變數的更多內容可以參考:http://blog.itpub.net/26736162/viewspace-2112274/ 和 http://blog.itpub.net/26736162/viewspace-2112277/
3.3 故障分析及解決過程
我採用了tnsping、用tnsnames連線和檢查3大網路配置檔案,都沒有問題,如下:
cssp@ZFZHLHRDB1:/cssp$ tnsping oratacc1
TNS Ping Utility for IBM/AIX RISC System/6000: Version 11.2.0.3.0 - Production on 12-AUG-2016 16:36:14
Copyright (c) 1997, 2011, Oracle. All rights reserved.
Used parameter files:
/oracle/app/oracle/product/11.2.0/db/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = ZFtaccDB-scan)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = 22.188.173.15)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = 22.188.173.16)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = oratacc1)))
OK (80 msec)
cssp@ZFZHLHRDB1:/cssp$ sqlplus tacc/tacc@oratacc1
SQL*Plus: Release 11.2.0.3.0 Production on Fri Aug 12 16:36:25 2016
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> exit
cssp@ZFZHLHRDB1:/cssp$ oerr ora 12545
12545, 00000, "Connect failed because target host or object does not exist"
// *Cause: The address specified is not valid, or the program being
// connected to does not exist.
// *Action: Ensure the ADDRESS parameters have been entered correctly; the
// most likely incorrect parameter is the node name. Ensure that the
// executable for the server exists (perhaps "oracle" is missing.)
// If the protocol is TCP/IP, edit the TNSNAMES.ORA file to change the
// host name to a numeric IP address and try again.
檢視環境變數的設定:
cssp@ZFZHLHRDB1:/cssp$ more .profile
#For CICS
export CICS=/usr/lpp/cics
#export LANG=zh_CN.UTF-8
export LANG=en_US
#For ORACLE
ORACLE_BASE=/oracle/app/oracle
ORACLE_HOME=/oracle/app/oracle/product/11.2.0/db
TWO_TASK=oratacc1
ORACLE_SID=oratacc1
ORACLE_TERM=vt100
ORACLE_OWNER=oracle
export ORACLE_BASE ORACLE_HOME ORACLE_SID ORACLE_TERM ORACLE_OWNER
LD_LIBRARY_PATH=/oracle/app/oracle/product/11.2.0/db/lib:/oracle/app/oracle/product/11.2.0/db/lib32
#LD_LIBRARY_PATH=/oracle/app/oracle/product/11.2.0/db/lib32
#export LIBPATH=$LIBPATH:/oracle/app/oracle/product/11.2.0/db/lib
NLS_LANG=American_America.ZHS16GBK
ORA_NLS33=/oracle/app/oracle/product/11.2.0/db/nls/data
export PATH=/usr/java5/bin:/cssp/jscs
export PATH=$PATH:/oracle/app/oracle/product/11.2.0/db/OPatch:/oracle/app/oracle/product/11.2.0/db/bin:/bin:/usr/ccs/bin:/usr/bin/X11:/sharebkup/data/peij
OPATCH_PLATFORM_ID=212
export LD_LIBRARY_PATH NLS_LANG ORA_NLS33 PATH TMP TMPDIR OPATCH_PLATFORM_ID
export AIXTHREAD_SCOPE=S
umask 022
export DBCA_RAW_CONFIG=/oracle/dbname_raw.conf
export PS1='LOGNAME@′‘hostname‘:′ PWD''$ '
export ORA_NL10=$ORACLE_HOME/nls/data
set -o vi
export EDITOR=vi
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export NLS_DATE_FORMAT=YYYY-MM-DD
export PATH=$PATH:/usr/vac/bin:/var/ifor:/usr/opt/ifor/ls/conf:/usr/lib/cobol/bin:/usr/lpp/cics/bin:/usr/lpp/cics/etc:/usr/lpp/dce/bin:/usr/lpp/mqm/bin:/usr/lpp/mqm/sa
mp/bin:/usr/mqm/samp/bin:HOME/bin: ORACLE_HOME/bin:/csspd05u/test/bin:.:/usr/mqm/samp/bin
export LIBPATH=/usr/mqm/lib:ORACLEHOME/lib32: COBDIR/coblib:/usr/lib:/lib:/usr/lpp/cics/lib:/usr/lpp/encina/lib:/usr/lpp/dce/lib:.
export NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lpp/cics/msg/%L/%N:/usr/lpp/nls/msg/en_US/%N:/usr/lpp/encina/msg/%L/%N:/usr/lpp/dce/lib/nls/msg/%L/%N
#For cssp
export JAVA_HOME=/usr/java5_64
export cssp_HOME=$HOME
export CLASSPATH=/csspd05u/CF
# PS1='[`hostname`:LOGNAME: PWD]'
alias rm='rm -i'
alias lf='ls -aF'
alias l='ls -al'
set -o vi
可以看到上邊的環境變數很亂,尤其PATH的配置有問題,所以我把這個部分的內容整理了一下,最後為:
umask 022
#For CICS
export CICS=/usr/lpp/cics
#export LANG=zh_CN.UTF-8
export LANG=en_US
#For ORACLE
export ORACLE_BASE=/oracle/app/oracle
export ORACLE_HOME=/oracle/app/oracle/product/11.2.0/db
export LD_LIBRARY_PATH=/oracle/app/oracle/product/11.2.0/db/lib:/oracle/app/oracle/product/11.2.0/db/lib32
export TWO_TASK=oratacc1
export ORACLE_SID=oratacc1
export ORACLE_TERM=vt100
export ORACLE_OWNER=oracle
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export ORA_NLS33=/oracle/app/oracle/product/11.2.0/db/nls/data
export OPATCH_PLATFORM_ID=212
export AIXTHREAD_SCOPE=S
export DBCA_RAW_CONFIG=/oracle/dbname_raw.conf
export PS1='LOGNAME@′‘hostname‘:′ PWD''$ '
export ORA_NL10=$ORACLE_HOME/nls/data
export EDITOR=vi
export PATH=$PATH:/usr/java5/bin:/cssp/jscs
export PATH=$PATH:/oracle/app/oracle/product/11.2.0/db/OPatch:/oracle/app/oracle/product/11.2.0/db/bin:/bin:/usr/ccs/bin:/usr/bin/X11:/sharebkup/data/peij
export PATH=PATH:/usr/vac/bin:/var/ifor:/usr/opt/ifor/ls/conf:/usr/lib/cobol/bin:/usr/lpp/cics/bin:/usr/lpp/cics/etc:/usr/lpp/dce/bin:/usr/lpp/mqm/bin:/usr/lpp/mqm/samp/bin:/usr/mqm/samp/bin: HOME/bin:$ORACLE_HOME/bin:/csspd05u/test/bin:.:/usr/mqm/samp/bin
export LIBPATH=/usr/mqm/lib:ORACLEHOME/lib32: COBDIR/coblib:/usr/lib:/lib:/usr/lpp/cics/lib:/usr/lpp/encina/lib:/usr/lpp/dce/lib:.
export NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lpp/cics/msg/%L/%N:/usr/lpp/nls/msg/en_US/%N:/usr/lpp/encina/msg/%L/%N:/usr/lpp/dce/lib/nls/msg/%L/%N
#For cssp
export JAVA_HOME=/usr/java5_64
export cssp_HOME=$HOME
export CLASSPATH=/csspd05u/CF
# PS1='[`hostname`:LOGNAME: PWD]'
alias rm='rm -i'
alias lf='ls -aF'
alias l='ls -al'
set -o vi
修改.profile檔案後,重新登入試試:
cssp@ZFZHLHRDB1:/cssp$ . .profile
cssp@ZFZHLHRDB1:/cssp$ sqlplus tacc/tacc
SQL*Plus: Release 11.2.0.3.0 Production on Fri Aug 12 16:43:26 2016
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
可以正常登陸資料庫了,可見環境變數的配置對sqlplus的登入有至關重要的作用。
About Me
..........................................................................................................................................................................................................
v 本文作者:小麥苗,只專注於資料庫的技術,更注重技術的運用
v 本文在ITpub(http://blog.itpub.net/26736162)、部落格園(http://www.cnblogs.com/lhrbest)和個人微信公眾號(xiaomaimiaolhr)上有同步更新,推薦pdf檔案閱讀或部落格園地址閱讀
v QQ群:230161599 微信群:私聊
v 本文itpub地址:http://blog.itpub.net/26736162/viewspace-2123414/ 部落格園地址:http://www.cnblogs.com/lhrbest/articles/5766183.html
v 本文pdf版: (提取碼:ed9b)
v 小麥苗分享的其它資料:http://blog.itpub.net/26736162/viewspace-1624453/
v 聯絡我請加QQ好友(642808185),註明新增緣由
v 於 2016-08-12 09:00~2016-08-12 19:00 在中行完成
v 【版權所有,文章允許轉載,但須以連結方式註明源地址,否則追究法律責任】
..........................................................................................................................................................................................................
長按識別二維碼或微信客戶端掃描下邊的二維碼來關注小麥苗的微信公眾號:xiaomaimiaolhr,學習最實用的資料庫技術。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26736162/viewspace-2123414/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [sublime xftp外掛] Host key verification failed ,錯誤處理FTPAI
- 【故障處理】ORA-28547: connection to server failed, probableServerAI
- SSH 登入失敗:Host key verification failed 的處理方法AI
- 【故障處理】ORA-600:[13013],[5001]故障處理
- “Host ‘xxxx‘ is not allowed to connect to this MySQL server“MySqlServer
- Host 'localhost' is not allowed to connect to this MySQL serverlocalhostMySqlServer
- linux故障處理Linux
- 故障分析 | Greenplum Segment 故障處理
- 【故障處理】Linux下匯入匯出“IMP-00030: failed to create file ... for write”LinuxAI
- GPON網路故障如何處理?GPON網路故障處理流程
- Host 'xxx' is not allowed to connect to this MySQL server.MySqlServer
- CMake Error: add_executable cannot create target ““ because another target with the same name已解決Error
- ssh: connect to host localhost port 22: Connection refusedlocalhost
- MySQL-1130-host ... is not allowed to connect to this MySql serverMySqlServer
- Oracle更新Opatch故障處理Oracle
- teams登入故障處理
- 微服務的故障處理微服務
- MySQL show processlist故障處理MySql
- VirtualBox Host-only Adapter,Failed to create the host-only adapter 轉APTAI
- Mysql host is blocked because of many connection errors;unblock解決方法MySqlBloCError
- FATAL - Fatal error: Target Interaction Manager failed at StartupErrorAI
- Host 'xxx' is not allowed to connect to this MySQL server 解決方法MySqlServer
- 線上故障處理手冊
- 【Linux】curl: (35) SSL connect error問題處理LinuxError
- Failed to connect to raw.githubusercontent.com port 443AIGithub
- Job for docker.service failed because the control process exited with error codeDockerAIError
- This application failed to start because it could not find or load the Qt platform plugin “windows“APPAIQTPlatformPluginWindows
- GaussDB(分散式)例項故障處理分散式
- 如何處理HTTP 503故障問題?HTTP
- Oracle 10g RAC故障處理Oracle 10g
- ORA-01591錯誤故障處理
- Oracle 11.2.0.4 Dataguard兩則故障處理Oracle
- 【故障處理】TNS-04610問題
- RocketMQ Connect 構建流式資料處理平臺MQ
- [mac pip錯誤]Can't connect to HTTPS URL because the SSL module is not availableMacHTTPAI
- Job for mysqld.service failed because the control process exited with error code...MySqlAIError
- 坑:ssh: connect to host github.com port 22: Connection refusedGithub
- 虛擬機器之間能夠ping通,但是建立tcp連線時卻顯示Failed in connect to TCP server: No route to host虛擬機TCPAIServer
- Vue init webpack xxxx project 報錯處理(connect ETIMEDOUT 192.30.253.112)VueWebProject