Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to get implicit parameters in shell script

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article is about how shell scripts get implicit parameters. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

The script involves: gethidpar.sql acquires implicit parameters

Gettrcname.sql gets the name of the current trace file

Getplan.sql gets the execution plan of the sql statement through the v$sql_plan view.

The gethidpar.sql content is as follows:

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 xrem sys. Xrek sppcv y

Where x.indx = y.indx

And x.ksppinm like'% & par%'

/

The gettrcname.sql content is as follows:

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 smag vandalism process pm where s.paddr = p.addr and s.sid = m.sid and m.statistic#=0) d

/

The getplan.sql content is as follows:

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 minute vandalism session waiting b

Where a.sid = b.sid and b.event ='& waitevent')

Order by hash_value,child_number,id

/

Thank you for reading! This is the end of the article on "how to get implicit parameters in shell script". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report