Question & Answer
Question
What is the command syntax to backup using single system view SSV, restore and rollforward a partitioned database ?
Cause
Demonstrating correct syntax to backup a partitioned database, restore and rollforward database. Example uses syntax applicable to DB2 LUW v10.1 and up.
Answer
Backup database command can be run only on the catalog partition. By default, this will include logs for each partition when single system view backup is used.
- db2 "BACKUP DATABASE dpfbar ON all dbpartitionnums TO /someshareddir/backupdir"
Restore database command must restore the catalog partition first particularly if redirect is used, then the other partitions. Use logtarget to specify where the logs for each partition must be extracted to.
- db2_all "<<+0<; db2 RESTORE DB dpfbar FROM /someshareddir/backupdir TAKEN AT 20150702020621 INTO clonedpf LOGTARGET /someshareddir/logtgt/ $N WITHOUT PROMPTING"
db2_all "<<-0<; db2 RESTORE DB dpfbar FROM /someshareddir/backupdir TAKEN AT 20150702020621 INTO clonedpf LOGTARGET /someshareddir/logtgt/ $N WITHOUT PROMPTING"
Rollforward command must be run only on the catalog partition.
- db2 "ROLLFORWARD DB clonedpf TO END OF BACKUP OVERFLOW LOG PATH('/someshareddir/logtgt') NORETRIEVE"
Related Information
[{"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Recovery - Backup","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"10.1;10.5;11.1","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21961524