PHP:无法使用pdo_oci作为SYSDBA连接到Oracle

时间:2016-05-27 15:01:19

标签: php oracle pdo

我尝试使用pdo_oci驱动程序连接到Oracle。我的用户有SYSDBA证明:

$oraHost = 'x.x.x.x';
$oraPort = 1521;
$oraUser = 'x';
$oraPassword = 'x';
$oraServiceName = 'x';

$db = "(DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = $oraHost)(PORT = $oraPort))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = $oraServiceName)
    )
  )";

$conn = new PDO("oci:dbname=" . $db, $oraUser, $oraPassword);

并收到错误

PHP Fatal error:  Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: OCISessionBegin:: ORA-28009: connection as SYS should be as SYSDBA or SYSOPER

我如何将SYSDBA角色传递给pdo连接?

0 个答案:

没有答案