解決oracle網路連線問題
Resolving Oracle networking problems
tnsManager - Distribute tnsnames the easy way and for free!This simple two part procedure will help to diagnose and fix the most common sqlnet and tnsnames configuration problems.
- 1. Test communication between the client and the listener
We will use tnsping to complete this step. It's a common misconception that tnsping tests connectivity to the instance. In actual fact, it only tests connectivity to the listener.
Here, we will use it to prove that a) the tnsnames.ora has the correct hostname and port, and b) that there is a listener listening on the specified host and port. Run tnsping:tnsping
If it is successful you will see something like this:oracle@bloo$ tnspinng scr9 Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = bloo)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = scr9))) OK (40 msec)
If not, here are some common errors, and some suggestions for fixing them:
TNS-03505: Failed to resolve name
The specified database name was not found in the tnsnames.ora, onames or ldap. This means that tnsping hasn't even got as far as trying to make contact with a server - it simply can't find any record of the database that you are trying to tnsping. Make sure that you've spelled the database name correctly, and that it has an entry in the tnsnames.ora.
If you have a sqlnet.ora, look at for the setting NAMES.DEFAULT_DOMAIN. If it is set, then all entries in your tnsnames.ora must have a matching domain suffix.
TNS-12545: Connect failed because target host or object does not exist
The host specified in the tnsnames is not contactable. Verify that you have spelled the host name correctly. If you have, try pinging the host with 'ping'. If ping returns 'unknown host', speak to your network admin. It might be that you have a DNS issue (you could try using the IP address if you have it to hand). If you get 'host unreachable', again speak to your network person, the problem could be down to a routing or firewall issue.
TNS-12541: TNS:no listener
The hostname was valid but the listener was not contactable. Things to check are that the tnsnames has the correct port (and hostname) specified, and that the listener is running on the server and using the correct port.
tnsping hangs for a long time
I've seen this happen in situations where there is something listening on the host/port - but it isn't an oracle listener. Make sure you have specified the correct port, and that your listener is running. If all looks ok, try doing a 'netstat -ap | grep 1521' (or whatever port you are using) to find out what program is listening on that port. - 2. Attempt a connection to the instance
Once you have proven that the tnsnames is talking to the listener properly, the next step is to attempt a full connection to the instance. To do this we.ll use sqlplus:sqlplus [username]/[password]@
If it works you will successfully log into the instance. If not, here are some common errors:
ORA-01017: invalid username/password; logon denied
This is actually a good error in these circumstances! Even though you didn't use the correct username or password, you must have successfully made contact with the instance.
ORA-12505: TNS:listener does not currently know of SID given in connect
Either the SID is misspelled in the tnsnames, or the listener isn't listening for it. Check the tnsnames.ora first. If it looks ok, do a 'lsnrctl status' on your server, to see what databases the listener is listening for.
ORA-12514: TNS:listener could not resolve SERVICE_NAME given in connect
This is quite a common error and it means that, while the listener was contactable, the database (or rather the service) specified in the tnsnames wasn't one of the things that it was listening out for.
Begin by looking at your tnsnames.ora. In it, you will a setting like SERVICE_NAME=.
If you are running a single instance database (ie. not RAC), and you are sure that you are not using services, it might be easier to change SERVICE_NAME= to SID= in your tnsnames. Using service names is the more modern way of doing things, and it does have benefits, but SID still works perfectly well (for now anyway).
If you would prefer to continue using service names, you must first check that you have not misspelled the service name in your tnsnames. If it looks alright, next check that the listener is listening for the service. Do this by running 'lsnrctl services' on your server. If there isn't an entry for your service, you need to make sure that the service_names parameter is set correctly on the database.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23205405/viewspace-704560/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 在Oracle網路結構中解決連線問題Oracle
- 理解oracle的網路結構 解決你的連線問題Oracle
- 在Oracle的網路結構中解決連線問題(轉)Oracle
- VMware中解決ubuntu不能連線網路問題。(親測有效)Ubuntu
- 網路問題:Tuxedo不能自動連線Oracle資料UXOracle
- GE研發路燈網路連線技術 智慧路燈或可解決擁堵問題
- 解決代理連線超時問題
- 使用 Charles 簡單解決微信開發者工具網路連線失敗的問題
- 解決Macbook網路連線成功但是圖示一直顯示正在查詢網路問題Mac
- 四招解決無線網路訊號太弱問題
- JDBC連線ORACLE問題JDBCOracle
- Ubuntu20.04.1LTS解決NAT方式連線網路後換源更新及本地SSH連線的問題Ubuntu
- Mac出現WiFi連線問題怎麼辦 Mac WiFi連線問題解決方法MacWiFi
- 無線網路連線不上的問題彙總
- 解決Pixel、Lineage等原始系統中的WIFI網路連線受限問題WiFi
- 解決mysql不能遠端連線的問題MySql
- 解決用PLSQL Developer連線VMWare中的Oracle 11g問題SQLDeveloperOracle
- 解決Oracle 11gR2 空閒連線過多,導致連線數滿的問題Oracle
- 解決線上Oracle連線耗時過長的問題現象RPYBOracle
- 代理伺服器的連線問題及解決伺服器
- 連線oracle中出現的問題Oracle
- navicate oracle 連線報錯問題Oracle
- 怎樣解決VMware虛擬機器無法連線外網問題虛擬機
- 解決虛擬網路卡無法連線到 Internet 問題(之一)
- 無線網路連線不上的原因與解決辦法
- 解決Mac無法共享網路問題Mac
- ORACLE RAC中連線ScanIP報錯ORA-12545的問題解決Oracle
- 輕鬆解決Github連線緩慢、圖裂問題Github
- Xshell連線Linux慢問題解決辦法Linux
- 解決git下載時斷開連線的問題Git
- 解決Xmanager連線HPUX顯示亂碼的問題UX
- 解決戶端連線CentOS系統亂碼問題CentOS
- 解決字串連線設定間隔符的問題字串
- Win8.1連不上無線網路的解決
- Win10系統連線無線網路時提示你目前沒有連線到任何網路怎麼解決Win10
- IIS連線ORACLE的一個問題Oracle
- 深入分析網路通訊,Wireshark助你解決網路問題!
- Laradock 網路問題不能下載解決