SlideShare a Scribd company logo
1 of 13
RASHIQA MAHMOOD 12-ARID-
2152
ANAM ZAHEER 12-ARID-2087
NAFEESA SHAHID 12-AIRD-2142
Course incharge : SIR BILAL QURESHI
Distributed Database systems
INTEGRITY
ENFORCEMENT
INTEGRITY ENFORCEMENT
Semantic integrity consists of rejecting update
transactions that violate some integrity
constraints.
Integrity constraints represent knowledge about
data with which a database must be
consistent, which means that the data
contained in a database is both accurate and
valid.
A constraint is violated when it becomes false in
the new database state produced by the
update transaction.
METHODS
Two basic methods permit the rejection of
inconsistent update transactions.
 Detection
 Prevention
1. DETECTION
The first one is based on the detection of
inconsistencies.
Execute update u: D  Du
If Du is inconsistent then
if possible: compensate Du  Du
’
else
undo Du  D
 This approach may be inefficient if a large
amount of work (the update of D) must be
undone in the case of an integrity failure.
2. PREVENTION
The second method is based on the prevention
of inconsistencies. An update is executed only
if it changes the database state to a consistent
state.
Execute u: D  Du only if Du will be consistent
The tuples subject to the update transaction are
either
 directly available (in the case of insert) or
 must be retrieved from the database (in the
case of deletion or modification)
EFFICIENCY
The preventive approach is more efficient than
the detection approach since updates never
need to be undone because of integrity
violation.
POSTTEST & PRETEST
POSTTEST
Tests are derived by
integrity constraints.
these tests are
applied after having
changed the
database state, they
are generally called
posttests.
PRETEST
Tests, derived by
integrity constraints,
are applied before
the database state
is changed they are
generally called
pretests.
QUERY MODIFICATION ALGO
 The query modification algorithm is an
example of a preventive method that is
particularly efficient at enforcing domain
constraints.
 It adds the assertion qualification to the query
qualification by an AND operator so that the
modified query can enforce integrity.
EXAMPLE
UPDATE PROJ
SET BUDGET = BUDGET*1.1
WHERE PNAME = "CAD/CAM"
UPDATE PROJ
SET BUDGET = BUDGET*1.1
WHERE PNAME = "CAD/CAM"
AND NEW.BUDGET ≥ 500000
AND NEW.BUDGET ≤ 1000000
QUERY MODIFICATION ALGO
 It produces pretests at run time by ANDing
the assertion predicates with the update
predicates of each instruction of the
transaction.
 This algorithm only applies to tuple calculus
formulae
DDB - integrity Enfrcement

More Related Content

Similar to DDB - integrity Enfrcement

Performance testing methodologies
Performance testing methodologiesPerformance testing methodologies
Performance testing methodologies
Dhanunjay Rasamala
 
Vb net xp_07
Vb net xp_07Vb net xp_07
Vb net xp_07
Niit Care
 
REAL-TIME CHANGE DATA CAPTURE USING STAGING TABLES AND DELTA VIEW GENERATION...
 REAL-TIME CHANGE DATA CAPTURE USING STAGING TABLES AND DELTA VIEW GENERATION... REAL-TIME CHANGE DATA CAPTURE USING STAGING TABLES AND DELTA VIEW GENERATION...
REAL-TIME CHANGE DATA CAPTURE USING STAGING TABLES AND DELTA VIEW GENERATION...
ijiert bestjournal
 

Similar to DDB - integrity Enfrcement (20)

2 countermeasures
2 countermeasures2 countermeasures
2 countermeasures
 
2 countermeasures
2 countermeasures2 countermeasures
2 countermeasures
 
DTAP
DTAPDTAP
DTAP
 
Performance testing methodologies
Performance testing methodologiesPerformance testing methodologies
Performance testing methodologies
 
Vb net xp_07
Vb net xp_07Vb net xp_07
Vb net xp_07
 
REAL-TIME CHANGE DATA CAPTURE USING STAGING TABLES AND DELTA VIEW GENERATION...
 REAL-TIME CHANGE DATA CAPTURE USING STAGING TABLES AND DELTA VIEW GENERATION... REAL-TIME CHANGE DATA CAPTURE USING STAGING TABLES AND DELTA VIEW GENERATION...
REAL-TIME CHANGE DATA CAPTURE USING STAGING TABLES AND DELTA VIEW GENERATION...
 
Test data management
Test data managementTest data management
Test data management
 
Database Testing
Database TestingDatabase Testing
Database Testing
 
Ch13
Ch13Ch13
Ch13
 
Ch 5- Achieving Qualities
Ch 5- Achieving QualitiesCh 5- Achieving Qualities
Ch 5- Achieving Qualities
 
Paper on experimental setup for verifying - "Slow Learners are Fast"
Paper  on experimental setup for verifying  - "Slow Learners are Fast"Paper  on experimental setup for verifying  - "Slow Learners are Fast"
Paper on experimental setup for verifying - "Slow Learners are Fast"
 
Geoscientific Data Management Principles
Geoscientific Data Management PrinciplesGeoscientific Data Management Principles
Geoscientific Data Management Principles
 
QUERY PROOF STRUCTURE CACHING FOR INCREMENTAL EVALUATION OF TABLED PROLOG PRO...
QUERY PROOF STRUCTURE CACHING FOR INCREMENTAL EVALUATION OF TABLED PROLOG PRO...QUERY PROOF STRUCTURE CACHING FOR INCREMENTAL EVALUATION OF TABLED PROLOG PRO...
QUERY PROOF STRUCTURE CACHING FOR INCREMENTAL EVALUATION OF TABLED PROLOG PRO...
 
Ch13.pptx
Ch13.pptxCh13.pptx
Ch13.pptx
 
A SURVEY ON STATIC AND DYNAMIC LOAD BALANCING ALGORITHMS FOR DISTRIBUTED MULT...
A SURVEY ON STATIC AND DYNAMIC LOAD BALANCING ALGORITHMS FOR DISTRIBUTED MULT...A SURVEY ON STATIC AND DYNAMIC LOAD BALANCING ALGORITHMS FOR DISTRIBUTED MULT...
A SURVEY ON STATIC AND DYNAMIC LOAD BALANCING ALGORITHMS FOR DISTRIBUTED MULT...
 
Getting Most Out of Your Disaster Recovery Infrastructure Using Active Data G...
Getting Most Out of Your Disaster Recovery Infrastructure Using Active Data G...Getting Most Out of Your Disaster Recovery Infrastructure Using Active Data G...
Getting Most Out of Your Disaster Recovery Infrastructure Using Active Data G...
 
Disaster Recovery Infrastructure Whitepaper 2012
Disaster Recovery Infrastructure Whitepaper 2012Disaster Recovery Infrastructure Whitepaper 2012
Disaster Recovery Infrastructure Whitepaper 2012
 
Systems and methods for improving database performance
Systems and methods for improving database performanceSystems and methods for improving database performance
Systems and methods for improving database performance
 
Database Testing: A Detailed Guide
Database Testing: A Detailed GuideDatabase Testing: A Detailed Guide
Database Testing: A Detailed Guide
 
Test Driven Database Development With Data Dude
Test Driven Database Development With Data DudeTest Driven Database Development With Data Dude
Test Driven Database Development With Data Dude
 

DDB - integrity Enfrcement

  • 1.
  • 2. RASHIQA MAHMOOD 12-ARID- 2152 ANAM ZAHEER 12-ARID-2087 NAFEESA SHAHID 12-AIRD-2142 Course incharge : SIR BILAL QURESHI
  • 4. INTEGRITY ENFORCEMENT Semantic integrity consists of rejecting update transactions that violate some integrity constraints. Integrity constraints represent knowledge about data with which a database must be consistent, which means that the data contained in a database is both accurate and valid. A constraint is violated when it becomes false in the new database state produced by the update transaction.
  • 5. METHODS Two basic methods permit the rejection of inconsistent update transactions.  Detection  Prevention
  • 6. 1. DETECTION The first one is based on the detection of inconsistencies. Execute update u: D  Du If Du is inconsistent then if possible: compensate Du  Du ’ else undo Du  D  This approach may be inefficient if a large amount of work (the update of D) must be undone in the case of an integrity failure.
  • 7. 2. PREVENTION The second method is based on the prevention of inconsistencies. An update is executed only if it changes the database state to a consistent state. Execute u: D  Du only if Du will be consistent The tuples subject to the update transaction are either  directly available (in the case of insert) or  must be retrieved from the database (in the case of deletion or modification)
  • 8. EFFICIENCY The preventive approach is more efficient than the detection approach since updates never need to be undone because of integrity violation.
  • 9. POSTTEST & PRETEST POSTTEST Tests are derived by integrity constraints. these tests are applied after having changed the database state, they are generally called posttests. PRETEST Tests, derived by integrity constraints, are applied before the database state is changed they are generally called pretests.
  • 10. QUERY MODIFICATION ALGO  The query modification algorithm is an example of a preventive method that is particularly efficient at enforcing domain constraints.  It adds the assertion qualification to the query qualification by an AND operator so that the modified query can enforce integrity.
  • 11. EXAMPLE UPDATE PROJ SET BUDGET = BUDGET*1.1 WHERE PNAME = "CAD/CAM" UPDATE PROJ SET BUDGET = BUDGET*1.1 WHERE PNAME = "CAD/CAM" AND NEW.BUDGET ≥ 500000 AND NEW.BUDGET ≤ 1000000
  • 12. QUERY MODIFICATION ALGO  It produces pretests at run time by ANDing the assertion predicates with the update predicates of each instruction of the transaction.  This algorithm only applies to tuple calculus formulae

Editor's Notes

  1. The update transaction u is executed, causing a change of the database state D to Du. The enforcement algorithm verifies, by applying tests derived from these constraints, that all relevant constraints hold in state Du. If state Du is inconsistent, the DBMS can try either to reach another consistent state, D’u by modifying Du with compensation actions, or to restore state D by undoing u.