Friday, June 21, 2013

How take DB2 database backup, setup in Linux environment?

Check DB directory list

[db2inst1@nodexxxx ~]$ db2 list db directory
System Database Directory
Number of entries in the directory = 1
Database 1 entry:
 Database alias                       = DBXXX
 Database name                        = DBXXX
 Local database directory             = /home/db2inst1
 Database release level               = b.00
 Comment                              =
 Directory entry type                 = Indirect
 Catalog database partition number    = 0
 Alternate server hostname            =
 Alternate server port number         =

[db2inst1@nodexxxx ~]$ ls -l
drwxr-xr-x  2 db2inst1 db2grp1 4096 Feb 15 15:35 backup_store

[db2inst1@nodexxxx ~]$ cd backup_store/

[db2inst1@nodexxxx backup_store]$ db2 backup db DBXXX compress
SQL1035N  The database is currently in use.  SQLSTATE=57019

[db2inst1@nodexxxx backup_store]$ db2 force application all
DB20000I  The FORCE APPLICATION command completed successfully.
DB21024I  This command is asynchronous and may not be effective immediately.

[db2inst1@nodexxxx backup_store]$ db2 backup db DBXXX compress
Backup successful. The timestamp for this backup image is : 20130218184329

[db2inst1@nodexxxx backup_store]$ ls -l
total 353652
-rw-r----- 1 db2inst1 db2grp1 361779200 Feb 18 18:46 DBXXX.0.db2inst1.NODE0000.CATN0000.20130218184329.001

 

No comments:

Post a Comment