Re: ORA-28009

From: Tim X <>
Date: Tue, 16 Feb 2010 17:45:41 +1100
Message-ID: <>

Shakespeare <> writes:

> Op 14-2-2010 23:45, syd_p schreef:
>> Hi,
>> I am running a shell script which call a perl script which uses DBI to
>> connect to a remote (ie another server) which creates schemas ie table
>> spaces, users, tables in the waiting DB.
>> Or rather it does not:
>> Database Connection Error: ORA-28009: connection as SYS should be as
>> The problem is as follows:
>> ./<database type> <database name> <host> <username>
>> <password> <port>
>> I ran one of the many scripts locally on the unix command line with
>> the hardcoded string "sqlplus sys as sysdba/bloggs" and that works OK.
>> The problem is that the shell script, calls more shell scripts, calls
>> perl scripts and passing in "sys" as a parameter fails at the Oracle
>> 10G level cos we need the AS sysdba.
>> And if I call the script with "sys as sysdba" "bloggs" (or similar
>> tried a few things) it goes wrong big time.
>> Possibly the answer is to create a user that has the powers of "sys as
>> sysdba" or something similar. But I am stuck really...
>> can anyone help plz?
>> Syd
> Try this: username: "sys", database name "DBNAME as sysdba"

If that doesn't work, my suggestion would be to look at the perl documentations for the DBD::Oracle driver. This has a lot of useful information and examples and will likely give better results than random shots in the dark. As the driver is regularly being updated and as its not uncommon to find multiple versions of perl on one system, its also important to check driver versions and ensure the docs you are looking at match the driver being used.

Doing a grep for sysdba for the DBD::Oracle driver on my system gives the following (as well as other matches - this is just an example).

  Connect Attributes

           The ora_session_mode attribute can be used to connect with SYSDBA
           authorization and SYSOPER authorization.  The ORA_SYSDBA and
           ORA_SYSOPER constants can be imported using

             use DBD::Oracle qw(:ora_session_modes);

           This is one case where setting ORACLE_SID may be useful since
           connecting as SYSDBA or SYSOPER via SQL*Net is frequently disabled
           for security reasons.

HTH Tim    

tcross (at) rapttech dot com dot au
Received on Tue Feb 16 2010 - 00:45:41 CST

Original text of this message