1、详细报错“
SQL> conn sys/system@ora11g
ERROR:
ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA
”
2、我不确认我当时安装数据库时数据库名是不是ora11g
3、监听启动打印:
bash-3.1$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 24-DEC-2012 03:51:52
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Starting /home/oracle/oracle_base/software_location/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /home/oracle/oracle_base/software_location/network/admin/listener.ora
Log messages written to /home/oracle/oracle_base/diag/tnslsnr/localhost/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 24-DEC-2012 03:51:54
Uptime 0 days 0 hr. 0 min. 4 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /home/oracle/oracle_base/software_location/network/admin/listener.ora
Listener Log File /home/oracle/oracle_base/diag/tnslsnr/localhost/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))
Services Summary...
Service "ora11g" has 1 instance(s).
Instance "ora11g", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
4、listener.ora文件内容,可放大查看
5、tnsnames.ora内容,可放大查看