#19129 [NEW]: Oracle 'ORA-12541: TNS:no listener' causes OCI8 to break

From: Date: Tue, 27 Aug 2002 19:05:10 +0000
Subject: #19129 [NEW]: Oracle 'ORA-12541: TNS:no listener' causes OCI8 to break
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-17959@lists.php.net to get a copy of this message
From: dante.lorenso@atmosenergy.com Operating system: RedHat Linux 7.3 PHP version: 4.2.1 PHP Bug Type: OCI8 related Bug description: Oracle 'ORA-12541: TNS:no listener' causes OCI8 to break I use the following code to loop through an array of SIDs for Oracle...and attempt to change the password for a given username on each Oracle database... ================================================== foreach ($names as $SID => $CONN_SID) { // make a connection $dbconn = @OCINLogon($username, $old_password, $SID); if (! $dbconn) { $this->dumpError("ORAPASS[OCILogon]"); continue; } // parse the SQL statement... $sql_statement = @OCIParse($dbconn, $sql); if (! $sql_statement) { error_log("ORAPASS[OCIParse]"); @OCILogOff($dbconn); continue; } // execute sql query $exec_result = @OCIExecute($sql_statement); if (! $exec_result) { error_log("ORAPASS[OCIExecute]"); @OCILogOff($dbconn); continue; } // disconnect... @OCILogOff($dbconn); unset($dbconn); // show the results... $text .= sprintf ('Success: %s<br>', $SID); } ================================================== However, for some reason if the SID I connect to results in the following OCIError: Failed: SID1 (ORA-12541: TNS:no listener) Then, all subsequent OCINLogon or OCILogon calls will result in this error message: Failed: SID2 (ORA-12154: TNS:could not resolve service name) If I restart Apache/PHP and connect to SID2, it will work, but if I connect to any SID after getting the 'ORA-12541: TNS:no listener' error, my Oracle connections all fail. --Dante -- Edit bug report at http://bugs.php.net/?id=19129&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=19129&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=19129&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=19129&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=19129&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=19129&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=19129&r=support Expected behavior: http://bugs.php.net/fix.php?id=19129&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=19129&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=19129&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=19129&r=globals

« previous php.bugs (#17959) next »