Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Database Backup/Restore

Can the database on one platform be restored on another platform ? by sathyarams
Posted: 14 Nov 02 (Edited 21 Jun 03)

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
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.

Back to IBM: DB2 FAQ Index
Back to IBM: DB2 Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close