0

this is working fine on cli and on a non pooled connection. when i try the following on cli it works

sqlplus CCP/"***"@DECCP1ST_POOLED.test.vis

but when i try to do this in php it throws an error

$c = oci_connect('CCP', "***", 'domain.com:33001/DECCP1ST_POOLED.test.vis');
print_r($c);

output is

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

in my tnsnames.ora i have

DECCP1ST_POOLED.test.vis =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = domain.com)(PORT = 33001))
    (CONNECT_DATA =
      (SERVER = POOLED)
      (SERVICE_NAME = DECCP1ST.test.vis)
    )
  )

I have followed this pdf. i have set oci8.connection_class = SHARED

2
  • Typo in: ddomain.de. Commented Feb 13, 2018 at 16:48
  • updated but its same thing Commented Feb 13, 2018 at 16:55

1 Answer 1

1

According to the PDF you linked in your question, page 15:

PHP applications must specify the server type POOLED in the connect string to use DRCP. Using Oracle’s Easy Connect syntax, the PHP call to connect to the sales database on myhost would look like:

$c = oci_pconnect('myuser', 'mypassword', 'myhost/sales:POOLED');

Based on the above, and your TNS string, you need to use the following in your script:

$c = oci_connect('CCP', '***', 'domain.com:33001/DECCP1ST.test.vis:POOLED');

It's important to note that you are using the Easy Connect syntax here so the TNSNAMES.ORA file is ignored. Because of this you must use the defined SERVICE_NAME (DECCP1ST.test.vis) not the TNS alias (DECCP1ST_POOLED.test.vis)!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.