Вопрос

Using sqlplus user/pass@serverI 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?

Это было полезно?

Решение

this turned out to be a problem in the configuration of the DB. The DBA fixed it.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top