Re: Problemas conectando a Oracle 8i.
| From: | Alberto Turienzo Romano | Date: | Wed, 12 Dec 2001 10:29:15 +0000 |
| Subject: | Re: Problemas conectando a Oracle 8i. | ||
| References: | 1 | Groups: | php.general.es |
| Request: | Send a blank email to general-es+get-16613@lists.php.net to get a copy of this message | ||
Chus wrote:
> Saludos.
> Estoy intentando acceder a una base de datos Oracle 8i en un servidor
> remoto. Mi servidor es un W2000 con PHP 4.06 y Apache 1.3.22. La
> extension
> oci8 esta cargada sin problemas y cuando intento conectar a la base en
> la
> otra máquina con el código que muestro abajo, me dice esto....
>
> Warning: _oci_open_server: Error while trying to retrieve text for error
> ORA-12538 in d:\apache\htdocs\gijon\tmp\oracle.php on line 9
Buenas, el error es:
12538, 00000, "TNS:no such protocol adapter"
// *Cause: The protocol adapter requested (by way of the "(PROTOCOL=..)"
// keyword-value pair in a TNS address) is unknown. If the supplied address
// is typographically correct then the protocol adaptor is not installed.
// *Action: Install the protocol adapter or correct typographically error,
// as appropriate. Note: if the supplied address was derived from
// resolving the service name, check the address in the appropriate file
// (TNSNAMES.ORA, LISTENER.ORA or TNSNET.ORA).
Tienes algun problema en la definición del SID aunque no consigo encontrarlo porque la declaración
del SID parece correcta.
Prueba a conectarte a la base de datos con slqplus para ver si tienes conexion desde tu equipo
Alberto
>
>
> Alguna sugerencia? . mil gracias.
>
> putenv("ORACLE_SID=base1");
> $user = "scott";
> $password = "tiger";
>
> $sid = "(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST
> =
> 192.168.0.2)(PORT = 1521))) (CONNECT_DATA = (SID = base1)))";
>
> $c1 = OCILogOn($user, $password, $sid);
> if($c1)
> return $c1;
> else
> return FALSE;
> ocilogoff($c1);