常用指令碼:獲取隱含引數
指令碼涉及:gethidpar.sql 獲取隱含引數
gettrcname.sql 獲取當前trace檔名稱
getplan.sql 獲取sql語句的執行計劃,透過v$sql_plan檢視。
gettrcname.sql 獲取當前trace檔名稱
getplan.sql 獲取sql語句的執行計劃,透過v$sql_plan檢視。
gethidpar.sql內容如下:
set linesize 120
col name for a30
col value for a20
col describ for a60
col name for a30
col value for a20
col describ for a60
select x.ksppinm name, y.ksppstvl value, x.ksppdesc describ
from sys.x$ksppi x,sys.x$ksppcv y
where x.indx = y.indx
and x.ksppinm like '%&par%'
from sys.x$ksppi x,sys.x$ksppcv y
where x.indx = y.indx
and x.ksppinm like '%&par%'
/
gettrcname.sql 內容如下:
select
a.value || b.symbol || c.instance_name || '_ora_' || d.spid || '.trc' trace_file_name
from (select value from v$parameter where name = 'user_dump_dest')a,
(select substr(value,-6,1) symbol from v$parameter where name = 'user_dump_dest') b,
(select instance_name from v$instance) c,
(select spid from v$session s,v$process p,v$mystat m where s.paddr = p.addr and s.sid = m.sid and m.statistic#=0) d
select
a.value || b.symbol || c.instance_name || '_ora_' || d.spid || '.trc' trace_file_name
from (select value from v$parameter where name = 'user_dump_dest')a,
(select substr(value,-6,1) symbol from v$parameter where name = 'user_dump_dest') b,
(select instance_name from v$instance) c,
(select spid from v$session s,v$process p,v$mystat m where s.paddr = p.addr and s.sid = m.sid and m.statistic#=0) d
/
getplan.sql 內容如下:
set linesize 120
col operation format a55
col cost format 99999
col kbytes format 999999
col object format a25
set linesize 120
col operation format a55
col cost format 99999
col kbytes format 999999
col object format a25
select hash_value,child_number,
lpad(' ',2*depth) || operation || ' ' || options || decode(id,0,substr(optimizer,1,6) || 'Cost=' || to_char(cost)) operation,
object_name object,
cost,
round(bytes/1024) kbytes
from v$sql_plan
where hash_value in (
select a.sql_hash_value from v$session a,v$session_wait b
where a.sid = b.sid and b.event = '&waitevent')
order by hash_value,child_number,id;
/
lpad(' ',2*depth) || operation || ' ' || options || decode(id,0,substr(optimizer,1,6) || 'Cost=' || to_char(cost)) operation,
object_name object,
cost,
round(bytes/1024) kbytes
from v$sql_plan
where hash_value in (
select a.sql_hash_value from v$session a,v$session_wait b
where a.sid = b.sid and b.event = '&waitevent')
order by hash_value,child_number,id;
/
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/2317695/viewspace-2152964/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- shell指令碼中main函式中$#獲取不到指令碼傳入引數個數淺析指令碼AI函式
- Python指令碼的常見引數獲取和處理方式Python指令碼
- URL引數獲取/轉碼
- [20190417]隱含引數_SPIN_COUNT.txt
- gofiber: 獲取引數Go
- maven的指令及常用引數Maven
- [20190401]隱含引數_mutex_spin_count.txtMutex
- Oracle direct path read相關隱含引數Oracle
- python獲取命令列引數的程式碼Python命令列
- JavaScript—獲取引數(23)JavaScript
- js獲取url傳遞引數,js獲取url?號後面的引數JS
- 獲取url上的引數
- Laravel request 獲取路由引數Laravel路由
- HttpServletRequest獲取header引數 signHTTPServletHeader
- Oracle 11G 隱含引數“_controlfile_autobackup_delay”Oracle
- v$parameter gv$parameter 檢視 DDL 與隱含引數
- [20191206]隱含引數_db_always_check_system_ts.txt
- 【Azure Redis 快取】使用Python程式碼獲取Azure Redis的監控指標值 (含Powershell指令碼方式)Redis快取Python指標指令碼
- jenkins pipline指令碼 獲取git分支Jenkins指令碼Git
- MySQL故障診斷常用方法手冊(含指令碼、案例)MySql指令碼
- Jmeter的指令碼引數化JMeter指令碼
- 使用隱含引數testMappingSpeed排查GoldenGate抽取慢的步驟APPGo
- 【PARANETERS】Oracle異常恢復相關的隱含引數Oracle
- Docker - 01 常用指令、引數配置速查表Docker
- js實現獲取URL引數JS
- C#獲取URL引數值C#
- go語言獲取外部引數Go
- vue獲取位址列引數方法Vue
- http獲取get引數過濾HTTP
- React router 4 獲取路由引數,跨頁面引數React路由
- 小程式 獲取帶引數太陽碼的引數,並解析出來(wxacode.getUnlimited)MIT
- 如何從context-param獲取引數?Context
- Spring LocalVariableTableParameterNameDiscoverer獲取方法的引數名Spring
- C# 解析獲取Url引數值C#
- JavaScript 獲取 url 傳遞引數值JavaScript
- 表單請求獲取路由引數路由
- SOLIDWORKS如何獲取模型中的引數Solid模型
- SpringBoot 攔截器獲取 @RequestBody 引數Spring Boot