R: ORA-12154

From: Date: Fri, 01 Dec 2000 07:45:18 +0000
Subject: R: ORA-12154
Groups: php.general 
Request: Send a blank email to php-general+get-28172@lists.php.net to get a copy of this message
Ciao Roberto > -----Messaggio originale----- > Da: Daniel Korcak [mailto:korcak@vol.cz] > Inviato: giovedì 30 novembre 2000 18.22 > A: php-general@lists.php.net > Oggetto: ORA-12154 > > > Hi All .. > > I'm trying to connect from PHP to Oracle running on another machine, > but script often crash with this error (40% successful, 60% error ): > > Warning: _oci_open_server: Error while trying to retrieve > text for error > ORA-12154 > > PHP code: > > putenv('ORACLE_BASE=/usr/oracle'); > putenv('ORACLE_HOME=/usr/oracle/8.1.5'); > > putenv('TNS_ADMIN=/usr/oracle/8.1.5/network/admin/tnsnames.ora > '); > putenv("TWO_TASK=/usr/oracle/8.1.5/network/admin/tnsnames.ora"); > putenv('ORA_NLS33=/usr/oracle/8.1.5/ocommon/nls/admin/data'); > putenv('ORACLE_SID=shop'); > putenv('NLS_LANG=American_America.EE8MSWIN1250'); Put all these into /etc/rc.d/init.d/httpd and export them (but decide between ORACLE_SID and TWO_TASK). All will be better! (Oracle shared library want them already defined). Restart Apache. > > $dbsf = OCIPLogon("user","pass","estore"); > > > > TNSNAMES.ORA (client): > > ESTORE = > (DESCRIPTION = > (ADDRESS_LIST = > (ADDRESS = (PROTOCOL = TCP)(HOST = estore.mydomain.cz)(PORT = > 1521)) > ) > (CONNECT_DATA = > (SERVICE_NAME = sdb) > ) > ) > Do you use server name for alias on clients? Whenever you'd add an instance into the same server, server name isn't enough. Let me suggest you, for names, use the same name you give at database creation (which you can pick with this SELECT GLOBAL_NAME FROM GLOBAL_NAME, or from initialization files). > > > > Platform: > - RedHat 7.0 > - Apache with (apache_1.3.12, mod_ssl-2.6.4-1.3.12, php-4.0.3pl1, > mcz-1.3.12-3.1.0, pdflib-3.02) > - Oracle (both 8.1.5, 8.1.6 make the same error) > > Thanks for any suggestion ... > > -- > o--------------------------o > | Daniel Korcak | > | Database Administrator | > | | > | Czech On Line, a.s. | > | http://www.col.cz | > | Burzovni palac, Rybna 14 | > | Praha 1, Czech Republic | > | mailto:korcak@col.cz | > | Tel +420.2.96251413 | > | Fax +420.2.96251113 | > o--------------------------o >

« previous php.general (#28172) next »