Books
in black and white
Main menu
Share a book About us Home
Books
Biology Business Chemistry Computers Culture Economics Fiction Games Guide History Management Mathematical Medicine Mental Fitnes Physics Psychology Scince Sport Technics
Ads

Teradata RDBMS Database Administration - NCR

NCR Teradata RDBMS Database Administration - NCR , 2004. - 616 p.
Download (direct link): teradatadatabaseadmin2004.pdf
Previous << 1 .. 117 118 119 120 121 122 < 123 > 124 125 126 127 128 129 .. 218 >> Next


RELEASE LOCK, FILE=MYDATA2 LOGOFF ;

COPY Statement

Use the COPY statement to recreate tables and/or databases that have been dropped or to restore them to the same system or to a different system.

The COPY statement:

Uses an archived file to recreate tables and/or databases that have been dropped.

Copies archived files to a different system.

Can replace the creator name of the copied object(s) with the name of the current user (the user submitting the COPY command). Otherwise, the name of the original creator is retained.

The COPY statement can perform one of the following tasks:

Copy an object that has been dropped back into the original system.

Copy an object from one system to another.

Copy an object back to the same system.

Example 1

Example 1 copies an archived data table called Personnel.Department from an archive file to a different RDBMS system.

COPY DATA TABLE (Personnel.Department) ,File=ARChive;

Example 2

Example 2 copies the same archived data table from its old database, OldPersonnel, to a new database.

The no fallback option indicates that the new table is to be non fallback on the receiving system even though it may have been fallback on the original one.

The NO JOURNAL option indicates that you do not want permanent journaling on this table in the receiving database.

COPY DATA TABLE (Personnel.Department)

(FROM (OldPersonnel), NO JOURNAL, NO FALLBACK)

,file=archive ;

Teradata RDBMS Database Administration

8 - 25 Chapter 8: Archiving, Restoring and Recovering Data

Restore-Related Statements

BUILD Statement

The BUILD statement recreates unique and non-unique secondary indexes on non-fallback and fallback tables. This statement also builds fallback rows for fallback tables when the restore statement was performed with the NO BUILD option, and generates journal tables by sorting the change images.

You must rebuild indexes for non-fallback tables after a restore operation if any of the following situations occur:

An AMP is offline during a dump or restore

The restore operation is not an all-AMP restore

The archive did not include the INDEXES option

The restore included the NO BUILD option

Example

The following example illustrates the Build statement. The example builds unique and non-unique secondary indexes for all tables on the archive tape. The release lock option removes the utility lock after successful completion of the build operation.

BUILD DATA TABLES (Personnel) ALL , RELEASE LOCK;

Changing the State of RI Tables with REVALIDATE REFERENCES FOR

When either a referenced (Parent) or referencing (Child) table is restored, the reference is marked inconsistent in the database dictionary definitions. As a result, the system does not allow application users to execute UPDATE, INSERT, or DELETE statements on such tables.

The REVALIDATE REFERENCES FOR statement validates the inconsistencies, thereby allowing users to execute UPDATE, INSERT and DELETE statements on the tables. The functions performed by this statement include:

Validates the inconsistent reference index on the target table and its buddy table

Creates an error table

Inserts into the error table rows that fail the referential constraint specified by the reference index

If inconsistent restraints remain after you execute the statement, you can use the ALTER TABLE DROP INCONSISTENT REFERENCES statement to remove them. To use the REVALIDATE REFERENCES FOR statement, the username you have specified in the LOGON statement must have one of the following privileges (for more details, see "Using Referential Integrity" on page 7-7):

RESTORE privileges on the table you are re-validating

Ownership privileges on the database or table

8 - 32

Teradata RDBMS Database Administration 8 - 25 Chapter 8: Archiving, Restoring and Recovering Data

Restore-Related Statements

RELEASE LOCK Statement

The ARC utility places locks on database objects while it performs archive and restore activities. These locks are referred to as utility-level locks.

Note: The ARC utility does not automatically release these locks upon successful completion of an ARC command.

In fact, these locks remain intact even when an AMP goes down and comes back online. You must submit the RELEASE LOCK statement to remove the locks.

Not everyone can issue the release lock statement. You must have either the DUMP or the RESTORE privilege on the locked object.

You can also release a utility-level lock if you are the owner of the locked object.

You may submit the RELEASE LOCK option at the same time you issue ARCHIVE, ROLLBACK, ROLLFORWARD, RESTORE, and BUILD commands. This accomplishes the same purpose as issuing the RELEASE LOCK statement.

Teradata RDBMS Database Administration

8 - 25 Chapter 8: Archiving, Restoring and Recovering Data

Restore-Related Statements

Restoring After a Down AMP

Assume the following:
Previous << 1 .. 117 118 119 120 121 122 < 123 > 124 125 126 127 128 129 .. 218 >> Next