shell腳本如何獲取隱含參數(shù)

這篇文章給大家分享的是有關(guān)shell腳本如何獲取隱含參數(shù)的內(nèi)容。小編覺得挺實(shí)用的,因此分享給大家做個(gè)參考,一起跟隨小編過來看看吧。

創(chuàng)新互聯(lián)主要企業(yè)基礎(chǔ)官網(wǎng)建設(shè),電商平臺建設(shè),移動手機(jī)平臺,微信小程序等一系列專為中小企業(yè)定制網(wǎng)站產(chǎn)品體系;應(yīng)對中小企業(yè)在互聯(lián)網(wǎng)運(yùn)營的各種問題,為中小企業(yè)在互聯(lián)網(wǎng)的運(yùn)營中保駕護(hù)航。

腳本涉及:gethidpar.sql 獲取隱含參數(shù)
          gettrcname.sql 獲取當(dāng)前trace文件名稱
          getplan.sql  獲取sql語句的執(zhí)行計(jì)劃,通過v$sql_plan視圖。

gethidpar.sql內(nèi)容如下:

set linesize 120
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%'

/

gettrcname.sql 內(nèi)容如下:
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 內(nèi)容如下:
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;
 
/

感謝各位的閱讀!關(guān)于“shell腳本如何獲取隱含參數(shù)”這篇文章就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,讓大家可以學(xué)到更多知識,如果覺得文章不錯(cuò),可以把它分享出去讓更多的人看到吧!

分享題目:shell腳本如何獲取隱含參數(shù)
本文鏈接:http://muchs.cn/article4/ipghoe.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供ChatGPT定制開發(fā)、網(wǎng)站設(shè)計(jì)公司微信公眾號、軟件開發(fā)企業(yè)建站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

外貿(mào)網(wǎng)站制作