ORA-12514 Connecting through php
So I want to connect to my database through php. I'm using XAMPP 3.1, Oracle 11g, PHP 5 and Windows XP Pro (VM), and I get this error
Error: 12514 - ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
Here I do "lsnrctl services":
C:\Documents and Settings\Administrator>lsnrctl services
LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 04-JAN-2013 01:03
:56
Copyright (c) 1991, 2010, Oracle. All rights reserved.
A ligar a (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=daniel-2f3bc07e)(PORT=1521))
Resumo dos Serviτos...
O serviτo "BD1213XDB" tem 1 instΓncia(s).
A instΓncia "bd1213", estado READY, tem 1 rotina(s) de tratamento deste serviτ
o...
Rotina(s) de tratamento:
"D000" estabelecido:0 recusado:0 actual:0 mßx.:1022 estado:ready
DISPATCHER <machine: DANIEL-2F3BC07E, pid: 2744>
(ADDRESS=(PROTOCOL=tcp)(HOST=daniel-2f3bc07e)(PORT=1028))
O serviτo "CLRExtProc" tem 1 instΓncia(s).
A instΓncia "CLRExtProc", estado UNKNOWN, tem 1 rotina(s) de tratamento deste
serviτo...
Rotina(s) de tratamento:
"DEDICATED" estabelecido:3 recusado:0
LOCAL SERVER
O serviτo "Oracle8" tem 1 instΓncia(s).
A instΓncia "ORCL", estado UNKNOWN, tem 1 rotina(s) de tratamento deste serviτ
o...
Rotina(s) de tratamento:
"DEDICATED" estabelecido:0 recusado:0
LOCAL SERVER
O serviτo "bd1213" tem 1 instΓncia(s).
A instΓncia "bd1213", estado READY, tem 1 rotina(s) de tratamento deste serviτ
o...
Rotina(s) de tratamento:
"DEDICATED" estabelecido:52 recusado:0 estado:ready
LOCAL SERVER
Comando concluφdo com Ωxito
C:\Documents and Settings\Administrator>
I'm sorry for this being in portuguese, I don't know how to get in english. I want to connect to bd1213. And the php I'm running:
<?php
$cfg = array();
$cfg['username'] = "trabalho";
$cfg['password'] = "cp7";
$cfg['c_string'] = "daniel-2f3bc07e:1521/trabalho";
$cbd = oci_connect($cfg['username'], $cfg['password'], $cfg['c_string']);
if(!$cbd){
$err = oci_error();
echo "Erro: ".$err['code']." - ".$err['message'];
die();
?>
Any thougts on how to fix this?
Thanks in advance!
Regards,
Daniel
979823 wrote:
So I want to connect to my database through php. I'm using XAMPP 3.1, Oracle 11g, PHP 5 and Windows XP Pro (VM), and I get this error
Error: 12514 - ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
Here I do "lsnrctl services":
C:\Documents and Settings\Administrator>lsnrctl services
LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 04-JAN-2013 01:03
:56
Copyright (c) 1991, 2010, Oracle. All rights reserved.
A ligar a (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=daniel-2f3bc07e)(PORT=1521))
Resumo dos Serviτos...
O serviτo "BD1213XDB" tem 1 instΓncia(s).
A instΓncia "bd1213", estado READY, tem 1 rotina(s) de tratamento deste serviτ
o...
Rotina(s) de tratamento:
"D000" estabelecido:0 recusado:0 actual:0 mßx.:1022 estado:ready
DISPATCHER <machine: DANIEL-2F3BC07E, pid: 2744>
(ADDRESS=(PROTOCOL=tcp)(HOST=daniel-2f3bc07e)(PORT=1028))
O serviτo "CLRExtProc" tem 1 instΓncia(s).
A instΓncia "CLRExtProc", estado UNKNOWN, tem 1 rotina(s) de tratamento deste
serviτo...
Rotina(s) de tratamento:
"DEDICATED" estabelecido:3 recusado:0
LOCAL SERVER
O serviτo "Oracle8" tem 1 instΓncia(s).
A instΓncia "ORCL", estado UNKNOWN, tem 1 rotina(s) de tratamento deste serviτ
o...
Rotina(s) de tratamento:
"DEDICATED" estabelecido:0 recusado:0
LOCAL SERVER
O serviτo "bd1213" tem 1 instΓncia(s).
A instΓncia "bd1213", estado READY, tem 1 rotina(s) de tratamento deste serviτ
o...
Rotina(s) de tratamento:
"DEDICATED" estabelecido:52 recusado:0 estado:ready
LOCAL SERVER
Comando concluφdo com Ωxito
C:\Documents and Settings\Administrator>
I'm sorry for this being in portuguese, I don't know how to get in english. I want to connect to bd1213. And the php I'm running:
<?php
$cfg = array();
$cfg['username'] = "trabalho";
$cfg['password'] = "cp7";
$cfg['c_string'] = "daniel-2f3bc07e:1521/trabalho";
$cbd = oci_connect($cfg['username'], $cfg['password'], $cfg['c_string']);
if(!$cbd){
$err = oci_error();
echo "Erro: ".$err['code']." - ".$err['message'];
die();
?>
Any thougts on how to fix this?
Thanks in advance!
Regards,
DanielORA-12514 ALWAYS only occurs due to a problem on DB Server system.
One cause of this problem is when the Oracle database is down & needs to be started.
A remote client send a request to the Listener asking to be connected to a specific service.
If/when the listener does not know anything about that service, the listener responds with ORA-12514
Since every connection request to the listener gets logged, listener.log file will contain a line with 12514 as status code.
This line contains valuable debugging details. So post this line & surrounding lines.
for additional debugging suggestions read the URL below:
http://edstevensdba.wordpress.com/2011/03/19/ora-12514/
Similar Messages
-
Ora-12514 connect to SCAN listener in dataguard RAC environment
I have two rac nodes datase on linux and two rac standby database also.
Here are what I got when I try to connect to scan listener from client. It connects to vip/or scan ip addresses without any problem.
sqlplus system/password@wxcy
SQL*Plus: Release 10.2.0.3.0 - Production on Wed Mar 14 18:42:42 2012
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
But when I log in to the ip address of the scan listener, it worked:
sqlplus system/[email protected]:1521/wxcy
SQL*Plus: Release 10.2.0.3.0 - Production on Wed Mar 14 18:43:12 2012
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL>
Here is the tnsnames.ora on the client:
wxcy =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)
(HOST = scan.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = wxcy)
Here are listener.ora and tnsnames.ora on the server:
LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))) # line added by Agent
LISTENER_SCAN3=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN3)))) # line added by Agent
LISTENER_SCAN2=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN2)))) # line added by Agent
LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))) # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN2=ON # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN3=ON # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agent
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = wxcy_DGMGRL)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = wxcy1)
SID_LIST_LISTENER_SCAN1 =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = wxcy)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = wxcy1)
SID_LIST_LISTENER_SCAN3 =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = wxcy)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = wxcy1)
INBOUND_CONNECT_TIMEOUT_LISTENER = 120
~
tnsnames.ora:
wxcy =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = scan.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = wxcy)
wxcy_DGMGRL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = scan.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = wxcy_DGMGRL)
wxcy1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = scan.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)(SERVICE_NAME = wxcy)
(INSTANCE_NAME = wxcy1)
wxcy2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = scan.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)(SERVICE_NAME = wxcy)
(INSTANCE_NAME = wxcy2)
From node 2:
LISTENER_SCAN2=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN2)))) # line added by Agent
LISTENER_SCAN3=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN3)))) # line added by Agent
LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))) # line added by Agent
LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))) # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN3=ON # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN2=ON # line added by Agent
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = wxcy_DGMGRL)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = wxcy1)
SID_LIST_LISTENER_SCAN2 =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = wxcy)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = wxcy2)
SID_LIST_LISTENER_SCAN3 =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = wxcy)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = wxcy2)
I wonder why I can connect to the ip addresses of those scan listener but not the scan name.
Thanks.Hello;
This note may help :
How to Troubleshoot Connectivity Issue with 11gR2 SCAN Name [ID 975457.1]
Also I would check my DNS ( OK double check ) and each listener service as follows :
lsnrctl service LISTENER_SCAN1
( and so on )
Also
Make sure a password file exists on on that node. ( A copy - Create new with Oracle 11 DG does not work )
Best Regards
mseberg
Edited by: mseberg on Mar 14, 2012 5:10 PM -
Error connecting via PHP to Oracle Database 10g XE in Arch Linux with XAMPP
I get this error whenever I try to connect through PHP to my locally hosted Oracle Database 10g Express Edition
Warning: oci_connect() [function.oci-connect]: OCIEnvNlsCreate() failed. There is something wrong with your system - please check that LD_LIBRARY_PATH includes the directory with Oracle Instant Client libraries in <filename>.php on line 10
What can I do?Not sure what to offer for XAMP with php, perhaps it needs a configure pointing OCI8 to your ORACLE_HOME, as well as setting the oracle environment and PATH adjustment in the Apache start script.
Somewhere under /etc there should be an init.d or perhaps rc.d directory with maybe an apache2 script that gets called at system boot or run level change. It will take editing that shell script and adding something like:
export ORACLE_HOME=/usr/....
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATHAnd restarting apache ... $ [sudo] {RC path}/apache2 restart or $ ...apache2 stop followed by an $ ...apache2 start all depending on how the boot/inits are setup on the box.
And in your $ORACLE_HOME/network/admin/tnsnames.ora adding a tnsalias won't hurt (as long as the whitespace as well as matching parenthesis are all in order)
myxedb =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = myhost.mycompany.com)(PORT = 1521))
(CONNECT_DATA =
(SID = XE)
) -
ORA-12514 Error coming whenever trying to connect to database in TOAD
Hi,
When i'm logging in database(10g) through TOAD, i'm getting the error as:
"ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor"
My listener.ora contains
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = E:\oracle\product\10.2.0\db_1)
(PROGRAM = extproc)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
My tnsnames.ora contain:
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
The listener status is as follows:
Welcome to LSNRCTL, type "help" for information.
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
Alias LISTENER
Version TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Produ
ction
Start Date 05-OCT-2008 06:40:42
Uptime 0 days 0 hr. 16 min. 31 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File E:\oracle\product\10.2.0\db_1\network\admin\listener.o
ra
Listener Log File E:\oracle\product\10.2.0\db_1\network\log\listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1ipc)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
The database is up and running and I've stopped-started the listener.
Still the error occurs. Could anyone suggest what can be done.
Regards,
SouvikThe error basically means that the connection service which you are requeting in your connection string is not yet to known to the listener of yours. See here the output of the listener's supported services from your post.
Listening Endpoints Summary...
+(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1ipc)))+
+(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))+
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
It clearly shows that the listener is only working to listen for the PLSExtproc service which is meant for external procedures.
Is the database just started? If that's the case than it may take a while to get the PMON register the db with the listener. Or you can issue,
alter system register from your db's sql prompt which can ask listener for immediately register the db with it. Try this command and post feedback. If that won't work than you may have to manualy register your db with the listener.
HTH
Aman.... -
NSV0: Failed to connect to remote database orcl. Error is ORA-12514
sGetting error on data guard broker configuration. redologs shiping properly, withot any problems.
Database: 11gR2 , Linux 64-bit
[root@redhat ~]# su - oracle
[oracle@redhat ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.1.0 Production on Fri Jun 18 17:39:07 2010
Copyright (c) 1982, 2009, Oracle. All rights reserved.
SQL> connect /as sysdba
Connected.
SQL> connect sys/oracle@primarydb as sysdba
Connected.
SQL> connect sys/oracle@physicaldb as sysdba
Connected.
SQL>
*/etc/hosts file contents on all nodes*
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
192.168.1.232 redhat redhat
192.168.1.234 rac1 rac1
primary database (drcorcl.log)
2010-06-18 17:41:39.972 02010001 1362743835 DMON: CTL_GET_STATUS forwarded to site physicaldb for processing
2010-06-18 17:41:41.044 NSV1: Site physicaldb returned ORA-16664.
2010-06-18 17:41:41.045 02010001 1362743821 DMON: Database physicaldb returned ORA-16664
2010-06-18 17:41:41.045 02010001 1362743821 for opcode = CTL_GET_STATUS, phase = NULL, req_id = 1.1.1362743821
2010-06-18 17:41:41.045 02010001 1362743821 DMON: CTL_GET_STATUS operation completed
2010-06-18 17:41:41.050 01000000 1362743836 DMON: MON_PROPERTY operation completed
2010-06-18 17:41:41.054 01010001 1362743837 DMON: MON_PROPERTY operation completed
2010-06-18 17:41:41.058 01010001 1362743838 DMON: MON_PROPERTY operation completed
2010-06-18 17:41:41.062 01010001 1362743839 DMON: CTL_GET_STATUS operation completed
2010-06-18 17:41:56.045 NSV1: Site physicaldb returned ORA-16664.
2010-06-18 17:41:56.045 02010001 1362743835 DMON: Database physicaldb returned ORA-16664
2010-06-18 17:41:56.045 02010001 1362743835 for opcode = CTL_GET_STATUS, phase = NULL, req_id = 1.1.1362743835
2010-06-18 17:41:56.046 02010001 1362743835 DMON: CTL_GET_STATUS operation completed
physical standby database (drcorcl.log)
2010-06-17 00:41:30.410 drcx: could not find task req_id=1.1.1362743821 for PROBE.
2010-06-17 00:41:45.411 drcx: could not find task req_id=1.1.1362743835 for PROBE.
2010-06-17 00:42:00.546 NSV0: Failed to connect to remote database orcl. Error is ORA-12514
2010-06-17 00:42:00.547 NSV0: Failed to send message to site orcl. Error code is ORA-12514.
2010-06-17 00:42:00.547 DMON: Database orcl returned ORA-12514
2010-06-17 00:42:00.547 for opcode = HEALTH_CHECK, phase = BEGIN, req_id = 1.1.1362743840
2010-06-17 00:42:15.414 drcx: could not find task req_id=1.1.1362743840 for PROBE.
2010-06-17 00:43:15.548 NSV0: Failed to connect to remote database orcl. Error is ORA-12514
2010-06-17 00:43:15.549 NSV0: Failed to send message to site orcl. Error code is ORA-12514.
2010-06-17 00:43:15.549 DMON: Database orcl returned ORA-12514
2010-06-17 00:43:15.549 for opcode = HEALTH_CHECK, phase = BEGIN, req_id = 1.1.1362743841
Standby Lintener file contents
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = rac1)(PORT = 1521))
ADR_BASE_LISTENER = /oradisk/oracle
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DNAME = physicaldb)
(ORACLE_HOME = /oradisk/oracle/product/11.2.0/db)
(SID_NAME = orcl)
(SID_DESC =
(GLOBAL_DNAME = physicaldb_DGMGRL)
(ORACLE_HOME = /oradisk/oracle/product/11.2.0/db)
(SID_NAME = ORCL)
Primary database Listener contents
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.232)(PORT = 1521))
ADR_BASE_LISTENER = /oradisk/oracle
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DNAME = orcl)
(ORACLE_HOME = /oradisk/oracle/product/11.2.0/db)
(SID_NAME = orcl)
(SID_DESC =
(GLOBAL_DNAME = orcl_DGMGRL)
(ORACLE_HOME = /oradisk/oracle/product/11.2.0/db)
(SID_NAME = orcl)
TNSNAMES.ora on all nodes
PRIMARYDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.232)(PORT = 1521)))
(CONNECT_DATA =(SID = orcl))
LISTENER_PHYSICALDB =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.234)(PORT = 1521))
PHYSICALDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.234)(PORT = 1521)) )
(CONNECT_DATA =(SID = orcl))
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.232)(PORT = 1521)))
(CONNECT_DATA =(SERVER = DEDICATED)(SID = orcl) )
)Don't use the old syntax 'SID=...' in tnsnames.ora, use 'SERVICE_NAME=...' . Make sure 'SERVICE_NAME' is exactly the same returned by 'lsnrctl status' on both nodes.
Primary and standby cannot talk to each other currently through the listener:
ORA-16664: unable to receive the result from a database
Cause: During execution of a command, a database in the Data Guard broker
configuration failed to return a result.
Action: Check Data Guard broker logs for the details of the failure. Fix any
possible network problems and try the command again.
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
Cause: The listener received a request to establish a connection to a database or other service. The connect descriptor received by the listener specified a service name for a service (usually a database service) that either has not yet dynamically registered with the listener or has not been statically configured for the listener. This may be a temporary condition such as after the listener has started, but before the database instance has registered with the listener.
Action: - Wait a moment and try to connect a second time.
- Check which services are currently known by the listener by executing: lsnrctl services <listener name>
- Check that the SERVICE_NAME parameter in the connect descriptor of the net service name used specifies a service known by the listener.
- If an easy connect naming connect identifier was used, check that the service name specified is a service known by the listener.
- Check for an event in the listener.log file.
Werner -
ORA-12514 error: Instant Client 11 connect to remote Oracle 8i
I encountered a problem that I have spent hours fixing that. Here is the problem:
I am trying to connect to a remote Oracle 8i server using Oracle 11 instant client: here is my connection string in PHP:
*$conn = oci_connect('db_user', 'db_pass', "db_ip/db_service");*
db_ip is the ip of the server, such as "12.34.56.78". db_service is the service of server, such as "test".
The error shown is "*ORA-12514:* TNS:listener does not currently know of service requested in connect descriptor"
I could use the same client to connect to another oracle 10g server. The php code is same, only change the db_user or db_pass or db_ip. db_service is not provided.
I dont use tnsnames.ora for either oracle *10g s*erver or oracle 8i server. I just use the simple IP of server. Does this matter?
Server using: Windows Server 2008 R2
PHP: php 5.2.17
Oracle Instant Client: 11_2
Any ideas will be appreciated.
Best, SamPl do not post duplicates - PHP 5.2.17 and Oracle 8i
-
Connecting to Oracle XE via regular 10g client - ORA-12514
I have had the 10g client installled on my computer for a while, for developing against our company Oracle databases. I have now installed the XE database locally on my computer so I can do some local development - according to the information I've been able to find the two should live side-by-side without problem.
I can still connect to our company databases just fine, but I can't get a connection to the local XE database at all.
I've added this line to tnsnames.ora:
XE = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))(CONNECT_DATA = (SERVICE_NAME = XE)))
The error I'm getting connecting is:
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
Thanks for any help!Hi,
I did mean duplicates even between different tnsnames.ora files.
As I understand, if you XE works, you should not need do anything for that tnsnames.ora.
Just find how entry should be for client.
BTW, what tool you will use for XE? Do you need client?
E.g. if you use SQL Developer, you do not need client or set anything to tnsnames.ora
Regards,
Jari
Edited by: jarola on Jan 18, 2011 2:30 PM
BTW, it might good to search Instant Client forums if you find help there.
If you do not find answer, then it might good idea post question there.
At least for me this is more client question than XE.
Instant Client
But as I understand it should not be any problem use 10g client for XE.
I just have never done that =) -
ORA-12514: TNS:listener could not resolve SERVICE_NAME given in connect
Hi Friends,
I have created 10g database for catalog.
I kept the tns entry in some other server. Tnsping is working fine.. I can see the result.
mexn01:$ tnsping rman09na
TNS Ping Utility for HPUX: Version 9.2.0.5.0 - Production on 28-APR-2008 19:29:07
Copyright (c) 1997 Oracle Corporation. All rights reserved.
Used parameter files:
/apps/app/oracle/local/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = torora60)(PORT = 1522))) (CONNECT_DATA = (SERVICE_NAME = rman09na)))
OK (0 msec)
When I am trying to connect to the database I am getting following error..
mexn01:$ sqlplus ismdba/xxxxx@rman09na
SQL*Plus: Release 9.2.0.5.0 - Production on Mon Apr 28 19:29:22 2008
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
ERROR:
ORA-12514: TNS:listener could not resolve SERVICE_NAME given in connect
descriptor
Please help me..
Thanks in advance.Try on the server where it doesn't work:
sqlplus ismdba/xxxxx@"(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = torora60)(PORT = 1522))) (CONNECT_DATA = (SERVICE_NAME = rman09na)))"
or
tnsping "(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = torora60)(PORT = 1522))) (CONNECT_DATA = (SERVICE_NAME = rman09na)))"
(note the double quotes)
If that works then your tnsnames.ora is incorrect on that server. -
ORA-12514:listener does not currently know of service requested in connect
I am not able to connect to oracle 10g xe database....
Can any one of you help me in resolving this error
last time I was able to login when I installed Oracle 10g XE on my
windows xp machine but I dont know wht has happen...now i didnt change
any setting... just restarted m/c..
C:\Documents and Settings\ak>sqlplus scott/tiger@XE
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Nov 19 17:11:24 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
regards,
aak.## below is my listner.ora file
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\10.2.0\server)
(PROGRAM = extproc)
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\10.2.0\server)
(PROGRAM = extproc)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
(ADDRESS = (PROTOCOL = TCP)(HOST = ak.com)(PORT = 1521))
DEFAULT_SERVICE_LISTENER = (XE)
### below is sqlnet.ora
# This file is actually generated by netca. But if customers choose to
# install "Software Only", this file wont exist and without the native
# authentication, they will not be able to connect to the database on NT.
SQLNET.AUTHENTICATION_SERVICES = (NTS)
### below is tnsnames.ora
XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = ak.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
) -
Good Day,
I'm encountering this problem
java.sql.SQLException: Listener refused the connection with the following error:
ORA-12514, TNS:listener does not currently know of service requested in connect descriptor
here's the java code
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
String url = "jdbc:oracle:thin:@//10.143.85.21/UCSL";
String userName = "mssoriano";
String passWord = "mssoriano_4319";
conn = DriverManager.getConnection(url, userName, passWord);
and here's my tnsnames.ora
UCSL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.143.85.21)(PORT = 1521))
(CONNECT_DATA =
(SID = psusldb11)
Please do let me know if what may the cause of the problem and how to solve this. Thank you and God bless.Hi,
see this example
Connect to Oracle DB via JDBC driver
Frank -
Hi at all.... I'm a newbie with database oracle.,
I have the follow problem:
I installed Oracle Database 11g R2 XE on my guest operating system CentOS 6.5.
I have changed the hostname in my SO CentOS (where is installed oracle 11g R2 XE) after installation was completed successfully.
-) Before and during installation the hostname was localhost.
-) After installation I changed the hostname in VMCentOS
From the moment I changed the hostname, nothing starts up automatically. In particular, the listener and the database instance does not starts up automatically.
When I starts up the listener manually and I try to connect to database instance with SQLPLUS i get this error:
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
I think that the problem is due to the changed hostname because I, for testing and debugging purpose, re-installed a new OS CentOS virtual machine, re-installed oracle database 11g and I have not got that problem. The database instance and the listener starts up automatically!
Can any one tell me if maybe the problem is related to the hostname changed? ... and Why?
P.S.: After changed the hostname I have also modified the listener.ora and the tnsnames.ora by modifying the HOST with the correct hostname.-) Output of command chkconfig (there isn't any line oracle-xe 0:off 1:off 2:on 3:on 4:on 5:on 6:off):
[oracle@VMCentOS /]$ chkconfig
NetworkManager 0:off 1:off 2:on 3:on 4:on 5:on 6:off
abrt-ccpp 0:off 1:off 2:off 3:on 4:off 5:on 6:off
abrtd 0:off 1:off 2:off 3:on 4:off 5:on 6:off
acpid 0:off 1:off 2:on 3:on 4:on 5:on 6:off
atd 0:off 1:off 2:off 3:on 4:on 5:on 6:off
auditd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
blk-availability 0:off 1:on 2:on 3:on 4:on 5:on 6:off
bluetooth 0:off 1:off 2:off 3:on 4:on 5:on 6:off
cpuspeed 0:off 1:on 2:on 3:on 4:on 5:on 6:off
crond 0:off 1:off 2:on 3:on 4:on 5:on 6:off
cups 0:off 1:off 2:on 3:on 4:on 5:on 6:off
dnsmasq 0:off 1:off 2:off 3:off 4:off 5:off 6:off
firstboot 0:off 1:off 2:off 3:on 4:off 5:on 6:off
haldaemon 0:off 1:off 2:off 3:on 4:on 5:on 6:off
htcacheclean 0:off 1:off 2:off 3:off 4:off 5:off 6:off
httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
ip6tables 0:off 1:off 2:on 3:on 4:on 5:on 6:off
iptables 0:off 1:off 2:on 3:on 4:on 5:on 6:off
irqbalance 0:off 1:off 2:off 3:on 4:on 5:on 6:off
jexec 0:off 1:on 2:on 3:on 4:on 5:on 6:off
kdump 0:off 1:off 2:off 3:on 4:on 5:on 6:off
lvm2-monitor 0:off 1:on 2:on 3:on 4:on 5:on 6:off
mdmonitor 0:off 1:off 2:on 3:on 4:on 5:on 6:off
messagebus 0:off 1:off 2:on 3:on 4:on 5:on 6:off
netconsole 0:off 1:off 2:off 3:off 4:off 5:off 6:off
netfs 0:off 1:off 2:off 3:on 4:on 5:on 6:off
network 0:off 1:off 2:on 3:on 4:on 5:on 6:off
ntpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
ntpdate 0:off 1:off 2:off 3:off 4:off 5:off 6:off
portreserve 0:off 1:off 2:on 3:on 4:on 5:on 6:off
postfix 0:off 1:off 2:on 3:on 4:on 5:on 6:off
psacct 0:off 1:off 2:off 3:off 4:off 5:off 6:off
quota_nld 0:off 1:off 2:off 3:off 4:off 5:off 6:off
rdisc 0:off 1:off 2:off 3:off 4:off 5:off 6:off
restorecond 0:off 1:off 2:off 3:off 4:off 5:off 6:off
rngd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
rsyslog 0:off 1:off 2:on 3:on 4:on 5:on 6:off
saslauthd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
smartd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
snmpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
snmptrapd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
spice-vdagentd 0:off 1:off 2:off 3:off 4:off 5:on 6:off
sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
sysstat 0:off 1:on 2:on 3:on 4:on 5:on 6:off
udev-post 0:off 1:on 2:on 3:on 4:on 5:on 6:off
vmware-tools 0:off 1:off 2:on 3:on 4:on 5:on 6:off
vmware-tools-thinprint 0:off 1:off 2:on 3:on 4:on 5:on 6:off
wdaemon 0:off 1:off 2:off 3:off 4:off 5:off 6:off
winbind 0:off 1:off 2:off 3:off 4:off 5:off 6:off
wpa_supplicant 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[oracle@VMCentOS /]$
Moreover in /etc/sysconfig there isn't any file oracle-xe!!!
At this point, I suspect that something in the installation I mistook. -
Not able to connect Oracle through PHP
Hello All ,
I am trying to connect Oracle DB through PHP script . But I am not able to do so .
My code is :
<?php
echo "PRASHANT" ;
include 'include/odb.php';
include 'include/ReadConfig.php';
$conn=OrclConnect('orcl');
$conn->SetFetchMode(ADODB_FETCH_BOTH);
echo "DWIVEDI" ;
?>
But when I ran this script throgh command prpmpt , I am getting the first echo message .. But not the last one ( echo "Dwivedi") .
I am not able to connect Oracle DB through this script .
Please some one help me out where I am wrong with script .
Thanks
Prashant DwivediBelow is my source code
<?php
$ORACLE_HOME = 'D:\\oracle\\product\\10.2.0\\parag';
$ORACLE_SID = 'parag';
$LD_PRELOAD ='';
$LD_LIBRARY_PATH ='';
$TNS_ADMIN = 'D:\\oracle\\product\\10.2.0\\parag\\NETWORK\\ADMIN';
$NLS_LANG = 'AMERICAN_AMERICA.WE8MSWIN1252';
$username='spd';
$password='spd';
$db='(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = parag)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = parag)))';
echo "here1";
echo "$TNS_ADMIN";
$conn = oci_connect($username,$password,$db);
echo "$ORACLE_HOME";
if (!$conn) {
$e = oci_error();
print htmlentities($e[' message']);
exit;
?>
But still i am getting the same error message -
ORA-12514 error while connecting to server
I am using instantclient to connect to Oracle 9i server.
The connection string is given using this format
//host:[port][service name].
In our development environment we can successfully connect to the server. But the connection fails in the production environment giving ORA-12514 error. This occurs even when we copy the instant client dll's onto separate folder and set the library loading path to this folder.
Can u please help me in resolving this problem.Vinay,
Since you are using Windows, are you setting PATH (the lib loading path of Windows)? -
Hi All,
While restarting the hyperion service we see this exception. Nothing was changed on the hyperion server. Checking with DB team if anything was change on their end.
Caused By: weblogic.common.ResourceException: weblogic.common.ResourceException: Could not create pool connection. The DBMS driver exception was: Listener refused the connection with the following error:ORA-12514, TNS:listener does not currently know of service requested in connect descriptor
at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(ConnectionEnvFactory.java:283)
at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1310)
at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1227)
at weblogic.common.resourcepool.ResourcePoolImpl.start(ResourcePoolImpl.java:250)
at weblogic.jdbc.common.internal.ConnectionPool.doStart(ConnectionPool.java:1330)
Truncated. see log file for complete stacktrace
We don't have oracle client on our end, so this is not a tnsnames issue. This is preventing all the hyperion services coming up.
Thanks,The listener is up , the message is from the listener indicating the listener does not know of SID/SERVICE name that you are giving it. Manually connect to the db using sqldeveloper in order to make sure the parameters you are providing are working. Pay special attention to SID vs SERVICE_NAME. Then try to open config tool and go back to your database connection info. Reconfigure your database connection. It will likely you will find your connection error there. Also sometimes the config tool has trouble figuring out whether you mean SID or SERVICE_NAME. You can open advanced properties on the connection in configtool and specify / or : in the url.
Java JDBC - How to connect to Oracle using Service Name instead of SID - Stack Overflow -
ORA-12514 when trying to connect to the database using SERVICE
Hi,
Version 10204
In a single instance database i would like to create new SERVICEs in order to use them later with Resource Manager.
The instance name is DWH.
I run the following commands:
I added to the tnsnames.ora file the following input:
XYZ =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = xxx)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XYZ)
As SYSDBA i execute:
> exec DBMS_SERVICE.CREATE_SERVICE('xyz','xyz');
PL/SQL procedure successfully completed.
> exec DBMS_SERVICE.START_SERVICE('xyz');
PL/SQL procedure successfully completed.
But when i tried to connect to the instance:
sqlplus ac/ac@xyzSQL*Plus: Release 10.2.0.4.0 - Production on Sat Nov 1 14:44:43 2008
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
When i am trying to connect , not via the service , its successed:
sqlplus ac/ac@dwh
SQL*Plus: Release 10.2.0.4.0 - Production on Sat Nov 1 14:45:07 2008
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Could you please help to understand why its failed to connect via SERVICE ?
ThanksYou told us.
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor.
I ask some questions, you set alias for listener port (no default) + local_listener parameter, don't you?
If you did....
Please check by .....
lsnrctl status
lsnrctl service
Let me show my example:
About 1522 (no default port)
SQL> show parameter local_listener
NAME TYPE VALUE
local_listener string ALIASLISTENER
- check tnsnames.ora file in the same location listener.ora file.
$ cat tnsnames.ora
ALIASLISTENER=
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost )(PORT = 1522))
- About create new service
SQL> show parameter service_names
NAME TYPE VALUE
service_names string db
SQL> exec DBMS_SERVICE.CREATE_SERVICE('xyz','xyz');
PL/SQL procedure successfully completed.
SQL> exec DBMS_SERVICE.START_SERVICE('xyz');
PL/SQL procedure successfully completed.
SQL> show parameter service_names
NAME TYPE VALUE
service_names string xyz
$ lsnrctl status
LSNRCTL for Linux: Version 11.1.0.6.0 - Production on 02-NOV-2008 03:29:21
Copyright (c) 1991, 2007, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=hostname)(PORT=1522)))
STATUS of the LISTENER
Alias LISTENER
Version TNSLSNR for Linux: Version 11.1.0.6.0 - Production
Start Date 02-NOV-2008 03:28:45
Uptime 0 days 0 hr. 0 min. 36 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File ORACLE_HOME/network/admin/listener.ora
Listener Log File ORACLE_HOME/log/diag/tnslsnr/hostname/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=hostname)(PORT=1522)))
Services Summary...
Service "db" has 1 instance(s).
Instance "db", status READY, has 1 handler(s) for this service...
Service "db2XDB" has 1 instance(s).
Instance "db", status READY, has 1 handler(s) for this service...
Service "db_XPT" has 1 instance(s).
Instance "db", status READY, has 1 handler(s) for this service...
Service "xyz" has 1 instance(s).
Instance "db", status READY, has 1 handler(s) for this service...
$ lsnrctl service
LSNRCTL for Linux: Version 11.1.0.6.0 - Production on 02-NOV-2008 03:29:40
Copyright (c) 1991, 2007, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=hostname)(PORT=1522)))
Services Summary...
Service "db" has 1 instance(s).
Instance "db", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
Service "db2XDB" has 1 instance(s).
Instance "db", status READY, has 1 handler(s) for this service...
Handler(s):
"D000" established:0 refused:0 current:0 max:972 state:ready
DISPATCHER <machine: hostname, pid: 30200>
(ADDRESS=(PROTOCOL=tcp)(HOST=hostname)(PORT=45572))
Service "db_XPT" has 1 instance(s).
Instance "db", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
Service "xyz" has 1 instance(s).
Instance "db", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
The command completed successfully
Maybe you are looking for
-
need help with 3gs which has decided to go mad really thanks
-
Recipe Box Crashes on Recipe Edit
After successfully visiting a site and saving a recipe, trying to change the name crashes the program. When you return the recipe is gone (but apparently still there as indicated by trying to re-enter the same recipe - recipe exists message). The pro
-
Decrypt video file(flv)??
Hello I write program to encrypt / decrypt video file , for encryption I can write a code that give for example "film.flv" and store it every where that I want. but Ihave another code that decrypt that file and store it,but I want that have code to
-
I have an X60 with XP that I tried to perform a factory reset on. the process started and then failed. Now when I boot it fails with a no operating system message. When I try to install xp from a windows cd is does not find a hard drive to install to
-
Hi. Is there possible, after disabling constraints, populating new data into tables and enabling constraints again, to validate only new data and not the old one? (DB: 10gR2 and newer...)