Skip to content
Home » Oracle Database » User and Role » Privilege » How to Resolve ORA-28009: connection as SYS should be as SYSDBA or SYSOPER

How to Resolve ORA-28009: connection as SYS should be as SYSDBA or SYSOPER

ORA-28009

Tried to connect to a database, but it failed with ORA-28009.

SQL> conn sys/password@orclpdb
ERROR:
ORA-28009: connection as SYS should be as SYSDBA or SYSOPER

ORA-28009 means that SYS should be used with SYSDBA or SYSOPER privilege, you may either try another user or explicitly declare AS SYSDBA.

Solutions

We have 2 ways to solve ORA-28009.

Use SYSTEM

If the job you want to do is a non-critical one, please use SYSTEM, not SYS to connect to the database.

SQL> conn system/password@orclpdb
Connected.
SQL> show user
USER is "SYSTEM"

This can prevent you from doing something inappropriate during busy hours. Just like we said in How to expdp as sysdba, we usually use SYSTEM to do data migration jobs.

AS SYSDBA

To correctly use SYS to connect to a database, you should explicitly declare the user we want to connect has SYSDBA privilege.

SQL> conn sys/password@orclpdb as sysdba
Connected.
SQL> show user
USER is "SYS"

We successfully connected.

As for SYSOPER, there're differences between SYSDBA and SYSOPER privileges.

Leave a Reply

Your email address will not be published. Required fields are marked *