Connect oracle with pdo, with SID and INSTANCE_NAME

How do I connect to Oracle using PDO::__construct().

What I have are the host, port, SID and INSTANCE_NAME.

Looking for information I have founded

 CONNECT username@[//]host[:port][/service_name][:server][/instance_name]

at http://docs.oracle.com/cd/E18283_01/network.112/e10836/naming.htm#i498306, but I don't know how to "translate" it to PDO.

Answers


Try this:

oci:dbname=//host:port/SID/INSTANCE_NAME

And see http://www.php.net/manual/en/ref.pdo-oci.connection.php for more info. The username is passed separately.


Need Your Help

Implement siginterrupt() using sigaction()?

c linux

Implement siginterrupt() using sigaction() with one example.