Home | Mirror | Search |
目錄
[root@database ~]# cat /u01/app/oracle/product/10.2.0.1/network/admin/listener.ora # listener.ora Network Configuration File: /u01/app/oracle/product/10.2.0.1/network/admin/listener.ora # Generated by Oracle configuration tools. SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = /u01/app/oracle/product/10.2.0.1) (PROGRAM = extproc) ) ) LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1)) (ADDRESS = (PROTOCOL = TCP)(HOST = database.example.com)(PORT = 1521)) ) )
tnsnames.ora 檔案預設在 network/admin/tnsnames.ora
有些情況如你沒有權限修改network/admin/tnsnames.ora, 你可以在$HOME下創建一個.tnsnames.ora檔案
oradb10g = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = db1.domain.com)(PORT = 1521)) ) (CONNECT_DATA = (SID = oradb10g) ) ) oradb = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = db2.domain.com)(PORT = 1521)) ) (CONNECT_DATA = (SID = oradb) ) )
測試TNS
$ sqlplus user@oradb