Using Keywords with ARCHIVE - TARA/ABU

Teradata Archive/Recovery Utility Reference

Product
TARA/ABU
Release Number
15.00
Language
English (United States)
Last Update
2018-09-25
dita:id
B035-2412
lifecycle
previous
Product Category
Teradata Tools and Utilities

Using Keywords with ARCHIVE

ARCHIVE is affected by the following keywords. For information about keywords that are specific to archiving selected partitions in a PPI table, see “Archiving Selected Partitions of PPI Tables” on page 178.

AMP Keyword

With Teradata Database, use the AMP=n option to specify up to five AMPs. If a specified processor is not online when the archive is for a particular database or table, Teradata ARC does not archive any data associated with that AMP.

This option archives individual processors and is useful for following up an all-AMPs or cluster archive when the AMPs were offline. Use this option only with the NO FALLBACK TABLES or JOURNAL TABLES option. Specify the option for (database DBC) ALL to automatically exclude database DBC.

CLUSTER Keyword

When using the CLUSTER keyword, maintain a dictionary archive for the same databases, stored procedures, or tables. Cluster archiving improves archive and recovery performance of very large tables and simplifies specific AMP restoring of non-fallback tables.

A complete cluster archive can restore all databases, stored procedures, and tables if it includes:

  • A dictionary archive of the databases, tables, or stored procedures
  • A set of cluster archives
  • A set of specific AMP archives (if archiving non-fallback tables and AMPs were offline during the cluster archive) so all data is contained in archive files
  • Create a dictionary archive whenever the tables in the cluster archive might be redefined.

    Although it is necessary to generate a dictionary archive only once if tables are not redefined, make a dictionary archive regularly in case an existing dictionary archive is damaged.

    If a cluster archive is created over several days and a table is redefined in that archive, create an all-AMPs archive of the changed tables. Otherwise, the table structure might differ between archive files.

    When archiving journal tables, archive the saved subtable created by a previous checkpoint. Consequently, it is not necessary to use locks on the data tables that are using the journal table. The Teradata Database places an internal lock on the saved journal subtable to prevent a concurrent deletion of the subtable.

    The following rules govern the CLUSTER keyword:

  • The option is allowed only when archiving data tables.
  • A dictionary archive must be performed before a cluster archive.
  • If any AMPs in the clusters are offline, archive non-fallback tables from those AMPs when they are brought back online.
  • Utility locks are placed and released at the cluster level.
  • The dictionary archive contains data stored in the dictionary tables of the Teradata Database for the different objects being archived. Do the following to ensure that the table data in the cluster archive matches the dictionary definition in the dictionary archive:

  • Archive clusters on tables with definitions that never change.
  • Create the dictionary archive immediately prior to the cluster archives, without releasing Teradata ARC locks. Then initiate a set of cluster archive requests covering all AMPs.
  • Do not archive database DBC in cluster archive operations. However, specifying DBC (ALL) is supported. In this case, database DBC is excluded automatically by Teradata ARC.

    RELEASE LOCK Keyword

    Notice:

    Releasing a HUT lock while another Teradata ARC job is running could result in data corruption and/or unexpected errors from ARCMAIN or the Teradata Database.

    This can occur if a HUT lock is explicitly released during an ARC job, or if multiple jobs are run concurrently on the same object with the same Teradata user, with each job specifying the RELEASE LOCK option. For example, a database-level archive, with one or more tables excluded, is run concurrently with a table-level archive of the excluded tables. In this situation, the RELEASE LOCK for the database-level job will release the table-level locks if the job completes first.

    Use different Teradata users for each archive job when running concurrent archives against the same objects. This ensures that locks placed by one job are not released by another.

    For the purposes of locking, a set of cluster archive jobs, with each job archiving different clusters, counts as only a single job running against the object. If all concurrent jobs running on an object archive different sets of clusters, it is acceptable to use the same Teradata user for each of the cluster archive jobs.

    INDEXES Keyword

    Specifying the INDEXES keyword increases the time and media required for an archive. This option does not apply to journal table archives. The option is ignored for cluster and specific AMP archives.

    The INDEXES keyword usually causes Teradata ARC to archive unique and non-unique secondary indexes on all data tables. However, if an AMP is offline, Teradata ARC only archives unique secondary indexes on fallback tables. Therefore, for the INDEXES keyword to be most effective, do not use it when AMPs are offline.

    If the archive applies a group read HUT lock, Teradata ARC writes no indexes to the archive file.

    ABORT Keyword

    For cluster archives, Teradata ARC only considers AMPs within the specified clusters. The ABORT keyword does not affect specific AMP archives.

    GROUP Keyword

    To avoid the full read HUT lock that Teradata ARC normally places, specify USE GROUP READ LOCK for a rolling HUT lock. (It is also possible to avoid the full read HUT lock by initiating an online archive using the ONLINE option during an ALL AMPS archive, or by using LOGGING ONLINE ARCHIVE ON.)

    If the GROUP keyword is specified, the Teradata Database:

    1 Applies an access HUT lock on the whole table.

    2 Applies a read HUT lock sequentially on each group of rows in the table as it archives them, then:

  • Releases that read HUT lock.
  • Applies another read HUT lock on the next group of rows to be archived.
  • 3 After the last group of rows is archived, releases the last group read HUT lock and the access HUT lock on the table.

    Using the GROUP keyword locks out updates to a table for a much shorter time than an archive operation without the option. The size of the locked group is approximately 64,000 bytes.

    A transaction can update a table while the table is being archived under a group read HUT lock. If an update occurs, the archive might contain some data rows changed by the transaction and other data rows that were not changed. In this case, the archived copy of the table is complete only when used in conjunction with the after image journal created by the transaction.

    Use a group read HUT lock only for tables with an after image journal. This means that online backups of database-level objects also require every table in the database have after-journaling defined. If a table is excluded as part of a database-level GROUP READ LOCK archive, it must still have an after-journal table defined so ARC can accept the GROUP READ LOCK option.

    If a group read HUT lock is specified for tables without an after image journal, the Teradata Database does not archive the table, and it prints an error message.

    If the GROUP keyword is not specified and the archive operation references a database, the Teradata Database locks the database. This HUT lock is released after all data tables for the database have been archived.

    If ARCHIVE specifies the archive of individual data tables, the Teradata Database locks each table before it is archived and releases the HUT lock only when the archive of the table is complete. HUT locks are released only if the RELEASE LOCK keywords are specified.

    ONLINE Keyword

    The ONLINE keyword initiates an online archive on a table or database. During an online archive, the system creates and maintains a log for the specified table or a separate log for each table in the specified database. All changes to a table are captured in its log. Each log of changed rows is then archived as part of the archive process. When the archive process completes, the online archive is terminated and the change logs are deleted.

    When a table is restored, the table's change log is restored also. The changed rows in the log are rolled back to the point that existed prior to the start of the archive process. The table is then rolled back to that same point. All tables within the same transaction in the online archive are restored to the same point in the transaction.

    For tables involved in a load operation, see section “Archiving Online” on page 45.

    NOSYNC Keyword

    For information on the NOSYNC keyword as it relates to Online Archive, see “Archiving Online” on page 45.

    KEEP LOGGING Keyword

    The KEEP LOGGING keyword overrides automatic termination of:

  • an ALL AMPs online archive that was initiated with the ONLINE option
  • a cluster online archive that was initiated with LOGGING ONLINE ARCHIVE ON
  • When KEEP LOGGING is used, the online archive process continues after the archive process completes. Changed rows continue to be logged into the change log. Use this keyword with caution: online logging continues until it is terminated manually with LOGGING ONLINE ARCHIVE OFF. If online logging is not terminated, there is a possibility that the logs could fill all available perm space.

    If any table is still enabled for Online Logging either after the archive is finished or due to a graceful abnormal termination of Teradata ARC, a warning message appears that indicates one or more tables are still enabled for online logging. For more details, see section “Archiving Online” on page 45.

    NONEMPTY DATABASE Keywords

    Teradata ARC writes no information to tape about empty objects. If there are many empty users on a system, using these keywords can appreciably reduce the archive time.

    The NONEMPTY keyword is only meaningful when used in conjunction with the ALL option. Using NONEMPTY, without ALL for at least one object, produces an ARC0225 warning message. In this case, the NONEMPTY option is ignored and execution continues.

    Teradata ARC uses the ARC_NonEmpty_List macro to determine which databases to archive. The ARC_NonEmpty_List macro is a DBS macro located in database DBC and is created by the DIP scripts. If this macro was not installed or if you do not have the EXECUTE privilege, Teradata ARC still archives all objects. Thus, if this macro is not installed, the time savings is not realized.