Copying Partitioned Data
Selected partitions of PPI tables can be copied. This means that one or more partitions of a table can be backed up so that only a subset of data in a table can be archived, restored, and copied.
Before attempting to copy selected partitions, read “Potential Data Risks When Archiving/Restoring Selected Partitions” on page 38.
Restrictions on Copying Partitioned Data
Normally, the table to be copied does not need to exist in the target database. The table must exist, however, in the target database to copy selected partitions to the table. Additionally, the target table must be a full table, not just selected partitions.
Copying selected partitions is not allowed to a table that has undergone any of the following major DDL changes:
Other restrictions exist for archiving selected partitions. See “Restrictions on Archiving Selected Partitions” on page 179.
Keywords for Copying Selected Partitions
The options available for copying selected partitions include:
PARTITIONS WHERE Keyword
Use the PARTITIONS WHERE option to specify the conditional expression for selected partitions. The expression must contain the definition of the partitions that will be copied. The following restrictions apply to the use of PARTITIONS WHERE:
LOG WHERE Keyword
If the PARTITIONS WHERE option does not capture all the rows that need to be copied, use the LOG WHERE option. This option inserts, into a Teradata-generated error table, archived rows that both fall outside the partitions specified by the PARTITIONS WHERE conditional expression and match the LOG WHERE conditional expression.
Use the option only if PARTITIONS WHERE is also specified for the object. If LOG WHERE is omitted, the default is to log to the error table only the rows in the partitions being restored that have errors.
ERRORDB/ERRORTABLES Keyword
The ERRORDB and ERRORTABLES options are mutually exclusive; specify only one option for an object. Also, specify either the PARTITIONS WHERE or ALL PARTITIONS option when using either ERRORDB or ERRORTABLES.
ALL PARTITIONS Keyword
Use the ALL PARTITIONS option to copy all of the archived partitions in a table. These restrictions apply:
If a conditional expression is not well-defined, Teradata ARC issues an error. Use PARTITIONS WHERE for the restore operation rather than ALL PARTITIONS.
QUALIFIED PARTITIONS Keyword
Use this option only to copy a specific-AMP archive after copying selected partitions from an all-AMP archive that was done while an AMP is down.