Home > Veritas Storage Foundation™ for DB2 Manual Pages

DB2ED_CLONEDB (1)

User Commands

Table of contents


NAME

db2ed_clonedb - clone a DB2 database to the same or a different instance, allowing the two databases to co-exist

SYNOPSIS

To create a clone database:

db2ed_clonedb [ -I SOURCE_INSTANCE ] -S SOURCE_DATABASE


     [ -T TARGET_DATABASE ] -c CKPT_NAME -m MOUNT_POINT
     [ -l TARGET_DATABASE_REDOLOG_DIRECTORY ]
     [ -i | a RECOVERY_LOG_LOCATION ]
     [ -h ]

To restart,unmount or remove a clone database:

db2ed_clonedb -o umount | restartdb [-d] [-h]


AVAILABILITY

This command is part of Veritas Storage Foundation for DB2. To determine whether this product is installed on an \1 system, type:

lslpp -L VRTSdb2ed


DESCRIPTION

The db2ed_clonedb command is used to create a copy of an existing DB2 database (the primary database), cloning all existing containers to new locations. Cloning an existing DB2 database requires a writable Storage Checkpoint, where a clone database needs to reside on the same host as the existing database. The primary database remains unaffected.

The db2ed_clonedb command must be run from the target instance. The target environment must be configured correctly for the primary database. Be sure you have enough space to create a clone instance on your system.

db2ed_clonedb creates a mounted, writable clone of an DB2 database. The new database is given a new name and mount point, as specified by arguments to the command. The db2ed_clonedb command is designed to work with a mounted,writable Storage Checkpoint of a DB2 database. If the Storage Checkpoint is already mounted, the mount point should be identical to that used to mount the Storage Checkpoint. If the Storage Checkpoint has not been mounted (for example, using the db2ed_ckptmount command), db2ed_clonedb will automatically mount the Storage Checkpoint as read-write at the specified mount point. The new DB2 database is given a new name and containers are given a new location, as specified by arguments to db2ed_clonedb.

Options -I, -S, -T, -c, -m, and -l are specified for the cloning function. Options -a and -i are specified to define recovery behavior. No recovery operation is possible if neither the -a nor the -i option is defined.

If the -a option is specified, db2ed_clonedb will perform cloning and attempts to do a minimum recovery automatically by accessing the archived log without user interaction. The estimated minimum required archive logs will be played back for the recovery process. If the -i option is specified, db2ed_clonedb will prompt you to complete the DB2 recovery process with the new database. This allows you the option of performing point-in-time recovery or a complete recovery. For information about DB2 recovery, see the documentation for your version of DB2.


OPTIONS

The following options are supported:
-I SOURCE_INSTANCE
Specifies the name of the source DB2 instance. If the instance name is not specified, the current user will be the source instance owner.
-S SOURCE_DATABASE
Specifies the name of the source DB2 database that will be cloned.
-T TARGET_DATABASE
Specifies the name of the new DB2 database that will be created.
-c CKPT_NAME
Specifies the name of the Storage Checkpoint to use for creating the new database. The Storage Checkpoint is mounted automatically during the cloning process, if necessary.
-m MOUNT_POINT
Specifies the location of the database to be cloned. It should be identical to the mount point supplied to the db2ed_ckptmount command used when mounting the Storage Checkpoint.
-l TARGET_DB_REDOLOG_DIRECTORY
Specifies the redo log directory of the target database.
-i
Sets interactive mode.

For an online Storage Checkpoint (that is, one that was created when the database was active), the user will be prompted for the archived log location and asked whether they want to do a minimum recovery or a complete recovery.

For an offline Storage Checkpoint (that is, one that was created when the database was inactive), the database wil be ready after db2ed_clonedb finishes and no recovery process is needed.

-a RECOVERY_LOG_DESTINATION
Specifies the archive log destination for recovering the database. db2ed_clonedb tries to do a minimum recovery automatically by accessing the archived log. With this option specified, db2ed_clonedb will find the minimum required logs (or, if it cannot find or access the log, it will display an error message), and then recover the database automatically.

For an offline Storage Checkpoint, the -a option is ignored since the database is ready after db2ed_clonedb finishes and no recovery processs is necessary. For an online Storage Checkpoint, db2ed_clonedb tries to recover the database and displays DB2 error messages if it cannot find or access the log.

-h
Shows command usage.
-o umount | restartdb
The -o umount option shuts down the clone database and unmounts the Storage Checkpoint of the file system. The -o restartdb option mounts the Storage Checkpoint of the file system. The -o restartdb option will not attempt to recover the clone database.
-d
This option is only for use with the -o umount option. If the -d option is specified, the Storage Checkpoint used to create the clone database will be removed along with the clone database.

NOTES

db2ed_clonedb is designed to work with VxFS file systems and mounted Storage Checkpoints. Other types of file systems are not supported with this command.

If neither the -i or -a options are specified, db2ed_clonedb clones the database and no recovery process is initiated.

db2ed_clonedb only works when the instance is up.


EXAMPLES

Assume the DB2 instance has a database PROD with a Storage Checkpoint (Checkpoint_1049927758).

To clone a DB2 instance with manual DB2 recovery:


$ /opt/VRTS/bin/db2ed_clonedb -S PROD -T PRODclone \.br
-c Checkpoint_1049927758  -m /db2clone/target_db1

To clone a DB2 instance with automatic DB2 recovery:


$ /opt/VRTS/bin/db2ed_clonedb -S PROD -T PRODclone \.br
-c Checkpoint_1049927758 -m /db2clone/target_db2 \.br
-a /db2clone/db2inst1/NODE0000/SQL00002/SQLOGDIR/

To clone a DB2 instance with interactive DB2 recovery:


$ /opt/VRTS/bin/db2ed_clonedb -S PROD -T PRODclone \.br
-c Checkpoint_1049927758 -m /db2clone/target_db3 -i


SEE ALSO

db2ed_ckptcreate(1M), db2ed_ckptdisplay(1M), db2ed_ckptmount(1M), db2ed_ckptpolicy(1M), db2ed_ckptquota(1M), db2ed_ckptremove(1M), db2ed_ckptrollback(1M), db2ed_ckptumount(1M), db2ed_update(1M), db2_edition(7)

Veritas Storage Foundation for DB2 Administrator's Guide

Last updated: 13 Dec 2004
Copyright ©2009 Symantec Corporation
All rights reserved.