Category Archives: DB2

Cara Backup dan Restore DB2 – OS yang sama

Berikut ini adalah cara Backup dan Restore database DB2 dengan OS yang sama.

Backup :

1.db2 deactivate database <nama_db>
2.db2 force applications all
3.db2 backup database btn to <lokasi backup>  ex: d:\btn\backup, /home/db2inst1/backupdb/
Restore :

1. copy image backup file (ex:BTN.0.DB2.NODE0000.CATN0000.20120224085107.001) ke suatu folder [ex: c:\backup, /home/db2inst1/backupdb/]

2.db2 deactivate database <nama_db>
3.db2 force applications all
4. db2 restore database [nama_database] from [folder_file_backup] on [folder_db2_data]
into [nama_database] redirect without prompting

explain:
[nama_database] => nama database, ex: btn
[folder_file_backup] => folder di step 2, ex: c:\backup
[folder_db2_data] => folder letak data2 table db2 disimpan, secara default C:\
jika terdapat c:\DB2\NODE0000, maka isi C:\
atau(di linux)

db2 force applications all
db2 restore db btn_wb from /home/db2inst1/backupdb/ into btn_wb redirect
5. db2 restore database btn_wb continue

Advertisements