大家好,详细情况如下:
服务器数据库的版本是oracle 9i,(操作系统solaris 10),客户端是enterprise manager console (10g client),操作系统windows 2003server,从客户端用enterprise manager console 能够正常连接数据库,并且在上面增删表空间都okey.
尝试使用tnsping 也正常,但是使用sqlplus进行连接的时候,总是报错"ORA-12154: TNS:could not resolve the connect identifier specified"
详细信息如下
客户端的
tnsnames.ora
# tnsnames.ora Network Configuration File: d:\oracle\product\10.2.0\client_2\NETWORK\ADMIN\tnsnames.ora
# Generated by Oracle configuration tools.
NETSERVICE =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.168.5)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = netservice)
)
)
MAOMI =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.168.5)(PORT = 1521))
)
(CONNECT_DATA =
(SID = dev920)
(SERVER = DEDICATED)
)
)
DEV920_172.16.168.5 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.168.5)(PORT = 1521))
)
(CONNECT_DATA =
(SID = dev920)
(SERVER = DEDICATED)
)
)
sqlnet.ora
# SQLNET.ORA Network Configuration File: /oracle/product/9.2.0/network/admin/sqlnet.ora
# Generated by Oracle configuration tools.
SQLNET.AUTHENTICATION_SERVICES= (NONE,NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)
服务器端的
listener.ora
# LISTENER.ORA Network Configuration File: /oracle/product/9.2.0/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = oraserver)(PORT = 1521))
)
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /oracle/product/9.2.0)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = dev920)
(ORACLE_HOME = /oracle/product/9.2.0)
(SID_NAME = dev920)
)
)
tnsnames.ora
# TNSNAMES.ORA Network Configuration File: /oracle/product/9.2.0/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
maomi =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = oraserver)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = dev920 )
)
)
INST1_HTTP =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = oraserver)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = SHARED)
(SERVICE_NAME = MODOSE)
(PRESENTATION = http://HRService)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
$
sqlnet.ora
# SQLNET.ORA Network Configuration File: /oracle/product/9.2.0/network/admin/sqlnet.ora
# Generated by Oracle configuration tools.
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)
/etc/hosts
$ cat /etc/hosts
#
# Internet host table
#
::1 localhost
127.0.0.1 localhost
172.16.168.5 oraserver loghost
------解决方案--------------------
我也有同样的问题:
http://blog.sina.com.cn/s/blog_3f2ef1180100aikc.html