Wednesday, July 27, 2011
Installer issues v11.5
Thursday, January 20, 2011
Spot mutex locks
#set -x
## param 1: min number of times a waiter has to appear on the list to be considered as a mutex lock
## param 3: wait time between samplings
## it only shows the session holding a mutex in a partition
_npollings=1
_samplings=$2
_interval=$3
while true
do
while [ _npollings -lt $_samplings ]
do
onstat -g lmx
((_npollings+=1))
done | awk -v max_waiters=$1 '
BEGIN { _alertit = 0 }
/^[0-9]/ {
if ($3 in holdinglock)
holdinglock[$3]++;
else
holdinglock[$3]=1;
}
/^[ \t]+/ {
if ( $1 in waiters)
waiters[$1]++;
else
waiters[$1]=1;
}
END {
for (_waiter in waiters)
{
if (waiters[_waiter] >= max_waiters)
_alertit=1;
}
if (_alertit == 1)
for (_holder in holdinglock) {
if ( substr(_holder,1,3) == "pt_" )
printf "%s\n",substr(_holder,4);
}
}
' | while read _holder
do
date
echo "SELECT FIRST 1 t.dbsname, t.tabname FROM systabnames t where lower(hex(t.partnum)) like \"%"$_holder"%\";" | dbaccess sysmaster
done| tee -a new_mutex_counts.out
sleep $_interval
done
Monday, December 20, 2010
Sessions doing sorts to disk
You can use a SQL statement to obtain information regarding each of the temporary tables that are currently created
- SELECT t.tabname ,t.dbsname,t.owner,
DECODE(d.is_logging,1,"Y","N") AS db_with_log,
s.name AS dbspace,
DBINFO("UTC_TO_DATETIME",ti_created) AS created,
DECODE(hex(mod(ti_flags,256)/16),6,"Y","N") AS
table_using_log,ti_npused AS num_usedpages,
ti_nptotal AS num_pages
FROM sysmaster:systabnames t, sysmaster:systabinfo i,
sysmaster:sysdbspaces s, sysmaster:sysdatabases d
WHERE t.partnum=ti_partnum AND
d.name=t.dbsname AND
s.dbsnum=TRUNC(t.partnum/1048576) AND
hex(mod(ti_flags,256)/16) IN ( 6,2 )
Wednesday, November 3, 2010
BTREE Cleaner, something to start with
Friday, June 18, 2010
Everything related to Locks
select
l.indx,
l.partnum,
p.dbsname,
p.tabname,
l.rowidr,
l.keynum,
l.grtime,
DECODE(l.type,
0, 'NONE',
1, 'BYTE',
2, 'IS',
3, 'S',
4, 'SR',
5, 'U',
6, 'UR',
7, 'IX',
8, 'SIX',
9, 'X',
10, 'XR') type,
r.sid,
s.pid,
s.hostname
from
syslcktab l, -- raw lock table
systabnames p, -- partnum -> dbs/tab map
systxptab x, -- transactions
sysrstcb r, -- rsam thread control blocks
sysscblst s -- session control blocks
where
l.partnum <> 1048578 and -- skip 'sysmaster.sysdatabases'...
l.partnum = p.partnum and
l.owner = x.address and
x.owner = r.address and
r.sid = s.sid
order by
l.grtime desc