this turned out to be a problem in the configuration of the DB. The DBA fixed it.
Can connect through sqlplus but not through oci_connect (ORA-12154)
-
10-06-2023 - |
質問
Using sqlplus user/pass@server
I can successfully connect.
Using
$db='(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 1.2.3.4)(PORT = 1521)))(CONNECT_DATA = (SID = server)))';
$conn=oci_connect('user','pass',$db);
I can connect as well.
Howerver, using $conn=oci_connect('user', 'pass', 'server');
I can not. It drops the following error:
oci_connect(): ORA-12154: TNS:could not resolve the connect identifier specified
I had to manually create the directory $ORACLE_HOME/network/admin/ because the installation didn't do it. Then I created a tnsnames.ora in that directory with the content of the $db variable.
Where could be the problem?
解決
所属していません StackOverflow