|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-12-14 04:43 UTC] s dot zurnieden at media-control dot com
Description:
------------
PDO_OCI 1.0
Oracle 10GR2(x86_64)
For the moment it seems that it isn't possible to connect to an oracle database with a priviledged connection (as sysdba).
In some cases this could be very useful to connect as sysdba.
Maybe this can be done via a connection dsn paramter like session_mode=sysdba or something like that.
So a full connection dsn could be:
oci:dbname=myoraclesid;session_mode=sysdba
Kind regards,
Sven Zurnieden
Reproduce code:
---------------
<?php
$connect_dsn = 'oci:dbname=myoraclesid';
$oracle_uname = 'sys';
$oracle_upass = 'syspasswd';
try{
$database = new PDO($connect_dsn, $oracle_uname, $oracle_upass);
$database->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$database->setAttribute(PDO::ATTR_CASE, PDO::CASE_LOWER);
$database->setAttribute(PDO::ATTR_ORACLE_NULLS, true);
$database->setAttribute(PDO::ATTR_PREFETCH, 1000);
}
catch(PDOException $e){
echo $e->getMessage() . ' in ' . $e->getFile() . ' on line ' . $e->getLine() . "\n";
}
?>
Expected result:
----------------
Connection as sysdba to an oracle database.
Actual result:
--------------
SQLSTATE[HY000]: OCISessionBegin:: ORA-28009: connection as SYS should be as SYSDBA or SYSOPER (/root/install/php/php-5.1.1/ext/pdo_oci/oci_driver.c:514) in /usr/local/httpd/htdocs/ora_mgmt/pdo_connect.php on line 30
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 02 12:00:01 2025 UTC |
hi, since Zend Framework provides Zend_DB class based on PDO, it would be very cool to have privileged sessions implemented. It should be quite simple adding a new variable to the DSN: struct pdo_data_src_parser vars[] = { { "charset", NULL, 0 }, { "dbname", "", 0 }, { "credentials", "OCI_DEFAULT", 0 } }; and passing the correct parameter to OciSessionBegin() call... kind regards -- Ludovico Caldara