You can relocate all objects from a source database to a different target database. To copy all objects in a source to a different target database, add the target_database element and specify the name of the target database. You can only specify target_database if you specify selection = "included". Specifying the target_database element when selection= "all" results in a create time error.
The target database must exist before creating the job. Data Mover does not create the database on the target system.
- Add the target_database element.
- Specify the name of the target database.
In the following example, objects in the database MySourceDB are copied to the target database MyTargetDB.
<database selection="included"> <name>MySourceDB</name> <target_database> <name>MyTargetDB</name> </target_database> </database>
When relocating an entire database, Teradata ARC does not automatically copy the join and hash indexes from the source database. The join or hash index to be copied to the target needs to be specified in the XML. The index is created on the relocated table on the target. The join or hash index itself is not relocated. In the following example, hash index MyDB.orders_hi is copied to the target database MyDB. Because the associated table MyDB.Orders is being relocated to MyTargetDB, the hash Index is created on the table MyTargetDB.Orders on the target.
<database selection="included"> <name>MyDB</name> <target_database> <name>MyTargetDB</name> </target_database> </database> <indices> <index selection="included"> <name>Orders_hi</name> <index_database>MyDB</index_database> <index_type>HASH_INDEX</index_type> <associate_table> <database>MyDB</database> <table>Orders</table> </associate_table> </index> </indices>