0

我在 Centos 6.3 上安装了最新版本的 Oracle 11g。但由于某种原因,我无法连接到 SQL plus。这是 listener.ora 的内容:

# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.104)(PORT = 1521))
    )
  )

ADR_BASE_LISTENER = /u01/app/oracle

我在 shell 中输入:

[oracle@localhost bin]$ ./lsnrctl start

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 07-JAN-2013 21:37:32

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Starting /u01/app/oracle/product/11.2.0/dbhome_1//bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.104)(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                07-JAN-2013 21:37:32
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.104)(PORT=1521)))
The listener supports no services
The command completed successfully
[oracle@localhost bin]$ 

然后我尝试启动 SQL 加上这个:

[oracle@localhost bin]$ ./sqlplus sys@oracle AS SYSDBA

SQL*Plus: Release 11.2.0.1.0 Production on Mon Jan 7 21:38:27 2013

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Enter password: 
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified


Enter user-name: 

我该如何解决这个问题?

4

1 回答 1

1

确保 $TNS_ADMIN 指向 tnsnames.ora 和 sqlnet.ora 所在的目录。

于 2013-01-07T19:44:41.977 回答