TMF Operations and Recovery Guide (G06.24+)
Managing SQL Objects
HP NonStop TMF Operations and Recovery Guideā522417-002
C-5
Operations for SQL/MP Only
You can also query the SQL catalog table, FILES, to obtain the AUDIT attribute of an
object, or list of objects, in the catalog. The following command, for example, queries
the FILES table of the catalog $DATA.SALESCAT to generate a list of all audited
objects in that catalog:
25> SQLCI
>> SELECT FILENAME, AUDIT FROM FILES;
FILENAME AUDIT
---------------------------------- -----
.
.
.
\SIERRA.$DATA.SALES.CUSTOMER Y
\SIERRA.$DATA.SALES.ODETAIL Y
\SIERRA.$DATA.SALES.ORDERS Y
\SIERRA.$DATA.SALES.PARTS Y
\SIERRA.$DATA.SALES.XCUSTNAME Y
\SIERRA.$DATA.SALES.XORDCUS Y
\SIERRA.$DATA.SALES.XORDPREP Y
\SIERRA.$DATA.SALES.XPARTDES Y
.
.
.
Copying Data from One Audited SQL/MP Object to Another
Object
From SQLCI, you can use the COPY command to copy data from an audited object to
either an audited object or a nonaudited object. The target table must exist before the
COPY utility can operate. The table can either be empty or contain rows.
If the target table does not exist, create it using the CREATE TABLE utility. If you want
to be able to use the TMF file recovery feature, make an online dump of the new table.
The following example copies data to an audited table:
25> SQLCI
>> CREATE TABLE $V1.SPECIAL.EMPLOYEE LIKE $V1.PERSNL.EMPLOYEE;
>> COPY $V1.PERSNL.EMPLOYEE, $V1.SPECIAL.EMPLOYEE;
>> EXIT
To copy data to an audited table without auditing the operation, first alter the
destination tableās AUDIT attribute to nonaudited. When the copy 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 copies data to a nonaudited table:
25> SQLCI
>> CREATE TABLE $V1.SPECIAL.EMPLOYEE LIKE $V1.PERSNL.EMPLOYEE;
>> ALTER TABLE $V1.SPECIAL.EMPLOYEE NO AUDIT;
>> COPY $V1.PERSNL.EMPLOYEE, $V1.SPECIAL.EMPLOYEE;
>> ALTER TABLE $V1.SPECIAL.EMPLOYEE AUDIT;
>> EXIT