Archive

Archive for October, 2008

See who is blocking for who in Oracle

October 28th, 2008

Today I had a full production stop on a system under my command.

A simple delete statement was blocked. I normally fire up TOAD when this occures.
But I found (read: google) a more simple way to do this in plain sql:

SELECT s1.username || '@' || s1.machine ||
' ( SID=' || s1.SID || ' )  is blocking ' ||
s2.username || '@' || s2.machine ||
' ( SID=' || s2.SID || ' ) ' AS blocking_status
FROM v$lock l1, v$session s1, v$lock l2, v$session s2
WHERE s1.SID = l1.SID
AND s2.SID = l2.SID
AND l1.BLOCK = 1
AND l2.request > 0
AND l1.id1 = l2.id1
AND l2.id2 = l2.id2

It produces a nice result:

BLOCKING_STATUS
user@host ( SID=24 )  is blocking user@host( SID=31 )
SYSTEM@host( SID=42 )  is blocking user@host( SID=68 )
SYSTEM@host( SID=42 )  is blocking user@host( SID=24 )
SYSTEM@host( SID=42 )  is blocking user@host( SID=45 )
user@host( SID=45 )  is blocking user@host( SID=43 )
user@host( SID=68 )  is blocking user@host( SID=44 )

It seems like our DBA was generating a HUGE index in daily production hours.
Somthing he usually knife other pure souls for.
Shame on you Mr. DBA, shame on you.

Never the less : Today I knifed him, and what a feeling!

Benjamin Sølberg Oracle

Converting a Nokia DLR-3 data cable to a 3.3V JTAG

October 27th, 2008

I have once before written about how to convert a Erisson data cable into a generic JTAG cable.
Only problem was that it needed 5V and the hardware I use only supplys 3.3V.

 

Nokia DLR-3 JTAG

Nokia DLR-3 JTAG

So when I found an old Nokia DLR-3 data cable i immediatly turned to my frind Google. What I found was that it used 3.3V which was perfect. The Erisson data cable got its supply from the power adapter (5V) while the nokia flavor got it from the mobile phone.

I found some homemade schematics for a DLR-3 look alike which indicated that it should be possible to use the TX and RX pins alone. I fired up the soldering iron and as the optimist I am, I started to solder female test leads, which i scavenged from the 5V Ericsson converted counterpart.

Half an hour later (thats a lie, nothing only takes half an hour) I was done and ready to test it.

I opened my (working) FON router and after swapping RX and TX test leads everything worked perfect.

The nice part of the DLR-3 is that it gets its supplie from the two other testleads as well, meaning that I didn’t have to use an external powersource as I had to with the Erisson version.

The layout of the Nokia pins I used is : 1(3.3v), 7(RX), 8 (TX), 9 (GND)

Links:

http://www.nokia-tuning.net/index.php?s=cabledlr3 points to a DLR-3 schematics

http://wiki.openwrt.org/OpenWrtDocs/Hardware/Fon/Fonera points to the FON JTAG pinout

http://www.pinout.net/browse.php?conid=66 points to a (now old) Nokia pinout connector.

Please note that the the supply voltage is 3.3V. Luckey for me, thats what is available in the FON router.

Benjamin Sølberg Electronics, FON