Professional Documents
Culture Documents
Agenda
Db2 tablespaces
Server-initiated Reorganization
Database Growth - APAR IC82886
LockWait problems
IC95301 Disabling Reorg on certain tables
Db2diag.log tips
Db2pd utility for problem determination
Grep
Deduplication and Reorganization
Reorg Technote: http://www.ibm.com/support/docview.wss?
uid=swg21452146
Server Education
DB2 Tablespaces
The database is composed of tablespaces
For V6-formatted servers, tablespace 2 is for the majority of the
Server Education
Server Education
#hours
Windows
550
130
13
AIX
465
228
15 (but exported to
NFS mounted fs)
Linux
1525
410
28
Server Education
Server Education
Server Education
Reorganizing databases
3 types reorganizing tables, reorganizing the indices for those
tables, doing a CLEANUP PAGES ALL index reorg on
bf_bitfile_extents when F7/F8 are true.
The discussion of reorganizing databases is only relevant on
properly-provisioned machines. Until that is resolved, we cant
continue.
Reorganization Technote:
http://www-.ibm.com/support/docview.wss?uid=swg21452146
Database size, database reorganization, and performance
considerations for Tivoli Storage Manager V6 and V7 servers
Server Education
Server Education
Server Education
20 days must have elapsed since the last table reorg was started
The current time is outside of the reorg window indicated by server options
REORGBEGINTIME and REORGDURATION
Table reorg is paused on this table, in which case, it will be resumed during the
next current reorg window.
Server Education
Server Education
Server Education
Server Education
Server Education
Runstats Messages
(Note that the 2314 is innocuous. With a large busy table not all the statistics
could be gathered, but sufficient were gathered.
Server Education
Server Education
Server Education
SCHEMA.NAME
CARD
OV
NP
FP ACTBLK
TSIZE F1 F2 F3 REORG
--------------------------------------------------------------------<lots of system table outputs>
Table: TSMDB1.BF_AGGREGATED_BITFILES
6,1e+08 2e+07 3e+06 3e+06
4,10e+10
2 90 97 ---
Server Education
Server Education
Server Education
Server Education
Server Education
Server Education
Server Education
Server Education
Server Education
Server Education
Server Education
Db2 list history reorg all for tsmdb1 -- for index reorg
Server Education
Server Education
IC82886
With dedup, lots of deletion of older rows in this table, but not
enough deletions to merge adjacent pages, and that new rows have
keys that are strictly increasing, this can cause this table to grow
without bound.
Reorg doesnt resolve the problem since a clustered index leaves
space on the page for rows to be re-inserted againthis wont
happen because the keys are strictly increasing. So there are many
almost-empty pages over time.
For newly formatted servers when running with the fixing level, that
index will be created correctly.
For servers upgraded, theres manual procedure to drop that
clustered index and to redefine it as an unclustered index.
http://www.ibm.com/support/docview.wss?uid=swg21592404
Server Education
Server Education
Server Education
Server Education
Server Education
Server Education
Server Education
http://www.ibm.com/support/docview.wss?uid=swg21452146
The Technote also includes information on disabling table and index
reorg by modifying global variablesthis will be useful until
customers have the fixing levels for the APAR.
The first time: db2 "insert into tsmdb1.global_attributes
(owner,name,type,length,datetime)
values('RDB','<globalVar>',5,6,current date)
Every 19 days afterwards:
db2 "update tsmdb1.global_attributes set datetime=current date
where owner='RDB' and name='<globalVar>' "
globalVar is REORG_TB_tablename for a table,
REORG_IX_tablename
Server Education
db2diag.logs
Located in SQLDUMP directory.
With new servers there may be several files of name db2diag.NN.log. When
DB2DUMP\db2diag.log
DB2DUMP\db2diag.0.log
DB2DUMP\db2diag.1.log
DB2DUMP\db2diag.2.log
DB2DUMP\db2diag.3.log
Phys Mem
Watch the free physical memory. If its lower than the minimum
required, that suggests a problem.
Server Education
Server Education
Server Education
Server Education
Db2diag.log
Running out of disk space is very bad.
Its even worse if the filesystem that runs out of space is the one that
db2diag.log resides on
Server Education
Db2diag.log
2012-10-26-19.01.45.842623-240 E3797A737
LEVEL: Error (OS)
PID : 9044114
TID : 4885
PROC : db2sysc 0
INSTANCE: tsm011
NODE : 000
EDUID : 4885
EDUNAME: db2pclnr (TSMDB1) 0
FUNCTION: DB2 UDB, oper system services, sqloLioAIOCollect,
probe:100
MESSAGE : ZRC=0x850F000C=-2062614516=SQLO_DISK "Disk
full."
DIA8312C Disk was full.
CALLED : OS, -, aio_return
OSERR : ENOSPC (28) "No space left on device"
Note the EDUID and find associated messages.
Server Education
Db2diag.log
2012-10-26-19.01.45.828204-240 E1507A775
LEVEL: Error
PID : 9044114
TID : 4885
PROC : db2sysc 0
INSTANCE: tsm011
NODE : 000
EDUID : 4885
EDUNAME: db2pclnr (TSMDB1) 0
FUNCTION: DB2 UDB, buffer pool services, sqlbClnrAsyncWriteCompletion,
probe:0
MESSAGE : ADM6017E The table space "LGTMPTSP" (ID "7") is full.
Detected on
container
"/tsmdbs/tsm011/db7/tsm011/NODE0000/TSMDB1/T0000007/C0000006.T
MP" (ID
"6"). The underlying file system is full or the maximum allowed
space usage for the file system has been reached. It is also possible
that there are user limits in place with respect to maximum file size
and these limits have been reached.
Server Education
Db2diag.log
2013-03-15-17.58.52.667168+060 E28772723E1027
LEVEL: Warning
PID : 11355
TID : 139949756114688PROC : db2sysc 0
INSTANCE: tsminst1
NODE : 000
DB : TSMDB1
APPHDL : 0-15788
APPID: *LOCAL.tsminst1.130602191844
AUTHID : TSMINST1
EDUID : 5555
EDUNAME: db2agent (TSMDB1) 0
FUNCTION: DB2 UDB, buffer pool services, sqlbReadPage, probe:1180
MESSAGE : ADM6000E DB2 encountered a read error while reading page "50065562"
from tablespace "4" for object "19" (located at offset "12516442" of
container
"/tsmbox/db/db1/tsminst1/NODE0000/TSMDB1/T0000004/C0000000.LRG"). DB2
was able to bypass the error by re-reading the page, but this may
indicate the presence of a serious problem that could result in a
future outage. You may wish to begin an investigation of the hardware
(such as disk, controllers, network) and/or the filesystem involved
in accessing the container.
Server Education
Db2diag.log
Lock Escalations with small # of locks when running dedup (this happens when
another thread running some LARGE dedup process has almost all the locks, and this
thread just needs a few, but it exceeds the total limit).
Probably needs to have the lockList tuned:
http://www-01.ibm.com/support/docview.wss?uid=swg21430874
2012-11-04-12.27.50.426000-420 E2915979F1540
LEVEL: Warning
PID : 2920
TID : 1856
PROC : db2syscs.exe
INSTANCE: SERVER1
NODE : 000
DB : TSMDB1
APPHDL : 0-1173
APPID: *LOCAL.SERVER1.121104192748
AUTHID : TSMBACKUP
EDUID : 1856
EDUNAME: db2agent (TSMDB1)
FUNCTION: DB2 UDB, data management, sqldEscalateLocks, probe:1
MESSAGE : ADM5501I DB2 is performing lock escalation. The affected application
is named "dsmsvc.exe", and is associated with the workload name
"SYSDEFAULTUSERWORKLOAD" and application ID
"*LOCAL.SERVER1.121104192748" at member "0". The total number of
locks currently held is "8", and the target number of locks to hold
is "4".
Server Education
Server Education
db2pd -tcbstats
Server Education
db2pd -tcbstats
db2pd -tcbstats
db2pd -tcbstats
Cat baggonly.stats.out
insCat baggonly.stats.out
inserts
updates
deletes
inserts-deletes
Server Education
Server Education
http://www.ibm.com/support/ docview.wss?uid=swg21596944
This script can also be used to see if reorg can help free up space.
Server Education
Server Education
Server Education