使用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语句,查询条件的 ...
随机推荐
- Could not find com.android.tools.build:gradle:3.3.0.
导入新项目时报错: Error:Could not find com.android.tools.build:gradle:3.3.0. Searched in the following locat ...
- 复制centos 后不能上网,处理办法
CentOS7 Failed to start LSB: Bring up/down解决方法 https://blog.51cto.com/addam/1839518 刚刚装好的虚拟机突然不能上网了, ...
- 重温RabbitMQ
RabbitMQ是用Erlang语言实现的,它有几个概念broker:消息队列服务器实体exchange:消息交换机,它指定消息按什么规则,路由到哪个队列queue:消息队列,每个消息都会被投入到一个 ...
- 使用java计算数组方差和标准差
使用java计算数组方差和标准差 觉得有用的话,欢迎一起讨论相互学习~Follow Me 首先给出方差和标准差的计算公式 代码 public class Cal_sta { double Sum(do ...
- html2canvas 将网页截图为图片,上传base64 到服务端
await html2canvas(getById("winyh"), { height:500, allowTaint: true, useCORS: true, }).then ...
- win7安装 truffle
1. 最近有个项目需要用到区块链,第一次玩不太熟悉.现在电脑上安装个 truffle,作为一个区块链节点 2. 安装 truffle ,之前需要安装其他几个软件 truffle的安装需要首先装有:n ...
- win7安装 nodejs,npm
1. 下载地址:http://nodejs.org/dist/v9.7.1/ 2. 安装 3. 查看是否安装成功,命令行查询 node -v 4. 默认已经安装了npm,直接查询版本 5. 配置np ...
- c# socket 心跳 重连
/// <summary> /// 检查一个Socket是否可连接 /// </summary> /// <param name="socket"&g ...
- Vue生命周期 以及应用场景
首先一张官方图 <!DOCTYPE html> <html lang="en"> <head> <meta charset="U ...
- 移动端实现裁剪图片生成base64图片(可缩放)
移动端实现裁剪图片生成base64图片(可缩放)<pre><!DOCTYPE html><html lang="en"> <head> ...