Home » RDBMS Server » Networking and Gateways » [PHP] ORA-28582: direct connection not allow [URGENT]
[PHP] ORA-28582: direct connection not allow [URGENT] [message #123939] Wed, 15 June 2005 11:27 Go to next message
No0ZBeeX
Messages: 5
Registered: June 2005
Junior Member
I test my script PHP on Debian(sarge) Oracle9.0.2 , and a mandrake Oracle 9.0.2 . On Mandrake all is OK, but on Debian, i have this message :

ORA-28582: a direct connection to this agent is not allowed

I search on Google, faqoracle, oracle.com, without finding any answers or way of solutions.

CODE PHP:
i need to add this on debian, if i want to have any message :

putenv("ORACLE_BASE=/home/oracle");
putenv("ORACLE_HOME=/home/oracle/OraHome");
putenv("ORACLE_SID=STOR");



SCRIPT GLOBAL :


echo "TEST<BR><BR>";

if ($c=OCILogon("storeland", "storeland", "TEST-ORCL")) {
  echo "Successfully connected to Oracle.\n";
} else {
  $err = OCIError();
  echo "Oracle Connect Error " . $err[text];
}

$query = "select * from articles";

$stmt = ociParse($c, $query);

if (!ociExecute($stmt)){
        echo " NOK";
        return FALSE;
}else{
        echo "OK<br>";
}

while ($succ = OCIFetchInto($stmt, $row)) {
        foreach ($row as $item) {
                echo $item." ";
        }
        echo "<br>\n";
}



I create a new topic, as my problem is different.

Thanks a lot for your help.
Re: [PHP] ORA-28582: direct connection not allow [URGENT] [message #124041 is a reply to message #123939] Thu, 16 June 2005 00:30 Go to previous messageGo to next message
Frank Naude
Messages: 4579
Registered: April 1998
Senior Member
Hi,

Connect to the correct listener service as defined in your listener.ora file:

28582, 00000, "a direct connection to this agent is not allowed"
// *Cause:  A user or a tool tried to establish a direct connection to either
//          an external procedure agent or a Heterogeneous Services agent,
//          for example: "SVRMGR> CONNECT SCOTT/TIGER@NETWORK_ALIAS". This type
//          of connection is not allowed.
// *Action: When executing the CONNECT statement, make sure your database link
//          or network alias is not pointing to a Heterogeneous Option agent or
//          an external procedure agent.
//


Best regards.

Frank
Re: [PHP] ORA-28582: direct connection not allow [URGENT] [message #124067 is a reply to message #124041] Thu, 16 June 2005 03:51 Go to previous message
No0ZBeeX
Messages: 5
Registered: June 2005
Junior Member
Thanks for your answer.

So i think it's about in my tnsnames.ora :

Quote:


TEST-ORCL.WORLD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.206.39)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = TEST)
)
)



I modify my code PHP :

putenv("ORACLE_BASE=/home/oracle");
putenv("ORACLE_HOME=/home/oracle/OraHome");
putenv("ORACLE_SID=TEST");


But i have the same problem :
Quote:


TEST

Successfully connected to Oracle.
Warning: ociexecute(): OCIStmtExecute: ORA-28582: a direct connection to this agent is not allowed in /var/www/test3.php on line 21
NOK



I dont know if user's apache need to be configure with a .bashrc as user's oracle. if i change my query, i have a different message :

Quote:


CODE PHP :

<?
putenv("ORACLE_BASE=/home/oracle");
putenv("ORACLE_HOME=/home/oracle/OraHome");
putenv("ORACLE_SID=TEST");

echo "TEST<BR><BR>";

if ($c=OCILogon("storeland", "storeland", "TEST-ORCL")) {
echo "Successfully connected to Oracle.\n";
} else {
$err = OCIError();
echo "Oracle Connect Error " . $err[text];
}

$query = "select * from magasins";
$stmt = ociParse($c, $query);

if (!ociExecute($stmt)){
echo " NOK";
return FALSE;
}else{
echo "OK<br>";
}

while ($succ = OCIFetchInto($stmt, $row)) {
foreach ($row as $item) {
echo $item." ";
}
echo "<br>\n";
}
?>

MESSAGE :

TEST

Successfully connected to Oracle. OK

Warning: ocifetchinto(): OCIFetchInto: ORA-01858: a non-numeric character was found where a numeric was expected in /var/www/test3.php on line 28




Quote:



CODE PHP :

<?
putenv("ORACLE_BASE=/home/oracle");
putenv("ORACLE_HOME=/home/oracle/OraHome");
putenv("ORACLE_SID=TEST");

echo "TEST<BR><BR>";

if ($c=OCILogon("storeland", "storeland", "TEST-ORCL")) {
echo "Successfully connected to Oracle.\n";
} else {
$err = OCIError();
echo "Oracle Connect Error " . $err[text];
}

$query = "select * from articles";
$stmt = ociParse($c, $query);

if (!ociExecute($stmt)){
echo " NOK";
return FALSE;
}else{
echo "OK<br>";
}

while ($succ = OCIFetchInto($stmt, $row)) {
foreach ($row as $item) {
echo $item." ";
}
echo "<br>\n";
}
?>


MESSAGE :

TEST

Successfully connected to Oracle.
Warning: ociexecute(): OCIStmtExecute: ORA-03106: fatal two-task communication protocol error in /var/www/test3.php on line 21
NOK



Thanks a lot for your help, i m lost with this problem .

Best regards, No0ZBeeX
Previous Topic: USING +PC technoglogy unable to connect destination
Next Topic: TNS: No Listener
Goto Forum:
  


Current Time: Thu May 09 16:41:55 CDT 2024