From:             marvin at chag dot net
Operating system: Linux 
PHP version:      5.2.1
PHP Bug Type:     OCI8 related
Bug description:  "ORA-02248: invalid option for ALTER SESSION" on OCIPLogon

Description:
------------
Problem is, that more or less often (not always) the call to OCIPLogon (or
OCILogon) results into an Oracle error message "ORA-02248: invalid option
for ALTER SESSION" and the connection to the database is not made.

Everything worked fine up to PHP 5.1.1 but all other versions starting
from 5.1.2 up to 5.2.1 are showing this "ALTER SESSION" behavior.

The Oracle related environment for Apache startup is:

export ORACLE_SID=db
export ORACLE_TERM=vt220
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=$ORACLE_BASE/product/8.1.7
export CLASSPATH=$ORACLE_HOME/jdbc/lib/classes111.zip
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export TNS_ADMIN=$ORACLE_HOME/network/admin
export PATH=$PATH:$ORACLE_HOME/bin
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export NLS_LANG=GERMAN_GERMANY.WE8ISO8859P1


Webserver: 
Linux 2.4.21-303-smp4G
Apache 1.3.37 + SSL Patch 1.57
PHP 5.2.1 compiled statically into Apache
Oracle Client 8.1.7.0.0

Database:
Oracle from version 8.1.6 to 8.1.7.0.4 running on different Linux and
Windows

PHP configure line:
./configure  --with-ldap --enable-dbase --with-mysql --with-oci8
--with-oracle --with-gd --with-jpeg-dir --with-png-dir --with-tiff-dir
--with-xpm-dir --enable-calendar --enable-sigchild --with-zlib --with-bz2
--enable-ftp --enable-sockets --with-apache=../apache_1.3.37
--with-gettext --enable-bcmath --with-mcrypt --with-mhash
--with-ttf=/usr/include/freetype --with-gmp --enable-trans-sid
--with-freetype-dir=/usr/include/freetype2 --enable-gd-native-ttf
--with-libxml-dir --enable-soap


Reproduce code:
---------------
<?
OCIInternalDebug(1);

for ($i = 1; $i <= 10; $i++)
{
        $con = @OCIPLogon("<user>","<pass>","<db>");
        if ($con == true)
                break;
        else
        {
                echo var_dump(OCIError());
                break;
        }
};
?>

Expected result:
----------------
OCIPLogon() should give a valid DB connection.

Actual result:
--------------
When the connect is not working, DEBUG shows the following:

OCI8 DEBUG: OCIEnvCreate at (/php-5.2.1/ext/oci8/oci8.c:1216)
OCI8 DEBUG: OCIHandleAlloc at (/php-5.2.1/ext/oci8/oci8.c:1239)
OCI8 DEBUG: OCIServerAttach at (/php-5.2.1/ext/oci8/oci8.c:1248)
OCI8 DEBUG: OCIHandleAlloc at (/php-5.2.1/ext/oci8/oci8.c:1258)
OCI8 DEBUG: OCIHandleAlloc at (/php-5.2.1/ext/oci8/oci8.c:1267)
OCI8 DEBUG: OCIHandleAlloc at (/php-5.2.1/ext/oci8/oci8.c:1276)
OCI8 DEBUG: OCIAttrSet at (/php-5.2.1/ext/oci8/oci8.c:1286)
OCI8 DEBUG: OCIAttrSet at (/php-5.2.1/ext/oci8/oci8.c:1297)
OCI8 DEBUG: OCIAttrSet at (/php-5.2.1/ext/oci8/oci8.c:1307)
OCI8 DEBUG: OCIAttrSet at (/php-5.2.1/ext/oci8/oci8.c:1316)
OCI8 DEBUG: OCISessionBegin at (/php-5.2.1/ext/oci8/oci8.c:1350)
OCI8 DEBUG: OCIErrorGet at (/php-5.2.1/ext/oci8/oci8.c:922)
OCI8 DEBUG: OCIHandleFree at (/php-5.2.1/ext/oci8/oci8.c:1514)
OCI8 DEBUG: OCIServerDetach at (/php-5.2.1/ext/oci8/oci8.c:1518)
OCI8 DEBUG: OCIHandleFree at (/php-5.2.1/ext/oci8/oci8.c:1522)
OCI8 DEBUG: OCIHandleFree at (/php-5.2.1/ext/oci8/oci8.c:1526)
OCI8 DEBUG: OCIHandleFree at (/php-5.2.1/ext/oci8/oci8.c:1530)
OCI8 DEBUG: OCIHandleFree at (/php-5.2.1/ext/oci8/oci8.c:1534)

DEBUG XXX
OCI8 DEBUG: OCIErrorGet at (/php-5.2.1/ext/oci8/oci8.c:922) array(4) {
["code"]=> int(604) ["message"]=> string(94) "ORA-00604: error occurred at
recursive SQL level 1 ORA-02248: invalid option for ALTER SESSION"
["offset"]=> int(0) ["sqltext"]=> string(0) "" }

-- 
Edit bug report at http://bugs.php.net/?id=40542&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40542&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40542&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40542&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=40542&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=40542&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=40542&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=40542&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=40542&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=40542&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=40542&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=40542&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=40542&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=40542&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40542&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=40542&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=40542&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=40542&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40542&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=40542&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=40542&r=mysqlcfg

Reply via email to