TMF Operations and Recovery Guide (G06.24+)

Managing SQL Objects
HP NonStop TMF Operations and Recovery Guide522417-002
C-6
Operations for Both SQL/MP and SQL/MX
For more information about TMF considerations for the COPY command, see SQL/MP
Reference Manual.
Loading Data from an Audited SQL/MP Table
From SQLCI, you can use the LOAD command to load data from an audited table, but
the destination table must be an existing nonaudited table. If the destination table is
not empty, its contents are overwritten. Once the destination table is loaded, you can
alter its AUDIT attribute to audited.
To load data to an audited table, first alter the destination table’s AUDIT attribute to
nonaudited. When the load operation is complete, alter the destination table’s AUDIT
attribute back to audited. If you want to be able to use the TMF file recovery feature,
make an online dump of the new table.
The following example loads data to a nonaudited table:
25> SQLCI
>> CREATE TABLE $V1.SPECIAL.EMPLOYEE LIKE $V1.PERSNL.EMPLOYEE;
>> ALTER TABLE $V1.SPECIAL.EMPLOYEE NO AUDIT;
>> LOAD $V1.PERSNL.EMPLOYEE, $V1.SPECIAL.EMPLOYEE;
>> ALTER TABLE $V1.SPECIAL.EMPLOYEE AUDIT;
>> EXIT
You cannot invoke the LOAD utility within a user-defined TMF transaction; if you
attempt to do so, you receive an SQL error.
For more information about TMF considerations for the LOAD command, see SQL/MP
Reference Manual.
Operations for Both SQL/MP and SQL/MX
You must adhere to certain guidelines when you create, duplicate, or purge an object.
These guidelines are described in the next subsection. Details and command syntax
for these operations may differ, depending on whether you are using SQL/MP or
SQL/MX. For specific examples, see SQL/MP Reference Manual for SQL/MP
operations using SQLCI, and SQL/MX Reference Manual for SQL/MX operations using
MXCI.
Creating an SQL Object
In both SQL/MP and SQL/MX, you create tables, views, or indexes by using the SQL
CREATE statements CREATE TABLE, CREATE INDEX, and CREATE VIEW. These
statements can either be embedded within host-language programs or run through the
SQL conversational interface. As indicated under Creating an Audited SQL/MP Object
on page C-2, while SQL/MP objects can be created as either audited objects or
nonaudited objects, SQL/MX objects are always audited.
You can create a table only when TMF is active, the disk volume that contains the table
is enabled for TMF transaction processing, and the disk volume that contains the SQL
catalog in which the table is registered is enabled for TMF transaction processing.