ora_numcols> <ora_logoff
Last updated: Mon, 28 Dec 2009

ora_logon

(PHP 4, PHP 5 <= 5.0.5)

ora_logon — Abre uma conexão com o Oracle

Descrição

resource ora_logon ( string $user , string $password )

Estabiliza uma conexão entre PHP e um Banco de Dados Oracle com o usuário especificado por user e senha especificada por password .

Conexões podem ser feitas usandoSQL*Net fornecendo o TNS name para user como isso:

<?php
$conn 
Ora_Logon("user@TNSNAME""pass");
?>

Se você tem dados com caracteres non-ASCII, você deve estar certo que a variável do Oracle NLS_LANG está setada. Você deve setar está variável de ambiente no servidor antes de inicializar o servidor.

Retorna uma conexão index em caso de sucesso, ou FALSE em caso de falha. Detalhes sobre este erro podem ser retornados usando as funções ora_error() e ora_errorcode().



ora_numcols> <ora_logoff
Last updated: Mon, 28 Dec 2009
 
User Contributed Notes
ora_logon
premiere_fondation at yahoo dot fr
23-Dec-2003 02:59
Hello,
I had the problem and the solution is this one :
Use OCILogon()

Instead of writing :

$db = ("INSTANCE_NAME");

Write the entire line corresponding to your oracle instance descriptor in tnsnames.ora file :

$db = "(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = db.ip.address)(PORT = db.port)) ) (CONNECT_DATA = (SID = YOUR_DB_SID) ) )";
$con = OCILogOn("user", "password",$db);

This works perfectly.
Nicolas Corlieu.
knitterb at blandsite dot org
11-Nov-2003 07:29
You probably want to use the more modern OCILogon and other OCI functions for logging in to a database.  Additional connection strings can also be found on the OCILogon page for documentation.
php developer
06-Nov-2003 12:52
I also goy the ORA-1245 error using ora_logon, but setting the ORACLE_HOME var so it showed up in both the Apache Environment and Environment sections in phpinfo didn't help the situation. The full error was "Warning: Oracle: Connection Failed: ORA-12545: Connect failed because target host or object does not exist in /path/to/script on line xx." Turns out I had the oracle client installed (which is required) and I had the environment correct (which is required), but I didn't have a local tnsnames.ora file setup, so the connection couldn't find the correct binaries to connect to oracle. Creating the tnsnames.ora file on the local server (db server is remote) and using the proper syntax of "ora_logon("user@tnsentry", "password");" worked for me. Note: ORACLE_HOME and ORACLE_SID were set in the script using putenv.
Devon
11-Apr-2001 10:38
In addition to above comments - I had a ORA-12545 error using ora_logon that I eventually found was simply a var/path problem - when you start up "apachectl start" make sure apache can find oracle!
keithv at bzlninc dot com
14-Mar-2000 11:10
In order to get this to work properly I needed to have the ORACLE_HOME variable set before starting the Apache web server. I put it in the /etc/profile file, but you can do it anyway you choose.

ora_numcols> <ora_logoff
Last updated: Mon, 28 Dec 2009