Example 2: DB-Level Restore Using Two Restore Statements - Teradata Tools and Utilities

Teradata® Archive/Recovery Utility Reference

Product
Teradata Tools and Utilities
Release Number
16.20
Published
March 2019
Language
English (United States)
Last Update
2019-06-05
dita:mapPath
fac1527114221922.ditamap
dita:ditavalPath
Audience_PDF_include.ditaval
dita:id
B035-2412
Product Category
Teradata Tools and Utilities

DB-level Archive:

ARCHIVE DATA TABLES
(SYSDBA),
RELEASE LOCK,
FILE=ARCHIVE;

DB-level Restore with Exclude tables from the DB-level Archive:

RESTORE DATA TABLES
  (SYSDBA)
    (EXCLUDE TABLES (TransactionHistory)),
RELEASE LOCK,
FILE=ARCHIVE;

TB-level Selected Partitions Restore from the DB-level Archive:

RESTORE DATA TABLES
 (SYSDBA.TransactionHistory)
   ( PARTITIONS WHERE
    (! TransactionDate = DATE ‘2004-03-15’
     !) ),
RELEASE LOCK,
FILE=ARCHIVE;

When you break down the restore into two separate restore statements, each restore statement requires a rewind back to the beginning of the archive file. Now, when the TB-level Selected Partitions Restore statement is executed, you don't need to do a backward reposition since you are already at the beginning of the archive file. You can just read forward in the archive file to find the PPI table. This will avoid the following error: The sequence of calls is incorrect.