SQL/MP Reference Manual
HP NonStop SQL/MP Reference Manual—523352-013
P-39
Examples—PURGEDATA
error 40 (The operation timed out) when the operation attempts to update file
labels and catalog entries.
If the PURGEDATA operation fails, PURGEDATA leaves the object or file marked
corrupt. To clear the corrupt flag, correct whatever problem caused the operation to
fail and repeat the PURGEDATA command.
PURGEDATA does not apply to audited tables that reside on nodes running
versions of SQL/MP software earlier than version 300.
If a file has dependent indexes, you must first drop them, purge the data, alter the
table to drop any partitions, and re-create the indexes.
The PURGEDATA operation temporarily invalidates the table and indexes to
prevent concurrent access by other users until the data is purged. If an error
occurs after the table is marked invalid but before the PURGEDATA operation
begins, the table is revalidated, and the data remains unchanged.
If an error occurs during the PURGEDATA operation and the operation fails to
complete, PURGEDATA leaves the table marked as corrupt. To recover, resolve
the problem that caused the first attempt to fail, then reissue the PURGEDATA
command.
After purging the data, the PURGEDATA operation validates the table and indexes
so that they are accessible to other users.
In some cases, you might need to reopen the table after the PURGEDATA
operation. For example, if there is an Embedded SQL program that has a cursor
defined as SELECT query with the BROWSE access option, while fetching rows
from this cursor, if data from the table (which this cursor refers) is purged using the
PURGEDATA operation, then the FETCH operation might fail with error 8204.
Examples—PURGEDATA
This example clears all tables and files other than catalog tables or SQL program
files on subvolume $VOL1.PERSNL and lists the names of the cleared files and
tables:
>> PURGEDATA $VOL1.PERSNL.*;
The confirmation message might look like this:
DATA ARE PURGED FROM TABLE $VOL1.PERSNL.DEPT
DATA ARE PURGED FROM TABLE $VOL1.PERSNL.JOB
DATA ARE PURGED FROM TABLE $VOL1.PERSNL.EMPLOYEE
DATA ARE PURGED FROM 3 OBJECT(S)
This example clears data from the partition $NY.SALES.ACCTS without clearing
other partitions of the table:
>> PURGEDATA $NY.SALES.ACCTS, PARTONLY NO LISTALL;
DATA ARE PURGED FROM 1 OBJECTS(S)