SQL/MX 2.x Installation and Management Guide (G06.24+, H06.03+)
Introduction to SQL/MX Database Management
HP NonStop SQL/MX Installation and Management Guide—523723-004
1-4
Data Integrity
For more information about database protection and recovery, see the TMF information
in Section 5, Planning Database Security and Recovery and Section 12, Performing
Recovery Operations.
Data Integrity
The database management system protects the database by ensuring that entered
data meets the definitional requirements. Application programs, therefore, do not need
to perform data checking.
These data definition features ensure definitional integrity:
•
Column definitions
•
ANSI views
•
Constraints
•
Indexes
These features provide additional data integrity for SQL/MX databases:
•
Database changes are monitored by TMF.
•
Database access is restricted to SQL/MX statements.
•
Integrity constraints on tables are enforced by the DBMS (database management
system). Referential integrity constraints, for example, depend on several layers of
software for checking, including the executor and disk processes.
•
Database consistency is maintained by concurrency control.
TMF provides data integrity. Database updates performed as part of a TMF transaction
are either all committed to the database when the transaction completes or all backed
out if the transaction does not complete. With the TMF two-phase commit protocol, an
update changes a database from one consistent state to another; an incomplete
transaction does not change the database. TMF transactions can be distributed across
multiple nodes.
SQL/MX database access is restricted to SQL/MX statements, including Data
Manipulation Language (DML), Data Definition Language (DDL), Transaction Control,
Resource Control and Optimization, Stored Procedures, and Trigger statements. For
information about SQL/MX statements, see the SQL/MX Reference Manual.
For each SQL/MX table, you can define up to five types of integrity constraints (Not
Null, Unique, Primary Key, Check, and Referential Integrity) that NonStop SQL/MX
checks before allowing an INSERT, UPDATE, or DELETE operation to change a row in
a table. If the change would violate the constraint, NonStop SQL/MX prohibits it.
Concurrency control for database access provides different degrees of database
consistency to meet different needs. For any DML statement, you can specify access
options by using the FOR option ACCESS clause and, for a SELECT statement, by
using this same clause, you can also specify access options for individual tables
referenced in the FROM clause. The possible settings for options in a DML statement
are: READ COMMITTED, READ UNCOMMITTED, SERIALIZABLE or REPEATABLE