Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can the database on one platform be restored on another platform ?

Database Backup/Restore

Can the database on one platform be restored on another platform ?

by  sathyarams  Posted    (Edited  )
With DB2 Version 8, you can take a backup from any big-endian server and restore it to any other big-endian server. For example, you can restore a backup image from DB2 for HP-UX to DB2 for AIX« or Sun Solaris. This does not apply to Windows and Linux, however.

If you do not fall under the above category, continue reading ...

If the source and the new target databases are on different operating system platforms, it is not possible to use DB2 UWOÆs BACKUP and RESTORE Utilities to create a copy of the database.

In this scenario, use the following procedure to create a copy of the database:

i)Create a new database on the target platform
Note : Have both the USEREXIT and LOGRETAIN database parameterÆs as OFF until all data from the source database is loaded into this new database.

ii) Use the db2look output of the source to create database objects on the target
(Eg of db2look command on source
db2look -d <dbname> -z <schema> -i <user> -w <password> -o <output file name> -e -x
)

iii) On the source database, issue the following command from the system command prompt :
db2move <dbname> EXPORT

This will export all the tables in the source database to IXF format files to the current directory. The following files are created :

Db2move.lst - The list of original filenames and corresponding tables
tabnnn.ixf - Table Data
tabnnn.msg - Export messages for the corresponding tables
EXPORT.out - The EXPORT summary

The db2move command can be issued either from the source server or from a remote client. If issuing this command from a remote client, give the userid and password as parameters for db2move.

iv) Copy db2move.lst and all tabnnn.ixf files to a directory in the target database server. Use zip/tar utility to copy the files from the source to the target or use æbinaryÆ mode in ftp to transfer the ixf files.
v) On the system command prompt at the target database server, with the current directory as the one with the above files, issue
Db2move <new db name> LOAD
This will load all the table data exported from the source database into the target database.

The following files are created during the LOAD Process.
LOAD.out - LOAD Summary
Tabnnn.out - LOAD message file for the corresponding table

There could be more to do after the LOAD depending on your environment, as examples
1) SET INTEGIRTY
2) Resetting Identity Columns

Additional Points:

1) You may wish to copy your db and dbm cfg and db2 environment varaibales.
2) If you have any extenders, you will need to enable them on the new db before creating tables etc.
3) You will need to create database objects in order. A suggested order will be :

(i) bufferpools
(ii) sequences
(iii) tablespaces
(iv) tables(and triggers), indexes and primary keys
(v) foreign keys
(vi) aliases
(vii) Stored Procedures
(Please make a note of other objects you use)
4) After loading data,do runstats and rebind any packages you have built.
5) Define node and db directory.

Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top