====== DB2 backup / restore ====== Change the database from circular logging to archiving mode: [tsminst1@rhlab01 ~]$ db2start [tsminst1@rhlab01 ~]$ db2 connect to TSMDB1 [tsminst1@rhlab01 ~]$ db2 get db cfg for tsmdb1 | grep ARCH First log archive method (LOGARCHMETH1) = OFF Archive compression for logarchmeth1 (LOGARCHCOMPR1) = OFF Options for logarchmeth1 (LOGARCHOPT1) = [tsminst1@rhlab01 ~]$ db2 update db cfg for tsmdb1 using logarchmeth1 disk:/home/tsminst1/archlog [tsminst1@rhlab01 ~]$ db2 get db cfg for tsmdb1 | grep ARCH First log archive method (LOGARCHMETH1) = DISK:/home/tsminst1/archlog Archive compression for logarchmeth1 (LOGARCHCOMPR1) = OFF Options for logarchmeth1 (LOGARCHOPT1) = [tsminst1@rhlab01 ~]$ db2pd -db tsmdb1 -logs Database Member 0 -- Database TSMDB1 -- Active -- Up 0 days 00:36:11 -- Date 2017-10-09-10.52.31.488221 Logs: Current Log Number 12 Pages Written 2458 Cur Commit Disk Log Reads 0 Cur Commit Total Log Reads 0 Method 1 Archive Status n/a Method 1 Next Log to Archive 12 .... Put you DB into circular mode: [tsminst1@rhlab01 ~]$ db2 update db cfg for tsmdb1 using logarchmeth1 off ===== Local clone ===== Local named pipe (DB2 > v9.7), backup and restore into the same machine, in the same instance (also possible into another instance) $ db2start $ mkfifo /tmp/mydb2.bkp $ db2 connect to MYDB2 $ db2 get snapshot for tablespaces on MYDB2 $ db2 connect reset First start the restore process, that is waiting for PIPE to be used $ db2 restore db MYDB2 from /backup into MYDB2_clone redirect Then start in a second windows, the backup using the PIPE $ db2 backup db MYDB2 to /backup In the restore Windows, you 'll be ask for changing the name of the cloned DB, as source is MYDB2, target will be MYDB2_clone, answer **yes** Once done, add a container (dbf file), for the clone database $ db2 "set tablespace containers for 3 using(file '/home/db2inst1/mydb2_clone/mydb2_clone.dbf' 750)" The ID 3 is the source database ID; 750 correspond to the number of pages, check in source snapshot to see the space currently use, and increase a little bit. Now you can continue the restore $ db2 restore db MYDB2 continue Check the progress using $ db2 list utilities show detail Now you will be backup process and restore, with percent progress. Useful when trying to upgrade, instance can be move back, but database not. Once finished: $ db2 connect to MYDB2_clone $ db2 list tablespaces show detail $ db2 get snapshot for tablespaces on MYDB2_clone $ db2 connect reset ===== Cloning using FlashCopy Manager ===== Commands: fcmcli -f create_clone fcmcli -f refresh_clone fcmcli -f delete_clone fcmcli -f inquire_detail_clone ===== Copy a DB and catalog it ===== Your requirement is similar to cloning database using a split mirror. You can try following steps * Create instance db2inst1 on new machine if it is not created during db2 installation * Copy NODE0000 directory to location /home/db2inst1/db2inst1 * Set owner to db2inst1 for directory NODE0000 and all sub-directories and files under NODE0000 * Catalog database you want to access. Example: **db2 catalog db commdb on /home/db2inst1** * Connect to database: **db2 connect to commdb; db2 list tablespaces**