Professional Documents
Culture Documents
DBMS Worksheet
DBMS Worksheet
Design a case study for Company Database System./ Hospital Management System/ Railway Reservation
System.
PROVIDING ROLES
Typically, you’ll first want to assign privileges to the user through attaching the account to various roles,
starting with the CONNECT role:
In some cases to create a more powerful user, you may also consider adding the RESOURCE role (allowing
the user to create named types for custom schemas) or even the DBA role, which allows the user to not only
create custom named types but alter and destroy them as well.
GRANTING/ASSIGNING PRIVILEGE
GRANT statement
Use the GRANT statement to give privileges to a specific user or role, or to all users, to perform actions on
database objects. You can also use the GRANT statement to grant a role to a user.
· Create a foreign key reference to the named table or to a subset of columns from a table.
Example:
REVOKE statement
Use the REVOKE statement to remove privileges from a specific user or role, or from all users, to perform
actions on database objects. You can also use the REVOKE statement to revoke a role from a user, from
PUBLIC, or from another role.
Example:-
REVOKING ROLES:
ALTER USER
DROP USER:
Use the DROP USER statement to remove a database user and optionally remove the user's objects.
Specify CASCADE to drop all objects in the user's schema before dropping the user. You must specify this
clause to drop a user whose schema contains any objects.
· If the user's schema contains tables, then Oracle Database drops the tables and automatically drops any
referential integrity constraints on tables in other schemas that refer to primary and unique keys on these
tables.
· If this clause results in tables being dropped, then the database also drops all domain indexes created
on columns of those tables and invokes appropriate drop routines.