Amazon books

Tuesday, July 16, 2013

Getting DDL of a view quickly



SELECT view_definition FROM v$fixed_view_definition
       WHERE view_name='GV$TRANSACTION';

VIEW_DEFINITION
--------------------------------------------------------------------------------
select inst_id,ktcxbxba,kxidusn,kxidslt,kxidsqn,ktcxbkfn,kubablk, kubaseq,kubare
c, decode(ktcxbsta,0,'IDLE',1,'COLLECTING',2,'PREPARED',3,'COMMITTED',
       4,'HEURISTIC ABORT',5,'HEURISTIC COMMIT', 6,'HEURISTIC DA
MAGE',7,'TIMEOUT',9,'INACTIVE', 10,'ACTIVE',11,'PTX PREPARED',12
,'PTX COMMITTED',  'UNKNOWN'), ktcxbstm,ktcxbssb,ktcxbssw, ktcxbs
en,ktcxbsfl,ktcxbsbk,ktcxbssq,ktcxbsrc, ktcxbses,ktcxbflg, decode(bitand(ktcxbfl
g,16),0,'NO','YES'), decode(bitand(ktcxbflg,32),0,'NO','YES'), decode(bitand(ktc
xbflg,64),0,'NO','YES'), decode(bitand(ktcxbflg,8388608),0,'NO','YES'), ktcxbnam
, ktcxbpus,ktcxbpsl,ktcxbpsq, ktcxbpxu,ktcxbpxs,ktcxbpxq, ktcxbdsb, ktcxbdsw, kt
cxbubk,ktcxburc,ktcxblio,ktcxbpio,ktcxbcrg,ktcxbcrc, to_date(ktcxbstm,'MM/DD/RR
HH24:MI:SS','NLS_CALENDAR=Gregorian'), ktcxbdsb, ktcxbdsw,  ktcxbssc, ktcxbdsc,
ktcxbxid, ktcxbpid, ktcxbpxi  from x$ktcxb where bitand(ksspaflg,1)!=0 and bitan
d(ktcxbflg,2)!=0


1 row selected.


Best Regards,
Paulo Portugal

No comments:

Post a Comment