Run the db2move and the db2look commands
if you encounter problems when you run the db2 backup and
the db2 restore commands, or if you want to clone
your source DB2® database to
a DB2 instance of HADR.
Before you begin
- Ensure that your system has sufficient space to back up databases.
The size that is required for the backup depends on the size of your
production databases.
- Ensure that your deployment manager and all the managed nodes
in the source deployment environment are stopped.
Procedure
To clone a DB2 database
to a DB2 instance by running
the db2move and the db2look commands,
complete the following steps:
- Run the following command to export data on the DB2 instance of the source environment:
db2move DATABASE_NAME export
where DATABASE_NAME can be monitor or
cognos.
- Run the following command to generate an SQL file on the DB2 instance of the source environment:
db2look -d DATABASE_NAME -e -a -l -o DATABASE_SQL_NAME
where DATABASE_NAME can
be monitor or cognos, and DATABASE_NAME is the
name of the generated SQL file.Note: Check the generated SQL file
and modify the settings according to your target environment. For
example, modify the path of tablespace.
- Copy the export and SQL files for the DB2 database from the source DB2 node to the target DB2 node.
- Ensure that your deployment manager and all the managed
nodes in the target deployment environment are stopped.
- Run the following command to execute the SQL file on the DB2 node of the target environment:
db2 -tvf DATABASE_SQL_NAME -l LOG_NAME
where DATABASE_SQL_NAME is
the name of the generated SQL file, and LOG NAME is
the name of the generated log.
- Run the following command to import data:
db2move DATABASE_NAME import -io insert
where DATABASE_NAME can
be monitor or cognos.Note: Modify the sequence of the tables in
db2move.lst to
ensure that the parent table is created in front of the child table.
For
example, move the following tables to the end of
db2move.lst to
ensure that the dependency tables are created in front of the following
tables:
- "MONBS00"."AC_MEMBER"
- "MONBS00"."FILESTORE_FILE"
- "MONBS00"."WIDGET_DEFINITION"
- "MONBS00"."WIDGET_INSTANCE"
- "MONBS00"."WIDGET_WINDOW"