Professional Documents
Culture Documents
Database Recovery
Recovery Concept
Transaction Failure: Use Log for Recovery
Catastrophic Failure: Past data from backup and
recent from log.
There are two types of recovery techniques
Log Based Recovery: maintains log files in stable
storage update log file before updating database.
Use this file for recovery.
Shadow Paging: Maintains two versions of
database in disk . BFIM and AFIM.
Steal/No-Force (Undo/Redo)
Steal/Force (Undo/No-redo)
No-Steal/No-Force (Redo/No-undo)
No-Steal/Force (No-undo/No-redo)
Check Pointing
Searching entire log file is time consuming and also may
perform unnecessary redo.
Checkpoint declares a point before which the DBMS was
in consistent state and all the transactions were
committed. Now recovery will be to only process log
records since the last checkpoint record.
The following steps define a checkpoint operation.
Suspend execution of transactions temporarily.
Force write modified buffer data to disk.
Write a [checkpoint] record to the log, save the log to
disk.
Resume normal transaction execution.
Read(y
)
Read(z
)
Write(y
)
Write(z
)
Commi
T1
Start
T1
Write
T1
Commit
T2
Start
T2
Write
200
350
T2
Write
500
250
400
300
Crash
Differed Update
Recovery
Policy
as single user environment but
Same
concurrency control mechanism
Tid
Operation
DataItem
OldValue
NewValue
T1
Start
T1
Write
400
300
T1
Write
340
250
T1
Commit
requires
Checkpont
T4
Start
T4
Write
200
350
T4
Write
300
250
T4
Commit
T2
Start
T2
Write
T3
Start
T3
T2
crash
y
350
250
Write
250
100
Write
250
525
Immediate Update
Recover Policy
Undo/Redo Policy:
Immediate Update in Single User Environment :
committed list and active list. Undo active tractions
and redo committed transactions.
Immediate Update in Multi-user Environment use
strict 2PL so that none of the locks are released till
transaction is committed.
Shadow Paging
Storage Hierarchy
Volatile Storage
Nonvolatile Storage
Stable Storage
Database Security
Role of DBA in Database Security
Managing User Accounts
Performing Database Audits
Classification of Database Security
Physical security-Hardware Safety
Logical Security- Software Safeguards
Levels of Security
Physical
Human
Operating System
Network
Database
Authorization
Types of authorization
Read Authorization
Insert Authorization
Update Authorization
Delete Authorization
Index Authorization
Resource Authorization
Alteration Authorization
Granting Privileges
Syntax
GRANT <privilege list> | ALL PRIVILEGES
ON < relation name or view name >
TO <user-name list/role list> | PUBLIC [WITH GRANT
OPTION]
Granting Privileges
GRANT INSERT, DELETE, UPDATE, SELECT
ON Employees, Departments, Orders, Products
TO DBA
WITH GRANT OPTION ;
GRANT UPDATE ON products (price) TO Binaya ;
Authorization Graph
DBA
U1
U4
U2
U5
U3
Revoking of Privileges
Syntax
REVOKE <privilege list> | ALL PRIVILEGES ON
<object_names>
FROM <user-name list> | PUBLIC [CASCADE | RESTRICT]
REVOKE ALL PRIVILEGES
ON
Employees, Departments, Orders, Products
FROM Anil ;
Revoking of Privileges
DBA
GRANT Select ON Employees TO Anil WITH GRANT
OPTION
Anil
GRANT Select ON Employees TO Bhupesh
DBA
REVOKE Select ON Employees FROM Anil RESTRICT;
DBA
REVOKE Select ON Employees FROM Anil CASCADE;
Authentication
Different techniques of authentication
Password Authentication
Biometric Authentication
Digital Signature
Smart Card Authentication
Encryption
Terminologies
Plain Text
Cipher Text
Encryption
Decryption
Key
Types of Encryption
Private Key Encryption-Ceaser Cipher, DES, AES
Public Key Encryption-RSA