突然无法登陆oracle数据库。无论时通过PLSQL工具远程登陆,还是用sqlplus命令本地登陆都无法连接数据库。
$ sqlplus /nolog
SQL*Plus: Release 10.2.0.5.0 - Production on Mon Dec 24 10:28:49 2012
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
SQL> connect SYS/passwd@orcl as SYSDBA
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
baidu一下(google已经被伟光正搞残,只能退而用这个次品)。
先重启 监听服务。
lsnrctl stop
lsnrctl start
现在可以在不指定数据库名称的前提下登陆。例如: sqlplus user/passwd。
但如果指定数据库名
$ sqlplus user/passwd@jfdbt
SQL*Plus: Release 10.2.0.5.0 - Production on Mon Dec 24 11:09:35 2012
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
Enter user-name: user
Enter password:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
按照这里 ORA-12514: TNS 的说法,修改 listener.ora。再重启监听服务。