本文共 1172 字,大约阅读时间需要 3 分钟。
[20171110]toad 小技巧.txt
--//前几天的事情,一大早要求查询记录操作异常,本来想使用logminer查询,我们redo文件太大,使用logminer分析很慢.
--//想到版本查询,vresions伪劣太多,我经常记不住,尤其是后面VERSIONS BETWEEN SCN MINVALUE AND MAXVALUE;这段, --//好在我以前保存在blog中,链接如下:> [20151103]versions伪列.txt--//想到toad有一个功能auto replace功能:
view=>toad optins=>editor=>Behavior =>auto replace : st select rowid x ,t.* from xxx t; sta SELECT rowid x,versions_starttime,versions_endtime,versions_xid,versions_operation,versions_startscn,versions_endscn,xxx.* FROM xxx VERSIONS BETWEEN TIMESTAMP MINVALUE AND MAXVALUE WHERE zyh = :b_zyh ORDER BY versions_endscn--//替换xxx用真实的表名就ok了.
--//可以根据自己的喜好定义.这样只要打入sta+space就可以了,缺点就是只能将语句写在一行,你也可以export备份,留下以后导入.
--//我导出如下:...
st=select rowid x ,t.* from xxx t where mzhm=:b_mzhm order by zyh; sta=SELECT rowid x,versions_starttime,versions_endtime,versions_xid,versions_operation,versions_startscn,versions_endscn,xxx.* FROM xxx VERSIONS BETWEEN TIMESTAMP MINVALUE AND MAXVALUE WHERE zyh = :b_zyh ORDER BY versions_endscn dpc=select * from table(dbms_xplan.display_cursor('&1',NULL,'ALL ALLSTATS LAST PEEKED_BINDS cost partition -projection -outline')); asoft=as of timestamp sysdate -15/1440 where--//还可以根据自己需要增加修改添加.
转载地址:http://jtvdl.baihongyu.com/