ORA-12514: TNS:listener does not currently know of service requested in connect
lsnrctl启动如下:
[oracle@powerlong4 admin]$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 02-FEB-2015 19:18:25
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Starting /oracle/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 /oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /oracle/app/oracle/diag/tnslsnr/xxxx/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=xxx)(PORT=1521)))
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 02-FEB-2015 19:18:25
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /oracle/app/oracle/diag/tnslsnr/powerlong4/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=powerlong4)(PORT=1521)))
The listener supports no services
The command completed successfully
[oracle@powerlong4 admin]$
[oracle@powerlong4 admin]$
[oracle@powerlong4 admin]$
[oracle@powerlong4 admin]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 02-FEB-2015 19:18:37
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 02-FEB-2015 19:18:25
Uptime 0 days 0 hr. 0 min. 12 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /oracle/app/oracle/diag/tnslsnr/powerlong4/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=xxx)(PORT=1521)))
The listener supports no services
The command completed successfully
[oracle@powerlong4 admin]$
tnsnames.ora配置文件如下:
[oracle@powerlong4 admin]$ vim tnsnames.ora
# tnsnames.ora Network Configuration File: /oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
SC_PD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.xxx.xxx.217)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = powerdes)
)
)
tnsping 是可以ping通的,如下所示:
[oracle@powerlong4 admin]$ tnsping SC_PD
TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 02-FEB-2015 19:22:26
Copyright (c) 1997, 2009, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = xxxx)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = powerdes)))
OK (0 msec)
[oracle@powerlong4 admin]$
但是连接报错:
[oracle@powerlong4 admin]$ sqlplus "sys/sys@SC_PD";
SQL*Plus: Release 11.2.0.1.0 Production on Mon Feb 2 19:21:04 2015
Copyright (c) 1982, 2009, Oracle. All rights reserved.
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
Enter user-name: ^C
[oracle@powerlong4 admin]$