Back up the IBM DB2 source database that contains the MDM Hub Store. Then copy and restore the backup on the target database. When you are finished, the target database has the same tablespaces as the source database.
On the source system, navigate to the following directory:
stored procedure in an editor. Replace the example values with values for your source database, and save the file.
Run the stored procedure.
C:/> db2 -tvf 0_PREPARE_DB_FOR_REPLICATION.db2
The stored procedure turns off transaction mode, sets the directory for log files, and creates a backup of the database.
Copy the backup file to a directory on the target system. Make a note of the timestamp in the file name.
For example, given a backup name of SRCDB.0.DB2.NODE0000.CATN0000.20150917213129.001, use 20150917213129 as the backup timestamp.
On the target system, navigate to the directory that contains the saved backup.
Restore the source database into the target database and create a generic restore script. In the following command, substitute the names of the databases as necessary and specify the timestamp of the backup:
D:\zdt\BACKUPS\SRCDB> db2 "RESTORE DB
srcdb
TAKEN AT
backup timestamp
INTO
tgtdb
REDIRECT GENERATE SCRIPT restore_2tgtdb.db2"
Open the generic restore script
restore_2tgtdb.db2
in an editor. Specify a directory path on the target system for the log files and data files.
LOGTARGET 'D:/db2data/tgtdb/logs'
NEWLOGPATH 'D:/db2data/tgtdb/LOGS'
For each tablespace:
FILE 'D:/db2data/tgtdb/<
tablespace name
>/<
dat file name
>.dat
Save the file.
Drop the target database.
D:\> db2 drop db
tgtdb
Restore the target database.
D:\zdt\BACKUPS\SRCDB> db2 -tvf restore_2tgtdb.db2
The restore process creates all the tablespaces in the specified directory.