ChannelDB2

Capturing IPC (interprocess communication) facility data using DB2

I've never actually posted to a blog before so here is a little test run:



#!/bin/ksh
# Original creator : Rick McClendon
# Purpose : Capturing IPC (interprocess communication) facility data using DB2
# Execution : This job runs once a minute
#
# Job summary: ipcs -u Will summarize current resource usage
# Summary data is inserted into UDB.
#
# Special Note:
# A delete statement has been added to nightly log file cleanup script
# (~/scripts/dba-sys/udb-diaglogs.ksh)
# to keep data trimmed at 30 days #------------------------------------------------------------------------------------------------------------------------------------
# History
# 05/15/07 : Rick McClendon - Created
#------------------------------------------------------------------------------------------------------------------------------------
# w o r k i n g s t o r a g e
typeset -x runtime=`date +"%y%m%d%H%s"`
typeset -x dir=~/scripts/dba-sys/ipcs
exec 2>&1 > /dev/null
. ~/sqllib/db2profile
db2 connect to > /dev/null

echo "INSERT INTO FSZDBA.INTERPROCESS_COMM (MEM_SEGMENTS_ALLOC, MEM_PAGES_ALLOC, MEM_PG_RESIDENT, MEM_PAGES_SWAPPED, \
SEM_USED_ARRAYS, SEM_ALLOCATED, MSG_ALLOC_QUEUES, MSG_USED_HEADERS, MSG_USED_SPACE) VALUES ("\
`ipcs -u |awk '/segments allocated/ {segAlloc=$3} /pages allocated/ {pgAlloc=$3} /pages resident/ {pgres=$3} /pages swapped/ {pgswap=$3} /used arrays/ {uarray=$4} /allocated semaphores/ {allocsem=$4} /allocated queues/ {aq=$4} /used headers/ {uh=$4} /used space/ {us=$4; print segAlloc "," pgAlloc "," pgres "," pgswap "," uarray "," allocsem "," aq "," uh "," us}'` \
");" > $dir/ipcs-insert.temp

db2 -tvf $dir/ipcs-insert.temp
exit 0



~~~ Table DDL ~~~

CREATE TABLE "FSZDBA"."INTERPROCESS_COMM"
("MEM_SEGMENTS_ALLOC" INTEGER NOT NULL,
"MEM_PAGES_ALLOC" INTEGER NOT NULL,
"MEM_PG_RESIDENT" INTEGER NOT NULL,
"MEM_PAGES_SWAPPED" INTEGER NOT NULL,
"SEM_USED_ARRAYS" INTEGER NOT NULL,
"SEM_ALLOCATED" INTEGER NOT NULL,
"MSG_ALLOC_QUEUES" INTEGER NOT NULL,
"MSG_USED_HEADERS" INTEGER NOT NULL,
"MSG_USED_SPACE" INTEGER NOT NULL,
"CREATED_TS" TIMESTAMP NOT NULL DEFAULT CURRENT TIMESTAMP )
DATA CAPTURE NONE
IN "DBATABLES_MDTS" INDEX IN "DBATABLES_MITS";

ALTER TABLE "FSZDBA"."INTERPROCESS_COMM"
LOCKSIZE ROW APPEND OFF NOT VOLATILE;

Views: 370

Comment

You need to be a member of ChannelDB2 to add comments!

Join ChannelDB2

Featured Downloads

Try BLU Acceleration on Cloud

© 2019   Created by channeldb2.   Powered by

Badges  |  Report an Issue  |  Terms of Service