Hi DBAs,
How will I get a list of locks pertaining to one database in a database
server? Onstat -u will give me a list of all the session with a coloumn
"lock" . But this will give me only the system wide locks used. I want it
perticularly for one database in a database server. Can anyone help me out?
thanks,
Srini
↪ replying to Srinivas Sreekumar
onstat -? | grep -i lock
-k Print locks
spi Print spin locks with long spins
lmx Print all locked mutexes
rbm Print block map for resident segment
nbm Print block map for non-resident segments
onstat -k output
Locks
address wtlist owner lklist type tblsnum rowid key#/bsiz
1001f5ec 0 103b43b8 0 HDR+S 100002 204 0
1001f640 0 103b43b8 1001f5ec HDR+X 10007a 0 0
2 active, 2000 total, 2048 hash buckets, 0 lock table overflows
You cannot easily limit this output to tables in a particular database,
but you can identify the tables :-
select tabname
from systables
where hex(partnum) = "0x0010007A"
tabname catalog
You should use the SMI :-
database sysmaster;
select * from syslocks
where dbsname = "stores_demo"
dbsname stores_demo
tabname catalog
rowidlk 0
keynum 0
type X
owner 20
waiter
HTH
Brett Randall
Srinivas Sreekumar wrote:
>
> Hi DBAs,
>
> How will I get a list of locks pertaining to one database in a database
> server? Onstat -u will give me a list of all the session with a coloumn
> "lock" . But this will give me only the system wide locks used. I want it
> perticularly for one database in a database server. Can anyone help me out?
>
> thanks,
> Srini