If your environment is windows, the file corresponding to the service of
OracleOraDb10g_home1TNSListener is located the file of %Oracle_Hoem\bin\TNSLSNR.EXEIf the services is not started,the error comes: Ora-12514:TNS:无监听程序。
on the other hand,
if the service of OracleServiceORACLE is not started,the error comes: Ora-12514:TNS:监听程序当前无法识别链接描述符
中请求的服务。
But ,if the two services are started, Maybe the error also comes ORA-12514 , you need modify the listener.ora file.
On linux environment and windows environment, you need modify the listener.ora file.
I modify the listener.ora file on linux environment below. the listener.ora file content on linux environment is the same as on the windows environment.
Last login: Sun Jan 8 19:53:40 2012 from 192.168.11.1
[root@TrainingServer ~]# su - oracle
[oracle@TrainingServer ~]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.5.0 - Production on Sun Jan 8 20:09:11 2012
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
SQL>
SQL> conn /as sysdba
Connected.
SQL> disc
SQL> conn system/oracle@king as sysdba
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
SQL> exit
[oracle@TrainingServer ~]$ cd $ORACLE_HOME/network/admin
[oracle@TrainingServer admin]$ ls
listener1201087PM5729.bak listener.ora shrept.lst tnsnames1201087PM5931.bak
listener1201087PM5931.bak samples tnsnames1201087PM5729.bak tnsnames.ora
[oracle@TrainingServer admin]$ ls -l
total 32
-rw-r--r-- 1 oracle oinstall 510 Jan 8 19:59 listener.ora
drwxr-x--- 2 oracle oinstall 4096 Jan 8 18:39 samples
-rw-r--r-- 1 oracle oinstall 172 Dec 26 2003 shrept.lst
-rw-r--r-- 1 oracle oinstall 531 Jan 8 19:58 tnsnames.ora
[oracle@TrainingServer admin]$ vi listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PL***tProc)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = TrainingServer)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)
[oracle@TrainingServer admin]$ vi listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PL***tProc)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOAB_NAME = king)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
(SID_NAME = king)
) )
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = TrainingServer)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)
[oracle@TrainingServer admin]$ lsnrctl stop
LSNRCTL for Linux: Version 10.2.0.5.0 - Production on 08-JAN-2012 20:05:10
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=TrainingServer)(PORT=1521)))
The command completed successfully
[oracle@TrainingServer admin]$ lsnrctl start
LSNRCTL for Linux: Version 10.2.0.5.0 - Production on 08-JAN-2012 20:05:16
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Starting /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.5.0 - Production
System parameter file is /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=TrainingServer)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=TrainingServer)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.5.0 - Production
Start Date 08-JAN-2012 20:05:16
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/10.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=TrainingServer)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "PL***tProc" has 1 instance(s).
Instance "PL***tProc", status UNKNOWN, has 1 handler(s) for this service...
Service "king" has 1 instance(s).
Instance "king", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@TrainingServer admin]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.5.0 - Production on Sun Jan 8 20:05:20 2012
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
SQL> conn system/oracle@king
Connected.
SQL>
--The End!