分类: DB2/Informix
2013-12-22 13:27:22
1、对数据库进行在线全备
Db2 backup database test online
2、查看备份过程中的表空间状态
db2 "select DBPARTITIONNUM, tbsp _id,substr(tbsp _name,1,20) as tbsname,tbsp _state from sysibmadm.tbsp>
DBPARTITIONNUM TBSP_ID TBSNAME TBSP_STATE
-------------- -------------------- -------------------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0 0 SYSCATSPACE BACKUP_IN_PROGRESS
0 1 SYSTOOLSPACE BACKUP_IN_PROGRESS
0 2 SYSTOOLSTMPSPACE NORMAL
0 3 PSAPTEMP NORMAL
0 4 PSAPBTABD BACKUP_IN_PROGRESS
0 5 PSAPBTABI BACKUP_IN_PROGRESS
0 6 PSAPCLUD BACKUP_IN_PROGRESS
0 7 PSAPCLUI BACKUP_IN_PROGRESS
0 8 PSAPDDICD BACKUP_IN_PROGRESS
0 9 PSAPDDICI BACKUP_IN_PROGRESS
0 10 PSAPDOCUD BACKUP_IN_PROGRESS
0 11 PSAPDOCUI BACKUP_IN_PROGRESS
0 12 PSAPEL46CD BACKUP_IN_PROGRESS
0 13 PSAPEL46CI BACKUP_IN_PROGRESS
0 14 PSAPES46CD BACKUP_IN_PROGRESS
0 15 PSAPES46CI BACKUP_IN_PROGRESS
0 16 PSAPLOADD BACKUP_IN_PROGRESS
0 17 PSAPLOADI BACKUP_IN_PROGRESS
0 18 PSAPPOOLD BACKUP_IN_PROGRESS
0 19 PSAPPOOLI BACKUP_IN_PROGRESS
0 20 PSAPPROTD BACKUP_IN_PROGRESS
0 21 PSAPPROTI BACKUP_IN_PROGRESS
0 22 PSAPSOURCED BACKUP_IN_PROGRESS
0 23 PSAPSOURCEI BACKUP_IN_PROGRESS
0 24 PSAPSTABD BACKUP_IN_PROGRESS
0 25 PSAPSTABI BACKUP_IN_PROGRESS
0 26 PSAPUSER1D BACKUP_IN_PROGRESS
0 27 PSAPUSER1I BACKUP_IN_PROGRESS
28 record(s) selected.
可以看见,备份过程中,除了俩个临时表空间(临时表空间不会被备份)的状态是normal,其他的表空间都是在备份一启动就被设置为backup in progress状态。
也可以用list命令查看
db2 list tablespaces show detail
Tablespaces for Current Database
Tablespace ID = 0
Name = SYSCATSPACE
Type = Database managed space
Contents = All permanent data. Regular table space.
State = 0x0800
Detailed explanation:
Backup in progress
Total pages = 436800
Useable pages = 436480
Used pages = 436320
Free pages = 160
High water mark (pages) = 436320
Page size (bytes) = 4096
Extent size (pages) = 32
Prefetch size (pages) = 3200
Number of containers = 10
Minimum recovery time = 2010-11-28-01.19.43.000000
Tablespace ID = 1
Name = SYSTOOLSPACE
Type = Database managed space
Contents = All permanent data. Regular table space.
State = 0x0800
Detailed explanation:
Backup in progress
Total pages = 25600
Useable pages = 25520
Used pages = 2656
Free pages = 22864
High water mark (pages) = 2656
Page size (bytes) = 4096
Extent size (pages) = 8
Prefetch size (pages) = 800
Number of containers = 10
Minimum recovery time = 2009-03-28-14.40.05.000000
Tablespace ID = 2
Name = SYSTOOLSTMPSPACE
Type = System managed space
Contents = User Temporary data
State = 0x0000
Detailed explanation:
Normal
Total pages = 10
Useable pages = 10
Used pages = 10
Free pages