SYSBACKUP, SYSDG and SYSKM Administrative Users in Oracle 12c

Large enterprise database environments have dedicated DBAs performing specific database roles. Some of these specific roles include database storage management, tuning, backup and recovery, etc. Inside these organizations there has been growing concern to further ensure the use of the SOD (Segregation of Duties) concept, to fulfill duties for these roles. Use of SOD ensures that the core business tasks are divided between different users and that each of them have a clear set of duties assigned. Also it guarantees that none of theses users have related set of duties or privileges which he/she can use in combination, to perform harmful operations.


Related Articles
Oracle 12c Database Installation On Solaris 11 Using VirtualBox
SGA Instance Parameters in CDB and PDB
What is Oracle 12c?

SYSBACKUP, SYSDG and SYSKM Administrative Users in Oracle 12c

Previously all Oracle DBA related activities were either performed using the powerful SYSDBA or the SYSOPER role. In support of the SOD requirements starting with Oracle 12c, new administrative roles have been introduced to conform to the principle of access to the least privilege. Three new user SYSBACKUP, SYSDG and SYSKM are created in support of this, when the database is created, with their account in the “EXPIRED & LOCKED” status. A equivalent administrative privilege with the same name as the user is created as well.

SQL>SELECT username , account_status
FROM dba_users
ORDER BY created;

USERNAME ACCOUNT_STATUS
---------------------- ------------------
SYS OPEN
SYSTEM OPEN
SYSKM EXPIRED & LOCKED
SYSDG EXPIRED & LOCKED
SYSBACKUP EXPIRED & LOCKED


New Administrative Privileges
These new accounts have been provisioned for use with the appropriate privileges.

SQL>SELECT *
FROM V$pwfile_users;

USERNAME SYSDB SYSOP SYSAS SYSBA SYSDG SYSKM CON_ID
------------------------------ ----- ----- ----- ----- ----- ----- ----------
SYS TRUE TRUE FALSE FALSE FALSE FALSE 0
SYSDG FALSE FALSE FALSE FALSE TRUE FALSE 1
SYSBACKUP FALSE FALSE FALSE TRUE FALSE FALSE 1
SYSKM FALSE FALSE FALSE FALSE FALSE TRUE 1


SYSBACKUP will be used to perform all backup and recovery related operations either via RMAN or SQL*PLUS. Here you can find a complete list of SYSBACKUP privileges you are assigned when logged in with the SYSBACKUP administrative privilege.


SYSDG is in place to separate the Data Guard related operations from other activities. Here you can find a complete list of SYSDG privileges you are assigned when logged in with the SYSDG administrative privilege.


SYSKM will be responsible for all TDE (Transparent Data Encryption) and Data Vault related administrative operations. Here you can find a complete list of SYSKM privileges you are assigned when logged in with the SYSKM administrative privilege.


None of these new database roles can be dropped. They have enough privileges that using them user can connect to database even if it is closed. Also all these roles are incorporated into the Oracle database Vault. Actions performed using these privilege can be audited if AUDIT_SYS_OPERATIONS is set to true.


Add New Privileges to Password File

When a user needs to connect to the database using the SYSBACKUP, SYSDG or SYSKM adminstrative privilege the user must me be added to the password file with the appropriate user privilege flag. The option to include these new privileges has been added to the orapwd utility.


orapwd file=[fname] entries=[users] force=[y/n] asm=[y/n] dbuniquename=[dbname] format=[legacy/12] sysbackup=[y/n] sysdg=[y/n] syskm=[y/n] delete=[y/n] input_file=[input-fname] orapwd FILE='$ORACLE_HOME/dbs/orapwvstdb01' ENTRIES=10 SYSBACKUP=y

Current Schema and Session for SYSBACKUP, SYSDG and SYSKM
When a user is connected using any of these admin privileges, the schema that they are assigned to is the SYS schema and the session name corresponds to the privilege name that they are using.

SQL> conn sys as sysdba
Enter password:
Connected.

SQL> select sys_context('userenv', 'current_schema') current_schema, sys_context('userenv', 'session_user') session_user from dual;

CURRENT_SCHEMA SESSION_USER
------------------------------ ------------------------------
SYS SYS

SQL> conn sysdg as sysdg
Enter password:
Connected.

SQL> select sys_context('userenv', 'current_schema') current_schema, sys_context('userenv', 'session_user') session_user from dual;

CURRENT_SCHEMA SESSION_USER
------------------------------ ------------------------------
SYS SYSDG

SQL> conn sysbackup as sysbackup
Enter password:
Connected.

SQL> select sys_context('userenv', 'current_schema') current_schema, sys_context('userenv', 'session_user') session_user from dual;

CURRENT_SCHEMA SESSION_USER
------------------------------ ------------------------------
SYS SYSBACKUP

SQL> conn syskm as syskm
Enter password:
Connected.

SQL> select sys_context('userenv', 'current_schema') current_schema, sys_context('userenv', 'session_user')
session_user from dual;

CURRENT_SCHEMA SESSION_USER
------------------------------ ------------------------------
SYSKM SYSKM

New Database Role OS Group

To further ensure the separation of access to the new SYSBACKUP, SYSDG and SYSKM privileges, Oracle recommends mapping them to the new OSBACKUPDBA, OSDGDBA and OSKMDBA operating system groups respectively.


SYSBACKUP BACKUPDBA
SYSDG DGDBA
SYSKM KMDBA

Summary
With the introduction of the new Database Administration users and the scaled down privileges, implementing segregation of duties is indeed possible. Further by providing the flexibility to only assign the required DBA privilege and mapping it to the specific OS role groups, accountability on the use of the specific role is made easier.


References
Configuring Users, Groups and Environments for Oracle Database