<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>天道酬勤 &#187; Useful Script</title>
	<atom:link href="http://www.ochef.net/tag/script/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ochef.net</link>
	<description>RDBMS and My Life</description>
	<lastBuildDate>Mon, 19 Jul 2010 02:01:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3181</generator>
		<item>
		<title>查询隐含参数的代码</title>
		<link>http://www.ochef.net/2009/05/implicit-parameter-query-code/</link>
		<comments>http://www.ochef.net/2009/05/implicit-parameter-query-code/#comments</comments>
		<pubDate>Tue, 12 May 2009 05:32:58 +0000</pubDate>
		<dc:creator>ochef</dc:creator>
				<category><![CDATA[dba-script]]></category>
		<category><![CDATA[Useful Script]]></category>

		<guid isPermaLink="false">http://www.ochef.net/?p=334</guid>
		<description><![CDATA[下面代码可用于查询系统中所有的隐含参数，Coding来自eygle的著作《深入浅出Oracle》。再次精读这本书，以前对Oracle的理解一些模糊的地方慢慢清晰起来，告诫自己，继续努力！ Coding: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 SQL&#62;select x.ksppinm name, y.ksppstvl value, y.ksppstdf isdefault, decode&#40;bitand&#40;y.ksppstvf,7&#41;,1,'MODIFIED',4,'SYSTEM_MOD','FALSE'&#41; ismod, decode&#40;bitand&#40;y.ksppstvf,2&#41;,2,'TRUE','FALSE'&#41; isadj FROM sys.x$ksppi x, sys.x$ksppcv y WHERE x.inst_id=userenv&#40;'Instance'&#41; AND y.inst_id=userenv&#40;'Instance'&#41; AND x.indx=y.indx AND x.ksppinm LIKE '%_&#38;par%' ORDER BY translate&#40;x.ksppinm,'_',''&#41;; Enter value FOR par: shared_pool_reserved_min_alloc old 14: x.ksppinm [...]]]></description>
			<content:encoded><![CDATA[<p>下面代码可用于查询系统中所有的隐含参数，Coding来自eygle的著作《深入浅出Oracle》。再次精读这本书，以前对Oracle的理解一些模糊的地方慢慢清晰起来，告诫自己，继续努力！<br />
Coding:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="sql" style="font-family:monospace;">SQL<span style="color: #66cc66;">&gt;</span>select 
   x<span style="color: #66cc66;">.</span>ksppinm   name<span style="color: #66cc66;">,</span>
   y<span style="color: #66cc66;">.</span>ksppstvl  value<span style="color: #66cc66;">,</span>
   y<span style="color: #66cc66;">.</span>ksppstdf  isdefault<span style="color: #66cc66;">,</span>
   decode<span style="color: #66cc66;">&#40;</span>bitand<span style="color: #66cc66;">&#40;</span>y<span style="color: #66cc66;">.</span>ksppstvf<span style="color: #66cc66;">,</span><span style="color: #cc66cc;">7</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'MODIFIED'</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">4</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'SYSTEM_MOD'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'FALSE'</span><span style="color: #66cc66;">&#41;</span>  ismod<span style="color: #66cc66;">,</span>
   decode<span style="color: #66cc66;">&#40;</span>bitand<span style="color: #66cc66;">&#40;</span>y<span style="color: #66cc66;">.</span>ksppstvf<span style="color: #66cc66;">,</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'TRUE'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'FALSE'</span><span style="color: #66cc66;">&#41;</span>  isadj
   <span style="color: #993333; font-weight: bold;">FROM</span>
     sys<span style="color: #66cc66;">.</span>x$ksppi   x<span style="color: #66cc66;">,</span>
     sys<span style="color: #66cc66;">.</span>x$ksppcv  y
   <span style="color: #993333; font-weight: bold;">WHERE</span>
     x<span style="color: #66cc66;">.</span>inst_id<span style="color: #66cc66;">=</span>userenv<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Instance'</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AND</span>
     y<span style="color: #66cc66;">.</span>inst_id<span style="color: #66cc66;">=</span>userenv<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Instance'</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AND</span>
     x<span style="color: #66cc66;">.</span>indx<span style="color: #66cc66;">=</span>y<span style="color: #66cc66;">.</span>indx <span style="color: #993333; font-weight: bold;">AND</span>
     x<span style="color: #66cc66;">.</span>ksppinm <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">'%_&amp;par%'</span>
   <span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span>
     translate<span style="color: #66cc66;">&#40;</span>x<span style="color: #66cc66;">.</span>ksppinm<span style="color: #66cc66;">,</span><span style="color: #ff0000;">'_'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">''</span><span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>


<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">Enter value <span style="color: #993333; font-weight: bold;">FOR</span> par: shared_pool_reserved_min_alloc
old  <span style="color: #cc66cc;">14</span>:      x<span style="color: #66cc66;">.</span>ksppinm <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">'%_&amp;par%'</span>
new  <span style="color: #cc66cc;">14</span>:      x<span style="color: #66cc66;">.</span>ksppinm <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">'%_shared_pool_reserved_min_alloc%'</span>
&nbsp;
NAME                                VALUE        ISDEFAULT ISMOD      ISADJ
<span style="color: #808080; font-style: italic;">----------------------------------- ------------ --------- ---------- -----</span>
_shared_pool_reserved_min_alloc     <span style="color: #cc66cc;">4400</span>         TRUE      FALSE      FALSE</pre></div></div>

<p>-The End-</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ochef.net/2009/05/implicit-parameter-query-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
