Scalable Database Server, HiRDB Version 8 Description
To prevent falsification of critical data due to human error or fraudulence, you can now define a falsification-prevented table, which prevents all users, including the table owner, from updating data in the table. Table 3-5 indicates the executability of operations on falsification-prevented tables.
Table 3-5 Executability of operations on falsification-prevented tables
Operation |
Falsification-prevention table |
With deletion-prevention duration specification |
Without deletion-prevention duration specification |
INSERT |
Y |
Y |
SELECT |
Y |
Y |
Update by column (UPDATE) |
Y1 |
Y1 |
Update by row (UPDATE) |
N |
N |
DELETE |
Y2 |
N |
PURGE TABLE |
N |
N |
Other data manipulation SQLs |
Y |
Y |
- Legend:
- Y: Can be executed.
- N: Cannot be executed.
- 1 Only updatable columns can be updated.
- 2 Only data for which the deletion-prevention duration has elapsed can be deleted. If a deletion-prevention duration is not specified, the data in the table cannot be deleted.
- Organization of this subsection
- (1) Specification method
- (2) Limitations
(1) Specification method
To prevent falsification, you specify the INSERT ONLY option (falsification prevention option) in the CREATE TABLE definition SQL. You can also use the INSERT ONLY option of ALTER TABLE to change the definition of an existing table so that it becomes a falsification-prevented table.
You can define the following types of columns when you create or change a table definition:
- Updatable column
If you define an updatable column, you can use either of the following methods to update the data by column:
- Always update (specify UPDATE)
- Update only once from the null value to a non-null value (specify UPDATE ONLY FROM NULL)
You can define updatable columns at the following times:
- When you execute CREATE TABLE
- Before you execute ALTER TABLE CHANGE INSERT ONLY
- When you execute ALTER TABLE ADD column-name or ALTER TABLE CHANGE column-name*
- * You cannot execute ALTER TABLE CHANGE column-name on a falsification-prevented table.
- Insert history maintenance column
By defining an insert history maintenance column, you can specify a deletion-prevented duration. If you do not specify the deletion-prevented duration, you will not be able to delete any of the data in the table. In addition, because you cannot execute DROP TABLE on such a table if it contains any data, you will not be able to delete either the table itself or the data in the table. To avoid this situation, specify the deletion-prevention duration if the data hold time has been determined, or if the data hold time can be determined.
(2) Limitations
The limitations of falsification-prevented tables and the RDAREAs in which falsification-prevented tables are stored are listed as follows. For details, see the HiRDB Version 8 Installation and Design Guide.
- You cannot specify the updatable column attribute for all columns and then specify the falsification prevention option.
- You cannot change existing columns to become updatable columns or change updatable columns to become regular columns.
- You must define updatable columns before you apply the falsification prevention facility.
- You cannot apply the falsification prevention facility to an existing table that already contains data. Instead, you must first unload the data from the existing table, change the table to a falsification-prevented table, and then load the data back into the table.
- You cannot delete a falsification-prevented table that contains data. The fact that you cannot delete data in a falsification-prevented table for which no deletion-prevention duration has been specified means that you cannot delete the table itself.
- You cannot use the database structure reconfiguration utility (pdmod) to initialize an RDAREA (initialize rdarea) in which a falsification-prevented table is stored.
- Do not use a replication facility (HiRDB Dataextractor or HiRDB Datareplicator) to duplicate data in or to reflect update results to a falsification-prevented table. If you do so, the data in the copy source and copy target may become inconsistent, resulting in errors.
All Rights Reserved. Copyright (C) 2007, Hitachi, Ltd.