您的位置:首页 > 数据库 > Oracle

sqlplus连接服务器的Oracle的经历

2012-01-30 18:44 387 查看
今天用sqlplus连接服务器的Oracle 时,怎么也连接不上。服务器端的数据库名为cebdsp,tnsnames.ora 配置为

cebdsp =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.101)(PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = cebdsp)

)

)

在命令行下查看 tnsping cebdsp,得到

C:\Users\zyxuc>tnsping cebdsp

TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 30-1月 -

2012 18:41:15

Copyright (c) 1997, 2005, Oracle. All rights reserved.

已使用的参数文件:

D:\oracle\product\10.2.0\db_1\network\admin\sqlnet.ora

TNS-03505: 无法解析名称

原因是上面的配位cebdsp时,前面有空格,不行。删除空格后,运行: tnsping cebdsp 得到:

C:\Users\zyxuc>tnsping cebdsp

TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 30-1月

2012 18:41:35

Copyright (c) 1997, 2005, Oracle. All rights reserved.

已使用的参数文件:

D:\oracle\product\10.2.0\db_1\network\admin\sqlnet.ora

已使用 TNSNAMES 适配器来解析别名

Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168

1.101)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = cebds

)))

OK (30 毫秒)

然后 运行:sqlplus cebdsp/cebdsp@cebdsp 测试能否连接上 cebdsp数据库,得到:

C:\Users\zyxuc>sqlplus cebdsp/cebdsp@cebdsp

SP2-1503: 无法初始化 Oracle 调用界面

SP2-0152: ORACLE 不能正常工作

最后发现 是权限问题。我之前用的不是Administrator用户,没有权限,更改到Administrator用户就行了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: