我装的是Oracle10G企业版。数据库也在本机。已将DMP成功导入数据库,但是当用PL\SQL登录时,出现ORA-12154错误。我也查了一些资料,但是好像都没什么效果。下面把相关设置和问题描述一下,希望你们帮我解决下。
1.环境变量。
查看了注册表,是正确的
ORACLE_HOME c:\oracle\product\10.1.0\Db_1
2.SQLPLUS
输入connect,然后按照提示输入用户名和密码后,显示Connected
但是输入connect user/password@orcl后,显示的也是ORA-12154错误,并出现Warning: You are no longer connected to ORACLE.
3.确定监听服务已经起来。
4.用户名和密码确定正确
5.我的tnsnames.ora文件内容如下:
# tnsnames.ora Network Configuration File: c:\oracle\product\10.1.0\Db_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = XP-200907172259)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
6.sqlnet.ora文件内容如下
# sqlnet.ora Network Configuration File: c:\oracle\product\10.1.0\Db_1\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
7.listener.ora文件如下:
# listener.ora Network Configuration File: c:\oracle\product\10.1.0\Db_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = c:\oracle\product\10.1.0\Db_1)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = XP-200907172259)(PORT = 1521))
)
)
)
请帮我找出原因,这个问题搞的我快要吐了。。
谢谢!
------解决方案--------------------
再可以看看lsnrctl status是否正常,如果都是正确的。。。
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = c:\oracle\product\10.1.0\Db_1)
(PROGRAM = extproc)
)
)
修改为:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
#(SID_NAME = PLSExtProc)
(SID_NAME = orcl)
(ORACLE_HOME = c:\oracle\product\10.1.0\Db_1)
#(PROGRAM = extproc)
)
)