db2 Backup Restore
db2 Backup Restore
db2 Backup Restore
####################################################################
2) offline backup
3) offline restore
drop database
Note :- If you have multiple images for same db then use taken at parameter
00001 SYSCATSPACE
00002 USERSPACE1
00003 SYSTOOLSPACE
----------------------------------------------------------------------------
Comment: DB2 BACKUP TESTDB OFFLINE
Start Time: 20210204122735
End Time: 20210204122736
Status: A
----------------------------------------------------------------------------
EID: 2 Location: /db2home/db2inst1
################## db2ckbkp TESTDB.0.db2inst1.DBPART000.20210204122735.001
=====================
MEDIA HEADER REACHED:
=====================
Server Database Name -- TESTDB
Server Database Alias -- TESTDB
Client Database Alias -- TESTDB
Timestamp -- 20210204122735
Database Partition Number -- 0
Instance -- db2inst1
Database Configuration Type -- 0 (Non-shared data)
Sequence Number -- 1
Database Member ID -- 0
Release ID -- 0x1400 (DB2 v11.1.3.3)
AL version -- V:11 R:1 M:3 F:3 I:0 SB:0
Database Seed -- 0x939564AA
DB Comment's Codepage (Volume) -- 0
DB Comment (Volume) --
DB Comment's Codepage (System) -- 0
DB Comment (System) --
Authentication Value -- 255 (Not specified)
Backup Mode -- 0 (Offline)
Includes Logs -- 0 (No)
Compression -- 0 (No Library Applied)
Backup Type -- 0 (Database-level)
Backup Granularity -- 0 (Non-incremental)
Merged Backup Image -- 0 (No)
Status Flags -- 0x1
Consistent on this member
System Catalogs in this image -- 1 (Yes)
Catalog Partition Number -- 0
DB Codeset -- UTF-8
DB Territory -- US
LogID -- 1612433494
LogPath --
/db2home/db2inst1/db2inst1/NODE0000/SQL00064/LOGSTREAM0000/
Backup Buffer Size -- 16781312 (4097 4K pages)
Number of Sessions -- 1
Platform -- 0x1E (Linux-x86-64)
Encrypt Info Flags -- 0x0
#################################################
db2 backup monitor
ID = 990599
Type = BACKUP
Database Name = TESTDB
Member Number = 0
Description = offline db
Start Time = 02/04/2021 12:40:25.735300
State = Executing
Invocation Type = User
Throttling:
Priority = Unthrottled
Progress Monitoring:
Estimated Percentage Complete = 36
###################################################################################
#######
###################################################################################
########
db2 "update db cfg for testdb using LOGARCHMETH1
'DISK:/db2home/db2inst1/TEST_LOGS'"
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
[db2inst1@TCS-PCM-183 TEST_LOGS]$
[db2inst1@TCS-PCM-183 TEST_LOGS]$
[db2inst1@TCS-PCM-183 TEST_LOGS]$ db2 backup db testdb online incremental
[db2inst1@TCS-PCM-183 TEST_LOGS]$
[db2inst1@TCS-PCM-183 TEST_LOGS]$
[db2inst1@TCS-PCM-183 TEST_LOGS]$ db2ckrst -d testdb -t 20210204125520 -r database
Member ID = 0
Rollforward status = DB pending
Next log file to be read = S0000004.LOG
Log files processed = -
Last committed transaction = 2021-02-04-12.55.19.000000 Local
Rollforward Status
Member ID = 0
Rollforward status = not pending
Next log file to be read =
Log files processed = S0000000.LOG - S0000000.LOG
Last committed transaction = 2021-02-04-10.55.06.000000 UTC
[db2inst1@TCS-PCM-183 ~]$ db2 "rollforward db testdb query status using local time"
Rollforward Status
Member ID = 0
Rollforward status = DB pending
Next log file to be read = S0000002.LOG
Log files processed = -
Last committed transaction = 2021-02-04-13.09.15.000000 Local
Rollforward Status
Rollforward Status
Member ID = 0
Rollforward status = not pending
Next log file to be read =
Log files processed = S0000002.LOG - S0000002.LOG
Last committed transaction = 2021-02-04-11.25.16.000000 UTC
#########################################################