免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2075 | 回复: 2
打印 上一主题 下一主题

tnsping是可以的,但是sqlplus 不可以,到底为什么?[/ [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-08-01 14:48 |只看该作者 |倒序浏览
tnsping是可以的,但是sqlplus 不可以,到底为什么?

$ sqlplus system/system@eric9i

SQL*Plus: Release 9.2.0.6.0 - Production on Tue Aug 1 14:40:13 2006

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

ERROR:
ORA-12514: TNS:listener could not resolve SERVICE_NAME given in connect
descriptor



Enter user-name:



具体的操作过程如下:
==============





root@e420 # cat /etc/passwd
root:0:1:Super-User:/:/sbin/sh
daemon:1:1::/:
bin:2:2::/usr/bin:
sys:3:3::/:
adm:4:4:Admin:/var/adm:
lp:71:8:Line Printer Admin:/usr/spool/lp:
uucp:5:5:uucp Admin:/usr/lib/uucp:
nuucp:9:9:uucp Admin:/var/spool/uucppublic:/usr/lib/uucp/uucico
smmsp:25:25:SendMail Message Submission Program:/:
listen:37:4:Network Admin:/usr/net/nls:
nobody:x:60001:60001:Nobody:/:
noaccess:x:60002:60002:No Access User:/:
nobody4:x:65534:65534:SunOS 4.x Nobody:/:
db2ps1:x:200:200::/db2/ibmdb/db2ps1:/bin/sh
patrol:x:1001:201::/opt/patrol:/bin/sh
dasusr1:x:106:101::/db2/ibmdb/dasusr1:/bin/sh
db2fenc1:x:108:102::/db2/ibmdb/db2fenc1:/bin/sh
eric:x:2008:100::/export/home/eric:/bin/sh
db2dev:x:102:108::/db2/ibmdb/db2dev:/bin/sh
db2pb01:x:109:109::/export/home/db2pb01:/bin/sh
nmail:x:1003:202::/ndata/mail:/bin/sh
notes1:x:1004:202::/ndata/notes1:/bin/sh
books:x:1005:1::/export/home/books:/usr/bin/sh
notes:x:1006:202::/export/home/notes:/bin/sh
ora9i:x:1007:100::/export/home/ora9i:/bin/sh
ora8i:x:1008:100::/export/home/ora8i:/bin/sh
orapd8:x:1009:100:SAP Database Administration User:/oracle/PD8:/bin/sh
pd8adm:x:1010:203:SAP System Administrator:/export/home/pd8adm:/bin/sh
ora10g:x:1011:100::/export/home/ora10g:/bin/sh
cnooc:x:1012:1::/home/cnooc:/bin/sh
ora10gr2:x:2009:205::/home/ora10gr2:/bin/sh
ora10:x:2010:100::/export/home/ora10:/bin/sh
ims:x:1000:1000::/ims52:/usr/bin/bash
webservd:x:80:80::/home/webservd:/bin/pfsh
smcorau:x:2011:1001::/var/opt/SUNWsymon/smcorau:/bin/sh
ops:x:2012:1::/export/home/ops:/bin/sh
-:x::::/export/home/ora10:/bin/sh
root@e420 #
root@e420 #
root@e420 #
root@e420 # su - ora9i
Sun Microsystems Inc.   SunOS 5.9       Generic May 2002
$
$
$
$ lsnrctl status

LSNRCTL for Solaris: Version 9.2.0.6.0 - Production on 01-AUG-2006 14:39:42

Copyright (c) 1991, 2002, Oracle Corporation.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=e420)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Solaris: Version 9.2.0.6.0 - Production
Start Date                21-JUL-2006 17:45:47
Uptime                    10 days 20 hr. 53 min. 54 sec
Trace Level               off
Security                  OFF
SNMP                      OFF
Listener Parameter File   /oracle/ora9i/product/9.2.0/network/admin/listener.ora
Listener Log File         /oracle/ora9i/product/9.2.0/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=e420.mdcl.com.cn)(PORT=1521)))
Services Summary...
Service "yszhang" has 2 instance(s).
Instance "eric9i", status UNKNOWN, has 1 handler(s) for this service...
  Instance "eric9i", status READY, has 1 handler(s) for this service...

The command completed successfully
$
$
$ tnsping eric9i

TNS Ping Utility for Solaris: Version 9.2.0.6.0 - Production on 01-AUG-2006 14:39:48

Copyright (c) 1997 Oracle Corporation.  All rights reserved.

Used parameter files:
/oracle/ora9i/product/9.2.0/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.129.55)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = eric9i)))
OK (70 msec)
$
$
$ sqlplus "/ as sysdba"

SQL*Plus: Release 9.2.0.6.0 - Production on Tue Aug 1 14:39:55 2006

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.6.0 - Production

SQL> exit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.6.0 - Production
$ sqlplus system/system@eric9i

SQL*Plus: Release 9.2.0.6.0 - Production on Tue Aug 1 14:40:13 2006

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

ERROR:
ORA-12514: TNS:listener could not resolve SERVICE_NAME given in connect
descriptor


Enter user-name:

论坛徽章:
0
2 [报告]
发表于 2006-08-01 15:43 |只看该作者
將 trsname.ora  文件中的 ..

SERVICE_NAME  改為  sid 試試...


(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.129.55)(PORT = 1521))) (CONNECT_DATA = (sid= eric9i)))

[ 本帖最后由 zhang_yong88 于 2006-8-1 15:44 编辑 ]

论坛徽章:
0
3 [报告]
发表于 2006-08-01 16:22 |只看该作者
谢谢,这样可以了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP