Welcome Guest, Not a member yet? Register   Sign In
ORA-28009
#1

Hi everyone

I have started CodeIgniter recently and I have a problem connecting to my DB (Oracle)

Indeed I have an error message telling me that I have to connect as SYSDBA or SYSOPER.

I have read a topic from this forum but he is from 2012 and the links doesn't help.

This is the error message : 

Message: oci_connect(): ORA-28009: connection as SYS should be as SYSDBA or SYSOPER
Filename: oci8/oci8_driver.php
Line Number: 239

If someone could help me that would be great, this is for my diploma work.

Thank you 

PS : I already had this problem in "simple" php, I fixed it by puting the session_mode argument in the "oci_connect" function.
Reply
#2

Personally I would do as the error message says and create a user that don't have global rights. That's a huge security risk.

Or set oci8.privileged_connect in php.ini
http://php.net/manual/en/oci8.configurat...ed-connect

Or hack \system\database\drivers\oci8\oci8_driver.php
PHP Code:
    public function db_connect($persistent FALSE)
    {
        
$func = ($persistent === TRUE) ? 'oci_pconnect' 'oci_connect';
        return empty(
$this->char_set)
            ? 
$func($this->username$this->password$this->dsn)
            : 
$func($this->username$this->password$this->dsn$this->char_set);
    } 
Reply
#3

I have found

I just had to add the variable "session_mode".

Like this :

PHP Code:
public function db_connect($persistent TRUE)
{
           
$func 
= ($persistent === TRUE) ? 'oci_pconnect' 'oci_connect';
return empty(
$this->char_set)
$func($this->username$this->password$this->dsn)
$func($this->username$this->password$this->dsn$this->char_set,$this->session_mode);





And in "database.php" :

PHP Code:
$db['default'] = array(
'dsn' => '',
'hostname' => $tnsname,
'username' => 'xxx',
'password' => 'xxx',
'database' => '',
'dbdriver' => 'oci8',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'AL32UTF8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE,
       'session_mode' => 2
); 


(SESSION MODE : 2 --> SYSDBA, 4 --> SYSOPER)
Reply




Theme © iAndrew 2016 - Forum software by © MyBB