0% found this document useful (0 votes)
39 views7 pages

Understanding Data Integrity in DBMS

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views7 pages

Understanding Data Integrity in DBMS

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Data Integrity

The term data integrity refers to the accuracy and consistency of data.
When creating databases, attention needs to be given to data integrity and how to
maintain it. A good database will enforce data integrity whenever possible.
For example, a user could accidentally try to enter a phone number into a date field. If
the system enforces data integrity, it will prevent the user from making these mistakes.
Maintaining data integrity means making sure the data remains intact and unchanged
throughout its entire life cycle. This includes the capture of the data, storage, updates,
transfers, backups, etc. Every time data is processed there’s a risk that it could get
corrupted (whether accidentally or maliciously).

Risks to Data Integrity


Some more examples of where data integrity is at risk:
 A user tries to enter a date outside an acceptable range.
 A user tries to enter a phone number in the wrong format.
 A bug in an application attempts to delete the wrong record.
 While transferring data between two databases, the developer accidentally tries
to insert the data into the wrong table.
 While transferring data between two databases, the network went down.
 A user tries to delete a record in a table, but another table is referencing that
record as part of a relationship.
 A user tries to update a primary key value when there’s already a foreign key in a
related table pointing to that value.

Types of Data Integrity


In the database world, data integrity is often placed into the following types:

 Domain Constraints
 Entity integrity
 Referential integrity
 Key Constraint
1. Domain constraints
o Domain constraints can be defned as the defnition of a valid set of
values for an attribute.
o The data type of domain includes string, character, integer, time, date,
currency, etc. The value of the attribute must be available in the
corresponding domain.

Example:

2. Entity integrity constraints


o The entity integrity constraint states that primary key value can't be null.
o This is because the primary key value is used to identify individual rows in
relation and if the primary key has a null value, then we can't identify those
rows.
o A table can contain a null value other than the primary key feld.

Example:
3. Referential Integrity Constraints
o A referential integrity constraint is specifed between two tables.
o In the Referential integrity constraints, if a foreign key in Table 1 refers to the
Primary Key of Table 2, then every value of the Foreign Key in Table 1 must
be null or be available in Table 2.

Example:
4. Key constraints
o Keys are the entity set that is used to identify an entity within its entity set
uniquely.
o An entity set can have multiple keys, but out of which one key will be the
primary key. A primary key can contain a unique and null value in the
relational table.

Example:
Database security
Database security encompasses a range of security controls designed to protect the
Database Management System (DBMS). The types of database security measures your
business should use include protecting the underlying infrastructure that houses the
database such as the network and servers), securely configuring the DBMS, and the
access to the data itself.
Database security controls
Database security encompasses multiple controls, including system hardening, access,
DBMS configuration, and security monitoring. These different security controls help to
manage the circumventing of security protocols.
System hardening and monitoring
The underlying architecture provides additional access to the DBMS. It is vital that all
systems are patched consistently, hardened using known security configuration
standards, and monitored for access, including insider threats.
DBMS configuration
It is critical that the DBMS be properly configured and hardened to take advantage of
security features and limit privileged access that may cause a misconfiguration of
expected security settings. Monitoring the DBMS configuration and ensuring proper
change control processes helps ensure that the configuration stays consistent.
Authentication
Database security measures include authentication, the process of verifying if a user’s
credentials match those stored in your database, and permitting only authenticated
users access to your data, networks, and database platform.
Access
A primary outcome of database security is the effective limitation of access to your data.
Access controls authenticate legitimate users and applications, limiting what they can
access in your database. Access includes designing and granting appropriate user
attributes and roles and limiting administrative privileges.
Database auditing
Monitoring (or auditing) actions as part of a database security protocol delivers
centralized oversight of your database. Auditing helps to detect, deter, and reduce the
overall impact of unauthorized access to your DBMS.
Backups
A data backup, as part of your database security protocol, makes a copy of your data
and stores it on a separate system. This backup allows you to recover lost data that
may result from hardware failures, data corruption, theft, hacking, or natural disasters.
Encryption
Database security can include the secure management of encryption keys, protection of
the encryption system, management of a secure, off-site encryption backup, and access
restriction protocols.
Application security
Database and application security framework measures can help protect against
common known attacker exploits that can circumvent access controls, including SQL
injection.

Why is database security important?


Safeguarding the data your company collects and manages is of utmost importance.
Database security can guard against a compromise of your database, which can lead to
financial loss, reputation damage, consumer confidence disintegration, brand erosion,
and non-compliance of government and industry regulation.
Database security safeguards defend against a myriad of security threats and can help
protect your enterprise from:
 Deployment failure
 Excessive privileges
 Privilege abuse
 Platform vulnerabilities
 Unmanaged sensitive data
 Backup data exposure
 Weak authentication
 Database injection attacks
Views Management:
Database view is a subset of a database and is based on a query that runs on one or
more database tables. Database views are saved in the database as named queries
and can be used to save frequently used, complex queries.

There are two types of database views: dynamic views and static views. Dynamic views
can contain data from one or two tables and automatically include all of the columns
from the specified table or tables. Dynamic views are automatically updated when
related objects or extended objects are created or changed. Static views can contain
data from multiple tables and the required columns from these tables must be specified
in the SELECT and WHERE clauses of the static view. Static views must be manually
updated when related objects or extended objects are created or changed.

When you create a dynamic view with data from two tables, you must ensure that both
tables have the same PRIMARYKEYCOLSEQ columns or contain unique indexes with
the same column name in the same order.

Database views are populated depending on the object on which they are based. For
example, if you add or remove an attribute from the WORKORDER object, the attribute
is either added or removed from the dynamic view that is based on the object. When
you change an attribute, not all changes are applied to the associated database view.
For example, if you change the data type of an attribute, the change is applied to the
database view. However, if you change or add a domain to the default value of the
WORKORDER object, the change is not automatically applied to the database view.
Instead, you must apply this change to the database view.

Common questions

Powered by AI

Data integrity in databases is categorized into four main types: domain constraints, entity integrity, referential integrity, and key constraints. Domain constraints define valid sets of values for an attribute, ensuring data type consistency such as string, integer, or date . Entity integrity ensures that primary key values cannot be null, as these values uniquely identify each row in a table . Referential integrity involves setting constraints between tables, where a foreign key in one table must either be null or match a primary key in another table . Key constraints uniquely identify entities within a set and designate a primary key for uniqueness and null restrictions . Together, these constraints ensure data is consistent, accurate, and reliable throughout its lifecycle.

Database views are subsets of a database based on queries from one or more tables. They are saved as named queries and can simplify complex data retrieval operations . Dynamic views automatically update to reflect changes in related tables, as they include all columns from specified tables . Static views, on the other hand, must be manually updated when there are changes in the underlying tables, requiring explicit specification of the columns in the SELECT and WHERE clauses . This makes dynamic views more flexible for real-time updates, while static views offer more controlled data snapshots.

Database security involves system hardening and monitoring as key components to protect the Database Management System (DBMS). System hardening includes applying patches, using known security configurations, and reducing vulnerabilities . Monitoring involves overseeing access, which includes detecting and mitigating insider threats, ensuring that unauthorized access is prevented . These measures are crucial because they help maintain the integrity of the DBMS, prevent potential breaches, and ensure compliance with security protocols, thus avoiding financial loss and reputation damage .

Database security measures, including input validation, prepared statements, and parameterized queries, help prevent SQL injection attacks by ensuring that inputs are treated as data rather than executable commands . Additionally, enforcing least privilege principle limits the exposure of databases to unauthorized commands. These measures create a robust defense by validating and sanitizing user inputs, ensuring that they do not alter database queries in harmful ways and thus maintain the integrity and confidentiality of the data . Regular audits and security testing also detect and reinforce vulnerabilities against SQL injection threats .

Authentication in database security is crucial because it verifies whether a user's credentials match those stored in the database before granting access . By ensuring that only authenticated users can access the data, networks, and database platforms, authentication acts as the first line of defense against unauthorized access. This reduces the risk of data breaches, ensures that sensitive data remains secure, and maintains privacy by restricting access to legitimate users only .

Primary and foreign keys are integral to maintaining referential integrity in databases. A primary key is a unique identifier for each record in a table, ensuring that each entry can be uniquely distinguished . A foreign key, on the other hand, is a field in one table that uniquely identifies a row of another table. Referential integrity ensures that a foreign key must either be null or correspond to an existing primary key in another table, maintaining consistency and integrity across related data sets . This prevents orphan records and ensures relational database links are valid, reducing the risk of data anomalies.

Database auditing is crucial for maintaining security in data management systems as it provides centralized oversight and helps detect unauthorized access or unusual activities. Key functions of auditing include monitoring user actions, analyzing access patterns, and ensuring compliance with security standards . By tracking these activities, auditing can deter misconduct, reduce the impact of potential security incidents, and ensure accountability, thereby safeguarding the database from threats and reinforcing trust in data integrity and confidentiality .

Improper configuration of the DBMS can result in security vulnerabilities such as misconfigured access controls, excessive privileges, or failure to utilize security features, which can lead to unauthorized access or data breaches . To prevent this, the DBMS should be properly configured and hardened according to security best practices. This includes consistently patching systems, monitoring configuration changes, and limiting privileged access to essential personnel only . Additionally, employing change control processes and regular audits can help maintain a secure and consistent configuration .

During data transfer between databases, data integrity risks include network interruptions leading to incomplete transfers, insertion of incorrect data into tables, or loss of data accuracy . These risks can be mitigated by employing checks and balances such as transaction logging, which ensures that all changes can be traced and reversed if necessary. Implementing robust error-handling mechanisms, ensuring network stability, and establishing clear data transfer protocols also help maintain integrity . Using referential integrity constraints can prevent incorrect data associations by checking foreign key relations during data migrations .

Domain constraints in data integrity define a valid set of values for an attribute, dictating the permissible data types such as integers, dates, or strings . These constraints ensure that only data that meets the predefined criteria is stored, preventing input errors such as entering dates as text. If domain constraints are not implemented, it can lead to invalid data entries, data corruption, and inconsistencies, thereby compromising the database's accuracy and reliability . Such failures could necessitate complex data repairs or lead to significant data processing errors.

You might also like