->
alter session set statistics_level=all;
select /*+ gathe_plan_statistics */ * from ts.ts_record t where system_name=’人员小车闸口’ order by pass_datetime desc;
select sql_text,sql_id from v$sql where sql_text like ‘select%*%人员小车闸口%’;
-> pl/sql developer
login in app user
run the app sql
get from sql from session monitor .
–>
sqlplus / as sysdba
spool D:\dba\tmp\sql_dev.log
select * from table(dbms_xplan.display_cursor(’36tvbv2uth9j9′,0,’runstats_last’));
spool off
select * from table(dbms_xplan.display_cursor(null,0,’allstats last’));
select * from table(dbms_xplan.display_cursor(null,null,’advanced’));
—查看上一条sql 的 plan :
select * from table(dbms_xplan.display_cursor());
–>
sqlplus / as sysdba
SET LONG 1000000 SET FEEDBACK OFF
spool monitor_sql.html
SELECT DBMS_SQLTUNE.report_sql_monitor(sql_id =>’20wfgydukawbw’,type=> ‘HTML’) AS report FROM dual;
spool off
->
SQL> alter session set events ‘10046 trace name context forever,level 12’;
Session altered.
SQL> /
Session altered.
SQL> alter session set events ‘10046 trace name context off’;
Session altered.
SQL>select * from v$diag_info;
案例可以参考 http://blog.mchz.com.cn/?p=404
转载于:https://www.cnblogs.com/feiyun8616/p/5872238.html
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/108880.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...