SlideShare a Scribd company logo
1 of 17
Database Administration:
The Complete Guide to Practices and Procedures
Chapter 13
Data Integrity
Database Structure Integrity
• Index corruption
– If the pointers do not point to the correct data, the index is
useless.
• Other types of pointer corruption
– XML, LOB, large text data, etc.
• Page header corruption
– If the header becomes corrupted, the DBMS may not be
able to interpret the data stored on the page.
• Backup files
– If the backup file is not formatted correctly, or if data is in
the wrong location in the backup file, it cannot be used by
the DBMS for recovery purposes.
– Media failures, tape degradation, and bugs can cause such
problems.
This document is a partial preview. Full document download can be found on Flevy:
http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-data-integrity-part-13-584
dbcc: Consistency Options
• DBCC CHECKTABLE(table_name)
– checks the consistency of the data and index
pages of a table. When DBCC is run using this
option it will report on the number of data pages,
the number of rows, the number of text and
image columns, as well as any integrity violations.
• DBCC REINDEX(table_name)
– defragments the indexes built on the specified
table.
This document is a partial preview. Full document download can be found on Flevy:
http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-data-integrity-part-13-584
dbcc: Other Options
The DBCC utility can also be used:
• To generate reports containing information on
database internals (for example, creation date
and internal identifier)
• To print formatted table pages showing the
header contents, to dump and display the
contents of buffers and caches
• To “zap” the database (that is, make quick
changes to any of the database contents).
This document is a partial preview. Full document download can be found on Flevy:
http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-data-integrity-part-13-584
Uniqueness
• A unique constraint is similar to a
primary key constraint.
– However, each table can have many unique
constraints.
– Unique constraints cannot be used to support
referential constraints.
• The values stored in the column, or combination
of columns, must but unique within the table.
– That is, no other row can contain the same value.
• A unique constraint most likely requires a unique
index to enforce.
This document is a partial preview. Full document download can be found on Flevy:
http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-data-integrity-part-13-584
Using UDTs
• After a user-defined data type has been
created, it can be used in the same manner as
a system-defined data type.
• Strong typing prohibits operations between
different data types.
– For example, the following would NOT be allowed:
This document is a partial preview. Full document download can be found on Flevy:
http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-data-integrity-part-13-584
Defining Check Constraints
• The check constraint syntax consists of two
components: a constraint name and a check
condition.
– The constraint name identifies the check constraint to
the database. If a constraint name is not explicitly
coded, the DBMS automatically generates a unique
name for the constraint.
– The check condition defines the actual constraint
logic. The check condition can be defined using any of
the basic predicates (>, <, =, <>, <=, >=), as well as
BETWEEN, IN, LIKE, and NULL.
• Furthermore, AND and OR can be used to string conditions
together in a check constraint.
This document is a partial preview. Full document download can be found on Flevy:
http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-data-integrity-part-13-584
Triggers
• Triggers are event-driven specialized procedures that are
attached to database tables.
• Execution is automatic and implicit
– You can not explicitly code a “run trigger” statement
• Trigger is executed, or “fired,” based upon a pre-defined
“firing” activity:
– Database Modification
• INSERT
• UPDATE
• DELETE
• Triggers are quite useful to support:
– Business rules
– Redundant data
– Derived data
– Data validation
This document is a partial preview. Full document download can be found on Flevy:
http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-data-integrity-part-13-584
Triggered Action
• Each trigger has a triggered action, consisting
of two parts:
– Trigger Condition: When the condition is true, the
trigger body is executed.
• If no trigger condition is coded, the trigger body
executes every time the trigger is activated.
– Trigger Body: The trigger body is the SQL code to
be executed when the trigger condition is true.
• Begins with BEGIN ATOMIC; ends with END.This document is a partial preview. Full document download can be found on Flevy:
http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-data-integrity-part-13-584
When Does a Trigger Fire
• Triggers can be coded to fire at two different
times:
– BEFORE the firing activity occurs
• A “before” trigger executes before the firing activity
occurs
– AFTER the firing activity occurs
• An “after” trigger executes after the firing activity
occurs.This document is a partial preview. Full document download can be found on Flevy:
http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-data-integrity-part-13-584
INSTEAD OF Triggers
• INSTEAD OF triggers can be created to make
non-updateable views updateable.
– Example: a view based on a join of two tables is
non-updateable
• INSTEAD OF triggers can be coded to specify how data
is to be inserted, updated, and deleted from such a
view
• After the INSTEAD OF triggers are coded, modifying the
view causes the triggers to fire and actually perform the
modifications.
This document is a partial preview. Full document download can be found on Flevy:
http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-data-integrity-part-13-584
RI: Parent / Child
• For any given referential constraint, the parent
table is the table that contains the primary key,
and the child table is the table that contains the
foreign key.
– The parent table in the employed-by relationship is
the DEPT table.
– The child table is the EMP table.
DEPT
EMP
employs
employed-by
This document is a partial preview. Full document download can be found on Flevy:
http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-data-integrity-part-13-584
UPDATE Rule
• The UPDATE rule controls updates such that a
foreign key value cannot be updated to a
value that does not correspond to a primary
key value in the parent table.
• There are, however, two ways to view the
update rule:
– Foreign key perspective.
– Primary key perspective.
This document is a partial preview. Full document download can be found on Flevy:
http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-data-integrity-part-13-584
DELETE Rule
Similar to the primary key perspective of the update rule,
three options exist when deleting a row from a parent
table:
• Restricted DELETE. The deletion of the primary key row
is not allowed if a foreign key value exists.
• Neutralizing DELETE. All foreign key values equal to
the primary key value of the row being deleted are set
to null.
• Cascading DELETE. All foreign key rows with a value
equal to the primary key of the row about to be
deleted are deleted as well.
This document is a partial preview. Full document download can be found on Flevy:
http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-data-integrity-part-13-584
• User-Managed vs. System-Managed RI
– Use declarative RI instead of program RI
• performance and ease of use
• ensure integrity for planned and ad hoc database modification
• Do not use RI for lookup tables
– consider CHECK constraints vs. lookup tables
• Use triggers only when declarative RI is not workable
– Triggers are less efficient (usually) than RI
• but usually better than enforcing in application programs
• Specify indexes on foreign keys
Referential Integrity Guidance
This document is a partial preview. Full document download can be found on Flevy:
http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-data-integrity-part-13-584
Questions
This document is a partial preview. Full document download can be found on Flevy:
http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-data-integrity-part-13-584
1
Flevy (www.flevy.com) is the marketplace
for premium documents. These
documents can range from Business
Frameworks to Financial Models to
PowerPoint Templates.
Flevy was founded under the principle that
companies waste a lot of time and money
recreating the same foundational business
documents. Our vision is for Flevy to
become a comprehensive knowledge base
of business documents. All organizations,
from startups to large enterprises, can use
Flevy— whether it's to jumpstart projects, to
find reference or comparison materials, or
just to learn.
Contact Us
Please contact us with any questions you may have
about our company.
• General Inquiries
support@flevy.com
• Media/PR
press@flevy.com
• Billing
billing@flevy.com

More Related Content

More from Flevy.com Best Practices

[Whitepaper] 8 Key Steps of Data Integration: Restructuring Redeployment Asse...
[Whitepaper] 8 Key Steps of Data Integration: Restructuring Redeployment Asse...[Whitepaper] 8 Key Steps of Data Integration: Restructuring Redeployment Asse...
[Whitepaper] 8 Key Steps of Data Integration: Restructuring Redeployment Asse...Flevy.com Best Practices
 
[Whitepaper] Strategy Classics: Value Disciplines Model
[Whitepaper] Strategy Classics: Value Disciplines Model[Whitepaper] Strategy Classics: Value Disciplines Model
[Whitepaper] Strategy Classics: Value Disciplines ModelFlevy.com Best Practices
 
[Whitepaper] The Definitive Guide to Strategic Planning: Here’s What You Need...
[Whitepaper] The Definitive Guide to Strategic Planning: Here’s What You Need...[Whitepaper] The Definitive Guide to Strategic Planning: Here’s What You Need...
[Whitepaper] The Definitive Guide to Strategic Planning: Here’s What You Need...Flevy.com Best Practices
 
[Whitepaper] The Definitive Introduction to Strategy Development and Strategy...
[Whitepaper] The Definitive Introduction to Strategy Development and Strategy...[Whitepaper] The Definitive Introduction to Strategy Development and Strategy...
[Whitepaper] The Definitive Introduction to Strategy Development and Strategy...Flevy.com Best Practices
 
[Whitepaper] The “Theory of Constraints:” What’s Limiting Your Organization?
[Whitepaper] The “Theory of Constraints:” What’s Limiting Your Organization?[Whitepaper] The “Theory of Constraints:” What’s Limiting Your Organization?
[Whitepaper] The “Theory of Constraints:” What’s Limiting Your Organization?Flevy.com Best Practices
 
[Whitepaper] Transportation Cost Reduction in Supply Chain Management
[Whitepaper] Transportation Cost Reduction in Supply Chain Management[Whitepaper] Transportation Cost Reduction in Supply Chain Management
[Whitepaper] Transportation Cost Reduction in Supply Chain ManagementFlevy.com Best Practices
 
[Whitepaper] A Great Leadership Experience: Dr. Rachid Yazami, Inventor of th...
[Whitepaper] A Great Leadership Experience: Dr. Rachid Yazami, Inventor of th...[Whitepaper] A Great Leadership Experience: Dr. Rachid Yazami, Inventor of th...
[Whitepaper] A Great Leadership Experience: Dr. Rachid Yazami, Inventor of th...Flevy.com Best Practices
 
[Whitepaper] Finding It Hard to Manage Conflict at the Workplace? Use the Tho...
[Whitepaper] Finding It Hard to Manage Conflict at the Workplace? Use the Tho...[Whitepaper] Finding It Hard to Manage Conflict at the Workplace? Use the Tho...
[Whitepaper] Finding It Hard to Manage Conflict at the Workplace? Use the Tho...Flevy.com Best Practices
 
[Whitepaper] Key Account Management: Handling Large Global Accounts the Right...
[Whitepaper] Key Account Management: Handling Large Global Accounts the Right...[Whitepaper] Key Account Management: Handling Large Global Accounts the Right...
[Whitepaper] Key Account Management: Handling Large Global Accounts the Right...Flevy.com Best Practices
 
[Whitepaper] Nudge Theory: An Effective Way to Transform Negative Behaviors
[Whitepaper] Nudge Theory: An Effective Way to Transform Negative Behaviors[Whitepaper] Nudge Theory: An Effective Way to Transform Negative Behaviors
[Whitepaper] Nudge Theory: An Effective Way to Transform Negative BehaviorsFlevy.com Best Practices
 
[Whitepaper] Business Model Innovation: Creation of Scalable Business Models ...
[Whitepaper] Business Model Innovation: Creation of Scalable Business Models ...[Whitepaper] Business Model Innovation: Creation of Scalable Business Models ...
[Whitepaper] Business Model Innovation: Creation of Scalable Business Models ...Flevy.com Best Practices
 
[Whitepaper] Shareholder Value Traps: How to Evade Them and Focus on Value Cr...
[Whitepaper] Shareholder Value Traps: How to Evade Them and Focus on Value Cr...[Whitepaper] Shareholder Value Traps: How to Evade Them and Focus on Value Cr...
[Whitepaper] Shareholder Value Traps: How to Evade Them and Focus on Value Cr...Flevy.com Best Practices
 
Six Sigma - Statistical Process Control (SPC)
Six Sigma - Statistical Process Control (SPC)Six Sigma - Statistical Process Control (SPC)
Six Sigma - Statistical Process Control (SPC)Flevy.com Best Practices
 
Lean Six Sigma - Process Risk Analysis (FMEA)
Lean Six Sigma - Process Risk Analysis (FMEA)Lean Six Sigma - Process Risk Analysis (FMEA)
Lean Six Sigma - Process Risk Analysis (FMEA)Flevy.com Best Practices
 
Effective Staff Suggestion System (Kaizen Teian)
Effective Staff Suggestion System (Kaizen Teian)Effective Staff Suggestion System (Kaizen Teian)
Effective Staff Suggestion System (Kaizen Teian)Flevy.com Best Practices
 

More from Flevy.com Best Practices (20)

[Whitepaper] 8 Key Steps of Data Integration: Restructuring Redeployment Asse...
[Whitepaper] 8 Key Steps of Data Integration: Restructuring Redeployment Asse...[Whitepaper] 8 Key Steps of Data Integration: Restructuring Redeployment Asse...
[Whitepaper] 8 Key Steps of Data Integration: Restructuring Redeployment Asse...
 
[Whitepaper] Strategy Classics: Value Disciplines Model
[Whitepaper] Strategy Classics: Value Disciplines Model[Whitepaper] Strategy Classics: Value Disciplines Model
[Whitepaper] Strategy Classics: Value Disciplines Model
 
[Whitepaper] The Definitive Guide to Strategic Planning: Here’s What You Need...
[Whitepaper] The Definitive Guide to Strategic Planning: Here’s What You Need...[Whitepaper] The Definitive Guide to Strategic Planning: Here’s What You Need...
[Whitepaper] The Definitive Guide to Strategic Planning: Here’s What You Need...
 
[Whitepaper] The Definitive Introduction to Strategy Development and Strategy...
[Whitepaper] The Definitive Introduction to Strategy Development and Strategy...[Whitepaper] The Definitive Introduction to Strategy Development and Strategy...
[Whitepaper] The Definitive Introduction to Strategy Development and Strategy...
 
[Whitepaper] The “Theory of Constraints:” What’s Limiting Your Organization?
[Whitepaper] The “Theory of Constraints:” What’s Limiting Your Organization?[Whitepaper] The “Theory of Constraints:” What’s Limiting Your Organization?
[Whitepaper] The “Theory of Constraints:” What’s Limiting Your Organization?
 
[Whitepaper] Transportation Cost Reduction in Supply Chain Management
[Whitepaper] Transportation Cost Reduction in Supply Chain Management[Whitepaper] Transportation Cost Reduction in Supply Chain Management
[Whitepaper] Transportation Cost Reduction in Supply Chain Management
 
[Whitepaper] A Great Leadership Experience: Dr. Rachid Yazami, Inventor of th...
[Whitepaper] A Great Leadership Experience: Dr. Rachid Yazami, Inventor of th...[Whitepaper] A Great Leadership Experience: Dr. Rachid Yazami, Inventor of th...
[Whitepaper] A Great Leadership Experience: Dr. Rachid Yazami, Inventor of th...
 
[Whitepaper] Finding It Hard to Manage Conflict at the Workplace? Use the Tho...
[Whitepaper] Finding It Hard to Manage Conflict at the Workplace? Use the Tho...[Whitepaper] Finding It Hard to Manage Conflict at the Workplace? Use the Tho...
[Whitepaper] Finding It Hard to Manage Conflict at the Workplace? Use the Tho...
 
[Whitepaper] Key Account Management: Handling Large Global Accounts the Right...
[Whitepaper] Key Account Management: Handling Large Global Accounts the Right...[Whitepaper] Key Account Management: Handling Large Global Accounts the Right...
[Whitepaper] Key Account Management: Handling Large Global Accounts the Right...
 
[Whitepaper] Nudge Theory: An Effective Way to Transform Negative Behaviors
[Whitepaper] Nudge Theory: An Effective Way to Transform Negative Behaviors[Whitepaper] Nudge Theory: An Effective Way to Transform Negative Behaviors
[Whitepaper] Nudge Theory: An Effective Way to Transform Negative Behaviors
 
[Whitepaper] Business Model Innovation: Creation of Scalable Business Models ...
[Whitepaper] Business Model Innovation: Creation of Scalable Business Models ...[Whitepaper] Business Model Innovation: Creation of Scalable Business Models ...
[Whitepaper] Business Model Innovation: Creation of Scalable Business Models ...
 
[Whitepaper] Shareholder Value Traps: How to Evade Them and Focus on Value Cr...
[Whitepaper] Shareholder Value Traps: How to Evade Them and Focus on Value Cr...[Whitepaper] Shareholder Value Traps: How to Evade Them and Focus on Value Cr...
[Whitepaper] Shareholder Value Traps: How to Evade Them and Focus on Value Cr...
 
The Top 101 Consulting Frameworks of 2020
The Top 101 Consulting Frameworks of 2020The Top 101 Consulting Frameworks of 2020
The Top 101 Consulting Frameworks of 2020
 
Six Sigma - Statistical Process Control (SPC)
Six Sigma - Statistical Process Control (SPC)Six Sigma - Statistical Process Control (SPC)
Six Sigma - Statistical Process Control (SPC)
 
Lean Six Sigma - Process Risk Analysis (FMEA)
Lean Six Sigma - Process Risk Analysis (FMEA)Lean Six Sigma - Process Risk Analysis (FMEA)
Lean Six Sigma - Process Risk Analysis (FMEA)
 
Lean Manufacturing
Lean ManufacturingLean Manufacturing
Lean Manufacturing
 
Effective Staff Suggestion System (Kaizen Teian)
Effective Staff Suggestion System (Kaizen Teian)Effective Staff Suggestion System (Kaizen Teian)
Effective Staff Suggestion System (Kaizen Teian)
 
Sales Excellence - Diagnostic Tool
Sales Excellence - Diagnostic ToolSales Excellence - Diagnostic Tool
Sales Excellence - Diagnostic Tool
 
Variance Analysis
Variance AnalysisVariance Analysis
Variance Analysis
 
Change Management Models
Change Management ModelsChange Management Models
Change Management Models
 

Recently uploaded

The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...Aggregage
 
Creating Low-Code Loan Applications using the Trisotech Mortgage Feature Set
Creating Low-Code Loan Applications using the Trisotech Mortgage Feature SetCreating Low-Code Loan Applications using the Trisotech Mortgage Feature Set
Creating Low-Code Loan Applications using the Trisotech Mortgage Feature SetDenis Gagné
 
VIP Call Girls In Saharaganj ( Lucknow ) 🔝 8923113531 🔝 Cash Payment (COD) 👒
VIP Call Girls In Saharaganj ( Lucknow  ) 🔝 8923113531 🔝  Cash Payment (COD) 👒VIP Call Girls In Saharaganj ( Lucknow  ) 🔝 8923113531 🔝  Cash Payment (COD) 👒
VIP Call Girls In Saharaganj ( Lucknow ) 🔝 8923113531 🔝 Cash Payment (COD) 👒anilsa9823
 
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...lizamodels9
 
RSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors DataRSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors DataExhibitors Data
 
7.pdf This presentation captures many uses and the significance of the number...
7.pdf This presentation captures many uses and the significance of the number...7.pdf This presentation captures many uses and the significance of the number...
7.pdf This presentation captures many uses and the significance of the number...Paul Menig
 
HONOR Veterans Event Keynote by Michael Hawkins
HONOR Veterans Event Keynote by Michael HawkinsHONOR Veterans Event Keynote by Michael Hawkins
HONOR Veterans Event Keynote by Michael HawkinsMichael W. Hawkins
 
Famous Olympic Siblings from the 21st Century
Famous Olympic Siblings from the 21st CenturyFamous Olympic Siblings from the 21st Century
Famous Olympic Siblings from the 21st Centuryrwgiffor
 
0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdf0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdfRenandantas16
 
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesMysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesDipal Arora
 
The Coffee Bean & Tea Leaf(CBTL), Business strategy case study
The Coffee Bean & Tea Leaf(CBTL), Business strategy case studyThe Coffee Bean & Tea Leaf(CBTL), Business strategy case study
The Coffee Bean & Tea Leaf(CBTL), Business strategy case studyEthan lee
 
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRLMONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRLSeo
 
Boost the utilization of your HCL environment by reevaluating use cases and f...
Boost the utilization of your HCL environment by reevaluating use cases and f...Boost the utilization of your HCL environment by reevaluating use cases and f...
Boost the utilization of your HCL environment by reevaluating use cases and f...Roland Driesen
 
Pharma Works Profile of Karan Communications
Pharma Works Profile of Karan CommunicationsPharma Works Profile of Karan Communications
Pharma Works Profile of Karan Communicationskarancommunications
 
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Delhi Call girls
 
Understanding the Pakistan Budgeting Process: Basics and Key Insights
Understanding the Pakistan Budgeting Process: Basics and Key InsightsUnderstanding the Pakistan Budgeting Process: Basics and Key Insights
Understanding the Pakistan Budgeting Process: Basics and Key Insightsseri bangash
 
Value Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and painsValue Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and painsP&CO
 
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876dlhescort
 
Event mailer assignment progress report .pdf
Event mailer assignment progress report .pdfEvent mailer assignment progress report .pdf
Event mailer assignment progress report .pdftbatkhuu1
 

Recently uploaded (20)

The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
 
Creating Low-Code Loan Applications using the Trisotech Mortgage Feature Set
Creating Low-Code Loan Applications using the Trisotech Mortgage Feature SetCreating Low-Code Loan Applications using the Trisotech Mortgage Feature Set
Creating Low-Code Loan Applications using the Trisotech Mortgage Feature Set
 
VIP Call Girls In Saharaganj ( Lucknow ) 🔝 8923113531 🔝 Cash Payment (COD) 👒
VIP Call Girls In Saharaganj ( Lucknow  ) 🔝 8923113531 🔝  Cash Payment (COD) 👒VIP Call Girls In Saharaganj ( Lucknow  ) 🔝 8923113531 🔝  Cash Payment (COD) 👒
VIP Call Girls In Saharaganj ( Lucknow ) 🔝 8923113531 🔝 Cash Payment (COD) 👒
 
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
 
RSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors DataRSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors Data
 
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabiunwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
 
7.pdf This presentation captures many uses and the significance of the number...
7.pdf This presentation captures many uses and the significance of the number...7.pdf This presentation captures many uses and the significance of the number...
7.pdf This presentation captures many uses and the significance of the number...
 
HONOR Veterans Event Keynote by Michael Hawkins
HONOR Veterans Event Keynote by Michael HawkinsHONOR Veterans Event Keynote by Michael Hawkins
HONOR Veterans Event Keynote by Michael Hawkins
 
Famous Olympic Siblings from the 21st Century
Famous Olympic Siblings from the 21st CenturyFamous Olympic Siblings from the 21st Century
Famous Olympic Siblings from the 21st Century
 
0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdf0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdf
 
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesMysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
 
The Coffee Bean & Tea Leaf(CBTL), Business strategy case study
The Coffee Bean & Tea Leaf(CBTL), Business strategy case studyThe Coffee Bean & Tea Leaf(CBTL), Business strategy case study
The Coffee Bean & Tea Leaf(CBTL), Business strategy case study
 
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRLMONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
 
Boost the utilization of your HCL environment by reevaluating use cases and f...
Boost the utilization of your HCL environment by reevaluating use cases and f...Boost the utilization of your HCL environment by reevaluating use cases and f...
Boost the utilization of your HCL environment by reevaluating use cases and f...
 
Pharma Works Profile of Karan Communications
Pharma Works Profile of Karan CommunicationsPharma Works Profile of Karan Communications
Pharma Works Profile of Karan Communications
 
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
 
Understanding the Pakistan Budgeting Process: Basics and Key Insights
Understanding the Pakistan Budgeting Process: Basics and Key InsightsUnderstanding the Pakistan Budgeting Process: Basics and Key Insights
Understanding the Pakistan Budgeting Process: Basics and Key Insights
 
Value Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and painsValue Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and pains
 
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
Call Girls in Delhi, Escort Service Available 24x7 in Delhi 959961-/-3876
 
Event mailer assignment progress report .pdf
Event mailer assignment progress report .pdfEvent mailer assignment progress report .pdf
Event mailer assignment progress report .pdf
 

The Complete Guide to DBA Practices & Procedures - Data Integrity - Part 13

  • 1. Database Administration: The Complete Guide to Practices and Procedures Chapter 13 Data Integrity
  • 2. Database Structure Integrity • Index corruption – If the pointers do not point to the correct data, the index is useless. • Other types of pointer corruption – XML, LOB, large text data, etc. • Page header corruption – If the header becomes corrupted, the DBMS may not be able to interpret the data stored on the page. • Backup files – If the backup file is not formatted correctly, or if data is in the wrong location in the backup file, it cannot be used by the DBMS for recovery purposes. – Media failures, tape degradation, and bugs can cause such problems. This document is a partial preview. Full document download can be found on Flevy: http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-data-integrity-part-13-584
  • 3. dbcc: Consistency Options • DBCC CHECKTABLE(table_name) – checks the consistency of the data and index pages of a table. When DBCC is run using this option it will report on the number of data pages, the number of rows, the number of text and image columns, as well as any integrity violations. • DBCC REINDEX(table_name) – defragments the indexes built on the specified table. This document is a partial preview. Full document download can be found on Flevy: http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-data-integrity-part-13-584
  • 4. dbcc: Other Options The DBCC utility can also be used: • To generate reports containing information on database internals (for example, creation date and internal identifier) • To print formatted table pages showing the header contents, to dump and display the contents of buffers and caches • To “zap” the database (that is, make quick changes to any of the database contents). This document is a partial preview. Full document download can be found on Flevy: http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-data-integrity-part-13-584
  • 5. Uniqueness • A unique constraint is similar to a primary key constraint. – However, each table can have many unique constraints. – Unique constraints cannot be used to support referential constraints. • The values stored in the column, or combination of columns, must but unique within the table. – That is, no other row can contain the same value. • A unique constraint most likely requires a unique index to enforce. This document is a partial preview. Full document download can be found on Flevy: http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-data-integrity-part-13-584
  • 6. Using UDTs • After a user-defined data type has been created, it can be used in the same manner as a system-defined data type. • Strong typing prohibits operations between different data types. – For example, the following would NOT be allowed: This document is a partial preview. Full document download can be found on Flevy: http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-data-integrity-part-13-584
  • 7. Defining Check Constraints • The check constraint syntax consists of two components: a constraint name and a check condition. – The constraint name identifies the check constraint to the database. If a constraint name is not explicitly coded, the DBMS automatically generates a unique name for the constraint. – The check condition defines the actual constraint logic. The check condition can be defined using any of the basic predicates (>, <, =, <>, <=, >=), as well as BETWEEN, IN, LIKE, and NULL. • Furthermore, AND and OR can be used to string conditions together in a check constraint. This document is a partial preview. Full document download can be found on Flevy: http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-data-integrity-part-13-584
  • 8. Triggers • Triggers are event-driven specialized procedures that are attached to database tables. • Execution is automatic and implicit – You can not explicitly code a “run trigger” statement • Trigger is executed, or “fired,” based upon a pre-defined “firing” activity: – Database Modification • INSERT • UPDATE • DELETE • Triggers are quite useful to support: – Business rules – Redundant data – Derived data – Data validation This document is a partial preview. Full document download can be found on Flevy: http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-data-integrity-part-13-584
  • 9. Triggered Action • Each trigger has a triggered action, consisting of two parts: – Trigger Condition: When the condition is true, the trigger body is executed. • If no trigger condition is coded, the trigger body executes every time the trigger is activated. – Trigger Body: The trigger body is the SQL code to be executed when the trigger condition is true. • Begins with BEGIN ATOMIC; ends with END.This document is a partial preview. Full document download can be found on Flevy: http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-data-integrity-part-13-584
  • 10. When Does a Trigger Fire • Triggers can be coded to fire at two different times: – BEFORE the firing activity occurs • A “before” trigger executes before the firing activity occurs – AFTER the firing activity occurs • An “after” trigger executes after the firing activity occurs.This document is a partial preview. Full document download can be found on Flevy: http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-data-integrity-part-13-584
  • 11. INSTEAD OF Triggers • INSTEAD OF triggers can be created to make non-updateable views updateable. – Example: a view based on a join of two tables is non-updateable • INSTEAD OF triggers can be coded to specify how data is to be inserted, updated, and deleted from such a view • After the INSTEAD OF triggers are coded, modifying the view causes the triggers to fire and actually perform the modifications. This document is a partial preview. Full document download can be found on Flevy: http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-data-integrity-part-13-584
  • 12. RI: Parent / Child • For any given referential constraint, the parent table is the table that contains the primary key, and the child table is the table that contains the foreign key. – The parent table in the employed-by relationship is the DEPT table. – The child table is the EMP table. DEPT EMP employs employed-by This document is a partial preview. Full document download can be found on Flevy: http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-data-integrity-part-13-584
  • 13. UPDATE Rule • The UPDATE rule controls updates such that a foreign key value cannot be updated to a value that does not correspond to a primary key value in the parent table. • There are, however, two ways to view the update rule: – Foreign key perspective. – Primary key perspective. This document is a partial preview. Full document download can be found on Flevy: http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-data-integrity-part-13-584
  • 14. DELETE Rule Similar to the primary key perspective of the update rule, three options exist when deleting a row from a parent table: • Restricted DELETE. The deletion of the primary key row is not allowed if a foreign key value exists. • Neutralizing DELETE. All foreign key values equal to the primary key value of the row being deleted are set to null. • Cascading DELETE. All foreign key rows with a value equal to the primary key of the row about to be deleted are deleted as well. This document is a partial preview. Full document download can be found on Flevy: http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-data-integrity-part-13-584
  • 15. • User-Managed vs. System-Managed RI – Use declarative RI instead of program RI • performance and ease of use • ensure integrity for planned and ad hoc database modification • Do not use RI for lookup tables – consider CHECK constraints vs. lookup tables • Use triggers only when declarative RI is not workable – Triggers are less efficient (usually) than RI • but usually better than enforcing in application programs • Specify indexes on foreign keys Referential Integrity Guidance This document is a partial preview. Full document download can be found on Flevy: http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-data-integrity-part-13-584
  • 16. Questions This document is a partial preview. Full document download can be found on Flevy: http://flevy.com/browse/document/the-complete-guide-to-dba-practices-and-procedures-data-integrity-part-13-584
  • 17. 1 Flevy (www.flevy.com) is the marketplace for premium documents. These documents can range from Business Frameworks to Financial Models to PowerPoint Templates. Flevy was founded under the principle that companies waste a lot of time and money recreating the same foundational business documents. Our vision is for Flevy to become a comprehensive knowledge base of business documents. All organizations, from startups to large enterprises, can use Flevy— whether it's to jumpstart projects, to find reference or comparison materials, or just to learn. Contact Us Please contact us with any questions you may have about our company. • General Inquiries support@flevy.com • Media/PR press@flevy.com • Billing billing@flevy.com