DB2监控备份、恢复进度

session1中执行备份:

[db2inst1@db ~]$ db2 backup db test to /db2data/


session2中使用如下命令监控备份进度:
[db2inst1@db db2data]$ db2 list utilities show detail
ID                               = 2
Type                             = BACKUP
Database Name                    = TEST
Partition Number                 = 0
Description                      = offline db 
Start Time                       = 10/17/2017 22:54:37.300623
State                            = Executing
Invocation Type                  = User
Throttling:
   Priority                      = Unthrottled
Progress Monitoring:
   Estimated Percentage Complete = 51
      Total Work                 = 17150073271 bytes
      Completed Work             = 8759459743 bytes
      Start Time                 = 10/17/2017 22:54:37.300638




[db2inst1@db db2data]$ db2 list utilities show detail
ID                               = 2
Type                             = BACKUP
Database Name                    = TEST
Partition Number                 = 0
Description                      = offline db 
Start Time                       = 10/17/2017 22:54:37.300623
State                            = Executing
Invocation Type                  = User
Throttling:
   Priority                      = Unthrottled
Progress Monitoring:
   Estimated Percentage Complete = 53
      Total Work                 = 17150073271 bytes
      Completed Work             = 9095036831 bytes
      Start Time                 = 10/17/2017 22:54:37.300638


[db2inst1@db db2data]$ db2 list utilities show detail


ID                               = 2
Type                             = BACKUP
Database Name                    = TEST
Partition Number                 = 0
Description                      = offline db 
Start Time                       = 10/17/2017 22:54:37.300623
State                            = Executing
Invocation Type                  = User
Throttling:
   Priority                      = Unthrottled
Progress Monitoring:
   Estimated Percentage Complete = 57
      Total Work                 = 17150073271 bytes
      Completed Work             = 9724243871 bytes
      Start Time                 = 10/17/2017 22:54:37.300638


[db2inst1@db db2data]$ db2 list utilities show detail
ID                               = 2
Type                             = BACKUP
Database Name                    = TEST
Partition Number                 = 0
Description                      = offline db 
Start Time                       = 10/17/2017 22:54:37.300623
State                            = Executing
Invocation Type                  = User
Throttling:
   Priority                      = Unthrottled
Progress Monitoring:
   Estimated Percentage Complete = 69
      Total Work                 = 17150073271 bytes
      Completed Work             = 11874341791 bytes
      Start Time                 = 10/17/2017 22:54:37.300638


 
[db2inst1@db db2data]$ db2 list utilities show detail
ID                               = 2
Type                             = BACKUP
Database Name                    = TEST
Partition Number                 = 0
Description                      = offline db 
Start Time                       = 10/17/2017 22:54:37.300623
State                            = Executing
Invocation Type                  = User
Throttling:
   Priority                      = Unthrottled
Progress Monitoring:
   Estimated Percentage Complete = 99
      Total Work                 = 17150073271 bytes
      Completed Work             = 17060404127 bytes
      Start Time                 = 10/17/2017 22:54:37.300638




[db2inst1@db db2data]$ db2 list utilities show detail


ID                               = 2
Type                             = BACKUP
Database Name                    = TEST
Partition Number                 = 0
Description                      = offline db 
Start Time                       = 10/17/2017 22:54:37.300623
State                            = Executing
Invocation Type                  = User
Throttling:
   Priority                      = Unthrottled
Progress Monitoring:
   Estimated Percentage Complete = 100
      Total Work                 = 17150073271 bytes
      Completed Work             = 17065647519 bytes
      Start Time                 = 10/17/2017 22:54:37.300638

 

session1中备份显示结束:

[db2inst1@db ~]$ db2 backup db test to /db2data/

Backup successful. The timestamp for this backup image is : 20171017225437


使用如下命令检测备份文件的有效性:
[db2inst1@db ~]$ db2ckbkp /db2data/TEST.0.db2inst1.NODE0000.CATN0000.20171017225437.001 
[1] Buffers processed:  ##########################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################


Image Verification Complete - successful.

[db2inst1@db ~]$ 





恢复:

session1执行恢复操作:

[db2inst1@db home]$ db2 restore db TEST from /home taken at 20171017225437 into test
SQL2523W  Warning!  Restoring to an existing database that is different from 
the database on the backup image, but have matching names. The target database 
will be overwritten by the backup version.  The Roll-forward recovery logs 
associated with the target database will be deleted.
Do you want to continue ? (y/n) y


session2监控恢复进度:

[db2inst1@db ~]$ db2 list utilities show detail
ID                               = 1
Type                             = RESTORE
Database Name                    = TEST
Partition Number                 = 0
Description                      = db 
Start Time                       = 10/19/2017 22:35:59.633842
State                            = Executing
Invocation Type                  = User
Progress Monitoring:
      Completed Work             = 3651899392 bytes
      Start Time                 = 10/19/2017 22:35:59.633860


[db2inst1@db ~]$ db2 list utilities show detail
ID                               = 1
Type                             = RESTORE
Database Name                    = TEST
Partition Number                 = 0
Description                      = db 
Start Time                       = 10/19/2017 22:35:59.633842
State                            = Executing
Invocation Type                  = User
Progress Monitoring:
      Completed Work             = 3714863104 bytes
      Start Time                 = 10/19/2017 22:35:59.633860

或者

[db2inst1@db ~]$ db2pd -utilities


Database Partition 0 -- Active -- Up 0 days 01:04:30


Utilities:
Address            ID         Type                   State      Invoker    Priority   StartTime           DBName   NumPhases  CurPhase   Description         
0x0000000200DBE340 1          RESTORE                0          0          0          Thu Oct 19 22:35:59 TEST     1           1           db                  


Progress:
Address            ID         PhaseNum   CompletedWork                TotalWork                    StartTime           Description           
0x0000000200DBE6C8 1          1          6884036608 bytes             Unknown                      Thu Oct 19 22:35:59 n/a   

你可能感兴趣的:(DB2)