HaKieuOanh LAB6
HaKieuOanh LAB6
I. Prepare:
1. Oracle database 19c/21c:
2. Oracle SQL developer:
Drop table
3. Create and delete user
You cannot create users or roles without “C##” before the user
Because when opening, oracle will default its container to root, to
create it directly must add c##, notation for normal users
You can use this code to bypass it
*Warning: Setting undocumented parameters like this (as indicated by
the leading underscore) should only be done under the direction of
Oracle Support. Changing such parameters without such guidance
may invalidate your support contract. So do this at your own risk.
Now you can create user without “C##”
Drop user
4. User Role
Grant <role> to <user>
CONNECT: The CONNECT role provides basic privileges necessary
for a user to connect to the database.
RESOURCE: The RESOURCE role is typically used for regular users
who need to create and manage database objects such as tables,
views, procedures and trigger.
DBA: The DBA (Database Administrator) role is a powerful role that
has extensive privileges for managing the entire database.
Show roles of a user
5. Custom roles
Create custom role
Grant function to the role (This role will let user command queries ABC
table)