安装oracle 10.2.0.1 数据库软件并创建数据库后,系统中没有 listener.ora 文件,则可以通过 netca 创建 listener.ora 及 tnsnames.ora
配置 tnsnames.ora 后,运行 sqlplus 用户名/密码@mydbsid 会报如下错误
ORA-28547: connection to server failed, probable Oracle Net admin error
这时修改 listener.ora ,原始文件内容如下:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc) #需要修改。这个会造成 ora-12514 错误
(ORACLE_HOME = /informix3/oracle/product/10.2.0/db_1)
(PROGRAM = extproc) #需要删除。这个会造成 ora-28547 错误
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = hpia64)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)
按上面要求修改后内容如下:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = mydbsid)
(ORACLE_HOME = /informix3/oracle/product/10.2.0/db_1)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = hpia64)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)
这时再可以正常连接。此时tnsnames.ora 如下:
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
wnms =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.2.34)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = mydbsid)
)
)
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22565551/viewspace-1040534/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/22565551/viewspace-1040534/