解決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連線耗時過長的問題現象RPYBOracle
- 解決代理連線超時問題
- 解決Pixel、Lineage等原始系統中的WIFI網路連線受限問題WiFi
- ORACLE RAC中連線ScanIP報錯ORA-12545的問題解決Oracle
- Ubuntu20.04.1LTS解決NAT方式連線網路後換源更新及本地SSH連線的問題Ubuntu
- Xshell連線Linux慢問題解決辦法Linux
- 使用 Charles 簡單解決微信開發者工具網路連線失敗的問題
- 解決虛擬網路卡無法連線到 Internet 問題(之一)
- 解決SpringBoot連線Nacos叢集報400問題Spring Boot
- 代理伺服器的連線問題及解決伺服器
- 解決Mac無法共享網路問題Mac
- Laradock 網路問題不能下載解決
- JDBC Oracle executeUpdate 卡死問題解決JDBCOracle
- 解決Oracle序列跳號問題Oracle
- 解決 Windows 下 Homestead 建立軟連線失敗問題Windows
- 輕鬆解決Github連線緩慢、圖裂問題Github
- 深入分析網路通訊,Wireshark助你解決網路問題!
- linux配置靜態路由解決網路問題Linux路由
- Oracle 解決like中無法匹配下劃線的問題Oracle
- Win10系統連線無線網路時提示你目前沒有連線到任何網路怎麼解決Win10
- SecureCRT 超時自動斷開連線問題解決方法Securecrt
- 記錄JSch連線SFTP Exception:Algorithm negotiation fail問題解決JSFTPExceptionGoAI
- win10網路連線配置異常如何解決_win10系統網路連線配置異常的解決教程Win10
- 您與該網站的連線不是私密連線,存在安全隱患,解決瀏覽器提示連線不安全的問題網站瀏覽器
- 解決Oracle死鎖問題步驟Oracle
- 五分鐘瞭解網路連線
- 解決安卓 linux adb 連線機器提示 no permissions 的問題安卓Linux
- docker下mysql連線數修改後不生效問題的解決DockerMySql
- 如何重置Mac的藍芽模組以解決連線問題Mac藍芽模組
- Linux配置靜態IP解決無法訪問網路問題Linux
- 解決macOS vim 不能連按問題Mac
- 內外網同時連線解決
- windows10網路連線正常無法上網最佳解決方法Windows
- 關於網路硬體配置出現問題,無法上網問題的解決
- 手機連線win10系統熱點顯示無網際網路連線的解決方法Win10
- Fiddler Everywhere for Mac – 解決網路問題的終極工具!Mac
- 國外代理ip能夠解決哪些網路問題
- ORACLE賬戶提示EXPIRED(GRACE)問題解決Oracle
- Oracle:ORA-27090 問題解決總結Oracle