查看oracle 真实执行计划
2016-04-18 12:18
405 查看
一共3个step;
step1:在sql执行时,增加hint: /*+gather_plan_statistics*/
step2:查出sql的sql id: select * from v$sql s where s.SQL_TEXT like 'SELECT /*+monitor*/TT.*%'
step3:执行下面sql查看真实执行计划;
SELECT
sp.last_starts AS "starts",
sp.last_output_rows AS "rows",
round(sp.last_elapsed_time / 1000000, 2) AS TIME,
sp.last_cr_buffer_gets bf,
sp.depth d,
rtrim(lpad(' ', 2 * (depth - 1)) || operation ||
decode(options, NULL, '', ' ' || options)) "Explain plan",
decode(id,
0,
'------------- ',
substr(decode(substr(object_name, 1, 7),
'SYS_LE_',
NULL,
object_name) || ' ',
1,
30)) AS "object",
step1:在sql执行时,增加hint: /*+gather_plan_statistics*/
step2:查出sql的sql id: select * from v$sql s where s.SQL_TEXT like 'SELECT /*+monitor*/TT.*%'
step3:执行下面sql查看真实执行计划;
SELECT
sp.last_starts AS "starts",
sp.last_output_rows AS "rows",
round(sp.last_elapsed_time / 1000000, 2) AS TIME,
sp.last_cr_buffer_gets bf,
sp.depth d,
rtrim(lpad(' ', 2 * (depth - 1)) || operation ||
decode(options, NULL, '', ' ' || options)) "Explain plan",
decode(id,
0,
'------------- ',
substr(decode(substr(object_name, 1, 7),
'SYS_LE_',
NULL,
object_name) || ' ',
1,
30)) AS "object",
相关文章推荐
- SQL语句oracle中如何插入Date类型的数据
- oracle 手工建库
- Oracle_动态sql为本地变量赋值
- 修复ORACLETNS-12545 因目标主机或对象不存在错误
- win7 64位安装oracle10g出现未知错误,程序异常终止解决方法
- Oracle之唯一性约束(UNIQUEConstraint)用法详解
- Oracle数据库的导入导出
- linux下oracle通过unixODBC连接MySQL
- oracle随记——控制文件
- Oracle查询一批数据,某字段的内容有重复数据,怎样取相同的记录中时间最近的一条
- PROC简单使用用例--VC连接ORACLE
- oracle后台进程杀掉会怎么样
- mysql中怎么实现oracle中的to_char和to_date
- myBatis oracle 与mysql自增问题
- 数据文件状态处于recover,恢复正常
- Power Designer逆向工程连接数据库创建pdm-oracle
- azure 云端centos6.5下oracle11g服务开机自启动
- 如何让Oracle客户端显示中文
- Oracle rownum 与 row_number
- 分布式并行数据库将在OLTP 领域促进去“Oracle”