分类: DB2/Informix
2013-07-27 21:31:44
<
1、在一个CLP中启动一个备份进程
db2 backup database nit online to /db2/NIT/db2backup
2、在另一个CLP中,使用命令进行查看此备份进程
db2 list applications show detail
CONNECT Auth Id Application Name Appl. Application Id Seq# Number of Coordinating DB Coordinator Status Status Change Time DB Name DB Path
Handle Agents partition number pid/thread
-------------------------------------------------------------------------------------------------------------------------------- -------------------- ---------- -------------------------------------------------------------- ----- ---------- ---------------- --------------- ------------------------------ -------------------------- -------- --------------------
DB2NIT db2fw4 38151 *LOCAL.DB2.130724075437 00001 1 0 9370 Connect Completed 07/24/2013 09:54:28.243810 NIT /db2/NIT/db2nit/NODE0000/SQL00001/
DB2NIT db2taskd 38144 *LOCAL.DB2.130724075430 00001 1 0 2707 UOW Waiting 07/27/2013 05:48:18.060123 NIT /db2/NIT/db2nit/NODE0000/SQL00001/
DB2NIT db2fw3 38150 *LOCAL.DB2.130724075436 00001 1 0 9113 Connect Completed 07/24/2013 09:54:28.242194 NIT /db2/NIT/db2nit/NODE0000/SQL00001/
DB2NIT db2stmm 38143 *LOCAL.DB2.130724075429 00001 1 0 15486 UOW Waiting 07/27/2013 05:49:21.431527 NIT /db2/NIT/db2nit/NODE0000/SQL00001/
DB2NIT db2fw2 38149 *LOCAL.DB2.130724075435 00001 1 0 8856 Connect Completed 07/24/2013 09:54:28.240569 NIT /db2/NIT/db2nit/NODE0000/SQL00001/
DB2NIT db2evmg_DB2DETAILDEA 38155 *LOCAL.DB2.130724075441 00001 1 0 10398 Connect Completed 07/24/2013 09:54:28.354142 NIT /db2/NIT/db2nit/NODE0000/SQL00001/
DB2NIT db2fw1 38148 *LOCAL.DB2.130724075434 00001 1 0 8599 Connect Completed 07/24/2013 09:54:28.238961 NIT /db2/NIT/db2nit/NODE0000/SQL00001/
DB2NIT db2fw7 38154 *LOCAL.DB2.130724075440 00001 1 0 10141 Connect Completed 07/24/2013 09:54:28.248635 NIT /db2/NIT/db2nit/NODE0000/SQL00001/
DB2NIT db2fw0 38147 *LOCAL.DB2.130724075433 00001 1 0 3734 Connect Completed 07/24/2013 09:54:28.237365 NIT /db2/NIT/db2nit/NODE0000/SQL00001/
DB2NIT db2fw6 38153 *LOCAL.DB2.130724075439 00001 1 0 9884 Connect Completed 07/24/2013 09:54:28.247030 NIT /db2/NIT/db2nit/NODE0000/SQL00001/
DB2NIT db2bp 43166 *LOCAL.db2nit.130727034909 00001 5 0 11239 Performing a Backup 07/27/2013 05:49:09.635901 NIT /db2/NIT/db2nit/NODE0000/SQL00001/
DB2NIT db2lused 38146 *LOCAL.DB2.130724075432 00001 1 0 3477 UOW Waiting 07/27/2013 05:43:18.473040 NIT /db2/NIT/db2nit/NODE0000/SQL00001/
DB2NIT db2fw5 38152 *LOCAL.DB2.130724075438 00001 1 0 9627 Connect Completed 07/24/2013 09:54:28.245419 NIT /db2/NIT/db2nit/NODE0000/SQL00001/
DB2NIT db2wlmd 38145 *LOCAL.DB2.130724075431 00001 1 0 3220 Connect Completed 07/24/2013 09:54:28.233807 NIT /db2/NIT/db2nit/NODE0000/SQL00001/
可以看到,此application处于“Performing a Backup”状态,这个就是正在进行备份操作的的application
3、使用快照观察此application
db2 get snapshot for application AGENTID 43166
从一大堆的输出中,我们关注以下内容:
Application Snapshot
Application handle = 43166
Application status = Performing a Backup
Status change time = 07/27/2013 05:49:09.635901
Application code page = 1208
Application country/region code = 0
DUOW correlation token = *LOCAL.db2nit.130727034909
Application name = db2bp
Application ID = *LOCAL.db2nit.130727034909
Sequence number = 00001
TP Monitor client user ID =
TP Monitor client workstation name =
TP Monitor client application name =
TP Monitor client accounting string =
Connection request start timestamp = 07/27/2013 05:49:09.581808
Connect request completion timestamp = 07/27/2013 05:49:09.583199
Application idle time = 42 seconds
……
Snapshot timestamp = 07/27/2013 05:49:51.071589
……
UOW log space used (Bytes) = 0
Previous UOW completion timestamp = 07/27/2013 05:49:09.583199
Elapsed time of last completed uow (sec.ms)= 0.000000
UOW start timestamp = 07/27/2013 05:49:09.583199
UOW stop timestamp = 07/27/2013 05:49:09.583199
UOW completion status =
4、查看当前的备份进度状况
db2 list utilities
ID = 26
Type = BACKUP
Database Name = NIT
Partition Number = 0
Description = online db
Start Time = 07/27/2013 05:49:09.659604
State = Executing
Invocation Type = User
Throttling:
Priority = Unthrottled
Progress Monitoring:
Estimated Percentage Complete = 75
5、强制杀死这个备份进程
db2 "force application(43166)"
DB20000I The FORCE APPLICATION command completed successfully.
DB21024I This command is asynchronous and may not be effective immediately.
确实不是立即生效,因为,发出命令后,紧接着再查数据库备份的进度情况,还是有信息的:
db2 list utilities
ID = 26
Type = BACKUP
Database Name = NIT
Partition Number = 0
Description = online db
Start Time = 07/27/2013 05:49:09.659604
State = Executing
Invocation Type = User
Throttling:
Priority = Unthrottled
Progress Monitoring:
Estimated Percentage Complete = 89
但是,过了一小会,就没信息输出了:
db2 list utilities
SQL1611W No data was returned by Database System Monitor. SQLSTATE=00000
同时,CLP窗口一中报错:
db2 backup database nit online to /db2/NIT/db2backup
SQL1224N The database manager is not able to accept new requests, has
terminated all requests in progress, or has terminated the specified request
because of an error or a forced interrupt. SQLSTATE=55032
查看也没有备份生成,备份被force掉了
ls
查看备份历史,里面也有报错信息:
Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log Backup ID
-- --- ------------------ ---- --- ------------ ------------ --------------
B D 20130727054909001 N D S0000153.LOG
----------------------------------------------------------------------------
Contains 32 tablespace(s):
00001 SYSCATSPACE
00002 SYSTOOLSPACE
00003 NIT#DDICD
00004 NIT#DDICI
00005 NIT#USER1D
00006 NIT#USER1I
00007 NIT#BTABD
00008 NIT#BTABI
00009 NIT#STABD
00010 NIT#STABI
00011 NIT#POOLD
00012 NIT#POOLI
00013 NIT#DOCUD
00014 NIT#DOCUI
00015 NIT#ES701D
00016 NIT#ES701I
00017 NIT#SOURCED
00018 NIT#SOURCEI
00019 NIT#PROTD
00020 NIT#PROTI
00021 NIT#LOADD
00022 NIT#LOADI
00023 NIT#CLUD
00024 NIT#CLUI
00025 NIT#EL701D
00026 NIT#EL701I
00027 NIT#ODSD
00028 NIT#ODSI
00029 NIT#DIMD
00030 NIT#DIMI
00031 NIT#FACTD
00032 NIT#FACTI
----------------------------------------------------------------------------
Comment: DB2 BACKUP NIT ONLINE
Start Time: 20130727054909
End Time: 20130727055109
Status: A
----------------------------------------------------------------------------
EID: 855 Location: /db2/NIT/db2backup
SQLCA Information
sqlcaid : SQLCA sqlcabc: 136 sqlcode: -1224 sqlerrml: 0
sqlerrmc:
sqlerrp : sqlubPol
sqlerrd : (1) 0 (2) 0 (3) 0
(4) 0 (5) 0 (6) 0
sqlwarn : (1) (2) (3) (4) (5) (6)
(7) (8) (9) (10) (11)
sqlstate:
报错信息的错误号都是1224
6、检查db2diag文件,查看其中的操作记录
2013-07-27-05.49.09.584815+120 E12787391A471 LEVEL: Info
PID : 15204508 TID : 11239 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 11239 EDUNAME: db2agent (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqluxGetDegreeParallelism, probe:762
DATA #1 :
Autonomic BAR - using parallelism = 4.
2013-07-27-05.49.09.585936+120 E12787863A506 LEVEL: Info
PID : 15204508 TID : 11239 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 11239 EDUNAME: db2agent (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqluxGetAvailableHeapPages, probe:876
DATA #1 :
Autonomic BAR - heap consumption.
Targetting (50%) - 4960 of 9920 pages.
2013-07-27-05.49.09.586080+120 E12788370A497 LEVEL: Info
PID : 15204508 TID : 11239 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 11239 EDUNAME: db2agent (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubTuneBuffers, probe:1127
DATA #1 :
Autonomic backup - tuning enabled.
Using buffer size = 1233, number = 4.
2013-07-27-05.49.09.659617+120 E12788868A443 LEVEL: Info
PID : 15204508 TID : 11239 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 11239 EDUNAME: db2agent (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubSetupJobControl, probe:1604
MESSAGE : Starting an online db backup.
可以看到,在真正开始备份前,application 43166还进行了一些调整工作,诸如调整内存,分配并行度等,然后,就开始备份了,如下所示;
2013-07-27-05.49.09.856154+120 E12789312A516 LEVEL: Info
PID : 15204508 TID : 10736 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 10736 EDUNAME: db2bm.11239.0 (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubBMCont, probe:1221
MESSAGE : Backing up tablespace
DATA #1 : Pool ID, PD_TYPE_POOL_ID, 2 bytes
18
DATA #2 : String, 10 bytes
NIT#ES701D
2013-07-27-05.49.09.859542+120 E12789829A516 LEVEL: Info
PID : 15204508 TID : 10993 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 10993 EDUNAME: db2bm.11239.1 (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubBMCont, probe:1221
MESSAGE : Backing up tablespace
DATA #1 : Pool ID, PD_TYPE_POOL_ID, 2 bytes
19
DATA #2 : String, 10 bytes
NIT#ES701I
2013-07-27-05.49.09.860624+120 E12790346A514 LEVEL: Info
PID : 15204508 TID : 11506 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 11506 EDUNAME: db2bm.11239.2 (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubBMCont, probe:1221
MESSAGE : Backing up tablespace
DATA #1 : Pool ID, PD_TYPE_POOL_ID, 2 bytes
12
DATA #2 : String, 9 bytes
NIT#STABD
2013-07-27-05.49.09.861704+120 E12790861A513 LEVEL: Info
PID : 15204508 TID : 11763 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 11763 EDUNAME: db2bm.11239.3 (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubBMCont, probe:1221
MESSAGE : Backing up tablespace
DATA #1 : Pool ID, PD_TYPE_POOL_ID, 2 bytes
6
DATA #2 : String, 9 bytes
NIT#DDICD
2013-07-27-05.49.24.770409+120 E12791375A514 LEVEL: Info
PID : 15204508 TID : 11763 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 11763 EDUNAME: db2bm.11239.3 (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubBMCont, probe:1221
MESSAGE : Backing up tablespace
DATA #1 : Pool ID, PD_TYPE_POOL_ID, 2 bytes
13
DATA #2 : String, 9 bytes
NIT#STABI
2013-07-27-05.49.26.908164+120 E12791890A514 LEVEL: Info
PID : 15204508 TID : 11506 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 11506 EDUNAME: db2bm.11239.2 (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubBMCont, probe:1221
MESSAGE : Backing up tablespace
DATA #1 : Pool ID, PD_TYPE_POOL_ID, 2 bytes
10
DATA #2 : String, 9 bytes
NIT#BTABD
2013-07-27-05.49.34.905976+120 E12792405A514 LEVEL: Info
PID : 15204508 TID : 10993 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 10993 EDUNAME: db2bm.11239.1 (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubBMCont, probe:1221
MESSAGE : Backing up tablespace
DATA #1 : Pool ID, PD_TYPE_POOL_ID, 2 bytes
14
DATA #2 : String, 9 bytes
NIT#POOLD
2013-07-27-05.49.43.202480+120 E12792920A514 LEVEL: Info
PID : 15204508 TID : 11506 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 11506 EDUNAME: db2bm.11239.2 (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubBMCont, probe:1221
MESSAGE : Backing up tablespace
DATA #1 : Pool ID, PD_TYPE_POOL_ID, 2 bytes
15
DATA #2 : String, 9 bytes
NIT#POOLI
2013-07-27-05.49.46.522032+120 E12793435A516 LEVEL: Info
PID : 15204508 TID : 11763 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 11763 EDUNAME: db2bm.11239.3 (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubBMCont, probe:1221
MESSAGE : Backing up tablespace
DATA #1 : Pool ID, PD_TYPE_POOL_ID, 2 bytes
0
DATA #2 : String, 11 bytes
SYSCATSPACE
2013-07-27-05.49.57.587073+120 E12793952A514 LEVEL: Info
PID : 15204508 TID : 10993 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 10993 EDUNAME: db2bm.11239.1 (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubBMCont, probe:1221
MESSAGE : Backing up tablespace
DATA #1 : Pool ID, PD_TYPE_POOL_ID, 2 bytes
11
DATA #2 : String, 9 bytes
NIT#BTABI
2013-07-27-05.50.00.226836+120 E12794467A513 LEVEL: Info
PID : 15204508 TID : 11763 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 11763 EDUNAME: db2bm.11239.3 (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubBMCont, probe:1221
MESSAGE : Backing up tablespace
DATA #1 : Pool ID, PD_TYPE_POOL_ID, 2 bytes
7
DATA #2 : String, 9 bytes
NIT#DDICI
2013-07-27-05.50.03.435520+120 E12794981A517 LEVEL: Info
PID : 15204508 TID : 11506 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 11506 EDUNAME: db2bm.11239.2 (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubBMCont, probe:1221
MESSAGE : Backing up tablespace
DATA #1 : Pool ID, PD_TYPE_POOL_ID, 2 bytes
20
DATA #2 : String, 11 bytes
NIT#SOURCED
2013-07-27-05.50.06.011203+120 E12795499A517 LEVEL: Info
PID : 15204508 TID : 11506 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 11506 EDUNAME: db2bm.11239.2 (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubBMCont, probe:1221
MESSAGE : Backing up tablespace
DATA #1 : Pool ID, PD_TYPE_POOL_ID, 2 bytes
21
DATA #2 : String, 11 bytes
NIT#SOURCEI
2013-07-27-05.50.06.259528+120 E12796017A514 LEVEL: Info
PID : 15204508 TID : 10993 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 10993 EDUNAME: db2bm.11239.1 (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubBMCont, probe:1221
MESSAGE : Backing up tablespace
DATA #1 : Pool ID, PD_TYPE_POOL_ID, 2 bytes
22
DATA #2 : String, 9 bytes
NIT#PROTD
2013-07-27-05.50.06.331364+120 E12796532A514 LEVEL: Info
PID : 15204508 TID : 11763 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 11763 EDUNAME: db2bm.11239.3 (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubBMCont, probe:1221
MESSAGE : Backing up tablespace
DATA #1 : Pool ID, PD_TYPE_POOL_ID, 2 bytes
23
DATA #2 : String, 9 bytes
NIT#PROTI
2013-07-27-05.50.07.115404+120 E12797047A516 LEVEL: Info
PID : 15204508 TID : 11763 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 11763 EDUNAME: db2bm.11239.3 (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubBMCont, probe:1221
MESSAGE : Backing up tablespace
DATA #1 : Pool ID, PD_TYPE_POOL_ID, 2 bytes
28
DATA #2 : String, 10 bytes
NIT#EL701D
2013-07-27-05.50.07.841656+120 E12797564A514 LEVEL: Info
PID : 15204508 TID : 11506 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 11506 EDUNAME: db2bm.11239.2 (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubBMCont, probe:1221
MESSAGE : Backing up tablespace
DATA #1 : Pool ID, PD_TYPE_POOL_ID, 2 bytes
16
DATA #2 : String, 9 bytes
NIT#DOCUD
2013-07-27-05.50.07.964945+120 E12798079A514 LEVEL: Info
PID : 15204508 TID : 11763 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 11763 EDUNAME: db2bm.11239.3 (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubBMCont, probe:1221
MESSAGE : Backing up tablespace
DATA #1 : Pool ID, PD_TYPE_POOL_ID, 2 bytes
17
DATA #2 : String, 9 bytes
NIT#DOCUI
2013-07-27-05.50.08.276675+120 E12798594A517 LEVEL: Info
PID : 15204508 TID : 10993 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 10993 EDUNAME: db2bm.11239.1 (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubBMCont, probe:1221
MESSAGE : Backing up tablespace
DATA #1 : Pool ID, PD_TYPE_POOL_ID, 2 bytes
5
DATA #2 : String, 12 bytes
SYSTOOLSPACE
2013-07-27-05.50.08.499490+120 E12799112A514 LEVEL: Info
PID : 15204508 TID : 11763 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 11763 EDUNAME: db2bm.11239.3 (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubBMCont, probe:1221
MESSAGE : Backing up tablespace
DATA #1 : Pool ID, PD_TYPE_POOL_ID, 2 bytes
24
DATA #2 : String, 9 bytes
NIT#LOADD
2013-07-27-05.50.08.645899+120 E12799627A514 LEVEL: Info
PID : 15204508 TID : 11763 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 11763 EDUNAME: db2bm.11239.3 (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubBMCont, probe:1221
MESSAGE : Backing up tablespace
DATA #1 : Pool ID, PD_TYPE_POOL_ID, 2 bytes
25
DATA #2 : String, 9 bytes
NIT#LOADI
2013-07-27-05.50.08.821783+120 E12800142A516 LEVEL: Info
PID : 15204508 TID : 11763 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 11763 EDUNAME: db2bm.11239.3 (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubBMCont, probe:1221
MESSAGE : Backing up tablespace
DATA #1 : Pool ID, PD_TYPE_POOL_ID, 2 bytes
29
DATA #2 : String, 10 bytes
NIT#EL701I
2013-07-27-05.50.08.885152+120 E12800659A513 LEVEL: Info
PID : 15204508 TID : 10993 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 10993 EDUNAME: db2bm.11239.1 (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubBMCont, probe:1221
MESSAGE : Backing up tablespace
DATA #1 : Pool ID, PD_TYPE_POOL_ID, 2 bytes
26
DATA #2 : String, 8 bytes
NIT#CLUD
2013-07-27-05.50.08.886803+120 E12801173A513 LEVEL: Info
PID : 15204508 TID : 11506 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 11506 EDUNAME: db2bm.11239.2 (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubBMCont, probe:1221
MESSAGE : Backing up tablespace
DATA #1 : Pool ID, PD_TYPE_POOL_ID, 2 bytes
27
DATA #2 : String, 8 bytes
NIT#CLUI
2013-07-27-05.50.09.132561+120 E12801687A515 LEVEL: Info
PID : 15204508 TID : 11506 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 11506 EDUNAME: db2bm.11239.2 (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubBMCont, probe:1221
MESSAGE : Backing up tablespace
DATA #1 : Pool ID, PD_TYPE_POOL_ID, 2 bytes
8
DATA #2 : String, 10 bytes
NIT#USER1D
2013-07-27-05.50.09.174086+120 E12802203A515 LEVEL: Info
PID : 15204508 TID : 11763 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 11763 EDUNAME: db2bm.11239.3 (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubBMCont, probe:1221
MESSAGE : Backing up tablespace
DATA #1 : Pool ID, PD_TYPE_POOL_ID, 2 bytes
9
DATA #2 : String, 10 bytes
NIT#USER1I
2013-07-27-05.50.09.279209+120 E12802719A513 LEVEL: Info
PID : 15204508 TID : 11506 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 11506 EDUNAME: db2bm.11239.2 (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubBMCont, probe:1221
MESSAGE : Backing up tablespace
DATA #1 : Pool ID, PD_TYPE_POOL_ID, 2 bytes
33
DATA #2 : String, 8 bytes
NIT#DIMI
2013-07-27-05.50.09.315099+120 E12803233A514 LEVEL: Info
PID : 15204508 TID : 11763 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 11763 EDUNAME: db2bm.11239.3 (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubBMCont, probe:1221
MESSAGE : Backing up tablespace
DATA #1 : Pool ID, PD_TYPE_POOL_ID, 2 bytes
34
DATA #2 : String, 9 bytes
NIT#FACTD
2013-07-27-05.50.09.333808+120 E12803748A513 LEVEL: Info
PID : 15204508 TID : 10993 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 10993 EDUNAME: db2bm.11239.1 (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubBMCont, probe:1221
MESSAGE : Backing up tablespace
DATA #1 : Pool ID, PD_TYPE_POOL_ID, 2 bytes
30
DATA #2 : String, 8 bytes
NIT#ODSD
2013-07-27-05.50.09.416195+120 E12804262A514 LEVEL: Info
PID : 15204508 TID : 10993 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 10993 EDUNAME: db2bm.11239.1 (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubBMCont, probe:1221
MESSAGE : Backing up tablespace
DATA #1 : Pool ID, PD_TYPE_POOL_ID, 2 bytes
35
DATA #2 : String, 9 bytes
NIT#FACTI
2013-07-27-05.50.09.492086+120 E12804777A513 LEVEL: Info
PID : 15204508 TID : 11506 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 11506 EDUNAME: db2bm.11239.2 (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubBMCont, probe:1221
MESSAGE : Backing up tablespace
DATA #1 : Pool ID, PD_TYPE_POOL_ID, 2 bytes
31
DATA #2 : String, 8 bytes
NIT#ODSI
2013-07-27-05.50.09.534800+120 E12805291A513 LEVEL: Info
PID : 15204508 TID : 10993 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 10993 EDUNAME: db2bm.11239.1 (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubBMCont, probe:1221
MESSAGE : Backing up tablespace
DATA #1 : Pool ID, PD_TYPE_POOL_ID, 2 bytes
32
DATA #2 : String, 8 bytes
NIT#DIMD
经过统计,一共有32个“Backing up tablespace”,这与backup history中的被备份的表空间的个数是一致的;但事实上,数据库中共有34个表空间
0 SYSCATSPACE |
3 PSAPTEMP16 |
4 SYSTOOLSTMPSPACE |
5 SYSTOOLSPACE |
6 NIT#DDICD |
7 NIT#DDICI |
8 NIT#USER1D |
9 NIT#USER1I |
10 NIT#BTABD |
11 NIT#BTABI |
12 NIT#STABD |
13 NIT#STABI |
14 NIT#POOLD |
15 NIT#POOLI |
16 NIT#DOCUD |
17 NIT#DOCUI |
18 NIT#ES701D |
19 NIT#ES701I |
20 NIT#SOURCED |
21 NIT#SOURCEI |
22 NIT#PROTD |
23 NIT#PROTI |
24 NIT#LOADD |
25 NIT#LOADI |
26 NIT#CLUD |
27 NIT#CLUI |
28 NIT#EL701D |
29 NIT#EL701I |
30 NIT#ODSD |
31 NIT#ODSI |
32 NIT#DIMD |
33 NIT#DIMI |
34 NIT#FACTD |
35 NIT#FACTI |
未被备份的那两个表空间是临时表空间。由此可见,进行备份的时候,不会备份临时表空间。
同时,仔细观察输出信息,在每段“Backing up tablespace”中,都会有DATA #1:代表表空间编号;DATA #2:代表表空间名字;
而且,通过上面这段输出,可以看到,在进行online 全备的过程中,一旦启动备份,就会同时对所有表空间进行备份(换句话说,所有的表空间都被置成0x0800 Backup in progress状态)
但是,个人不清楚,这是因为数据库启动了并行备份还是默认设置就是这样。
同时,经过统计,所有的这些表空间的备份,是通过3个EDU进行的(EDUID分别为:10993 、11506 、11763),目前尚不清楚其是否与并行备份有关
在继续向下看,当所有的表空间(临时表空间除外)都开始备份了,过一段时间,会有备份完成的信息输出:
2013-07-27-05.50.09.637228+120 E12805805A430 LEVEL: Info
PID : 15204508 TID : 11506 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 11506 EDUNAME: db2bm.11239.2 (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubBMCont, probe:1480
MESSAGE : Finished tablespaces
2013-07-27-05.50.09.707628+120 E12806236A430 LEVEL: Info
PID : 15204508 TID : 10993 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 10993 EDUNAME: db2bm.11239.1 (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubBMCont, probe:1480
MESSAGE : Finished tablespaces
2013-07-27-05.50.09.710658+120 E12806667A430 LEVEL: Info
PID : 15204508 TID : 11763 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 11763 EDUNAME: db2bm.11239.3 (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubBMCont, probe:1480
MESSAGE : Finished tablespaces
………………..
然后,看看当我们发出了force命令时,db2diag中记录了什么:
2013-07-27-05.51.07.521379+120 E12807098A542 LEVEL: Severe
PID : 15204508 TID : 11239 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 11239 EDUNAME: db2agent (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubPollMsg, probe:160
DATA #1 : Sqlcode, PD_TYPE_SQLCODE, 4 bytes
-1224
DATA #2 : Hexdump, 4 bytes
0x0A00020058623190 : FFFF FB38 ...8
2013-07-27-05.51.07.521564+120 E12807641A1038 LEVEL: Severe
PID : 15204508 TID : 11239 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 11239 EDUNAME: db2agent (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubPollMsg, probe:160
MESSAGE : SQL1224N The database manager is not able to accept new requests,
has terminated all requests in progress, or has terminated the
specified request because of an error or a forced interrupt.
DATA #1 : SQLCA, PD_DB2_TYPE_SQLCA, 136 bytes
sqlcaid : SQLCA sqlcabc: 136 sqlcode: -1224 sqlerrml: 0
sqlerrmc:
sqlerrp : sqlubPol
sqlerrd : (1) 0x00000000 (2) 0x00000000 (3) 0x00000000
(4) 0x00000000 (5) 0x00000000 (6) 0x00000000
sqlwarn : (1) (2) (3) (4) (5) (6)
(7) (8) (9) (10) (11)
sqlstate:
2013-07-27-05.51.09.091749+120 E12808680A421 LEVEL: Severe
PID : 15204508 TID : 11239 PROC : db2sysc 0
INSTANCE: db2nit NODE : 000 DB : NIT
APPHDL : 0-43166 APPID: *LOCAL.db2nit.130727034909
AUTHID : DB2NIT
EDUID : 11239 EDUNAME: db2agent (NIT) 0
FUNCTION: DB2 UDB, database utilities, sqlubcka, probe:911
MESSAGE : Backup terminated.
数据库详细记录了备份被中断,并给出了一个Severe级别的错误输出。
7、通过上述的4、5、6三个标题的内容,我们知道了下面的信息
数据库备份时间开始于07/27/2013 05:49:09.659604;到2013-07-27-05.51.09.091749+120的时候,备份的application被手动杀死;在备份过程中,真正进行备份操作的,是由application拉起的几个EDU
而且,在application的快照中
Connection request start timestamp = 07/27/2013 05:49:09.581808
Connect request completion timestamp = 07/27/2013 05:49:09.583199
Application idle time = 42 seconds
……
Snapshot timestamp = 07/27/2013 05:49:51.071589
因此,个人怀疑,在备份用的application在拉起了EDU去进行备份操作后,它自己就不再工作了,所以,Application idle time近似的等于备份用的application执行备份的时间。
结论:
1、在进行online全备的时候,临时表空间不会被备份;
2、在进行online全备的时候,会在备份启动的时候,将所有的表空间状态设置为baking up in progress (0x0800)
3、在进行online全备的时候,application会唤醒几个EDU来进行备份工作(这几个EDU进行工作,是不是application就不会工作进入idle状态了,这个还需要调查)
4、在进行online全备的时候,list applications show detail会看到具体的那个application在进行备份工作。
Run_LeoCat2014-02-26 09:45:52
wolaos123:DB2就是缺乏像楼主这样的探索者,很喜欢你的这篇文章。
关于结论的第二点我有点不同的看法,db2在做online 备份的时候,只会把当前正在进行备份的表空间置为0x0800,这个之前在一个数据仓库中看到过。
第三点,关于调用几个sub agent,确实跟并行度有关系,你尝试着在备份命令中指定PARALLELISM,然后在看sub agent的个数。
thx.第二点和第三点,我会继续调查一下。DB2呢,只能说了解的不多,所以才调查学习。也许高手对于这种问题,本来就门儿清呢……
回复 | 举报