【筆記】 sql_trace相關
SQL> create table tt( id number);
Table created
SQL> insert into tt select rownum from dba_objects;
39530 rows inserted
清除緩衝區:
SQL> alter session set events 'immediate trace name flush_cache level 1';
Session altered
SQL> alter session set sql_trace=true;
Session altered
SQL>
SQL> declare
2 l_num number;
3 begin
4 for i in 1..39530
5 loop
6 select id into l_num from test.tt where id = i;
7 end loop;
8 end;
9 /
PL/SQL procedure successfully completed
SQL> alter session set sql_trace=false;
Session altered
用tkprof檢視trc檔案:(disk和query注意,不清除緩衝區的話沒有disk)
E:\oracle\admin\yellow\udump>tkprof yellow_ora_812.trc trace.txt print=100 record=sql.txt sys=no
TKPROF: Release 9.2.0.1.0 - Production on 星期二 5月 19 21:02:08 2009
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Trace file: yellow_ora_812.trc
Sort options: default
********************************************************************************
count = number of times OCI procedure was executed
cpu = cpu time in seconds executing
elapsed = elapsed time in seconds executing
disk = number of physical reads of buffers from disk
query = number of buffers gotten for consistent read
current = number of buffers gotten in current mode (usually for update)
rows = number of rows processed by the fetch or execute call
********************************************************************************
The following statement encountered a error during parse:
call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 21 0.00 0.00 0 0 0 0
Execute 158139 1.73 1.55 0 0 0 0
Fetch 158149 1.18 1.05 182 316312 0 158140
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 316309 2.92 2.61 182 316312 0 158140
================
Error encountered: ORA-06576
********************************************************************************
OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 43 0.04 0.03 1 10 0 0
Execute 48 6.01 6.87 0 0 0 27
Fetch 11 0.00 0.00 0 33 0 11
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 102 6.06 6.90 1 43 0 38
Misses in library cache during parse: 2
OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 22 0.00 0.00 0 0 0 0
Execute 197669 2.23 1.95 0 0 0 0
Fetch 197679 1.45 1.33 265 395372 0 197670
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 395370 3.68 3.30 265 395372 0 197670
Misses in library cache during parse: 15
48 user SQL statements in session.
22 internal SQL statements in session.
70 SQL statements in session.
********************************************************************************
Trace file: yellow_ora_812.trc
Trace file compatibility: 9.00.01
Sort options: default
1 session in tracefile.
48 user SQL statements in trace file.
22 internal SQL statements in trace file.
70 SQL statements in trace file.
21 unique SQL statements in trace file.
395849 lines in trace file.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/16179598/viewspace-600494/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- sql_trace相關指令碼SQL指令碼
- 路由相關筆記路由筆記
- php相關筆記PHP筆記
- docker相關概念筆記Docker筆記
- MSBUID相關(筆記)UI筆記
- iOS searchbar 相關筆記iOS筆記
- ASM相關概念(筆記)ASM筆記
- Windows API 程式相關筆記WindowsAPI筆記
- oracle index索引相關筆記OracleIndex索引筆記
- Kafka筆記系列-概念相關Kafka筆記
- JDBC mysql 相關內容筆記JDBCMySql筆記
- 前端面試筆記 – js相關前端面試筆記JS
- Anaconda3相關筆記筆記
- Oracle安裝Patch相關筆記Oracle筆記
- mini-lsm通關筆記-字元相關操作筆記字元
- Dcat/laravel-admin 相關筆記Laravel筆記
- webpack4.x相關筆記整理Web筆記
- XDMA上位機相關:一點筆記筆記
- Java相關課程系列筆記之一Java學習筆記Java筆記
- DG學習筆記(12)_相關檢視筆記
- 在wsl中部署puppeteer的相關筆記筆記
- js效能優化相關內容筆記整理JS優化筆記
- iOS學習筆記01 APP啟動相關iOS筆記APP
- (十五) 學習筆記: Python程式(Process)相關筆記Python
- 記一次mpvue開發完整小程式相關筆記Vue筆記
- ES 筆記十八:搜尋的相關性算分筆記
- nodejs的TCP相關的一些筆記NodeJSTCP筆記
- elasticsearch學習筆記二:相關軟體安裝Elasticsearch筆記
- (原)獨立需求與相關需求-讀書筆記筆記
- 六,陣列筆記及相關練習題大全陣列筆記
- 【Java 虛擬機器筆記】記憶體分配策略相關整理Java虛擬機筆記記憶體
- Laravel 記錄相關Laravel
- ePWM相關記錄
- UI自動化學習筆記- 日誌相關操作UI筆記
- 【Java 併發筆記】7 種阻塞佇列相關整理Java筆記佇列
- TensorFlow筆記(1)——TensorFlow中的相關基本概念筆記
- vim學習筆記——三種基本模式和相關操作筆記模式
- linux相關記錄Linux