2 Replies Latest reply: Jan 3, 2013 7:22 PM by asahide RSS

    ORA-12514 Connecting through php

    982826
      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
        • 1. Re: ORA-12514 Connecting through php
          sb92075
          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,
          Daniel
          ORA-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/
          • 2. Re: ORA-12514 Connecting through php
            asahide
            Hi,

            Could you check "tnsping trabalho"?
            And show us your client's tnsnames.ora file.

            Regards,