Data Integrity
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).
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:
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.
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.