ATTENTION: this script only works if the BLOCKER's last sql statement
was the statement that blocked the waiter, thus the script is of very
limited use, mainly for test cases. I plan to write a more general
solution in the future.

Given the above situation, ie a blockers last SQL statement blocks a
waiter, and the waiter is waiting for a TX lock then the script will
tell the OBJECT the wait is on and dump the relavant UNDO information


SQL> @lockdmp

Enter value for txid: 655382

alter system dump datafile 2 block 16238;

/export/home/oracle/admin/cdb/udump/cdb_ora_21082.trc

grep "Rec #0x2a" /export/home/oracle/admin/cdb/udump/cdb_ora_21082.trc | sed -e "s/.*objn:/select object_name from dba_objects where object_id=/" | sed -e "s/(.*/;/" > objn.sql

TOTO

awk '/Rec #0x2a/,/^.$/{print}' /export/home/oracle/admin/cdb/udump/cdb_ora_21082.trc
* Rec #0x2a  slt: 0x16  objn: 569189(0x0008af65)  objd: 569189  tblspc: 0(0x00000000)
*       Layer:  11 (Row)   opc: 1   rci 0x00
Undo type:  Regular undo    Begin trans    Last buffer split:  No
Temp Object:  No
Tablespace Undo:  No
rdba: 0x00000000
*-----------------------------
uba: 0x00803f6e.3b3d.29 ctl max scn: 0x084a.798756cf prv tx scn: 0x084a.79875730
KDO undo record:
KTB Redo