To provide security and data integrity, Teradata Database provides the backup and archive facility. The backup and recovery of data is very critical in case of system crush, which leads to data corruption, or when developers want to rebuild a table with new columns or definitions. Backup and recovery comes to the rescue in many cases.
The ARCHIVE
command allows you to back up objects in a database to media (tape). The following diagram shows the syntax for ARCHIVE
command:
Teradata ARC orange book
In this recipe, we will back up one of the databases along with all the object in that database.
You need to be connected to the Teradata arcmain
utility. To archive the database, the user must be granted the ARCHIVE
and SELECT
privileges on the database to be archived. This can be checked in the following code:
/*GRANT Archive to archive role*/ GRANT RESTORE, DUMP ON DATABASENAME TO ARCH_ROLE; GRANT ARCH_ROLE to ARCH01