在生产环境上进行application的force操作,需要小心谨慎,特别是在有很多applications进行操作的时候。如果想force掉一个backup的进程,可以采用下面的方法
1、首先,查看正在进行的备份的后台job
arlpsap28:db2px4 13> jobs -l
[1] + 29098046 Running nohup db2 backup db px4 online load /usr/openv/netbackup/bin/nbdb2.sl64 exclude ...
arlpsap28:db2px4 14>
arlpsap28:db2px4 10> db2 list utilities show detail
ID = 292872
Type = BACKUP
Database Name = PX4
Partition Number = 0
Description = online db
Start Time = 11/29/2013 05:56:42.616389
State = Executing
Invocation Type = User
Throttling:
Priority = Unthrottled
Progress Monitoring:
Estimated Percentage Complete = 0
Total Work = 790929174081 bytes
Completed Work = 0 bytes
Start Time = 11/29/2013 05:56:42.616397
2、寻找正在进行备份操作的application
arlpsap28:db2px4 13> db2 list applications show detail | more
CONNECT Auth Id App
lication Name Appl. Application Id Seq# Number of Coordinating DB Coordi
nator Status Status Change Time DB Name DB Path
Handle Agents partition number pid/th
read
-------------------------------------------------------------------------------------------------------------------------------- ---
----------------- ---------- -------------------------------------------------------------- ----- ---------- ---------------- ------
--------- ------------------------------ -------------------------- -------- --------------------
SAPPX4 dis
p+work 39217 10.194.6.43.50322.131027020835 07705 1 0 51645
UOW Waiting 11/29/2013 06:36:10.051367 PX4 /db2/PX4/db2px4/NODE0000/SQL00001/
SAPPX4 dis
p+work 38842 10.194.6.43.50343.131027020843 08998 1 0 57554
UOW Waiting 11/29/2013 06:31:08.082016 PX4 /db2/PX4/db2px4/NODE0000/SQL00001/
DB2PX4 db2
taskd 263 *LOCAL.DB2.130504222408 00001 1 0 37886
UOW Waiting 11/29/2013 06:35:55.077608 PX4 /db2/PX4/db2px4/NODE0000/SQL00001/
SAPPX4DB db2
jcc_application 13184 10.194.6.43.39255.131127234016 00049 1 0 68952
UOW Waiting 11/28/2013 01:13:20.863586 PX4 /db2/PX4/db2px4/NODE0000/SQL00001/
SAPPX4 dis
p+work 43934 10.194.6.43.50354.131027020842 01416 1 0 61661
UOW Waiting 11/29/2013 00:25:01.719551 PX4 /db2/PX4/db2px4/NODE0000/SQL00001/
。。。。。。
有很多的applicaiton,找到做backup的application
arlpsap28:db2px4 14> db2 list applications show detail | grep -i backup
DB2PX4 db2bp 24308 *LOCAL.db2px4.131129045641 00001 5 0 67414 Performing a Backup 11/29/2013 05:56:42.616246 PX4 /db2/PX4/db2px4/NODE0000/SQL00001/
还是很乱,看不清楚是哪个是apphandl
这个时候,进行这样的操作:
arlpsap28:db2px4 16> db2 list applications | more
Auth Id Application Appl. Application Id DB # of
Name Handle Name Agents
-------- -------------- ---------- -------------------------------------------------------------- -------- -----
SAPPX4 disp+work 39217 10.194.6.43.50322.131027020835 PX4 1
SAPPX4 disp+work 38842 10.194.6.43.50343.131027020843 PX4 1
SAPPX4DB db2jcc_applica 13184 10.194.6.43.39255.131127234016 PX4 1
arlpsap28:db2px4 17> db2 list applications | grep -i 24308
DB2PX4 db2bp 24308 *LOCAL.db2px4.131129045641 PX4 5
arlpsap28:db2px4 18> db2 list applications show detail | grep -i 24308
DB2PX4 db2bp 24308 *LOCAL.db2px4.131129045641 00001 5 0 67414 Performing a Backup 11/29/2013 05:56:42.616246 PX4 /db2/PX4/db2px4/NODE0000/SQL00001/
通过以上的操作,确认要force的backup的application是24308
3、开始force:
arlpsap28:db2px4 19> db2 "force application(24308)"
DB20000I The FORCE APPLICATION command completed successfully.
DB21024I This command is asynchronous and may not be effective immediately.
arlpsap28:db2px4 20>
4、force完毕后,查看force的结果:
arlpsap28:db2px4 14> jobs -l
[1] + 29098046 Running nohup db2 backup db px4 online load /usr/openv/netbackup/bin/nbdb2.sl64 exclude ...
arlpsap28:db2px4 15>
arlpsap28:db2px4 15>
arlpsap28:db2px4 15>
[1] Exit 4 nohup db2 backup db px4 online load /usr/openv/netbackup/bin/nbdb2.sl64 exclude ...
arlpsap28:db2px4 15> jobs -l
arlpsap28:db2px4 16>
可以看到,job已经退出;
arlpsap28:db2px4 21> db2 list utilities show detail
ID = 292863
Type = RUNSTATS
Database Name = PX4
Partition Number = 0
Description = SAPPX4.SXMSPHIST
Start Time = 11/29/2013 05:39:22.466600
State = Executing
Invocation Type = Automatic
Throttling:
Priority = 40
arlpsap28:db2px4 22>
数据库后台的备份任务也已经取消。
阅读(1195) | 评论(0) | 转发(0) |