Friday, December 13, 2013

SYS vs SYSDBA

As far as I know SYSDBA privilege includes ALL permissions of DBA privilege.  Ok, but what can a user with SYSDBA privilege do what a user with (only) DBA privilege cannot?  Peter

User with SYSDBA can shutdown the database, which a user with DBA role cannot  You cannot make any changes to dictionary with just the DBA role. You need to have SYSDBA role to make these changes.

The DBA role does not include the SYSDBA or SYSOPER system privileges.   SYSDBA - Special Administrative Privilege. SYSDBA/SYSOPER can create , Drop a database,Shutdown and startup database,mount and open the database, switching between noarchivelog to archivelog.  DBA - Role - Rest can be done with DBA Role.  HTH -Anantha


SYSDBA and SYSOPER

The following operations are authorized by the SYSDBA and SYSOPER system privileges:
System PrivilegeOperations Authorized
SYSDBA
  • Perform STARTUP and SHUTDOWN operations
  • ALTER DATABASE: open, mount, back up, or change character set
  • CREATE DATABASE
  • DROP DATABASE
  • CREATE SPFILE
  • ALTER DATABASE ARCHIVELOG
  • ALTER DATABASE RECOVER
  • Includes the RESTRICTED SESSION privilege
Effectively, this system privilege allows a user to connect as user SYS.
SYSOPER
  • Perform STARTUP and SHUTDOWN operations
  • CREATE SPFILE
  • ALTER DATABASE OPEN/MOUNT/BACKUP
  • ALTER DATABASE ARCHIVELOG
  • ALTER DATABASE RECOVER (Complete recovery only. Any form of incomplete recovery, such as UNTIL TIME|CHANGE|CANCEL|CONTROLFILE requires connecting as SYSDBA.)
  • Includes the RESTRICTED SESSION privilege
This privilege allows a user to perform basic operational tasks, but without the ability to look at user data.
The manner in which you are authorized to use these privileges depends upon the method of authentication that you use.
When you connect with SYSDBA or SYSOPER privileges, you connect with a default schema, not with the schema that is generally associated with your username. For SYSDBA this schema is SYS; for SYSOPER the schema is PUBLIC.

SYS

When you create an Oracle Database, the user SYS is automatically created and granted the DBA role.
All of the base tables and views for the database data dictionary are stored in the schema SYS. These base tables and views are critical for the operation of Oracle Database. To maintain the integrity of the data dictionary, tables in the SYS schema are manipulated only by the database. They should never be modified by any user or database administrator, and no one should create any tables in the schema of user SYS. (However, you can change the storage parameters of the data dictionary settings if necessary.)
Ensure that most database users are never able to connect to Oracle Database using the SYS account.

SYSTEM

When you create an Oracle Database, the user SYSTEM is also automatically created and granted the DBA role.
The SYSTEM username is used to create additional tables and views that display administrative information, and internal tables and views used by various Oracle Database options and tools. Never use the SYSTEM schema to store tables of interest to non-administrative users.

The DBA Role

A predefined DBA role is automatically created with every Oracle Database installation. This role contains most database system privileges. Therefore, the DBA role should be granted only to actual database administrators.
Note:
The DBA role does not include the SYSDBA or SYSOPER system privileges. These are special administrative privileges that allow an administrator to perform basic database administration tasks, such as creating the database and instance startup and shutdown. These system privileges are discussed in "Administrative Privileges".

No comments:

Post a Comment