久久精品人人爽,华人av在线,亚洲性视频网站,欧美专区一二三

如何使用10046查看執(zhí)行計(jì)劃并讀懂trace文件

156次閱讀
沒有評論

共計(jì) 3043 個(gè)字符,預(yù)計(jì)需要花費(fèi) 8 分鐘才能閱讀完成。

自動(dòng)寫代碼機(jī)器人,免費(fèi)開通

這篇文章給大家分享的是有關(guān)如何使用 10046 查看執(zhí)行計(jì)劃并讀懂 trace 文件的內(nèi)容。丸趣 TV 小編覺得挺實(shí)用的,因此分享給大家做個(gè)參考,一起跟隨丸趣 TV 小編過來看看吧。

查看 sql 執(zhí)行計(jì)劃的方法有許多種, 10046 事件就是其中的一種. 與其他查看 sql 執(zhí)行計(jì)劃不同, 當(dāng)我們遇到比較復(fù)雜的 sql 語句, 我們可以通過 10046 跟蹤 sql 得到執(zhí)行計(jì)劃中每一個(gè)步驟的邏輯讀, 物理讀以及花費(fèi)的時(shí)間等. 這種細(xì)粒度的跟蹤對于我們分析 sql 性能尤其有用.

一般來說, 使用 10046 事件得到 sql 執(zhí)行計(jì)劃的步驟如下:
1. 激活當(dāng)前 session 10046 事件
2. 在當(dāng)前 session 中執(zhí)行 sql 語句
3. 關(guān)閉當(dāng)前 session 10046 事件

執(zhí)行完上述步驟后, 通常會(huì)自動(dòng)生成一個(gè) trace 文件. 在 oracle 11g 中, trace 文件一般放在 $ORACLE_BASE/diag/rdbms/{database_name}/$ORACLE_SID/trace  目錄下. 如果使用 oradebug 激活跟蹤 10046 后, 可以使用 oradebug tracefile_name 得到剛剛生成的 trace 文件的完整路徑.

剛剛提到的 oradebug 激活跟蹤 10046 事件, 我想大部分 dba 都會(huì)使用. oradebug 是個(gè)功能強(qiáng)大非常好用的工具, 使用 oradebug help 將會(huì)看到它的功能很多

SQL oradebug
help

HELP
          [command]                
Describe
one
all commands

SETMYPID                                 Debug
current
process

SETOSPID       ospid                  
OS pid
process
debug

SETORAPID       orapid [force]        
Oracle
pid
process
debug

SETORAPNAME     orapname                
Oracle
process
debug

SHORT_STACK                              
abridged OS stack

CURRENT_SQL                              
current
SQL

DUMP           dump_name lvl [addr]   Invoke named dump

DUMPSGA        [bytes]                   Dump
fixed
SGA

DUMPLIST                                 Print a
available dumps

EVENT
          text                    
trace
event
process

SESSION_EVENT   text                    
trace
event
session

DUMPVAR         p|s|uga name [level]   Print/dump a
fixed
PGA/SGA/UGA
variable

DUMPTYPE       address type count   Print/dump an address
type
info

SETVAR         p|s|uga name value  
Modify
fixed
PGA/SGA/UGA
variable

PEEK           addr len [level]       Print/Dump
memory

POKE           addr len value      
Modify
memory

WAKEUP         orapid                   Wake up
Oracle
process

SUSPEND
                                 
Suspend
execution

RESUME
                                 
Resume
execution

FLUSH
                                   
Flush
pending writes
trace
file

CLOSE_TRACE                              
Close
trace
file

TRACEFILE_NAME                          
name
trace
file

LKDEBUG                                   Invoke
global
enqueue
service debugger

NSDBX                                     Invoke CGS
name-service debugger

-G             Inst-List
| all  
Parallel
oradebug command prefix

-R             Inst-List
| all  
Parallel
oradebug prefix (return
output

SETINST         instance# .. | all      
instance
list
double
quotes

SGATOFILE       SGA dump dir             Dump SGA
file; dirname in double quotes

DMPCOWSGA       SGA dump dir Dump map SGA as COW; dirname in double quotes

MAPCOWSGA       SGA dump dir             Map SGA as COW; dirname in double quotes

HANGANALYZE    [level] [syslevel]        
Analyze
system
hang

FFBEGIN                                   Flash Freeze the
Instance

FFDEREGISTER                             FF deregister
instance
from
cluster

FFTERMINST                              
exit
terminate
instance

FFRESUMEINST                            
Resume
the flash frozen
instance

FFSTATUS                                 Flash freeze
status
instance

SKDSTTPCS       ifname   ofname         Helps
translate
PCs
names

WATCH           address len self|exist|all|target  Watch a region
memory

DELETE
        local|global|target watchpoint id    Delete
a watchpoint

SHOW
          local|global|target watchpoints        Show
 watchpoints

DIRECT_ACCESS   set/enable/disable
command |
select
query
Fixed
table
access

CORE                                     Dump core
without
crashing process

IPC                                       Dump ipc information

UNLIMIT                                   Unlimit the
the
trace
file

PROCSTAT                                 Dump process
statistics

CALL
          func [arg1] … [argn]   Invoke
function
with
arguments

感謝各位的閱讀!關(guān)于“如何使用 10046 查看執(zhí)行計(jì)劃并讀懂 trace 文件”這篇文章就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,讓大家可以學(xué)到更多知識(shí),如果覺得文章不錯(cuò),可以把它分享出去讓更多的人看到吧!

向 AI 問一下細(xì)節(jié)

丸趣 TV 網(wǎng) – 提供最優(yōu)質(zhì)的資源集合!

正文完
 
丸趣
版權(quán)聲明:本站原創(chuàng)文章,由 丸趣 2024-02-04發(fā)表,共計(jì)3043字。
轉(zhuǎn)載說明:除特殊說明外本站除技術(shù)相關(guān)以外文章皆由網(wǎng)絡(luò)搜集發(fā)布,轉(zhuǎn)載請注明出處。
評論(沒有評論)
主站蜘蛛池模板: 蕉岭县| 五家渠市| 呼伦贝尔市| 玛纳斯县| 米泉市| 明水县| 南漳县| 浮梁县| 江都市| 东安县| 河西区| 政和县| 曲阳县| 新竹县| 瑞金市| 禄丰县| 万州区| 项城市| 偏关县| 安仁县| 安徽省| 兖州市| 璧山县| 嵊州市| 楚雄市| 水城县| 镇原县| 贵定县| 石家庄市| 富阳市| 都昌县| 宁化县| 新绛县| 十堰市| 申扎县| 临江市| 桐柏县| 娄烦县| 武威市| 特克斯县| 宜城市|