sqlnet.ora doesn"t seem to be read since oci8 1.3.4

sqlnet.ora doesn"t seem to be read since oci8 1.3.4

am 17.02.2009 19:40:47 von JEROME

Hello,

I used to use oci8 version 1.2.3 and I wanted to update to last
version (1.3.4). Everything works fine except the fact that
"sqlnet.ora" does not seems to be read.

I use the following string to describe my database in oci_connect: "MEN1PRD".

In sqlnet.ora there is the parameter NAMES.DEFAULT_DOMAIN which is set
to "WORLD".

In the tnsname.ora I have a full definition for "MEN1PRD.WORLD".

With oci8 1.2.3, it worked but since I upgraded to 1.3.4 this is not
the case anymore. I have to use the same ID in oci_connect and
tnsname.org. The sqlnet.ora NAMES.DEFAULT_DOMAIN does not seem to be
used anymore.

The version of php (5.2.3) is still the same, the configure options
are the sames, the oracle lib is the same (9.2) and the php.ini
parameters are the same too. I just changed the oci8 version.

Has anyone the same problem ? Is this a normal behaviour ? If yes, why
and is there a workaround ?

Thanks for your answers.

++ Jerome

Reproduce code:
---------------
Piece of code which used to work (version 1.2.3) and doesn't work
anymore (version 1.3.4):
$conn = oci_connect('EDUCATION', 'manager', 'MEN1PRD');

Piece of code which works (version 1.3.4):
$conn = oci_connect('EDUCATION', 'manager', 'MEN1PRD.WORLD');

Content of sqlnet.ora (which is in the same directory as tnsname.ora):
NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)
NAMES.DEFAULT_DOMAIN = WORLD
LOG_DIRECTORY_SERVER = /var/tmp

Contenat of tnsname.ora
MEN1PRD_RAC =
( DESCRIPTION =
( ADDRESS = ( PROTOCOL = TCP )( HOST = host1 )( PORT = 1521 ) )
( ADDRESS = ( PROTOCOL = TCP )( HOST = host2 )( PORT = 1521 ) )
( LOAD_BALANCE = yes )
( CONNECT_DATA =
( SERVER = DEDICATED )
( SERVICE_NAME = SN_MEN1PRD )
)
)

Expected result:
----------------
The connexion is made to the database

Actual result:
--------------
[Mon Feb 16 18:05:14 2009] [error] [client 127.0.0.1] PHP Warning:
oci_connect() []:
ORA-12154: TNS:could not resolve service name in /var/www/docs/test1.php
on line 2

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: sqlnet.ora doesn"t seem to be read since oci8 1.3.4

am 17.02.2009 20:06:39 von Christopher Jones

Jérôme Loyet wrote:
> Hello,
>
> I used to use oci8 version 1.2.3 and I wanted to update to last
> version (1.3.4). Everything works fine except the fact that
> "sqlnet.ora" does not seems to be read.
>
> I use the following string to describe my database in oci_connect: "MEN1PRD".
>
> In sqlnet.ora there is the parameter NAMES.DEFAULT_DOMAIN which is set
> to "WORLD".
>
> In the tnsname.ora I have a full definition for "MEN1PRD.WORLD".
>
> With oci8 1.2.3, it worked but since I upgraded to 1.3.4 this is not
> the case anymore. I have to use the same ID in oci_connect and
> tnsname.org. The sqlnet.ora NAMES.DEFAULT_DOMAIN does not seem to be
> used anymore.

Where are your network files located and how you tell PHP where to
find them. Do you set ORACLE_HOME or TNS_ADMIN? Where are they set?

At a wild guess, perhaps you are using putenv() in your scripts -
which is never recommended. See page 106 of the current (1.5) version
of http://www.oracle.com/technology/tech/php/pdf/underground-ph p-oracle-manual.pdf
on how to set environment variables.

Chris

--
Email: christopher.jones@oracle.com Tel: +1 650 506 8630
Twitter: http://twitter.com/ghrd Free PHP Book: http://tinyurl.com/UGPOM

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: sqlnet.ora doesn"t seem to be read since oci8 1.3.4

am 17.02.2009 21:09:53 von JEROME

2009/2/17 Christopher Jones :
>
> J=E9r=F4me Loyet wrote:
>> Hello,
>>
>> I used to use oci8 version 1.2.3 and I wanted to update to last
>> version (1.3.4). Everything works fine except the fact that
>> "sqlnet.ora" does not seems to be read.
>>
>> I use the following string to describe my database in oci_connect:
>> "MEN1PRD".
>>
>> In sqlnet.ora there is the parameter NAMES.DEFAULT_DOMAIN which is set
>> to "WORLD".
>>
>> In the tnsname.ora I have a full definition for "MEN1PRD.WORLD".
>>
>> With oci8 1.2.3, it worked but since I upgraded to 1.3.4 this is not
>> the case anymore. I have to use the same ID in oci_connect and
>> tnsname.org. The sqlnet.ora NAMES.DEFAULT_DOMAIN does not seem to be
>> used anymore.
>
> Where are your network files located and how you tell PHP where to
> find them. Do you set ORACLE_HOME or TNS_ADMIN? Where are they set?
>
> At a wild guess, perhaps you are using putenv() in your scripts -
> which is never recommended. See page 106 of the current (1.5) version
> of
> http://www.oracle.com/technology/tech/php/pdf/underground-ph p-oracle-manu=
al.pdf
> on how to set environment variables.
>

sorry I forgot some intel:

My init script where the ENV are set:

export ORACLE_HOME=3D/usr/local/oracle/VERSIONS/Linux/CL.9.2.0
PATH=3D$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/network/admin:$OR ACLE_HOME/lib:/=
usr/local/bin
export ORACLE_SID=3DMEN1PRD
export HOSTNAME=3D`hostname`
export NLS_LANG=3DFRENCH_FRANCE.WE8ISO8859P15
export LC_ALL=3Dfr_FR
export LANG=3Dfr_FR

Php is loaded by apache as a module
OCI8 is compile into PHP and is not a shared module

As I explain it before, nothing as changed but the OCI8 version. The
ENV var are set the same way.

Jerome

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: sqlnet.ora doesn"t seem to be read since oci8 1.3.4

am 17.02.2009 21:28:26 von Christopher Jones

Jérôme Loyet wrote:
> My init script where the ENV are set:
>
> export ORACLE_HOME=/usr/local/oracle/VERSIONS/Linux/CL.9.2.0
> PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/network/admin:$ORAC LE_HOME/lib:/usr/local/bin

(The admin and lib directories aren't needed in the PATH because they
don't contain executables.)

> export ORACLE_SID=MEN1PRD
> export HOSTNAME=`hostname`
> export NLS_LANG=FRENCH_FRANCE.WE8ISO8859P15
> export LC_ALL=fr_FR
> export LANG=fr_FR

Does phpinfo() show these all set in the Environment section? (see the
Underground Manual again).

Is sqlnet.ora readable by the Apache process?

What directory is it in?

Try moving it to /etc/sqlnet.ora (since this is a default search
location).

> Php is loaded by apache as a module
> OCI8 is compile into PHP and is not a shared module
>
> As I explain it before, nothing as changed but the OCI8 version. The
> ENV var are set the same way.

The OCI initialization function used by OCI8 was standardized to
OCIEnvNlsCreate() in 1.3.4. But sqlnet.ora should definitely still be
usable.

Chris

--
Email: christopher.jones@oracle.com Tel: +1 650 506 8630
Twitter: http://twitter.com/ghrd Free PHP Book: http://tinyurl.com/UGPOM

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: sqlnet.ora doesn"t seem to be read since oci8 1.3.4

am 17.02.2009 22:56:18 von JEROME

2009/2/17 Christopher Jones :
>
> J=E9r=F4me Loyet wrote:
>> My init script where the ENV are set:
>>
>> export ORACLE_HOME=3D/usr/local/oracle/VERSIONS/Linux/CL.9.2.0
>>
>> PATH=3D$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/network/admin:$OR ACLE_HOME/li=
b:/usr/local/bin
>
> (The admin and lib directories aren't needed in the PATH because they
> don't contain executables.)
>
>> export ORACLE_SID=3DMEN1PRD
>> export HOSTNAME=3D`hostname`
>> export NLS_LANG=3DFRENCH_FRANCE.WE8ISO8859P15
>> export LC_ALL=3Dfr_FR
>> export LANG=3Dfr_FR
>
> Does phpinfo() show these all set in the Environment section? (see the
> Underground Manual again).

Yes all Environment variable are shown in the phpinfo Environement section

>
> Is sqlnet.ora readable by the Apache process?
>

Yes, it's 644 and all directories between / and
$ORACLE_HOME/network/admin are 755

> What directory is it in?

I don't have access to the server right now, but if I remember good
there is a tnsname.ora, tnsname.ora.sample, sqlnet.ora et two other
files sqlnet.xxx (don't remember the file ext right now)

>
> Try moving it to /etc/sqlnet.ora (since this is a default search
> location).

I'll try that tomorow

>
>> Php is loaded by apache as a module
>> OCI8 is compile into PHP and is not a shared module
>>
>> As I explain it before, nothing as changed but the OCI8 version. The
>> ENV var are set the same way.
>
> The OCI initialization function used by OCI8 was standardized to
> OCIEnvNlsCreate() in 1.3.4. But sqlnet.ora should definitely still be
> usable.

I'll try to make it happened in a total difference environment to see
if it's system related or a bug somewhere.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php