Meas
Meas

Reputation: 212

How Cakephp2.x connect Oracle 11g?

I could not connect oracle with cakephp2, After search a few hour i found and followed link step by step still not success, my oracle 11g

error:

ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

Upvotes: 0

Views: 1321

Answers (2)

Meas
Meas

Reputation: 212

I found solution with many errors, here what i fixed: (Note still follow this link)

  1. Error with php version 5.4.+ ,p 5.3.0 (wamp server)
  2. Error with oracle php file file with override function (method not compatible )
  3. Error connect database config
  4. Error SELECT * FROM your table name [don't use select * that will work]

How to fix:

  1. If still php 5.3.0 enable module oci8
  2. Use this oracle file database i have been modified
  3. in Cakephp Config database.php use
public $dboracle = array(
        'datasource' => 'Database/Oracle',
        'driver' => 'oracle',
        'connect' => 'oci_connect',
        'persistent' => true,
        'host' => "your host database ip",
        'login' => 'db user name',
        'password' => 'db password',
        'database' => '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=you db ip )(PORT=1521))
                    (CONNECT_DATA=(SID= you sid)))',
        'prefix' => '',
        'schema' => 'schema_name'
);

Upvotes: 1

Mark
Mark

Reputation: 8451

First, the ORA error is a permutation of the ORA-12514: TNS listener cannot resolve service name error as shown below. This form of the ORA-12541 error commonly happens when the database or the listener processes are in the middle of a startup, or when the database (mysid in your case) has not been registered with the listener.

root> oerr ora 12514

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
  • 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.

Upvotes: 0

Related Questions