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 .. 120 121 122 123 124 125 < 126 > 127 128 129 130 131 132 .. 218 >> Next


ROLLBACK Statement

To recover from one or more transaction errors, use the ROLLBACK statement. To use this statement, you must define the table with a before-image journal table. The ROLLBACK is performed to a checkpoint or to the beginning of the current or restored journal.

The system uses the before images to replace any changes made to the table or database since a particular checkpoint was taken.

The ROLLBACK command helps you recover from one or more transaction errors. It reverses changes made to a database or table. To accomplish this reversal, it replaces existing data table rows with before-change images stored in a permanent journal.

The before-change images must reside in either the restored or current subtables of a permanent journal. If you choose the current subtable for rollback procedures, the database uses the contents of both the active and saved subtables.

When you use the restored subtable for rollback procedures, you need to verify it contains the desired journal table. If it does not, submit the RESTORE

8 - 10 Teradata RDBMS Database Administration

Chapter 8: Archiving, Restoring and Recovering Data

Arc Recovery versus FastLoad

JOURNAL TABLE command with the appropriate removable storage media. This process ensures that you restore the correct subtable contents. The Teradata database does not have any simple tools for looking at journal subtables to determine that they contain the desired data.

Checkpoint names need to match existing names used with a previous CHECKPOINT statement. An eventno is the software-supplied event number of a previous checkpoint. You can supply either one of these or both. To find the checkpoint names or event numbers, select information about the checkpoint from the DBC.Events view.

If there are duplicate checkpoint names in the journal and an event number is not supplied, rollback stops at the first one encountered with a matching name.

The following illustrates a rollback procedure:

Step Action
1 First, activate the ROLLBACK CURRENT JOURNAL statement to rollback any changes made since the journal table was archived. This statement rolls back the saved subtable first followed by the active subtable.
2 Next, run the RESTORE JOURNAL TABLE command to load the appropriate archive file into the restored subtable of the permanent journal.
3 Finally, submit the ROLLBACK RESTORED JOURNAL command to reverse the changes by replacing any changed rows with their before-image rows stored in the restored journal. Repeat Steps 2 and 3 as necessary.

By default, the rollback procedure automatically deletes the contents of the restored subtable after successfully completing the command. The NO DELETE option lets you overrides the default.

NO DELETE has the following benefits:

Overrides automatic deletion of restored subtables, allowing you to:

Recover selected tables first

Later recover other tables that may have changes in the journal

Is used only for restored subtables

Is never used with current subtables

8 - 10

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

Arc Recovery versus FastLoad

ROLLFORWARD Statement

The ROLLFORWARD command helps you recover from a hardware error. It changes existing rows in data tables by replacing them with after-change images stored in a permanent journal. The after-change images must reside in either the restored or current subtables of a permanent journal.

When you use the restored subtable for rollforward procedures, you need to verify that it contains the desired journal table.

If it does not, submit the RESTORE JOURNAL TABLE command with the appropriate portable storage media. This ensures that you restore the correct subtable.

Also, before you can rollforward, you must have a backup copy of the table rows and AFTER Image journal rows since the last backup.

A description of some of the options follows:

ROLLFORWARD Option Description
PRIMARY DATA During a rollforward operation, this option instructs the software to ignore secondary index and fallback row updates. A BUILD operation will rebuild the invalidated fallback copy and indexes.
TO checkpointname, eventno Checkpoint names need to match existing names used with a previous CHECKPOINT statement. An event number is the software-supplied event number of a previous checkpoint. You can supply either one or both of these. To find the checkpoint names or event numbers, select information about the checkpoint from the DBC.Events view. If there are duplicate checkpoint names in the journal and an event number is not supplied, rollback stops when it encounters with a matching name.

The following illustrates a rollforward procedure:

Step Action
1 Submit the RESTORE DATA TABLE command.
2 Submit the RESTORE JOURNAL TABLE command to load the appropriate archive files into the restored permanent journal subtable.

8 - 10 Teradata RDBMS Database Administration
Previous << 1 .. 120 121 122 123 124 125 < 126 > 127 128 129 130 131 132 .. 218 >> Next