PL/SQL API jcs.drop_user
Summary
Drops the (redwood) user or role identified by username, which effectively means that all its privileges are dropped, possibly including the Oracle user and privileges attached to that.
All objects that are owned by the given username, or are dependent on such an object are removed as well, or their ownership is transferred. Amongst the objects that will be removed are:
- Privileges (object and system) where the user is the grantee
- Privileges (object and system) where the user is the grantor
- Registry entries owned by the user; if there are sub-entries owned by other users, the owner of this entry is modified to the owner of its parent entry
- Jobs owned by the user
- Job notes owned by the user
- Scripts owned by the user and any executions (jobs) of those
- Subscriptions for the user
- Log file entires relating to jobs being deleted
Privileges
The SCHEDULER_SCHEMA (usually SYSJCS) cannot be dropped. If you are not the SCHEDULER_SCHEMA, you need the ORACLE privilege DROP USER. To drop the Oracle user, when it pertains to a role, you need the ORACLE privilege DROP ANY ROLE. To drop the Oracle user, when it pertains to a user, you need the ORACLE privilege DROP USER. To drop the Redwood user you need the Redwood privilege MANIPULATE_USER_OBJECTS. To drop the partition you need the Redwood privilege DROP_PARTITION.
Specification
procedure drop_user(username in varchar2,
drop_ora_user in varchar2 default const.jcs_no,
drop_partition in varchar2 default const.jcs_no,
disable_only in varchar2 default const.jcs_no)
Parameters
- username - user or role to be dropped
- drop_ora_user - whether to remove the database user and privileges as well.
- drop_partition - whether to remove the partition with the same name as the username as well.
- disable_only - if 'Y' the user is only disabled. In this case drop_ora_user and drop_partition are not checked Disabling a role has no meaning and is silently ignored.
Transaction keyword
The transaction keyword defines how and/or when the changes are committed to the database. A definition of the various transaction keywords can be found on the jcs package summary page.
commits
plsqlTopic
onsiteTopic