About Replacing Databases - Teradata Data Mover

Teradata® Data Mover User Guide - 20.01

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
Lake
VMware
Product
Teradata Data Mover
Release Number
20.01
Published
November 2023
Language
English (United States)
Last Update
2023-12-05
dita:mapPath
hlv1700545853003.ditamap
dita:ditavalPath
mpm1591127278842.ditaval
dita:id
don1467241476387
Product Category
Analytical Ecosystem

When you copy all objects in a database by specifying <database selection="included">, Data Mover copies all of the tables from the source to the target, but leaves any additional tables that exist in the target database intact. For example, if the source database contains tables A, B, and C and the target contains tables A, B, C, and D, tables A, B, and C are copied from the source to the target database, and table D remains on the target database.

The database replacement feature enables you to completely overwrite or "replace" a database on the target system by eliminating all of the objects in the target database and replacing them with those on the source. Any additional tables that existed on the target database but not on the source are removed. You replace a database by setting an optional replaceDatabase attribute as true, as shown here:
<database selection="included" replaceDatabase="true">
     <name>MyDatabase</name>
</database>
The default value for the replaceDatabase attribute is "false" if not specified. If the attribute is set as <replaceDatabase="false"> or is not specified at all, the tables on the target that do not exist on the source remain on the target after the entire database is copied.
When using DSA and the source or target database is earlier than Teradata Database 16.20, Data Mover overwrites the target database regardless of the replaceDatabase value.