Wednesday, February 8, 2017

Information about Archive in Teradata

If a multi-stream archive includes database DBC, the archive must be split into 2 separate jobs to maintain the integrity of their backed up data and to preserve  the performance improvements with using multiple, parallel streams:

      1) Archive database DBC as a stand-alone single-stream job

            LOGON DBC,DBC;
           ARCHIVE DATA TABLES (DBC),
           RELEASE LOCK,
           FILE=ARCHIVE;
           LOGOFF;

      2) Archive the user data in a separate job, which can be run as single-stream
         or multi-stream

         LOGON DBC,DBC;
         ARCHIVE DATA TABLES (DBC) ALL,
           EXCLUDE (DBC),
           RELEASE LOCK,
           FILE=ARCHIVE;
         LOGOFF;

   If multi-stream is not required (ie, performance is not an issue), then a full system archive      can be run as a single single-stream archive job:

           LOGON DBC,DBC;
           ARCHIVE DATA TABLES (DBC) ALL,
           RELEASE LOCK,
           FILE=ARCHIVE;
           LOGOFF;

  Note: If users have older multi-stream archives which include database DBC, they should                follow the procedure above to re-run the DBC archive as a single-stream job to                        maintain the integrity of their backup data.

 The ARC scripts currently used to perform the backups are as follows:

Job 1:  This is only dbc backup (No other db's backup)

LOGON TDP1/DBC, 9q76GVp2;
ARCHIVE DATA TABLES (DBC),
RELEASE LOCK,
FILE=DBCBKUP;
LOGOFF;

Job : 2  This is for all database backup (DBC + under DBC users ,DB's

LOGON TDP1/DBC, 9q76GVp2;
ARCHIVE DATA TABLES (DBC) ALL,
RELEASE LOCK,
FILE=DBCBKUP;
LOGOFF;

Job 3:

LOGON TDP1/BACKUPUSER, yXk73PmA;
ARCHIVE DATA TABLES
 (DB1),
 (DB2),
 (DB3),
 (DB4),
USE GROUP READ LOCK,
RELEASE LOCK,
FILE=ALLAMPA;
CHECKPOINT (JOURNAL_DB.JNLTABLE),
WITH SAVE,
NAMED CHKPT1;

ARCHIVE JOURNAL TABLES (JOURNAL_DB.JNLTABLE),
RELEASE LOCK,
FILE=JOURNALA;

DELETE SAVED JOURNAL (JOURNAL_DB.JNLTABLE);

LOGOFF;


Job 4: Exclude more than 2 tables while taking backup

LOGON TDP1/BACKUPUSER2, yXk73PmA;
ARCHIVE DATA TABLES
 (DBC) ALL,
EXCLUDE
 (DBC),
 (DB1),
 (DB2),
 (DB3),
 (DB4),
RELEASE LOCK,
FILE=ALLAMPB;
LOGOFF;

In the case of a restore, the site has to consider which job(s) contain the objects that need
to be restored, and create scripts appropriate for the type of backup used for those objects.
In the case of a full-system restore, all four backup files (DBC, non-online, online, and
journal) must be restored, and the journal rollforward step will need to be performed on
all four databases from the online archive. In the case of a single table restore, an
appropriate restore script must be created—if the table is in one of the four online archive
databases, then the script must restore the table from the online data file, restore the
journal archive, and perform a journal rollforward on the restored table. An example of a
single-table restore from the GROUP READ LOCK archive follows:

LOGON TDP1/BACKUPUSER, yXk73PmA;
RESTORE DATA TABLES
 (DB2.TRANSACTIONS),
RELEASE LOCK,
FILE=ALLAMPA;

RESTORE JOURNAL TABLES
 (JOURNAL_DB.JNLTABLE),
RELEASE LOCK,
FILE=JOURNALA;

ROLLFORWARD
 (DB2.TRANSACTIONS),
TO CHKPT1,
RELEASE LOCK,
USE RESTORED JOURNAL;
LOGOFF;



No comments:

Post a Comment