二孝卜禅、如果服务器状态正常,检查Oracle客户端$ORACLE\NETWORK\ADMIN\TNSNAME.ORA是否正确配置;
三、客户弊悔端也配置正常,确认客户端是否安装有多个Oracle产品,按如下步骤解决
你的机器上应该是安装了多个Oracle产品,默认的sqlplus和PL/SQL Developer使用了不同路径下的tnsname。
这个问题有两种解决方法:
1.配置每个Oracle产品的$ORACLE_HOME/NETWORK/ADMIN/TNSNAME.ORA
2.配置PL/SQL Developer使用的tnsname
打开PL/SQL Developer,点击“Cancel”进入“PLS/SQL Developer(Not logged on)”,选择Tools >巧尘>Preferences 打开Preferences窗口,选择 Connection >>Oracle Home下拉框,选择tnsname。
先看是什么系统,windows 的话 看看监听服务有没有启动,linux 或unix shell 下用 lsnrctl start 尝试一下看能不能启动监听 , 上述没用的话 用netca重新配置一下监听服务器
[oracle@ghy-database-test ~]$ lsnrctl stop
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 22-SEP-2014 16:39:35
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ghy-database-test)(PORT=1521)))
The command completed successfully
客户端
C:\Documents and Settings\Administrator>sqlplus sys/Clark3721@testdb as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on 星期一 9月 22 16:39:39 2014
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ERROR:
ORA-12541: TNS: 无监携含李听程序
请输入用户老郑名:
服务器
[oracle@ghy-database-test ~]$ lsnrctl start
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 22-SEP-2014 16:41:04
.............................
The command completed successfully
[oracle@ghy-database-test ~]$ lsnrctl status
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 22-SEP-2014 16:41:46
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ghy-database-test)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date22-SEP-2014 16:41:04
Uptime0 days 0 hr. 0 min. 46 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/辩迟oracle/product/12.1.2/db/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/ghy-database-test/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ghy-database-test)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=ghy-database-test)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/admin/testdb/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "testdb" has 1 instance(s).
Instance "testdb", status READY, has 1 handler(s) for this service...
Service "testdbXDB" has 1 instance(s).
Instance "testdb", status READY, has 1 handler(s) for this service...
Service "testpdb1" has 1 instance(s).
Instance "testdb", status READY, has 1 handler(s) for this service...
Service "testpdb2" has 1 instance(s).
Instance "testdb", status READY, has 1 handler(s) for this service...
Service "testpdb3" has 1 instance(s).
Instance "testdb", status READY, has 1 handler(s) for this service...
Service "testpdb4" has 1 instance(s).
Instance "testdb", status READY, has 1 handler(s) for this service...
The command completed successfully
客户端
C:\Documents and Settings\Administrator>sqlplus sys/Clark3721@testdb as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on 星期一 9月 22 16:42:46 2014
Copyright (c) 1982, 2005, Oracle. All rights reserved.
连接到:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing opt
ions
SQL>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)