Wednesday, February 8, 2017

Copy vs Restore in Teradata


==================================================
What are the difference between COPY and RESTORE
==================================================

Restore is used to...

Well restore the contents back to the original object that was archived.

ie

If you had archived mydb.table1 in TD system TDDB,

then you can RESTORE the that table contents from the archive to mydb.table1 in TD system TDDB.

If you wanted to put in another TD system say TDDB2 you would have to use copy. or

If you wanted to put it in another db/table name in the same TD System (TDDB) you would still have to use copy.

Restore ensures that all the object ids (tableid/dbid etc) match exactly as it was when it was archived.
with copy, new structures and object ids are created.There's one scenario when you can use restore to restore an Object in another TD system.

That's when you first restore the DBC.


===========================================
Copy vs. Restore
===========================================

The difference between copy and restore depends on the kind of operation being performed:

• A restore operation moves data from archived files back to the same Teradata Database
from which it was archived or moves data to a different Teradata Database so long as
database DBC is already restored.

• A copy operation moves data from an archived file to any existing Teradata Database and
creates a new object if one does not already exist on that target database. (The target object
does not have to exist, however, the database must already exist.) When selected partitions are copied, the table must exist and be a table that was previously copied as a full-table copy.

1 comment:

  1. Nice tutorial. The Teradata tutorial was help ful for me. Keep Sharing Tutorials.

    ReplyDelete