码迷,mamicode.com
首页 > 数据库 > 详细

oracle执行计划走偏处理步骤

时间:2018-09-06 12:28:56      阅读:507      评论:0      收藏:0      [点我收藏+]

标签:步骤   advance   .exe   执行计划   des   table   output   ted   order   

-- sql执行时间
select a.EXECUTIONS,a.ELAPSED_TIME,a.ELAPSED_TIME/a.EXECUTIONS/1000/1000 as 秒,a.SQL_ID,a.HASH_VALUE,a.address,a.SQL_TEXT from gv$session b,gv$sql a where a.hash_value=b.SQL_HASH_VALUE and username in (‘ZLCFTPUB‘,‘ZLCFTUSER‘) and status=‘ACTIVE‘;
0nx7fbv1w5xg2
0nx7fbv1w5xg2

select sql_id,a.* from gv$session a where username in(‘ZLCFTPUB‘,‘ZLCFTUSER‘) and status=‘ACTIVE‘;
-- select ‘alter system kill session ‘‘‘||sid||‘,‘||serial#||‘‘‘;‘ from gv$session where username=‘ZLCFTPUB‘ and status=‘ACTIVE‘

select * from gv$sql a where a.PARSING_SCHEMA_NAME in(‘ZLCFTPUB‘,‘ZLCFTUSER‘);

-- 执行计划解析
select * from table(dbms_xplan.display_cursor(‘0nx7fbv1w5xg2‘,null,‘ADVANCED ALLSTATS LAST PEEKED_BINDS‘)) --where PLAN_TABLE_OUTPUT like ‘%FULL%‘;
select * from table(dbms_xplan.display_cursor(‘0nx7fbv1w5xg2‘));
select * from table(dbms_xplan.display_awr(‘0nx7fbv1w5xg2‘));

3janh23tkjac4
a77srfk7ybrn8

-- sql语句
select * from v$sql where sql_id=‘0nx7fbv1w5xg2‘

-- 存储过程
SELECT OBJECT_NAME,CREATED,LAST_DDL_TIME FROM USER_OBJECTS WHERE OBJECT_TYPE =‘PROCEDURE‘ order by last_ddl_time desc;

-- 最新执行的sql
select sql_text,last_load_time from v$sql order by last_load_time desc;

 

oracle执行计划走偏处理步骤

标签:步骤   advance   .exe   执行计划   des   table   output   ted   order   

原文地址:https://www.cnblogs.com/niubaba/p/9597259.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!