简体   繁体   中英

OCI_connect/OCIPLogon ORA-01031: insufficient privileges

We have two oracle accounts log_reader and log_writer. log_reader has read access for reading data. log_writer has write access writting data into database. The application is run from Apache and uses Perl and PHP. Passwords are hardcoded into php/perl scripts. Recently we are trying to migrate to Oracle Wallet to eliminate hard coded passwords. Oracle wallet is configured and following works - sqlplus and perl for both log_reader and log_writer accounts. php for log_reader account. php does not work for log-writer account. We get following error -

insert err = 1031:ORA-01031: insufficient privileges

PHP code -

    $conn = OCIPLogon("/", "", "SLACDEV", "", OCI_CRED_EXT);

In short with Oracle Wallet there is no problem for sqlplus and Perl. But for PHP we are facing issue when we try to write/insert data into database. Read for PHP works fine.

I have tried following so far but no luck -

    $conn = OCIPLogon("/", "", "SLACDEV", "", OCI_CRED_EXT);
    $conn = OCIPLogon("/", "", "SLACDEV", "", OCI_CRED_EXT+OCI_SYSOPER);
    $conn = OCIPLogon("/", "", "SLACDEV", "", OCI_CRED_EXT+OCI_SYSDBA);

php does not work for log-writer account. We get following error -

insert err = 1031:ORA-01031: insufficient privileges

The solution was to create the two wallet entries, set the two connection names in tnsnames.ora, and make sure environment variables were set in the environment starting the web server. Thanks to Christopher Jones for his help to get this resolved.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM