<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-34658302</atom:id><lastBuildDate>Fri, 13 Sep 2024 07:07:05 +0000</lastBuildDate><category>Oracle Basics</category><category>Quick SQL&#39;s</category><category>Unix</category><category>Oracle Performance Tunning</category><category>ORA Errors</category><category>Troubleshooting</category><category>DR</category><category>Oracle Cross-Platform Migration</category><title>Tips, information and some real-time experiences in Oracle, UNIX</title><description></description><link>http://oracleshare.blogspot.com/</link><managingEditor>noreply@blogger.com (kaspi)</managingEditor><generator>Blogger</generator><openSearch:totalResults>49</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34658302.post-2293848066018670505</guid><pubDate>Thu, 22 Aug 2013 03:03:00 +0000</pubDate><atom:updated>2013-08-21T20:03:37.407-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Unix</category><title>To add up column values in a file - UNIX</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
To all up all the values in a particular column of a file in unix use below command&lt;br /&gt;
&lt;br /&gt;
Ex: sample.txt contains below data&lt;br /&gt;
10 20 30&lt;br /&gt;
40 50 60&lt;br /&gt;
70 80 90&lt;br /&gt;
&lt;br /&gt;
Now I want to add all values in column two of above file sample.txt&lt;br /&gt;
&lt;br /&gt;
$ cat sample.txt | awk -F&#39; &#39; &amp;nbsp;&#39;{print $2}&#39; &amp;nbsp;| awk &#39;{total = total +$1}END{print total}&#39;&lt;br /&gt;
&lt;br /&gt;
Output: 150&lt;/div&gt;
</description><link>http://oracleshare.blogspot.com/2013/08/to-add-up-column-values-in-file-unix.html</link><author>noreply@blogger.com (kaspi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34658302.post-3967488675142028825</guid><pubDate>Thu, 22 Aug 2013 02:55:00 +0000</pubDate><atom:updated>2013-08-21T19:56:02.006-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Unix</category><title>How to rename or unzip or untar and vice-versa all files in a directory with same file extension - UNIX</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
To rename or unzip or untar and vice-versa all files in a directory use below commands&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Command&lt;/b&gt;:&lt;br /&gt;
$ for i in `ls -latr *.txt.2013 | awk &#39;{print $9}&#39;`&lt;br /&gt;
do&lt;br /&gt;
mv $i `basename $i .2013`&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
The above command will rename all files in a directory for example test01.txt.2013, test02.txt.2013, test03.txt.2013 to test01.txt, test02.txt, test03.txt&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Note&lt;/b&gt;: All lines after $ symbol line together form the command.&lt;br /&gt;
&lt;br /&gt;
A similar command can be used to unzip or untar all files in a directory&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Command&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
$ for i in `ls -latr *.txt.gz | awk &#39;{print $9}&#39;`&lt;br /&gt;
do&lt;br /&gt;
gunzip $i&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
The above command will unizp all files in a directory for example test01.txt.gz, test02.txt.gz, test03.txt.gz to test01.txt, test02.txt, test03.txt&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Note&lt;/b&gt;: All lines after $ symbol line together form the command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</description><link>http://oracleshare.blogspot.com/2013/08/how-to-rename-or-unzip-or-untar-and.html</link><author>noreply@blogger.com (kaspi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34658302.post-3220911131854202445</guid><pubDate>Thu, 22 Aug 2013 02:43:00 +0000</pubDate><atom:updated>2013-08-21T19:43:07.687-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Unix</category><title>How to print or trim end characters of a string/line in UNIX</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
The commands below help in printing end characters of a line or a string.&amp;nbsp;I assume that ORACLE_SID is set to &quot;TESTDB&quot; for examples below.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Print last one character from ORACLE_SID:&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
$ echo $ORACLE_SID | sed -e &quot;s/^.*\(.\)$/1/&quot;&lt;br /&gt;
Output: B&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Print last two characters:&lt;/b&gt;&lt;br /&gt;
$ echo $ORACLE_SID | sed -e &quot;s/^.*\(..\)$/1/&quot;&lt;br /&gt;
Output: DB&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Print last three characters:&lt;/b&gt;&lt;br /&gt;
$ echo $ORACLE_SID | sed -e &quot;s/^.*\(...\)$/1/&quot;&lt;br /&gt;
Output: TDB&lt;br /&gt;
&lt;br /&gt;
The commands below help in trimming end characters of a line or a string. &amp;nbsp;I assume that&amp;nbsp;ORACLE_SID is set to &quot;TESTDB&quot; for examples below.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Trims last one character:&lt;/b&gt;&lt;br /&gt;
$ echo $ORACLE_SID | sed &#39;s/.$//&#39;&lt;br /&gt;
Output: TESTD&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Trims last two characters:&lt;/b&gt;&lt;br /&gt;
$ echo $ORACLE_SID | sed &#39;s/..$//&#39;&lt;br /&gt;
Output: TEST&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Trims last three characters:&lt;/b&gt;&lt;br /&gt;
$ echo $ORACLE_SID | sed &#39;s/...$//&#39;&lt;br /&gt;
Output: TES&lt;/div&gt;
</description><link>http://oracleshare.blogspot.com/2013/08/how-to-print-or-trim-end-characters-of.html</link><author>noreply@blogger.com (kaspi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34658302.post-6069207138656832060</guid><pubDate>Thu, 22 Aug 2013 02:27:00 +0000</pubDate><atom:updated>2013-08-21T19:27:51.945-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Quick SQL&#39;s</category><title>SQL Query to find top SQL&#39;s with two specific AWR Snapshots</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
SQL:&lt;br /&gt;
&lt;br /&gt;
WITH subq as&lt;br /&gt;
(SELECT *&lt;br /&gt;
&amp;nbsp; &amp;nbsp; FROM (SELECT s.sql_id,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SUM(nvl(s.executions_delta, 0)) execs,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SUM(round(s.elapsed_time_delta / 1000000, 3)) exec_time,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SUM(round(s.buffer_gets_delta)) io_logical,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SUM(round(s.cpu_time_delta / 1000000, 3)) cpu_time,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SUM(nvl(s.parse_calls_delta, 0)) parse_calls,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SUM(round(s.iowait_delta / 1000000, 3)) io_wait,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SUM(nvl(s.disk_reads_delta, 0)) disk_reads&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FROM dba_hist_sqlstat s, dba_hist_snapshot ss&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; WHERE s.snap_id BETWEEN &lt;b&gt;start_snap_id&lt;/b&gt; AND &lt;b&gt;end_snap_id&lt;/b&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AND ss.snap_id = s.snap_id&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AND ss.instance_number = s.instance_number&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AND s.executions_delta &amp;gt; 0&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;GROUP BY s.sql_id&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ORDER BY exec_time DESC)&lt;br /&gt;
&amp;nbsp; WHERE rownum &amp;lt; &lt;b&gt;num_of_sqls&lt;/b&gt;)&lt;br /&gt;
SELECT subq.*, substr(sql_text, 1, 8000) sqltext&lt;br /&gt;
&amp;nbsp; &amp;nbsp; FROM dba_hist_sqltext st, subq&lt;br /&gt;
&amp;nbsp;WHERE st.sql_id=subq.sql_id&lt;br /&gt;
&amp;nbsp;ORDER BY 3 desc&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Things to replace in above sql before executing:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;start_snap_id&lt;/b&gt;: replace this with starting AWR snapshot number of your database from your peak day snapshots for the period which you want collect the top SQL&#39;s. For example: Starting snapshot of database TEST on wednesday at 9AM is 12345.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;end_snap_id&lt;/b&gt;: replace this with ending AWR snapshot number of your database from your peak day snapshots for the period which you want collect the top SQL&#39;s. For example: Ending snapshot of database TEST on wednesday at 9AM is 12355.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;num_of_sqls&lt;/b&gt;: Give the number of how many top SQL&#39;s you want to collect using the query for example if you want to collect top 50 SQL&#39;s replace num_of_sqls with 50&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</description><link>http://oracleshare.blogspot.com/2013/08/sql-query-to-find-top-sqls-with-two.html</link><author>noreply@blogger.com (kaspi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34658302.post-7355999090606985696</guid><pubDate>Thu, 14 Jul 2011 19:12:00 +0000</pubDate><atom:updated>2011-07-14T12:16:41.496-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Quick SQL&#39;s</category><title>Undo Latch Contention</title><description>Here is the SQL to find sessions causing UNDO Latch Contention:&lt;br /&gt;
&lt;div style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;select&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp; swh.seq#,&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp; sess.sid,&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp; sess.username username,&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp; swh.event&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; event, &lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp; swh.p1, &lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp; swh.p2&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;from&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp; v$session&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sess, &lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp; v$session_wait_history&amp;nbsp; swh&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;where&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp; sess.sid = 798&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;and&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp; sess.sid = swh.sid&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;order by &lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp; swh.seq#;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Sample Output&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SEQ#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; USERNAME&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EVENT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; P1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; P2&lt;br /&gt;
---------- -------&amp;nbsp;&amp;nbsp;&amp;nbsp; --------------- ------------------------------------&amp;nbsp;&amp;nbsp; --------------&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ---------- &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 798&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ORCL &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; latch free&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5.0440E+17&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 127&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 798&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ORCL &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; latch free&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5.0440E+17&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 127&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 798&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ORCL &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; latch free&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5.0440E+17&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 127&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 798&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ORCL &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; latch free&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5.0440E+17&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 127&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 798&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ORCL &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; latch: cache buffers chains&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5.0440E+17&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 122&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5 rows selected.</description><link>http://oracleshare.blogspot.com/2011/07/undo-latch-contention.html</link><author>noreply@blogger.com (kaspi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34658302.post-487988007404792748</guid><pubDate>Thu, 14 Jul 2011 19:06:00 +0000</pubDate><atom:updated>2011-07-14T12:17:27.402-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Quick SQL&#39;s</category><title>To find list of objects accessed by a database session</title><description>Here is a simple query that shows all the objects accessed by a database:&lt;br /&gt;
&lt;div style=&quot;color: red;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;SELECT sid,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; owner,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TYPE,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; object&lt;br /&gt;
&amp;nbsp; FROM v$access&lt;br /&gt;
&amp;nbsp;WHERE sid = &#39;&lt;i&gt;session_id&lt;/i&gt;&#39;;&lt;/div&gt;&lt;br /&gt;
Ex:&lt;br /&gt;
&lt;div style=&quot;color: blue;&quot;&gt;SELECT sid,&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; owner,&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TYPE,&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; object&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&amp;nbsp; FROM v$access&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&amp;nbsp;WHERE sid = &#39;769&#39;; &lt;/div&gt;</description><link>http://oracleshare.blogspot.com/2011/07/to-find-list-of-objects-accessed-by.html</link><author>noreply@blogger.com (kaspi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34658302.post-107961850740002822</guid><pubDate>Mon, 30 Aug 2010 17:21:00 +0000</pubDate><atom:updated>2011-07-14T12:18:27.275-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Quick SQL&#39;s</category><title>Temporary Tablespace Space Monitoring</title><description>Here are some quick SQL&#39;s to monitor the usage of TEMP Tablespace:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Space Usage of TEMP Tablespace:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: blue;&quot;&gt;SELECT A.tablespace_name tablespace, D.mb_total,&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;SUM (A.used_blocks * D.block_size) / 1024 / 1024 mb_used,&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;D.mb_total - SUM (A.used_blocks * D.block_size) / 1024 / 1024 mb_free&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;FROM v$sort_segment A,&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;(&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;SELECT B.name, C.block_size, SUM (C.bytes) / 1024 / 1024 mb_total&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;FROM v$tablespace B, v$tempfile C&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;WHERE B.ts#= C.ts#&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;GROUP BY B.name, C.block_size&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;) D&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;WHERE A.tablespace_name = D.name&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;GROUP by A.tablespace_name, D.mb_total;&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;b&gt;Temp Space Usage by Session:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: blue;&quot;&gt;SELECT S.sid || &#39;,&#39; || S.serial# sid_serial, S.username, S.osuser, P.spid, S.module,&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;S.program, SUM (T.blocks) * TBS.block_size / 1024 / 1024 mb_used, T.tablespace,&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;COUNT(*) sort_ops&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;FROM v$sort_usage T, v$session S, dba_tablespaces TBS, v$process P&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;WHERE T.session_addr = S.saddr&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;AND S.paddr = P.addr&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;AND T.tablespace = TBS.tablespace_name&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;GROUP BY S.sid, S.serial#, S.username, S.osuser, P.spid, S.module,&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;S.program, TBS.block_size, T.tablespace&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;ORDER BY sid_serial;&lt;/div&gt;&amp;nbsp; &lt;br /&gt;
&lt;b&gt;Temp Space Usage by Statement:&lt;/b&gt; &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;div style=&quot;color: blue;&quot;&gt;SELECT S.sid || &#39;,&#39; || S.serial# sid_serial, S.username, &lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;T.blocks * TBS.block_size / 1024 / 1024 mb_used, T.tablespace,&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;T.sqladdr address, Q.hash_value, Q.sql_text&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;FROM v$sort_usage T, v$session S, v$sqlarea Q, dba_tablespaces TBS&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;WHERE T.session_addr = S.saddr&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;AND T.sqladdr = Q.address (+)&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;AND T.tablespace = TBS.tablespace_name&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;ORDER BY S.sid;&lt;/div&gt;</description><link>http://oracleshare.blogspot.com/2010/08/temporary-tablespace-space-monitoring.html</link><author>noreply@blogger.com (kaspi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34658302.post-1374085164647684341</guid><pubDate>Fri, 27 Aug 2010 04:04:00 +0000</pubDate><atom:updated>2011-07-14T12:19:03.642-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Oracle Performance Tunning</category><title>Waits Related to Initialization Parameters</title><description>Wait Problem: Potential Fix&lt;br /&gt;
Free buffer: Increase the DB_CACHE_SIZE; shorten the checkpoint; tune the code&lt;br /&gt;
Buffer busy: &amp;nbsp;Segment Header — Add freelists or freelist groups or use ASSM&lt;br /&gt;
Buffer busy: &amp;nbsp;Data Block — Separate hot data; use reverse key indexes; small&amp;nbsp;block sizes&lt;br /&gt;
Buffer busy: &amp;nbsp;Data Block — Increase initrans and/or maxtrans&lt;br /&gt;
Buffer busy: &amp;nbsp;Undo Header —Use automatic undo management&lt;br /&gt;
Buffer busy: &amp;nbsp;Undo Block — Commit more; use automatic undo management&lt;br /&gt;
Latch free: &amp;nbsp;Investigate the detail (listing in next table of this chapter for fixes)&lt;br /&gt;
Log buffer space: Increase the log buffer; use faster disks for the redo logs&lt;br /&gt;
Scattered read: Indicates many full table scans — tune the code; cache small tables&lt;br /&gt;
Sequential read: Indicates many index reads — tune the code (especially joins)&lt;br /&gt;
Write complete waits: Adds database writers; checkpoint more often; buffer cache too small&lt;br /&gt;
&lt;br /&gt;
Latch Problem: Potential Fix&lt;br /&gt;
&lt;br /&gt;
Library cache: &amp;nbsp;Use bind variables; adjust the shared_pool_size&lt;br /&gt;
Shared pool: &amp;nbsp;Use bind variables; adjust the shared_pool_size&lt;br /&gt;
Row cache objects: Increase the shared pool. This is not a common problem.&lt;br /&gt;
Cache buffers chain: &amp;nbsp;If you get this latch wait, it means you need to reduce logical I/O&amp;nbsp;rates by tuning and minimizing the I/O requirements of the SQL&amp;nbsp;involved. High I/O rates could be a sign of a hot block (meaning&lt;br /&gt;
a block highly accessed). Cache buffer lru chain latch contention&amp;nbsp;can be resolved by increasing the size of the buffer cache and&amp;nbsp;thereby reducing the rate at which new blocks are introduced&amp;nbsp;into the buffer cache. You should adjust DB_BLOCK_BUFFERS,&amp;nbsp;and possible DB_BLOCK_SIZE. Multiple buffer pools can help&lt;br /&gt;
reduce contention on this latch. You can create additional cache&amp;nbsp;buffer lru chain latches by adjusting the configuration parameter&amp;nbsp;DB_BLOCK_LRU_LATCHES. You may be able to reduce the load&amp;nbsp;on the cache buffer chain latches by increasing the configuration&amp;nbsp;parameter. _DB_BLOCK_HASH_BUCKETS may need to be&amp;nbsp;increased or set to a prime number (in pre-9i versions).</description><link>http://oracleshare.blogspot.com/2010/08/waits-related-to-initialization.html</link><author>noreply@blogger.com (kaspi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34658302.post-6666594459933880884</guid><pubDate>Fri, 27 Aug 2010 03:55:00 +0000</pubDate><atom:updated>2011-07-14T12:19:18.329-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Quick SQL&#39;s</category><title>Library Cache SQL</title><description>The following query uses the V$LIBRARYCACHE view to examine the&amp;nbsp;reload ratio in the library cache:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;select Sum(Pins) &quot;Hits&quot;,&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Sum(Reloads) &quot;Misses&quot;,&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;((Sum(Reloads) / Sum(Pins)) * 100)&quot;Reload %&quot;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;from V$LibraryCache;&lt;/span&gt;&lt;/div&gt;</description><link>http://oracleshare.blogspot.com/2010/08/library-cache-sql.html</link><author>noreply@blogger.com (kaspi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34658302.post-7060751493079984651</guid><pubDate>Fri, 27 Aug 2010 03:53:00 +0000</pubDate><atom:updated>2011-07-14T12:19:39.676-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Quick SQL&#39;s</category><title>Data Dictionary Cache Hit Ratio SQL</title><description>SQL:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;select ((1 - (Sum(GetMisses) / (Sum(Gets) + Sum(GetMisses)))) * 100) &quot;Hit Rate&quot;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;from V$RowCache&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;where Gets + GetMisses &amp;lt;&amp;gt; 0;&lt;/span&gt;&lt;/div&gt;</description><link>http://oracleshare.blogspot.com/2010/08/data-dictionary-cache-hit-ratio-sql.html</link><author>noreply@blogger.com (kaspi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34658302.post-1410565823043229300</guid><pubDate>Fri, 27 Aug 2010 02:57:00 +0000</pubDate><atom:updated>2011-07-14T12:19:53.377-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Quick SQL&#39;s</category><title>Session or System Modifiable Parameter SQL</title><description>There are two key fields in the V$PARAMETER view:&lt;br /&gt;
■ ISSES_MODIFIABLE Indicates if a user with the ALTER SESSION privilege can modify&lt;br /&gt;
this initialization parameter for their session.&lt;br /&gt;
&lt;br /&gt;
■ ISSYS_MODIFIABLE Indicates if someone with ALTER SYSTEM privilege can modify&lt;br /&gt;
this particular parameter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This query displays the initialization parameters that&amp;nbsp;can be modified with an ALTER SYSTEM or ALTER SESSION command (partial result displayed):&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;select name, value, isdefault, isses_modifiable, issys_modifiable&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;from v$parameter&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;where issys_modifiable &amp;lt;&amp;gt; &#39;FALSE&#39;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;or isses_modifiable &amp;lt;&amp;gt; &#39;FALSE&#39;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;order by name;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;</description><link>http://oracleshare.blogspot.com/2010/08/session-or-system-modifiable-parameter.html</link><author>noreply@blogger.com (kaspi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34658302.post-4041118228915060030</guid><pubDate>Fri, 27 Aug 2010 02:55:00 +0000</pubDate><atom:updated>2011-07-14T12:20:09.722-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Quick SQL&#39;s</category><title>Data Cache Hit Ratio SQL</title><description>Query to view the data cache hit ratio:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;column phys format 999,999,999 heading &#39;Physical Reads&#39;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;column gets format 999,999,999 heading &#39; DB Block Gets&#39;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;column con_gets format 999,999,999 heading &#39;Consistent Gets&#39;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;column hitratio format 999.99 heading &#39; Hit Ratio &#39;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;select sum(decode(name,&#39;physical reads&#39;,value,0)) phys,&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;sum(decode(name,&#39;db block gets&#39;,value,0)) gets,&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;sum(decode(name,&#39;consistent gets&#39;, value,0)) con_gets,&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;(1 - (sum(decode(name,&#39;physical reads&#39;,value,0)) /&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;(sum(decode(name,&#39;db block gets&#39;,value,0)) +&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;sum(decode(name,&#39;consistent gets&#39;,value,0))))) * 100 hitratio&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;from v$sysstat;&lt;/span&gt;&lt;/div&gt;</description><link>http://oracleshare.blogspot.com/2010/08/data-cache-hit-ratio-sql.html</link><author>noreply@blogger.com (kaspi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34658302.post-4304997665441890982</guid><pubDate>Tue, 24 Aug 2010 19:36:00 +0000</pubDate><atom:updated>2010-08-24T12:37:07.591-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Oracle Basics</category><title>Cardinality in Oracle Table Joins</title><description>&lt;strong&gt;Cardinatly&lt;/strong&gt;: This is the number of rows that Oracle expects to process or&amp;nbsp;expects to be the number rows that will be returned&amp;nbsp;after joining the tables from the join condition. &lt;br /&gt;
&lt;br /&gt;
More to follow...............</description><link>http://oracleshare.blogspot.com/2010/08/cardinality-in-oracle-table-joins.html</link><author>noreply@blogger.com (kaspi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34658302.post-562758144849596263</guid><pubDate>Tue, 24 Aug 2010 19:23:00 +0000</pubDate><atom:updated>2011-07-14T12:20:42.422-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Quick SQL&#39;s</category><title>Check RMAN Backup Status</title><description>SQL to report on all backups i.e., Full, Incremental and Archive log backups:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: blue;&quot;&gt;col STATUS format a9&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;col hrs format 999.99&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;select SESSION_KEY, INPUT_TYPE, STATUS,&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;to_char(START_TIME,&#39;mm/dd/yy hh24:mi&#39;) start_time,&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;to_char(END_TIME,&#39;mm/dd/yy hh24:mi&#39;) end_time,&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;elapsed_seconds/3600 hrs&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;from V$RMAN_BACKUP_JOB_DETAILS&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;order by session_key;&lt;/div&gt;&lt;br /&gt;
SQL to report on all Full and Incremental backup but not Archive log backups:&lt;br /&gt;
&lt;div style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;col STATUS format a9&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;col hrs format 999.99&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;select SESSION_KEY, INPUT_TYPE, STATUS,&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;to_char(START_TIME,&#39;mm/dd/yy hh24:mi&#39;) start_time,&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;to_char(END_TIME,&#39;mm/dd/yy hh24:mi&#39;) end_time,&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;elapsed_seconds/3600 hrs&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;from V$RMAN_BACKUP_JOB_DETAILS&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;where input_type=&#39;DB INCR&#39;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;order by session_key;&lt;/div&gt;&lt;br /&gt;
To check progress of RMAN Backup:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: blue;&quot;&gt;select SID, START_TIME,TOTALWORK, sofar, (sofar/totalwork) * 100 done,&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;sysdate + TIME_REMAINING/3600/24 end_at&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;from v$session_longops&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;where totalwork &amp;gt; sofar&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;AND opname NOT LIKE &#39;%aggregate%&#39;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;AND opname like &#39;RMAN%&#39;;&lt;/div&gt;</description><link>http://oracleshare.blogspot.com/2010/08/check-rman-backup-status.html</link><author>noreply@blogger.com (kaspi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34658302.post-5794559128134291744</guid><pubDate>Mon, 12 Apr 2010 13:55:00 +0000</pubDate><atom:updated>2010-04-12T06:55:35.696-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Oracle Basics</category><title>Resize/Add/Move/Rename/Drop datafile and temporary datafile in Oracle</title><description>&lt;strong&gt;Resize a datafile and tempfile:&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;SQL&amp;gt; alter database datafile &#39;/u10/oradata/TEST/test.tst_tbspace.data.01.dbf&#39; resize 50M;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;SQL&amp;gt; alter database tempfile &#39;/u09/oradata/TEST/test.tmp_tbspace.data.01.dbf&#39; resize 50M;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Add a datafile:&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;SQL&amp;gt; alter tablespace tst_tbspace1 add datafile &#39;/u10/oradata/TEST/test.tst_tbspace.data.02.dbf&#39; size 2000M;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;SQL&amp;gt; alter tablespace tmp_tbspace add tempfile &#39;/u09/oradata/TEST/test.tmp_tbspace.data.02.dbf&#39; size 2000M;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Steps to move and/or rename datafile in oracle:&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
1. Shutdown the database and exit out of the SQL prompt - Database level step&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;Ex: SQL&amp;gt; shutdown&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
2. At the unix prompt copy or move&amp;nbsp;the datafile from current location to new location using the OS copy (cp) command - OS level step&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;Ex: $ mv /u10/oradata/TEST/test.tbspace.data.01.dbf /u01/oradata/TEST/test.tst_tbspace.data.01.dbf&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
you change the location and also rename the file at a time if you need to.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;Ex: $ mv /u10/oradata/TEST/test.tst_tbspace.data.01.dbf /u01/oradata/TEST/test.tst_tbspace.datafile.02.dbf&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
3. Open a SQL session and startup mount the database - Database level step&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;Ex: SQL&amp;gt; startup mount&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
4. Rename the datafile using oracle rename command - Database level step&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;Ex: SQL&amp;gt; alter database rename file &#39;/u10/oradata/TEST/test.tst_tbspace.data.01.dbf&#39; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; to &#39;/u01/oradata/TEST/test.tbspace.data.01.dbf&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
5. Open the database - Database level step&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;Ex: SQL&amp;gt; alter database open;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (or)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SQL&amp;gt; shutdown&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SQL&amp;gt; startup&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;strong&gt;Drop datafile:&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;SQL&amp;gt;&amp;nbsp;&amp;nbsp;alter database datafile &#39;/u10/oradata/TEST/test.tst_tbspace.data.01.dbf&#39;&amp;nbsp;offline drop;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;(or)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;SQL&amp;gt; alter tablespace tst_tbspace drop datafile &#39;/u10/oradata/TEST/test.tst_tbspace.data.01.dbf&#39;;&lt;/span&gt;</description><link>http://oracleshare.blogspot.com/2010/04/resizeaddmoverenamedrop-datafile-and.html</link><author>noreply@blogger.com (kaspi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34658302.post-5248532466713656798</guid><pubDate>Mon, 12 Apr 2010 13:24:00 +0000</pubDate><atom:updated>2010-04-12T06:55:35.697-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Oracle Basics</category><title>Rename/Copy a Table</title><description>A table in oracle can be renamed using the following syntax:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;alter table &lt;em&gt;table_name&lt;/em&gt; rename to &lt;em&gt;new_table_name&lt;/em&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;Ex: SQL&amp;gt; alter table dept rename to hist_dept;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Renaming a table doesn&#39;t update the oracle&amp;nbsp;objects such as HTML DB, PL/SQL, Views&amp;nbsp;some of which might be invalid based on their dependancy on the renamed object.&lt;br /&gt;
&lt;br /&gt;
A copy of the&amp;nbsp;original table can be created using the following syntax:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;create table &lt;em&gt;new_table_name&lt;/em&gt; as select * from &lt;em&gt;table_name&lt;/em&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;Ex: SQL&amp;gt; create hist_dept as select * from dept;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
we need not necessarily need to include all the columns from the original table we can create a copy based on our choice of columns that we want to be included in the new table. The new table can be created either from one single table or multiple tables. The advantage of using CREATE TABLE....AS SELECT..(CTAS) it will create the new table with datatypes similar to old table(s).&lt;br /&gt;
&lt;br /&gt;
A copy of the original table created including only the columns of our choice from a single table:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;create table &lt;em&gt;new_table_name&lt;/em&gt; as select &lt;em&gt;column1, column2&lt;/em&gt; from &lt;em&gt;table_name&lt;/em&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;Ex: SQL&amp;gt; create hist_dept as select&amp;nbsp;dept_id, dept_name&amp;nbsp;from dept;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A copy of the original table created including only the columns of our choice from a two tables:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;create table &lt;em&gt;new_table_name&lt;/em&gt; as select t1.column1, t2.column1, t2.column2 from &lt;em&gt;table_name1 t1&lt;/em&gt;, &lt;em&gt;table_name2 t2&lt;/em&gt; where t1.column1 = t2.column1;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;Ex: SQL&amp;gt; create hist_dept as select&amp;nbsp;d.dept_id, e.emp_id, e.emp_anem&amp;nbsp;from dept d, employee e where &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; d.dept_id = e.dept_id;&lt;/span&gt;</description><link>http://oracleshare.blogspot.com/2010/04/renamecopy-table.html</link><author>noreply@blogger.com (kaspi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34658302.post-4458863700333860068</guid><pubDate>Thu, 08 Apr 2010 14:15:00 +0000</pubDate><atom:updated>2010-04-08T07:19:03.744-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Oracle Basics</category><title>Oracle Background Processes</title><description>&lt;strong&gt;Oracle Background Porcesses:&lt;/strong&gt; To maximize performance and accommodate many users, a multiprocess Oracle Database system uses background processes. Background processes consolidate functions that would otherwise be handled by multiple database programs running for each user process. Background processes asynchronously perform I/O and monitor other Oracle Database processes to provide increased parallelism for better performance and reliability.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Basic Oracle Background Processes:&lt;/strong&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Database writer (DBWn):&lt;/strong&gt; The database writer writes modified blocks from the database buffer cache to the datafiles. Oracle Database allows a maximum of 20 database writer processes (DBW0-DBW9 and DBWa-DBWj). The DB_WRITER_PROCESSES initialization parameter specifies the number of DBWn processes. The database selects an appropriate default setting for this initialization parameter or adjusts a user-specified setting based on the number of CPUs and the number of processor groups. &lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Log writer (LGWR):&lt;/strong&gt; The log writer process writes redo log entries to disk. Redo log entries are generated in the redo log buffer of the system global area (SGA). LGWR writes the redo log entries sequentially into a redo log file. If the database has a multiplexed redo log, then LGWR writes the redo log entries to a group of redo log files.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Checkpoint (CKPT):&lt;/strong&gt; At specific times, all modified database buffers in the system global area are written to the datafiles by DBWn. This event is called a checkpoint. The checkpoint process is responsible for signalling DBWn at checkpoints and updating all the datafiles and control files of the database to indicate the most recent checkpoint.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;System monitor (SMON):&lt;/strong&gt; The system monitor performs recovery when a failed instance starts up again. In a Real Application Clusters database, the SMON process of one instance can perform instance recovery for other instances that have failed. SMON also cleans up temporary segments that are no longer in use and recovers dead transactions skipped during system failure and instance recovery because of file-read or offline errors. These transactions are eventually recovered by SMON when the tablespace or file is brought back online.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Process monitor (PMON):&lt;/strong&gt; The process monitor performs process recovery when a user process fails. PMON is responsible for cleaning up the cache and freeing resources that the process was using. PMON also checks on the dispatcher processes (described later in this table) and server processes and restarts them if they have failed.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Archiver (ARCn):&lt;/strong&gt; One or more archiver processes copy the redo log files to archival storage when they are full or a log switch occurs. &lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Recoverer (RECO):&lt;/strong&gt; The recoverer process is used to resolve distributed transactions that are pending because of a network or system failure in a distributed database. At timed intervals, the local RECO attempts to connect to remote databases and automatically complete the commit or rollback of the local portion of any pending distributed transactions. &lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Dispatcher (Dnnn):&lt;/strong&gt; Dispatchers are optional background processes, present only when the shared server configuration is used. &lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Global Cache Service (LMS):&lt;/strong&gt; In a Real Application Clusters environment, this process manages resources and provides inter-instance resource control.&lt;/li&gt;
&lt;/ul&gt;&lt;strong&gt;Source:&lt;/strong&gt; Oracle Documentation</description><link>http://oracleshare.blogspot.com/2010/04/oracle-background-processes.html</link><author>noreply@blogger.com (kaspi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34658302.post-8263310782213674629</guid><pubDate>Thu, 08 Apr 2010 13:12:00 +0000</pubDate><atom:updated>2010-04-08T07:19:03.744-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Oracle Basics</category><title>Oracle Dedicated and Shared Server Processes</title><description>Oracle creates server processes whenever a user tries to connect to a database for handling all user requestss. Below are the two ways a server process can be:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;A Dedicated Server Process, which serves only one user or one user connection&lt;/li&gt;
&lt;li&gt;A Shared Server Process, which server multiple users or multiple user connections &lt;/li&gt;
&lt;/ul&gt;&lt;strong&gt;Dedicated Server Processes:&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Oracle databases are by default configured for dedicated server process and if you need to enable Shared server process you need to configure it manually by setting one or more initialization parameters. However&amp;nbsp;a Dedicated server process is always&amp;nbsp;required&amp;nbsp; for:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;To submit a batch job (for example, when a job can allow little or no idle time for the server process)&lt;/li&gt;
&lt;li&gt;To use Recovery Manager (RMAN) to back up, restore, or recover a database&lt;/li&gt;
&lt;/ul&gt;To request a dedicated server connection when Oracle Database is configured for shared server, users must connect using a net service name that is configured to use a dedicated server. Specifically, the net service name value should include the SERVER=DEDICATED clause in the connect descriptor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPQxuKsvx6-naxbAT1Duwy2ZRdEEaf3lO6HBhuRvfhS_lCqxPbnv2t0enBkP2NMjO9o0P5NdvL36ESWdkRazo7Rc8VFX6HYrxZNrKuqz-JNm64GRenbCnk4CwnN6O2jFkzGHrZdA/s1600/admin013.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;600&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPQxuKsvx6-naxbAT1Duwy2ZRdEEaf3lO6HBhuRvfhS_lCqxPbnv2t0enBkP2NMjO9o0P5NdvL36ESWdkRazo7Rc8VFX6HYrxZNrKuqz-JNm64GRenbCnk4CwnN6O2jFkzGHrZdA/s640/admin013.gif&quot; width=&quot;640&quot; wt=&quot;true&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Figure 1:&amp;nbsp;Oracle Database Dedicated Server Processes&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Shared Server Process:&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixyi_Tz7OF7c4wD1XjGARoiKIiF4YaionBCbDcqKgpEE20bDqMd73KfT_KT1w0XQTEzhEUqvuKhxXcTLJILegP9Ukpp4DpJlODGcIzMc7OS8kthe5vAQ30204I53a368eQq_D5Ag/s1600/untitled.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixyi_Tz7OF7c4wD1XjGARoiKIiF4YaionBCbDcqKgpEE20bDqMd73KfT_KT1w0XQTEzhEUqvuKhxXcTLJILegP9Ukpp4DpJlODGcIzMc7OS8kthe5vAQ30204I53a368eQq_D5Ag/s640/untitled.bmp&quot; width=&quot;384&quot; wt=&quot;true&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Figure 2: Oracle Database Shared Server Processes&lt;br /&gt;
&lt;br /&gt;
In Shared server configuration a client user process&amp;nbsp;connect a dispatcher and the dispatcher then communicates with the oracle database for client request processing once the processing is done oracle then sends back the output or solution back to the dispatcher which in turn communicates it to the client user process. One dispatcher can serve multiple client user processes by connection pooling which can be enabled for shared server process. Further, shared server can be configured for session multiplexing, which combines multiple sessions for transmission over a single network connection in order to conserve the operating system&#39;s resources.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Initialization Parameters for Shared Server:&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
The following initialization parameters control shared server operation:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;SHARED_SERVERS: Specifies the initial number of shared servers to start and the minimum number of shared servers to keep. This is the only required parameter for using shared servers.&lt;/li&gt;
&lt;li&gt;MAX_SHARED_SERVERS: Specifies the maximum number of shared servers that can run simultaneously.&lt;/li&gt;
&lt;li&gt;SHARED_SERVER_SESSIONS: Specifies the total number of shared server user sessions that can run simultaneously. Setting this parameter enables you to reserve user sessions for dedicated servers.&lt;/li&gt;
&lt;li&gt;DISPATCHERS: Configures dispatcher processes in the shared server architecture.&lt;/li&gt;
&lt;li&gt;MAX_DISPATCHERS: Specifies the maximum number of dispatcher processes that can run simultaneously. This parameter can be ignored for now. It will only be useful in a future release when the number of dispatchers is auto-tuned according to the number of concurrent connections.&lt;/li&gt;
&lt;li&gt;CIRCUITS: Specifies the total number of virtual circuits that are available for inbound and outbound network sessions.&lt;/li&gt;
&lt;/ul&gt;&lt;strong&gt;Enabling Shared Server: &lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Shared server is enabled by setting the SHARED_SERVERS initialization parameter to a value greater than 0. The other shared server initialization parameters need not be set. Because shared server requires at least one dispatcher in order to work, a dispatcher is brought up even if no dispatcher has been configured.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Determining a Value for SHARED_SERVERS and others:&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
The SHARED_SERVERS initialization parameter specifies the minimum number of shared servers that you want created when the instance is started. After instance startup, Oracle Database can dynamically adjust the number of shared servers based on how busy existing shared servers are and the length of the request queue.&lt;br /&gt;
You can limit the number of shared servers that can be created by setting MAX_SHARED_SERVERS parameter specifies the maximum number of shared servers that can be automatically created by PMON. After you set the SHARED_SERVERS parameter oracle decides the number of shares servers that needs to be created based on how busy the system is.&lt;br /&gt;
&lt;br /&gt;
The SHARED_SERVER_SESSIONS initialization parameter specifies the maximum number of concurrent shared server user sessions. Setting this parameter, which is a dynamic parameter, lets you reserve database sessions for dedicated servers. &lt;br /&gt;
Configuring Dispatchers:&lt;br /&gt;
&lt;br /&gt;
Ex: This is a typical example of setting the DISPATCHERS initialization parameter.&lt;br /&gt;
&lt;br /&gt;
DISPATCHERS=&quot;(PROTOCOL=TCP)(DISPATCHERS=2)&quot;&lt;br /&gt;
&lt;br /&gt;
You can use multiple different protocols for different dispatchers within the same initialization parameter.&lt;br /&gt;
&lt;br /&gt;
Ex: DISPATCHERS=&#39;(PROT=tcp)(DISP=5)&#39;, &#39;(PROT-tcps)(DISP=3)&#39;&lt;br /&gt;
&lt;br /&gt;
Monitor the following views to determine the load on the dispatcher processes:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;V$QUEUE&lt;/li&gt;
&lt;li&gt;V$DISPATCHER&lt;/li&gt;
&lt;li&gt;V$DISPATCHER_RATE&lt;/li&gt;
&lt;/ul&gt;Shutting down specific Dispatches process:&lt;br /&gt;
To identify the name of the specific dispatcher process to shut down, use the V$DISPATCHER dynamic performance view.&lt;br /&gt;
&lt;br /&gt;
SQL&amp;gt; SELECT NAME, NETWORK FROM V$DISPATCHER;&lt;br /&gt;
&lt;br /&gt;
Each dispatcher is uniquely identified by a name of the form Dnnn.To shut down dispatcher D002, issue the following statement:&lt;br /&gt;
&lt;br /&gt;
SQL&amp;gt;ALTER SYSTEM SHUTDOWN IMMEDIATE &#39;D002&#39;;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Monitoring Shared Server:&lt;/strong&gt;&lt;br /&gt;
The following views are useful for obtaining information about your shared server configuration and for monitoring performance.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;V$DISPATCHER: Provides information on the dispatcher processes, including name, network address, status, various usage statistics, and index number. &lt;/li&gt;
&lt;li&gt;V$DISPATCHER_CONFIG: Provides configuration information about the dispatchers.&lt;/li&gt;
&lt;li&gt;V$DISPATCHER_RATE: Provides rate statistics for the dispatcher processes. &lt;/li&gt;
&lt;li&gt;V$QUEUE: Contains information on the shared server message queues. &lt;/li&gt;
&lt;li&gt;V$SHARED_SERVER: Contains information on the shared servers. &lt;/li&gt;
&lt;li&gt;V$CIRCUIT: Contains information about virtual circuits, which are user connections to the database through dispatchers and servers. &lt;/li&gt;
&lt;li&gt;V$SHARED_SERVER_MONITOR: Contains information for tuning shared server. &lt;/li&gt;
&lt;li&gt;V$SGA: Contains size information about various system global area (SGA) groups. May be useful when tuning shared server. &lt;/li&gt;
&lt;li&gt;V$SGASTAT: Contains detailed statistical information about the SGA, useful for tuning. &lt;/li&gt;
&lt;li&gt;V$SHARED_POOL_RESERVED: Lists statistics to help tune the reserved pool and space within the shared pool. &lt;/li&gt;
&lt;/ul&gt;Source: Oracle Documentation</description><link>http://oracleshare.blogspot.com/2010/04/oracle-dedicated-and-shared-server.html</link><author>noreply@blogger.com (kaspi)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPQxuKsvx6-naxbAT1Duwy2ZRdEEaf3lO6HBhuRvfhS_lCqxPbnv2t0enBkP2NMjO9o0P5NdvL36ESWdkRazo7Rc8VFX6HYrxZNrKuqz-JNm64GRenbCnk4CwnN6O2jFkzGHrZdA/s72-c/admin013.gif" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34658302.post-3682623155353953466</guid><pubDate>Thu, 08 Apr 2010 13:00:00 +0000</pubDate><atom:updated>2010-04-08T07:16:02.825-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Oracle Basics</category><title>All about startup migrate and startup upgrade</title><description>&lt;strong&gt;startup migrate&lt;/strong&gt;:&lt;br /&gt;
&lt;br /&gt;
=&amp;gt; Used to upgrade a database till 9i.&lt;br /&gt;
See the step 11 from the 9.2 manual upgrade guide :&lt;br /&gt;
&lt;a href=&quot;http://download-east.oracle.com/docs/cd/B10501_01/server.920/a96530/upgrade.htm#1009472&quot;&gt;http://download-east.oracle.com/docs/cd/B10501_01/server.920/a96530/upgrade.htm#1009472&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=&amp;gt; Used to downgrade a database till 9i.&lt;br /&gt;
See the step 5 from the 9.2 downgrade guide :&lt;br /&gt;
&lt;a href=&quot;http://download-east.oracle.com/docs/cd/B10501_01/server.920/a96530/downgrad.htm#248958&quot;&gt;http://download-east.oracle.com/docs/cd/B10501_01/server.920/a96530/downgrad.htm#248958&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=&amp;gt; Used to downgrade a database since 10g.&lt;br /&gt;
See the step 18 from the 10.2 downgrade guide :&lt;br /&gt;
&lt;a href=&quot;http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14238/downgrade.htm#sthref415&quot;&gt;http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14238/downgrade.htm#sthref415&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&lt;strong&gt;startup upgrade&lt;/strong&gt;&lt;br /&gt;
=&amp;gt; Used to upgrade a database since 10g.&lt;br /&gt;
See the step 7 from the 10.2 manual upgrade guide :&lt;br /&gt;
&lt;a href=&quot;http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14238/upgrade.htm#CACGGHJC&quot;&gt;http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14238/upgrade.htm#CACGGHJC&lt;/a&gt;</description><link>http://oracleshare.blogspot.com/2010/04/all-about-startup-migrate-and-startup.html</link><author>noreply@blogger.com (kaspi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34658302.post-6874800939976443564</guid><pubDate>Tue, 06 Apr 2010 14:35:00 +0000</pubDate><atom:updated>2010-04-08T06:03:25.844-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Oracle Basics</category><title>Recompiling Invalid Schema Objects</title><description>&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Objects in a database tend to get invalid due to operation such as patches, DDL changes and upgrades etc. The invalid objects are to compiled to ensure proper health of the database and user&#39;s&amp;nbsp;access to them. I will provide here the ways you can compile objects in Oracle.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial;&quot;&gt;&lt;strong&gt;Identifying Invalid Objects:&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial;&quot;&gt;col format OBJECT_NAME a40&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial;&quot;&gt;SQL&amp;gt; SELECT OBJECT_NAME,&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;OBJECT_TYPE,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;OWNER,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; STATUS &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM DBA_OBJECTS &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE STATUS=&#39;INVALID&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ORDER BY OBJECT_NAME, OBJECT_TYPE, OWNER;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: black; font-family: Arial;&quot;&gt;to get invalid objects list for a particular schema below is the SQL:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;col format OBJECT_NAME a40&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;SQL&amp;gt; SELECT OBJECT_NAME,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OBJECT_TYPE,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OWNER,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;STATUS &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FROM DBA_OBJECTS &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE OWNER=&#39;DEPT&#39; AND&amp;nbsp;STATUS=&#39;INVALID&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ORDER BY OBJECT_NAME, OBJECT_TYPE, OWNER;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;DBMS_UTILITY.COMPILE_SCHEMA:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;DBMS_UTILITY package proides COMPILE_SCHEMA procedure to compile all the objects in a schema:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;SQL&amp;gt; EXECUTE&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;DBMS_UTILITY.COMPILE_SCHEMA (&#39;&lt;em&gt;SCHEMA_NAME&#39;);&lt;/em&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;UTLRP and UTLPRP:&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;UTLRP&lt;/strong&gt; and &lt;strong&gt;UTLPRP&lt;/strong&gt; are the oracle provided scripts to compile all invalid objects in oracle database.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Ex: &lt;span style=&quot;color: red;&quot;&gt;SQL&amp;gt; ?/rdbms/admin/utlrp&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;Manual Approach:&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Invalid Objects can be compiled individually after you have the list of invalid objects in your oracle database. Below are some of the examples:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;SQL&amp;gt; ALTER PACKAGE &lt;em&gt;package_name&lt;/em&gt; COMPILE;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;SQL&amp;gt; ALTER PACKAGE &lt;em&gt;package_name&lt;/em&gt; COMPILE BODY;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;SQL&amp;gt; ALTER PROCEDURE &lt;em&gt;procedure_name&lt;/em&gt; COMPILE;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;SQL&amp;gt; ALTER FUNCTION &lt;em&gt;function_name&lt;/em&gt; COMPILE;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;SQL&amp;gt; ALTER TRIGGER &lt;em&gt;trigger_name&lt;/em&gt; COMPILE;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;SQL&amp;gt; ALTER VIEW &lt;em&gt;view_name&lt;/em&gt; COMPILE;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;An alternative approach is to use the &lt;strong&gt;DBMS_DDL&lt;/strong&gt; package to perform the recompilations:&lt;/span&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;SQL&amp;gt; EXEC DBMS_DDL.alter_compile(&#39;PACKAGE&#39;, &#39;&lt;em&gt;SCHEMA_NAME&lt;/em&gt;&#39;, &#39;&lt;em&gt;PACKAGE_NAME&lt;/em&gt;&#39;);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;SQL&amp;gt; EXEC DBMS_DDL.alter_compile(&#39;PACKAGE BODY&#39;, &lt;em&gt;&#39;SCHEMA_NAME&#39;&lt;/em&gt;, &lt;em&gt;&#39;PACKAGE_NAME&#39;&lt;/em&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;SQL&amp;gt; EXEC DBMS_DDL.alter_compile(&#39;PROCEDURE&#39;, &lt;em&gt;&#39;SCHEMA_NAME&#39;, &#39;PROCEDURE_NAME&#39;&lt;/em&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;SQL&amp;gt; EXEC DBMS_DDL.alter_compile(&#39;FUNCTION&#39;, &lt;em&gt;&#39;SCHEMA_NAME&#39;, &#39;FUNCTION_NAME&#39;&lt;/em&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;SQL&amp;gt; EXEC DBMS_DDL.alter_compile(&#39;TRIGGER&#39;, &lt;em&gt;&#39;SCHEMA_NAME&#39;, &#39;TRIGGER_NAME&#39;&lt;/em&gt;);&lt;/span&gt; &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;In addition to the above approaches you can write your own script to get the invalid objects and recompile them using the manual approach to recompile them all included in the script.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;/span&gt;</description><link>http://oracleshare.blogspot.com/2010/04/recompiling-invalid-schema-objects.html</link><author>noreply@blogger.com (kaspi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34658302.post-2428811888345044678</guid><pubDate>Mon, 05 Apr 2010 15:55:00 +0000</pubDate><atom:updated>2010-04-06T07:41:43.487-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Oracle Basics</category><title>How to get DDL for an object: TABLE, INDEX, PACKAGE....</title><description>&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;DBMS_METADATA&lt;/strong&gt; is a package that can be used to get DDL for TABLE, INDEXES etc. Below is a quick view of how it works:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;SQL&amp;gt; select dbms_metadata.get_ddl(&#39;TABLE&#39;,&#39;IDX3_TAB&#39;) from dual;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The output would be:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;CREATE TABLE &quot;SCOTT&quot;.&quot;IDX3_TAB&quot;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;( &quot;NAME&quot; VARCHAR2(30),&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&quot;ID&quot; NUMBER,&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&quot;ADDR&quot; VARCHAR2(100),&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&quot;PHONE&quot; VARCHAR2(30)&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 LOGGING&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 &lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;PCTINCREASE 0&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE &quot;USERS&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;To get the create table definition without the storage clause you could do &lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;as follows:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;SQL&amp;gt; EXECUTE DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,&#39;STORAGE&#39;,false);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The output should be PL/SQL procedure successfully completed.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;And then if you run &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;set long 100000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;select dbms_metadata.get_ddl(&#39;TABLE&#39;,&#39;IDX3_TAB&#39;) from dual;&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;would return&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;CREATE TABLE &quot;SCOTT&quot;.&quot;IDX3_TAB&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;( &quot;NAME&quot; VARCHAR2(30),&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&quot;ID&quot; NUMBER,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&quot;ADDR&quot; VARCHAR2(100),&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&quot;PHONE&quot; VARCHAR2(30)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 LOGGING TABLESPACE &quot;USERS&quot;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;But the above package wasn&#39;t useful when I tried to get DDL information for a package body based on my experience and DBA_SOURCE from into help for that. Below is an example: &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-family: Arial, Helvetica, sans-serif;&quot;&gt;SQL&amp;gt; SELECT TEXT FROM DBA_SOURCE WHERE NAME=&#39;PKG_DEPT_PROCESS&#39;;&lt;/span&gt;</description><link>http://oracleshare.blogspot.com/2010/04/how-to-get-ddl-for-object-table-index.html</link><author>noreply@blogger.com (kaspi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34658302.post-271541119875424070</guid><pubDate>Thu, 01 Apr 2010 20:51:00 +0000</pubDate><atom:updated>2010-04-06T07:45:50.306-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Oracle Performance Tunning</category><title>CURSOR_SHARING Parameter in Oracle</title><description>&lt;strong&gt;CURSOR_SHARING&lt;/strong&gt; parameter is the one that oracle uses to control whether it will auto-bind a SQL statement or not. &lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;SQL&amp;gt; select * from dept where dept_id = &#39;&lt;em&gt;literal_value&#39;;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Oracle takes the above statement and replaces the predicate with something as below:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;SQL&amp;gt; select * from dept where dept_id=:&quot;SYS_B_0&quot;;&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
And now the oracle compares the above sql statement to the plans that it already has in the memory to see if the plan can be reused or not, perhaps leading to a better utilization of shared_pool and reduction in number hard parses performed by the system.&lt;br /&gt;
&lt;br /&gt;
The cursor_sharing parameter can be set to three values:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;EXACT:&lt;/strong&gt; This is the default setting. With this value in place, the query is not rewritten to use bind variables.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;FORCE:&lt;/strong&gt; This setting rewrites the query, replacing all literals with bind values and setting up a one-size-fits-all plan—a single plan for the rewritten query. I&#39;ll demonstrate what that implies in a moment. &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SIMILAR:&lt;/strong&gt; This setting also rewrites the query, replacing the literals with bind variables, but can set up different plans for different bind variable combinations. This last point is why &lt;strong&gt;CURSOR_SHARING=SIMILAR&lt;/strong&gt; might reduce the number of plans generated. Because multiple plans may be generated, the setting of SIMILAR may or may not reduce the number of actual plans you observe in the shared pool. &lt;/li&gt;
&lt;/ul&gt;An example to show how &lt;strong&gt;CURSOR_SHARING&lt;/strong&gt; works with setting equal to &lt;strong&gt;EXACT, FORCE&lt;/strong&gt; and &lt;strong&gt;SIMILAR&lt;/strong&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;SQL&amp;gt; alter session set cursor_sharing=EXACT;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;Session altered.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;SQL&amp;gt; select * from dual CS_EXACT where dummy=&#39;A&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;no rows selected&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;SQL&amp;gt; select * from dual CS_EXACT where dummy=&#39;B&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;no rows selected&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;SQL&amp;gt; alter session set cursor_sharing=FORCE;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;Session altered.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;SQL&amp;gt; select * from dual CS_FORCE where dummy=&#39;A&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;no rows selected&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;SQL&amp;gt; select * from dual CS_FORCE where dummy=&#39;B&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;no rows selected&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;SQL&amp;gt; alter session set cursor_sharing=SIMILAR;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;Session altered.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;SQL&amp;gt; select * from dual CS_SIMILAR where dummy=&#39;A&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;no rows selected&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;SQL&amp;gt; select * from dual CS_SIMILAR where dummy=&#39;B&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;no rows selected&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;SQL&amp;gt; select sql_text&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;2 from v$sql&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;3 where sql_text like &#39;select * from dual CS% where dummy=%&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;4 order by sql_text;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;SQL_TEXT&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;--------------------------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;select * from dual CS_EXACT where dummy=&#39;A&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;select * from dual CS_EXACT where dummy=&#39;B&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;select * from dual CS_FORCE where dummy=:&quot;SYS_B_0&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;select * from dual CS_SIMILAR where dummy=:&quot;SYS_B_0&quot;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;CURSOR_SHARING=EXACT&lt;/strong&gt;: From the above example as we can see oracle uses different plans for each of the select statements which include the word &quot;&lt;strong&gt;CS_EXACT&lt;/strong&gt;&quot;. With this setting every SQL statement you excute will be new and a new plan is generated for every query that we execute and the plans are not shared. And a&amp;nbsp;new entry is created in &lt;strong&gt;V$SQL&lt;/strong&gt; as you can see from above for every SQL Statement we execute.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;CURSOR_SHARING=FORCE&lt;/strong&gt;: When this is the setting for the parameter then for each statement that I have executed above which include the word &quot;&lt;strong&gt;CS_FORCE&lt;/strong&gt;&quot; the literal values &#39;&lt;strong&gt;A&lt;/strong&gt;&#39; and &#39;&lt;strong&gt;B&lt;/strong&gt;&#39; are replaced by &quot;&lt;strong&gt;SYS_B_0&lt;/strong&gt;&quot;. The oracle uses the same plan for each of the SQL whether the predicate is either &#39;&lt;strong&gt;A&lt;/strong&gt;&#39; or &#39;&lt;strong&gt;B&lt;/strong&gt;&#39; since rest of the statement is similar and thus we see just one entry in &lt;strong&gt;V$SQL&lt;/strong&gt; for the two SQL that we have executed.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;CURSOR_SHARING=SIMILAR&lt;/strong&gt;: When this is the setting for the parameter then for each statement that I have executed above which include the word &quot;&lt;strong&gt;CS_FORCE&lt;/strong&gt;&quot; the literal values &#39;&lt;strong&gt;A&lt;/strong&gt;&#39; and &#39;&lt;strong&gt;B&lt;/strong&gt;&#39; are replaced by &quot;&lt;strong&gt;SYS_B_0&lt;/strong&gt;&quot;. The oracle uses the same plan for each of the SQL whether the predicate is either &#39;&lt;strong&gt;A&lt;/strong&gt;&#39; or &#39;&lt;strong&gt;B&lt;/strong&gt;&#39; since rest of the statement is similar and thus we see just one entry in &lt;strong&gt;V$SQL&lt;/strong&gt; for the two SQL that we have executed. So, the settings &lt;strong&gt;FORCE&lt;/strong&gt; and &lt;strong&gt;SIMILAR&lt;/strong&gt; looks similar huh? But there is one difference between both i.e., when the setting is &lt;strong&gt;SIMILAR&lt;/strong&gt; oracle not only checks for similar looking statements but also compares the plans. For example when I executed the &lt;strong&gt;SELECT&lt;/strong&gt; statement with the literal value &#39;&lt;strong&gt;A&lt;/strong&gt;&#39; it generates a plan which will say a &lt;strong&gt;FULL TABLE SCAN&lt;/strong&gt; for the statement. Now when I executed the same &lt;strong&gt;SELECT&lt;/strong&gt; statement with the literal value &#39;&lt;strong&gt;B&lt;/strong&gt;&#39; the it also generates a plan for the statement and compares to the plan that is already stored i.e., when literal value is &#39;&lt;strong&gt;A&lt;/strong&gt;&#39;. If the explain plan for the &lt;strong&gt;SELECT&lt;/strong&gt; statement when literal is &#39;&lt;strong&gt;A&lt;/strong&gt;&#39; a &lt;strong&gt;FULL TABLE SCAN&lt;/strong&gt; and also a&amp;nbsp;&lt;strong&gt;FULL TABLE SCAN&lt;/strong&gt; (lets assume for now) when the literal value is &#39;&lt;strong&gt;B&lt;/strong&gt;&#39; then we see only one entry in the dynamic view &lt;strong&gt;V$SQL&lt;/strong&gt;. If both the plans are different say a &lt;strong&gt;FULL TABLE SCAN&lt;/strong&gt; when literal value is &#39;&lt;strong&gt;A&lt;/strong&gt;&#39; and an &lt;strong&gt;INDEX SCAN&lt;/strong&gt; when literal value is &#39;&lt;strong&gt;B&lt;/strong&gt;&#39; which is not in this case as per our assumption then we will see two different entries in &lt;strong&gt;V$SQL&lt;/strong&gt; for the SQL statements which contain the word &quot;&lt;strong&gt;CS_SIMILAR&lt;/strong&gt;&quot; and you would see something as below (which is not with our example above): The results displayed shown below are with respect to an imaginary table &quot;t&quot; which is a big table of about atleast 100 rows&amp;nbsp;and has an index on it and the data is skewed&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;SQL&amp;gt; alter session set cursor_sharing=FORCE;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;Session altered.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;SQL&amp;gt; select * from&amp;nbsp;t CS_FORCE where t_id=1;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;1 row selected.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;SQL&amp;gt; select * from&amp;nbsp;t CS_FORCE where t_id=&#39;99&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;1 row selected.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;SQL&amp;gt; alter session set cursor_sharing=SIMILAR;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;Session altered.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;SQL&amp;gt; select * from&amp;nbsp;t CS_SIMILAR where t_id=&#39;1&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;1 row selected.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;SQL&amp;gt; select * from&amp;nbsp;t CS_SIMILAR where t_id=&#39;99&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;1 row selected.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;SQL&amp;gt; select sql_text&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;2 from v$sql&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;3 where sql_text like &#39;select * from&amp;nbsp;t CS% where t_id=%&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;4 order by sql_text;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;SQL_TEXT&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;--------------------------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;select * from&amp;nbsp;t CS_FORCE where t_id=:&quot;SYS_B_0&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;select * from&amp;nbsp;t CS_SIMILAR where t_id=:&quot;SYS_B_0&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;select * from t CS_SIMILAR where t_id=:&quot;SYS_B_0&quot;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
From the above example we can see that the plans are different say a &lt;strong&gt;FULL TABLE SCAN&lt;/strong&gt; when literal value is &#39;&lt;strong&gt;1&lt;/strong&gt;&#39; and an &lt;strong&gt;INDEX SCAN&lt;/strong&gt; when literal value is &#39;&lt;strong&gt;99&lt;/strong&gt;&#39;&amp;nbsp;we see two different entries in &lt;strong&gt;V$SQL&lt;/strong&gt; for the SQL statements which contain the word &quot;&lt;strong&gt;CS_SIMILAR&lt;/strong&gt;&quot;.</description><link>http://oracleshare.blogspot.com/2010/04/cursorsharing-parameter-in-oracle.html</link><author>noreply@blogger.com (kaspi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34658302.post-2782099635138004308</guid><pubDate>Thu, 01 Apr 2010 13:37:00 +0000</pubDate><atom:updated>2010-04-01T13:53:15.388-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Oracle Basics</category><title>Database Structures: Logical Structures</title><description>Oracle database logical structures mainly comprise of &lt;strong&gt;Tablespaces, Segements, Extents and Oracle Datablocks&lt;/strong&gt;. &lt;br /&gt;
&lt;br /&gt;
I will present the information starting with the finest logical structure Oracle Datablocks.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Oracle Datablocks&lt;/strong&gt;: Oracle datablocks are at the finest level granularity, all of the oracle datatbase data is stored in oracle datablocks. One oracle datablock corresponds to specific number of bytes which occupy the same number of bytes on the physical disk space. The size of a datablock is determined by the initialization parameter &lt;strong&gt;DB_BLOCK_SIZE&lt;/strong&gt;. In addition to the one specified already you can specify upto 5 additional datablock sizes&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Extent&lt;/strong&gt;: Extent is the next level of oracle logical database space. A extent is comprised specific number of contiguous datablocks, obtained in a single allocation, used to store a specific type of information.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Segment&lt;/strong&gt;: A segment is a set of extents allocated for a certain logical structure. The segments can be of one of following type data segment,index segment,temporary segment,rollback segment.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Tablespace&lt;/strong&gt;: Each database is logically divided into one or more tablespaces. One or more datafiles are explicitly created for each tablespace to physically store the data of all logical structures in a tablespace. The combined size of the datafiles in a tablespace is the total storage capacity of the tablespace.</description><link>http://oracleshare.blogspot.com/2010/04/database-structures-logical-structures.html</link><author>noreply@blogger.com (kaspi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34658302.post-2930140199025133483</guid><pubDate>Thu, 01 Apr 2010 13:33:00 +0000</pubDate><atom:updated>2010-04-01T13:53:50.459-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Oracle Basics</category><title>Database Structures: Physical Structures</title><description>A database consists of Physical Structures and Logical Structures in this post I will post information regarding the physical structures in simple terms:&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Datafiles&lt;/strong&gt;: Contain all of the database data; logical structures , such as tables, indexes, packages, procedures, functions, triggers and etc.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Redo Log Files&lt;/strong&gt;: Hold records of all changes made to the database for recovery purposes.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Control Files&lt;/strong&gt;: Record the physical structure and status of the database&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Parameter File&lt;/strong&gt;: Contain startup values for database parameters (often referred as the init.ora file )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: The explanation provided here is for understanding only.</description><link>http://oracleshare.blogspot.com/2010/04/database-structures-physical-structures.html</link><author>noreply@blogger.com (kaspi)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-34658302.post-7645770135015812920</guid><pubDate>Wed, 31 Mar 2010 19:21:00 +0000</pubDate><atom:updated>2010-04-01T06:28:24.482-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Oracle Performance Tunning</category><title>Oracle Resource Manager</title><description>&lt;strong&gt;Oracle Resource Manager (ORM)&lt;br /&gt;Goal of ORM: &lt;/strong&gt;&lt;br /&gt;To give Oracle Database Server more control over resource management decisions, thus preventing problems resulting from inefficient operating system management.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Problems addressed by ORM:&lt;/strong&gt;• Excessive overhead&lt;br /&gt;• Inefficient scheduling&lt;br /&gt;• Inappropriate allocation of resources&lt;br /&gt;• Inability to manage database-specific resources, such as parallel execution servers and active sessions&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How above problems can be addressed:&lt;/strong&gt;&lt;br /&gt;• Guarantee specific users with certain amount of processing resources irrespective of the load on the system and the no. of users&lt;br /&gt;&lt;br /&gt;Ex: HR_BATCH_GROUP – 50% CPU will be allocated for Batch processing jobs irrespective of the load on the system       &lt;br /&gt;       &lt;br /&gt;• Distribute available processing resources by allocating percentages of CPU time to different users and applications. In a data warehouse, a higher percentage may be given to ROLAP (relational on-line analytical processing) applications than to batch jobs.&lt;br /&gt;&lt;br /&gt;Ex:  CPU Resources distribution for HR:&lt;br /&gt;       HR_BATCH_GROUP – 50% CPU&lt;br /&gt;       HR_WF_REPT_AUD_METADATA_GROUP – 20% CPU&lt;br /&gt;       HR_ADHOC_HRLINK_WF_GROUP – 15% CPU&lt;br /&gt;       HR_ADHOC_BUS_USER_GROUP – 5% CPU&lt;br /&gt;       HR_STEAM_DBLINK_USERS_GROUP – 5% CPU&lt;br /&gt;       OTHER_GROUPS – 5% CPU&lt;br /&gt;&lt;br /&gt;• Limit to 10 concurrent sessions for HR_ADHOC_BUS_USER_GROUP so that members of the group performing  any operation are limited to maximum of 10 sessions within the group. Additional sessions beyond the maximum are queued for execution, but you can specify a timeout period, after which queued jobs will terminate.  Prevent the execution of operations that the optimizer estimates will run for a longer time than a specified limit&lt;br /&gt;Ex: The parameter setting for this is ACTIVE_SESS_POOL_P1 =&gt; 10 &lt;br /&gt;Ex: The parameter setting for this is QUEUEING_P1 =&gt; 60 &lt;br /&gt;Ex: The parameter setting for this is MAX_EST_EXEC_TIME =&gt; 2700 (45 minutes)&lt;br /&gt;&lt;br /&gt;• (not doing in below example) Allow automatic switching of users from one group to another group based on administrator defined criteria. If a member of a particular group of users creates a session that executes for longer than a specified amount of time, that session can be automatically switched to another group of users with different resource requirements.&lt;br /&gt;&lt;br /&gt;• (not doing in below example) Create an undo pool. This pool consists of the amount of undo space that can be consumed in by a group of users.&lt;br /&gt;&lt;br /&gt;• (not doing in below example) Limit the amount of time that a session can be idle. This can be further defined to mean only sessions that are blocking other sessions.&lt;br /&gt;&lt;br /&gt;• (not doing in below example) Configure an instance to use a particular method of allocating resources. You can dynamically change the method, for example, from a daytime setup to a nighttime setup, without having to shut down and restart the instance.&lt;br /&gt;&lt;br /&gt;• (not doing in below example) Allow the cancellation of long-running SQL statements and the termination of long-running sessions.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Terminology:&lt;/strong&gt;&lt;br /&gt;Resource Plan:  A resource plan is a way to group a set of resource consumer groups together and specify how resources should be divided among them&lt;br /&gt;&lt;br /&gt;Resource consumer groups: Allow the administrator to group user sessions together by resource requirements&lt;br /&gt;&lt;br /&gt;Resource allocation methods: determine what policy to use when allocating for any particular resource. Resource allocation methods are used by resource plans and resource consumer groups&lt;br /&gt;Resource plan directives: are a means of assigning consumer groups to particular plans and partitioning resources among consumer groups by specifying parameters for each resource allocation method&lt;br /&gt;&lt;br /&gt;Subplans: allow further subdivision of resources among different users of an application&lt;br /&gt;&lt;br /&gt;Levels: provide a mechanism to specify distribution of unused resources among available users. Up to eight levels of resource allocation can be specified&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Steps for implementing ORM:&lt;/strong&gt;&lt;br /&gt;1. Execute the HR_PLAN.sql and check for any errors. HR_PLAN.sql is an example of how an ORM Plan can be created.&lt;br /&gt;&lt;br /&gt;2. Do the following once ORM has been installed succesfully without any errors&lt;br /&gt;    $ sqlplus &quot;/ as sysdba&quot;&lt;br /&gt;&lt;br /&gt;a. SQL&gt; &#39;ALTER SYSTEM SET RESOURCE_MANAGER_PLAN =&#39;HR_PLAN&#39;;&lt;br /&gt; &lt;br /&gt;b. Set the init parameter RESOURCE_MANAGER_PLAN = HR_PLAN in database init parameter file&quot;&lt;br /&gt;&lt;br /&gt;Note: Both the above steps are required to make sure the created plan is active both dynamically and permanent&lt;br /&gt;to ensure that if database is bounced the plan is still active in case database cannot be bounced now &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;HR_PLAN:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;BEGIN&lt;br /&gt;&lt;br /&gt;DBMS_RESOURCE_MANAGER.CLEAR_PENDING_AREA;&lt;br /&gt;&lt;br /&gt;DBMS_RESOURCE_MANAGER.CREATE_PENDING_AREA();&lt;br /&gt;&lt;br /&gt;DBMS_RESOURCE_MANAGER.CREATE_PLAN(PLAN =&gt; &#39;HR_PLAN&#39;, COMMENT =&gt; &#39;HR ORM Plan&#39;);&lt;br /&gt;&lt;br /&gt;DBMS_RESOURCE_MANAGER.CREATE_CONSUMER_GROUP(CONSUMER_GROUP =&gt; &#39;HR_BATCH_GROUP&#39;, COMMENT =&gt; &#39;HR Batch group&#39;);&lt;br /&gt;&lt;br /&gt;DBMS_RESOURCE_MANAGER.CREATE_CONSUMER_GROUP(CONSUMER_GROUP =&gt; &#39;HR_WF_REPT_AUD_METADATA_GROUP&#39;, COMMENT =&gt; &#39;Reporting group&#39;);&lt;br /&gt;&lt;br /&gt;DBMS_RESOURCE_MANAGER.CREATE_CONSUMER_GROUP(CONSUMER_GROUP =&gt; &#39;HR_ADHOC_HRLINK_WF_GROUP&#39;, COMMENT =&gt; &#39;Ad-hoc WF HRLink group&#39;);&lt;br /&gt;&lt;br /&gt;DBMS_RESOURCE_MANAGER.CREATE_CONSUMER_GROUP(CONSUMER_GROUP =&gt; &#39;HR_ADHOC_BUS_USER_GROUP&#39;, COMMENT =&gt; &#39;Ad-hoc Business User group&#39;);&lt;br /&gt;&lt;br /&gt;DBMS_RESOURCE_MANAGER.CREATE_CONSUMER_GROUP(CONSUMER_GROUP =&gt; &#39;HR_STEAM_DBLINK_USERS_GROUP&#39;, COMMENT =&gt; &#39;Steam DBLink User group&#39;);&lt;br /&gt;&lt;br /&gt;DBMS_RESOURCE_MANAGER.CREATE_PLAN_DIRECTIVE(PLAN =&gt; &#39;HR_PLAN&#39;, GROUP_OR_SUBPLAN =&gt; &#39;HR_BATCH_GROUP&#39;, COMMENT =&gt; &#39;Batch Process&#39;, CPU_P1 =&gt; 50);&lt;br /&gt;&lt;br /&gt;DBMS_RESOURCE_MANAGER.CREATE_PLAN_DIRECTIVE(PLAN =&gt; &#39;HR_PLAN&#39;, GROUP_OR_SUBPLAN =&gt; &#39;HR_WF_REPT_AUD_METADATA_GROUP&#39;, COMMENT =&gt; &#39;Reporting Process&#39;, CPU_P1 =&lt;br /&gt;&gt; 20);&lt;br /&gt;&lt;br /&gt;DBMS_RESOURCE_MANAGER.CREATE_PLAN_DIRECTIVE(PLAN =&gt; &#39;HR_PLAN&#39;, GROUP_OR_SUBPLAN =&gt; &#39;HR_ADHOC_HRLINK_WF_GROUP&#39;, COMMENT =&gt; &#39;Ad-hoc WF HRLink group&#39;, CPU_P1 =&lt;br /&gt;&gt; 15);&lt;br /&gt;&lt;br /&gt;DBMS_RESOURCE_MANAGER.CREATE_PLAN_DIRECTIVE(PLAN =&gt; &#39;HR_PLAN&#39;, GROUP_OR_SUBPLAN =&gt; &#39;HR_ADHOC_BUS_USER_GROUP&#39;, COMMENT =&gt; &#39;Ad-hoc Business User group&#39;, CPU_P&lt;br /&gt;1 =&gt; 5, MAX_EST_EXEC_TIME =&gt; 2700 , ACTIVE_SESS_POOL_P1 =&gt; 10, QUEUEING_P1 =&gt; 60);&lt;br /&gt;&lt;br /&gt;DBMS_RESOURCE_MANAGER.CREATE_PLAN_DIRECTIVE(PLAN =&gt; &#39;HR_PLAN&#39;, GROUP_OR_SUBPLAN =&gt; &#39;HR_STEAM_DBLINK_USERS_GROUP&#39;, COMMENT =&gt; &#39;Steam User group&#39;, CPU_P1 =&gt; 5&lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;DBMS_RESOURCE_MANAGER.CREATE_PLAN_DIRECTIVE(PLAN =&gt; &#39;HR_PLAN&#39;,GROUP_OR_SUBPLAN =&gt; &#39;OTHER_GROUPS&#39;, COMMENT =&gt; &#39;mandatory&#39;, CPU_P1 =&gt; 5);&lt;br /&gt;&lt;br /&gt;DBMS_RESOURCE_MANAGER.VALIDATE_PENDING_AREA();&lt;br /&gt;&lt;br /&gt;DBMS_RESOURCE_MANAGER.SUBMIT_PENDING_AREA();&lt;br /&gt;&lt;br /&gt;DBMS_RESOURCE_MANAGER_PRIVS.GRANT_SWITCH_CONSUMER_GROUP(&#39;SYSADM&#39;, &#39;HR_BATCH_GROUP&#39;, TRUE);&lt;br /&gt;DBMS_RESOURCE_MANAGER.SET_INITIAL_CONSUMER_GROUP(&#39;SYSADM&#39;, &#39;HR_BATCH_GROUP&#39;);&lt;br /&gt;&lt;br /&gt;DBMS_RESOURCE_MANAGER_PRIVS.GRANT_SWITCH_CONSUMER_GROUP(&#39;WFLINK&#39;, &#39;HR_ADHOC_HRLINK_GROUP&#39;, TRUE);&lt;br /&gt;DBMS_RESOURCE_MANAGER.SET_INITIAL_CONSUMER_GROUP(&#39;WFLINK&#39;, &#39;HR_ADHOC_HRLINK_WF_GROUP&#39;);&lt;br /&gt;&lt;br /&gt;DBMS_RESOURCE_MANAGER_PRIVS.GRANT_SWITCH_CONSUMER_GROUP(&#39;BUS_AH32366&#39;, &#39;HR_ADHOC_BUS_USER_GROUP&#39;, TRUE);&lt;br /&gt;DBMS_RESOURCE_MANAGER.SET_INITIAL_CONSUMER_GROUP(&#39;BUS_AH32366&#39;, &#39;HR_ADHOC_BUS_USER_GROUP&#39;);&lt;br /&gt;&lt;br /&gt;DBMS_RESOURCE_MANAGER_PRIVS.GRANT_SWITCH_CONSUMER_GROUP(&#39;HR_LINK_APAC&#39;,&#39;HR_ST_DBLINK_USERS_GROUP&#39;, TRUE);&lt;br /&gt;DBMS_RESOURCE_MANAGER.SET_INITIAL_CONSUMER_GROUP(&#39;HR_LINK_APAC&#39;,&#39;HR_STEAM_DBLINK_USERS_GROUP&#39;);&lt;br /&gt;&lt;br /&gt;DBMS_RESOURCE_MANAGER_PRIVS.GRANT_SWITCH_CONSUMER_GROUP(&#39;CSBOUTA1&#39;,&#39;HR_REPT_AUD_METADATA_GROUP&#39;, TRUE);&lt;br /&gt;DBMS_RESOURCE_MANAGER.SET_INITIAL_CONSUMER_GROUP(&#39;CSBOUTA1&#39;,&#39;HR_WF_REPT_AUD_METADATA_GROUP&#39;);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;END;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Steps for enabling ORM: &lt;/strong&gt;&lt;br /&gt;There are two ways for enabling ORM after you create your custom ORM Plan in the database. Below are the steps:&lt;br /&gt;1. Enable it dynamically from a SQLPLUS Session&lt;br /&gt;     Ex: SQL&gt; ALTER SYSTEM SET RESOURCE_MANAGER_PLAN=’HR_PLAN’;&lt;br /&gt;2. Enable it permanently in init.ora if you are using pfile&lt;br /&gt;     Ex: In init file add the parameter – RESOURCE_MANAGER_PLAN=’HR_PLAN’;&lt;br /&gt;&lt;br /&gt;Both the above steps are recommended as database needs to be bounced if you update init file and if that cannot be done immediately Step 1 will take care of enabling the Resource Manager immediately and even if the database is bounced Step 2 will take care of enabling it Resource Manager automatically.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Steps for disabling ORM:&lt;/strong&gt;There are two ways for enabling ORM after you create your custom ORM Plan in the database. Below are the steps:&lt;br /&gt;&lt;br /&gt;1. Disable it dynamically from a SQLPLUS Session&lt;br /&gt;     Ex: SQL&gt; ALTER SYSTEM SET RESOURCE_MANAGER_PLAN=’  ’; (space in between)&lt;br /&gt;2. Disable it permanently in init.ora if you are using pfile&lt;br /&gt;     Ex: In init file comment out or remove the parameter – RESOURCE_MANAGER_PLAN=’HR_PLAN’;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ORM FAQ&#39;s:&lt;/strong&gt;&lt;br /&gt;Q: How does the Resource Manager work in a multi-instance server?&lt;br /&gt;&lt;br /&gt;A: The resource manager cannot manage resources across instances, only within an instance.  It would not be useful in multi-instance on a single server situation.    If you are having more than one instance, you must use OS tools such as taking a big honking Sun E10k and setting up separate domains (so all of a sudden you don&#39;t have more than one instance per &quot;server&quot;)&lt;br /&gt;&lt;br /&gt;Q: Overhead of using &quot;Oracle Resource Manager&quot;? &lt;br /&gt;&lt;br /&gt;A: The implementation of a resource plan is going to take some resources itself (of course). You do not quantify at all what &quot;non-insignificant&quot; is - so I will not address that (everyone has a different definition for that...). so it is not really possible to comment. &lt;br /&gt;Note: The above question has been taken from www.asktom.oracle.com website&lt;br /&gt;&lt;br /&gt;Q: When does &quot;Oracle Resource Manager&quot; (ORM) kick in?&lt;br /&gt;&lt;br /&gt;A: Resource manager basically does nothing until a resource is totally maxed out (you cannot put CPU in the bank and use it later). So, even if you say &quot;100% to group A&quot;, unless group A actually needs to consume 100%. Resource manager is not a &quot;fence&quot;, but rather an attempt to assure you that if group A makes a demand for X%, it will be given to them.&lt;br /&gt;&lt;br /&gt;Q: Will there be any degradation in response time or execution time of jobs than the regular taken time?&lt;br /&gt;&lt;br /&gt;A: Yes, when the server is busy and is at 100% CPU or more the jobs will take a long time to finish than what they might be taking regularly. But the response time will almost be the same.&lt;br /&gt;&lt;br /&gt;Q. What is the overhead after implementing ORM?&lt;br /&gt;&lt;br /&gt;A: There was no specific answer for what is the overhead of using ORM resource regulation. So, I did a test to find out the results of which are presented here but there is minimal to no impact while the server is not 100% busy and there might very little overhead when the server is 100% which hasn&#39;t been quantified yet but I did some estimation based on some tests.&lt;br /&gt;&lt;br /&gt;Reference: Based on information read from Oracle Documentation and other online websites</description><link>http://oracleshare.blogspot.com/2010/03/oracle-resource-manager.html</link><author>noreply@blogger.com (kaspi)</author><thr:total>0</thr:total></item></channel></rss>