DB Sec 2
DB Sec 2
Lecture 2
Security procedures
Procedure implementation scripts or programs
Predefined roles description
[PROFILE {pname}]
[PASSWORD EXPIRE]
[ACCOUNT {lock | unlock}]
PROFILE DEFAULT
ACCOUNT UNLOCK;
◼ Simple process
◼ Make a backup first
◼ Obtain a written request (for auditing
purposes)
A
◼ DROP command
◼ CASCADE option: when user owns
database objects
◼ Recommendations:
Backup the account for one to three months
A
◼ Command line:
SP_DEFAULTDB system stored procedure
SP_DEFAULTLANGUAGE stored procedure
◼ Enterprise Manager:
A
Object privileges:
◼ Granted to a user by the schema owner
◼ Granted by a user with GRANT privileges
Database Security and Auditing 38
Granting and Revoking User
Privileges (continued)
◼ In Oracle (continued):
Grant a privilege using the DCL GRANT
statement
Revoke a privilege using the DCL REVOKE
statement:
◼ ADMIN option
◼ GRANT option
◼ Syntax:
REVOKE privilege ,ALL
ON object
FROM user,role,PUBLIC;
Example:
REVOKE select, insert
ON departments
FROM Scott;
.
What Is a Role?
◼ A role is a named group of related privileges that
can be granted to the user.
◼ This method makes it easier to revoke and
maintain privileges.
◼ user can have access to several roles, and
several users can be assigned the same role
◼ Pre-defined roles:
– DBA: it has all system privileges (which SYS/SYSTEM have)
– RESOURCE: Enables a user to create certain types of
objects in his own schema
– CONNECT: Enables a user to connect to the database.
Grant this role to any user or application that needs
database access.
Creating and Assigning a Role
◼ Deals with:
Complexity
Change frequency
Reuse
SQL> SHUTDOWN
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> STARTUP
ORACLE instance started.
V_OPERATION VARCHAR2(20);
BEGIN
----- comment lines
-inserting , updating and deleting
-variables that are set to TRUE automatically
-by oracle, based on the action DML operation
-That fired the trigger. If an INSERT fires
-The trigger, then INSERTING is set TRUE and
-So forth for the UPDATE and DELETE.
SQL_TEXT
------------------------------------------
SELECT sal FROM emp WHERE ename = 'Larry'