You are on page 1of 5

Polytechnic Loni: 0030

DMS-22319

Unit 5: Database Security and Transaction Processing

(10 Marks)

Database Security:
Protect the important data from unauthorized users.
Requirements of Security:
1. Confidentiality: authorized users can see the data.
2. Privacy of Communication: data communication must be secured.
3. Secure Storage: data can be stored securely.
4. Authenticated users: authenticated users can access the data.
5. Integrity: protect the data from corruption.
6. Availability: data only available for authenticated users only.

Database Users:
1. Naive users (General)
Access the data by using different readily available softwares/methods
2. Application Programmers
Access the data by developing their own software.
3. Sophisticated users
Access the data by writing the queries (SQL)
4. DBA
Database Administrator (centralized control on database)

New User Creation:


1. Create user: creates the new database users.
create user anil identified by 123;

2. Alter user:
alter user anil identified by abc;

3. Delete user:
drop user anil;
drop user anil cascade;
Polytechnic Loni: 0030
DMS-22319
Database Privileges:
Privileges-rights
Different users provided with different privileges for accessing the database
1. Grant:
Is used to provide different privileges to the users.

grant select on system.emp to anil;


grant select, insert on system.emp to anil;
grant select, insert, delete, update on system.emp to anil;

2. Revoke:
Is used to cancel different privileges from the users.

revoke select on system.emp from anil;


revoke select, insert on system.emp from anil;
revoke select, insert, delete, update on system.emp from anil;

Transaction:
Unit of program execution.
Properties: ACID
Properties
1. Atomicity: all operations get executed or none.
2. Consistency: update the same data stored at different locations.
3. Isolation: all transactions get executed independent of each other.
4. Durability: data saved in database permanently.
Polytechnic Loni: 0030
DMS-22319
States of Transaction:

1. Live (Active): beginning of transaction


2. Partially committed: some operations gets executed
3. Failed: some operations remain incomplete (can’t executed)
4. Aborted: end the failed transaction
5. Committed: successfully executed all operations in transaction
Polytechnic Loni: 0030
DMS-22319

Database Backup:
Store the same copy of database at different locations.
It is used to restore the database, when the original database gets corrupted.
Types of Failure:
1. System crash: hardware malfunction/ operating system gets corrupted
2. Statement failure: wrong SQL queries/programs
3. Media Failure: HDD/Pen Drive/CD/DVD crash/corrupt
4. Application software error:
Types of Database Backup:
1. Physical Backup: store the database at different locations or in different medias
(HDD/Pen Drive)
2. Logical Backup: use the VIEW of the large database.

Database Recovery:
To restore the original data in system from backup.
Recovery Techniques:
1. Backward Recovery:
Recover the database and restored that into previous stage.
2. Forward Recovery:
Recover the database and restored the updated copy of the database.
Polytechnic Loni: 0030
DMS-22319

Assignment

1. Define need of database security. (2) (L1)


2. Write the syntax to create user and alter user. (2) (L1)
3. Write syntax for grant and revoke command. (2) (L1)
4. Explain ACID properties of transaction. (4) (L2)
5. Explain states of transactions with diagram. (4) (L2)
6. Explain system privileges. (4) (L2)
7. Explain causes of database failure. (4) (L2)
8. Explain database recovery techniques. (4) (L2)

You might also like