使用awrsqrpt.sql查看执行计划demo
SQL> @?/rdbms/admin/awrsqrpt.sql
Current Instance
~~~~~~~~~~~~~~~~
DB Id DB Name Inst Num Instance
----------- ------------ -------- ------------
2545367939 RAC 1 rac1
Specify the Report Type
~~~~~~~~~~~~~~~~~~~~~~~
Would you like an HTML report, or a plain text report?
Enter 'html' for an HTML report, or 'text' for plain text
Defaults to 'html'
Enter value for report_type: text
Type Specified: text
Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DB Id Inst Num DB Name Instance Host
------------ -------- ------------ ------------ ------------
* 2545367939 1 RAC rac1 rac1
2545367939 2 RAC rac2 rac2
Using 2545367939 for database Id
Using 1 for instance number
Specify the number of days of snapshots to choose from
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Entering the number of days (n) will result in the most recent
(n) days of snapshots being listed. Pressing <return> without
specifying a number lists all completed snapshots.
Enter value for num_days: 1
Listing the last day's Completed Snapshots
Snap
Instance DB Name Snap Id Snap Started Level
------------ ------------ --------- ------------------ -----
rac1 RAC 3 14 Jan 2018 14:35 1
4 14 Jan 2018 16:00 1
Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 3
Begin Snapshot Id specified: 3
Enter value for end_snap: 4
End Snapshot Id specified: 4
Specify the SQL Id
~~~~~~~~~~~~~~~~~~
Enter value for sql_id: 5mycvad72f8qc
SQL ID specified: 5mycvad72f8qc
Specify the Report Name
~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is awrsqlrpt_1_3_4.txt. To use this name,
press <return> to continue, otherwise enter an alternative.
Enter value for report_name: lijiaman_awrsqpt_1.txt
Using the report name lijiaman_awrsqpt_1.txt
报告内容如下:
WORKLOAD REPOSITORY SQL Report
Snapshot Period Summary
DB Name DB Id Instance Inst Num Startup Time Release RAC
------------ ----------- ------------ -------- --------------- ----------- ---
RAC 2545367939 rac1 1 14-Jan-18 14:23 11.2.0.1.0 YES
Snap Id Snap Time Sessions Curs/Sess
--------- ------------------- -------- ---------
Begin Snap: 3 14-Jan-18 14:35:02 46 1.0
End Snap: 4 14-Jan-18 16:00:03 48 1.1
Elapsed: 85.01 (mins)
DB Time: 0.63 (mins)
SQL Summary DB/Inst: RAC/rac1 Snaps: 3-4
Elapsed
SQL Id Time (ms)
------------- ----------
5mycvad72f8qc 18
Module: PL/SQL Developer
SQL ??????
select j.job_id, j.job_title, j.min_salary, j.max_s
alary, e.employee_id, e.first_name||e.last_name as name,
e.email, e.phone_number from jobs j,employees e where j.job_
id = e.job_id
-------------------------------------------------------------
SQL ID: 5mycvad72f8qc DB/Inst: RAC/rac1 Snaps: 3-4
-> 1st Capture and Last Capture Snap IDs
refer to Snapshot IDs witin the snapshot range
-> select j.job_id, j.job_title, j.min_salary, ...
Plan Hash Total Elapsed 1st Capture Last Capture
# Value Time(ms) Executions Snap ID Snap ID
--- ---------------- ---------------- ------------- ------------- --------------
1 303035560 18 2 4 4
-------------------------------------------------------------
Plan 1(PHV: 303035560)
----------------------
Plan Statistics DB/Inst: RAC/rac1 Snaps: 3-4
-> % Total DB Time is the Elapsed Time of the SQL statement divided
into the Total Database Time multiplied by 100
Stat Name Statement Per Execution % Snap
---------------------------------------- ---------- -------------- --------
Elapsed Time (ms) 18 9.1 0.0
CPU Time (ms) 7 3.5 0.0
Executions 2 N/A N/A
Buffer Gets 23 11.5 0.0
Disk Reads 1 0.5 0.0
Parse Calls 2 1.0 0.0
Rows 214 107.0 N/A
User I/O Wait Time (ms) 9 N/A N/A
Cluster Wait Time (ms) 0 N/A N/A
Application Wait Time (ms) 0 N/A N/A
Concurrency Wait Time (ms) 0 N/A N/A
Invalidations 0 N/A N/A
Version Count 2 N/A N/A
Sharable Mem(KB) 34 N/A N/A
-------------------------------------------------------------
Execution Plan
-------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
-------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | | | 6 (100) | |
| 1 | MERGE JOIN | | 107 | 8988 | 6 (17) | 00:00:01 |
| 2 | TABLE ACCESS BY INDEX ROWID| JOBS | 19 | 627 | 2 (0) | 00:00:01 |
| 3 | INDEX FULL SCAN | JOB_ID_PK | 19 | | 1 (0) | 00:00:01 |
| 4 | SORT JOIN | | 107 | 5457 | 4 (25) | 00:00:01 |
| 5 | TABLE ACCESS FULL | EMPLOYEES | 107 | 5457 | 3 (0) | 00:00:01 |
-------------------------------------------------------------------------------------------
Full SQL Text
SQL ID SQL Text
------------ -----------------------------------------------------------------
5mycvad72f8q select j.job_id, j.job_title, j.min_salary, j.max_salary, e.emplo
oyee_id, e.first_name||e.last_name as name, e.email, e.phone_numb
er from jobs j, employees e where j.job_id = e.job_id
使用awrsqrpt.sql查看执行计划demo的更多相关文章
- oracle执行计划(二)----如何查看执行计划
目录: (一)六种执行计划 (1)explain plan for (2)set autotrace on (3)statistics_level=all (4)dbms_xplan.disp ...
- oralce 查看执行计划
SQL的执行计划实际代表了目标SQL在Oracle数据库内部的具体执行步骤,作为调优,只有知道了优化器选择的执行计划是否为当前情形下最优的执行计划,才能够知道下一步往什么方向. 执行计划的定义:执行目 ...
- db2数据库创建索引,删除索引,查看表索引,SQL语句执行计划以及优化建议
1.建立表索引 create index 索引名 on 表名(列名,列名); 2.删除表索引 drop index 索引名 on 表名; 3.查看表索引 select * from sysibm.sy ...
- KingbaseES 如何查看应用执行的SQL的执行计划
通过explain ,我们可以获取特定SQL 的执行计划.但对于同一条SQL,不同的变量.不同的系统负荷,其执行计划可能不同.我们要如何取得SQL执行时间点的执行计划?KingbaseES 提供了 a ...
- oracle如何查看执行计划
1.在PL/SQL Developer中得到一个SQL的执行计划 输入想要查看执行计划的目标SQL,再按一下快捷键F5就可以了.2.explain plan 命令 explain plan for + ...
- oracle查看执行计划以及使用场景
文档结构: oracle执行计划使用场景 环境: Centos 6.10 Oracle 18.3.0.0.0 c 11g默认启动了自动统计信息收集的任务,默认运行时间是周一到周五晚上10点和周6,周天 ...
- ORACLE从共享池删除指定SQL的执行计划
Oracle 11g在DBMS_SHARED_POOL包中引入了一个名为PURGE的新存储过程,用于从对象库缓存中刷新特定对象,例如游标,包,序列,触发器等.也就是说可以删除.清理特定SQL的执行计划 ...
- SQL Server 执行计划缓存
标签:SQL SERVER/MSSQL SERVER/数据库/DBA/内存池/缓冲区 概述 了解执行计划对数据库性能分析很重要,其中涉及到了语句性能分析与存储,这也是写这篇文章的目的,在了解执行计划之 ...
- 浅析SQL SERVER执行计划中的各类怪相
在查看执行计划或调优过程中,执行计划里面有些现象总会让人有些疑惑不解: 1:为什么同一条SQL语句有时候会走索引查找,有时候SQL脚本又不走索引查找,反而走全表扫描? 2:同一条SQL语句,查询条件的 ...
随机推荐
- SpringBoot入门-集成mybatis(四)
pom.xml <parent> <groupId>org.springframework.boot</groupId> <artifactId>spr ...
- Hive学习笔记——metadata
Hive结构体系 https://blog.csdn.net/zhoudaxia/article/details/8855937 可以在hive的jdbc接口中使用getMetaData方法来获取hi ...
- openlive writer 汉化方法
使用方法: 替换你安装openlive writer 位置C:\Users\Administrator\AppData\Local\OpenLiveWriter的 app目录 下的 OpenLiveW ...
- ubuntu下编译C++程序
1.CMake 定义:CMake是一个跨平台编译工具,可以用来自动输出makefile文件: 用法:(1)想要自动生成makefile,还需要编写对应的CMakeLists.txt文件: (2)在CM ...
- spring boot 实现定时任务
定时任务或者说定时调度,是系统中比较普遍的一个功能,例如数据归档.清理,数据定时同步(非实时),定时收发等等都需要用到定时任务,常见的定时调度框架有Quartz.TBSchedule等. 如何在Spr ...
- centos7如何将docker容器配置成开机自启动
docker 服务器开机自启动: 1.systemctl is-enabled docker.service 检查服务是否开机启动 2.systemctl enable docker.service ...
- war包部署在tomcat下,使用windows service服务方式启动tomcat服务器,在包含调用dll的模块,报dll找不到问题的解决办法
问题描述: 开发了一个需要调用dll的java web程序,在idea开发环境下运行调试没问题,可以正常运行,在tomcat/bin下,运行批处理startup.bat,启动tomcat服务器,也可以 ...
- mybatis异常集锦
[Mybatis]报错:Malformed OGNL expression: name!= null and name != ' ' [Mybatis]报错:Malformed OGNL expres ...
- 一个".java"源文件中是否可以包括多个类(不包括内部类)
开通好几个月博客了,但是一直没有时间写,这一段时间准备开始复习了,以后准备好好写博客了,会从基础的内容开始. 一个".java"源文件中可以定义多个类,但最多只能定义一个publi ...
- 推荐一款好用的json导出execl格式的文件的js工具-JsonExportExcel
<html> <head> <meta charset="utf-8"> <title>json导出Excel</title& ...