简体   繁体   中英

OCILOGON error ORA 12514

I am getting

Array (
       [code] => 12514     
       [message] => Error while trying to retrieve text for error ORA-12514     
       [offset] => 0     
       [sqltext] =>  
    )

when calling the Ocilogon function to connect with oracle. I got the correct string but still getting the error.

ocilogon() is deprecated (along with many other aliases ) and you should not be using it in new code. Use oci_connect() instead.

Personally I use the following code that doesn't rely on environment settings like TNS_ADMIN :

oci_connect($username, $password, $conn_string);

Where $conn_string is a valid connection string that looks something like this:

(DESCRIPTION =
    (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = HOST.EXAMPLE.COM)(PORT = 1521))
    )
    (CONNECT_DATA = (SID = EXAMPLE))
)

You can copy the connection string directly from your TNSNAMES.ORA file.

This blog entry on oracle.com might be useful further reading for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM