今天,在虛擬機上運行oracle,在MAC中使用eclipse,JDBC鏈接oracle時失敗,而用my eclipse的jdbc鏈接時,則報:ORA-12505, TNS:listener does not currently know of SID given in connect desc...oracle
出現以上的問題是沒法識別SID,解決方法以下:dom
1.找到如下目錄,/opt/oracle/product/10.2.0/db_1/network/admin,修改listener.ora,(find -name listener.ora便可找到該文件)爲:eclipse
# listener.ora Network Configuration File: /opt/oracle/product/10.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.spa
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /opt/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = ORCL)
(ORACLE_HOME = /opt/oracle/product/10.2.0/db_1)
(SID_NAME = ORCL)
)
)orm
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC3))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1523))
)
)ip
最後從新配置和啓動監聽就能夠了!!
虛擬機