Home >Database >Mysql Tutorial >sqlplus连接服务器的Oracle的经历

sqlplus连接服务器的Oracle的经历

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 17:10:311136browse

今天用sqlplus连接服务器的Oracle 时,怎么也连接不上。服务器端的数据库名为cebdsp,tnsnames.ora 配置为

今天用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用户就行了。

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn