RDS for Oracle users and privileges
When you create an Amazon RDS for Oracle DB instance, the default master user has most of the maximum
user permissions on the DB instance. Use the master user account for any administrative tasks,
such as creating additional user accounts in your database. Because RDS is a managed
service, you aren't allowed to log in as SYS and SYSTEM, and thus
don't have SYSDBA privileges.
Topics
Limitations for Oracle DBA privileges
In the database, a role is a collection of privileges that you can
grant to or revoke from a user. An Oracle database uses roles to provide security. For more
information, see Configuring Privilege and Role Authorization
The predefined role DBA normally allows all administrative privileges on an
Oracle database. When you create a DB instance, your master user account gets DBA privileges
(with some limitations). To deliver a managed experience, an RDS for Oracle database doesn't
provide the following privileges for the DBA role:
-
ALTER DATABASE -
ALTER SYSTEM -
CREATE ANY DIRECTORY -
DROP ANY DIRECTORY -
GRANT ANY PRIVILEGE -
GRANT ANY ROLE
For more RDS for Oracle system privilege and role information, see Master user account privileges.
How to manage privileges on SYS objects
You can manage privileges on SYS objects by using the
rdsadmin.rdsadmin_util package. For example, if you create the database
user myuser, you could use the
rdsadmin.rdsadmin_util.grant_sys_object procedure to grant
SELECT privileges on V_$SQLAREA to myuser.
For more information, see the following topics:
AWS managed database accounts and roles in RDS for Oracle
RDS for Oracle creates and uses several database accounts and roles to perform automated management tasks. These accounts and roles are reserved for RDS for Oracle. Don't use them for your applications or workloads.
Don't lock, drop, or rename these accounts, or change their passwords. Don't modify the privileges or grants of these accounts and roles. Changes like these might prevent RDS for Oracle from managing your DB instance, which can affect its availability.
The following are AWS managed accounts:
-
RDSADMIN -
RDS_DATAGUARD -
RDSSEC -
RDSPERFMON -
RDSDBSNMP -
OPS$RDSDB -
RDSZEROETLADMIN -
RDSADMIN$LIMITED
Not all of these accounts are present in every DB instance. Their presence depends on the features and options enabled for the instance.
The following are AWS managed roles:
-
OPS_RDSDB_READ_ONLY -
OPS_RDSDB_READ_WRITE
Excluding AWS managed accounts from logon triggers
If you create an AFTER LOGON ON DATABASE trigger, allow all
AWS managed accounts to connect without restriction. Blocking these accounts can
prevent Amazon RDS automation from running and may affect the availability of your
DB instance.
Add a guard at the top of your trigger that returns immediately for all
AWS managed accounts. The following example shows the recommended pattern using the
USER function:
CREATE OR REPLACE TRIGGER my_logon_trigger AFTER LOGON ON DATABASE DECLARE v_user VARCHAR2(100); BEGIN v_user := USER; -- Allow AWS managed accounts to connect. IF v_user IN ('admin-user', 'SYS', 'SYSTEM', 'RDSADMIN', 'OPS$RDSDB', 'RDSZEROETLADMIN', 'RDSADMIN$LIMITED', 'RDS_DATAGUARD', 'RDSSEC', 'RDSPERFMON', 'RDSDBSNMP') THEN RETURN; END IF; -- Your custom trigger logic here. EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE(SQLERRM); RAISE; END; /