#19129 [Fbk]: Oracle 'ORA-12541: TNS:no listener' causes OCI8 to break
| From: | thies@php.net | Date: | Thu, 12 Sep 2002 09:58:12 +0000 |
| Subject: | #19129 [Fbk]: Oracle 'ORA-12541: TNS:no listener' causes OCI8 to break | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-19226@lists.php.net to get a copy of this message | ||
ID: 19129
Updated by: thies@php.net
Reported By: dante.lorenso@atmosenergy.com
Status: Feedback
Bug Type: OCI8 related
Operating System: RedHat Linux 7.3
PHP Version: 4.2.1
New Comment:
seems to work for me (oracle 9.2.0.1)
any chance i could get a login on your box to see the
problem?
Previous Comments:
------------------------------------------------------------------------
[2002-09-12 04:58:12] thies@php.net
seems to work for me (oracle 9.2.0.1)
any chance i could get a login on your box to see the
problem?
------------------------------------------------------------------------
[2002-08-27 15:05:08] dante.lorenso@atmosenergy.com
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 this bug report at http://bugs.php.net/?id=19129&edit=1