Oracle用戶端工具串連資料庫伺服器問題解決整理

來源:互聯網
上載者:User

經常遇到PL/SQL Developer等依賴Client的工具無法串連Oracle資料庫伺服器的問題。至今也沒完全理清楚,先發個帖總結一下目前的方法,後面會不斷完善。

方法一:

重啟Oracle伺服器端相關服務,包括...TNSListener,所用的資料庫執行個體的服務。可直接在Windows的“服務”中重啟。或者(可使用的命令):

lsnrctl stop
lsnrctl start
lsnrctl reload
sqlplus / as sysdba;
startup;

這個方法試過多次有效,但原因未知,求真相。

方法二:

使用Net Configuration Assist設定管理員端和用戶端。

Oracle伺服器端需要設定listener(監聽程式),設定結果影響listener.ora(...\db_1\NETWORK\ADMIN)。Client端(用戶端)需要配置“本地Net服務名配置”,可能影響tnsnames.ora和sqlnet.ora兩個檔案。若是Oracle Client,則檔案位置是...\client_1\NETWORK\ADMIN

方法三:

若裝有Oracle Client,則可使用Enterprise Manager Console添加資料庫連接,會修改tnsnames.ora檔案(...\client_1\NETWORK\ADMIN)。

方法四:

查看sqlnet.ora中是否有NAMES,DIRECTORY_PATH等,可能與此有關。

# sqlnet.ora Network Configuration File: C:\oracle\product\10.2.0\db_1\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.

# This file is actually generated by netca. But if customers choose to
# install "Software Only", this file wont exist and without the native
# authentication, they will not be able to connect to the database on NT.

SQLNET.AUTHENTICATION_SERVICES= (NTS)

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

注意:

1. Enterprise Manager Console與Net Configuration Assist添加的資料庫連接描述符不同,前者為...CONNECT_DATA=(SID=...)(SERVER=...)...,後者為...(SERVICENAME=...)...。

2. Enterprise Manager Console中刪除一條串連後,tnsnames.ora中的描述字串不會自動刪除;Net Configuration Assist中刪除一條本地Net服務配置後,tnsnames.ora檔案中對應的描述字串會自動刪除。

3. 若安裝配置OWB(Oracle Warehouse Builder),則檔案位置是...\client_1\NETWORK\ADMIN

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.