<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Exploring Oracle</title>
	<atom:link href="http://mehrajdba.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://mehrajdba.wordpress.com</link>
	<description>Oracle DBA</description>
	<lastBuildDate>Wed, 10 Aug 2011 10:36:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='mehrajdba.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/ff19a3b346b40d25b08179f5c8436a6b?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Exploring Oracle</title>
		<link>http://mehrajdba.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://mehrajdba.wordpress.com/osd.xml" title="Exploring Oracle" />
	<atom:link rel='hub' href='http://mehrajdba.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Beyond the Basics : File Permissions in Unix/Linux</title>
		<link>http://mehrajdba.wordpress.com/2010/11/11/beyond-the-basics-file-permissions-in-unixlinux/</link>
		<comments>http://mehrajdba.wordpress.com/2010/11/11/beyond-the-basics-file-permissions-in-unixlinux/#comments</comments>
		<pubDate>Thu, 11 Nov 2010 07:31:53 +0000</pubDate>
		<dc:creator>Mohammed Mehraj Hussain</dc:creator>
				<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://mehrajdba.wordpress.com/?p=279</guid>
		<description><![CDATA[A user’s ability to read from or write to files on a UNIX system depends on the permissions that have been granted for that file by the owner of the file or directory. The user who creates a file is the owner of that file. Every file and directory comes with three types of permissions: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=279&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A user’s ability to read from or write to files on a UNIX system depends on the permissions that have been granted for that file by the owner of the file or directory.</p>
<p>The user who creates a file is the owner of that file. Every file and directory comes with three types of permissions:<br />
• Read: Lets you view the contents of the file only.<br />
• Write: Lets you change the contents of the file. Write permission on a directory will let you create, modify, or delete files in that directory.<br />
• Execute: Lets you execute (run) the file if the file contains an executable program (script).<br />
Read permission is the most basic permission. Having the execute permission without the read permission is of no use,you can’t execute a file if you can’t read it in the first place.</p>
<p>Use the <strong>ls -al</strong> command to list the file permissions along with the filenames in a directory. For example, look at the (partial) output of the following command:</p>
<p><strong>$ ls -al<br />
-rwxrwxrwx 1 oracle dba 320 Jan 23 09:00 test.ksh<br />
-rw-r&#8212;r- 1 oracle dba 152 Jul 18 13:38 updown.ksh<br />
-rw-r&#8212;r- 1 oracle dba 70 Nov 22 01:30 tokill.ksh</strong></p>
<p>You’ll notice that at the beginning of each line, each file has a combination of ten different letters and the blank sign (-).<br />
The first letter could be a blank or the letter d. If it is the letter d, then it’s a directory. If it’s a blank, it’s a regular file.<br />
The next nine spaces are grouped into three sets of the letters rwx. The rwx group refers to the read, write, and execute permissions on that file. The first set of rwx indicates the permissions assigned to the owner of the file. The second set lists the permissions assigned to the group the user belongs to. The last set lists the permissions on that file granted to all the other users of the system.</p>
<p>For example, consider the access permissions on the following file:<br />
<strong>$ -rwxr-x&#8211;x 1 oracle dba Nov 11 2001 test.ksh</strong></p>
<p>Because the first character is a hyphen (-), this is a file, not a directory. The next three characters, rwx, indicate that the owner of the file test.ksh has all three permissions (read, write, and execute) on the file. The next three characters, r-x, show that all the users who are in the same group as the owner have read and execute permissions, but not write permissions. In other words, they cannot change the contents of the file. The last set of characters, &#8211;x, indicates that all other users on the system can execute the file, but they cannot modify it.</p>
<p>Any file that you create will first have the permissions set to -rw-r&#8211;r&#8211;. That is, everybody has read permissions, and no user has permission to execute the file. If you put an executable program inside the file, you’ll want to grant someone permission to execute the file. You can set the permissions on the file by using the chmod command in one of two ways.<br />
First, you can use the symbolic notation, with the letter o standing for owner, g for group, and u for other users on the system. You grant a group or users specific permissions by first specifying the entity along with a plus sign (+) followed by the appropriate symbol for the permission.</p>
<p>In the following example, the notation go+x means that both the group and others are assigned the execute (x) permission on the test.ksh shell script:</p>
<p><strong>$ chmod go+x test.ksh</strong></p>
<p>The next example shows how you can use symbolic notation to remove read and write permissions on a file from the group:</p>
<p><strong>$ chmod g-rw test.ksh</strong></p>
<p>Second, you can use the octal numbers method to change file permissions. Each permission carries different numeric “weights”: read carries a weight of 4, write a weight of 2, and execute a weight of 1. To determine a permission setting, just add the weights for the permissions you want to assign. The highest number that can be associated with each of the three different entities—owner,group, and all others—is 7, which is the same as having read, write, and execute permissions on the file.</p>
<p>For example, consider the following:</p>
<p><strong>$ chmod 777 test.txt<br />
$ ls<br />
$ -rwxrwxrwx 1 oracle dba 102 Nov 11 15:20 test.txt</strong></p>
<p>The file test.txt initially had its file permissions set to 644 (rw, r, r.) The command chmod 777 assigned full permissions (read, write, and execute) to all three entities: owner, group, and all others.<br />
If you want to change this so that only the owner has complete rights and the others have no permissions at all, set the octal number to 700 (read, write, and execute permissions for the owner, and no permissions at all for the group or others) and use the chmod command as follows:</p>
<p><strong>$ chmod 700 test.txt<br />
$ ls -altr test.txt<br />
-rwx&#8212;&#8212; 1 oracle dba 0 Mar 28 11:23 test.txt</strong></p>
<p>&nbsp;</p>
<p><strong><br />
</strong></p>
<br />Filed under: <a href='http://mehrajdba.wordpress.com/category/database/'>Database</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mehrajdba.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mehrajdba.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mehrajdba.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mehrajdba.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mehrajdba.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mehrajdba.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mehrajdba.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mehrajdba.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mehrajdba.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mehrajdba.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mehrajdba.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mehrajdba.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mehrajdba.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mehrajdba.wordpress.com/279/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=279&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mehrajdba.wordpress.com/2010/11/11/beyond-the-basics-file-permissions-in-unixlinux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cbeac91208b1d3d18eaac1a3c87fdf18?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mehraj</media:title>
		</media:content>
	</item>
		<item>
		<title>Oracle 11g Virtual columns</title>
		<link>http://mehrajdba.wordpress.com/2010/04/06/oracle-11g-virtual-columns/</link>
		<comments>http://mehrajdba.wordpress.com/2010/04/06/oracle-11g-virtual-columns/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 12:52:19 +0000</pubDate>
		<dc:creator>Mohammed Mehraj Hussain</dc:creator>
				<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://mehrajdba.wordpress.com/?p=275</guid>
		<description><![CDATA[I read an article regarding the virtual columns in oracle 11g . i wish to share this article in  this blog. Thanks to Arup Nanda for his excellent presentation. Acme&#8217;s database contains a table called SALES, as you saw earlier. The table has the following structure: SALES_ID NUMBER CUST_ID NUMBER SALES_AMT NUMBER Some users want [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=275&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I read an article regarding the virtual columns in oracle 11g . i wish to share this article in  this blog.</p>
<p>Thanks to Arup Nanda for his excellent presentation.</p>
<p>Acme&#8217;s database contains a table called SALES, as you saw earlier.  The table has the following structure:</p>
<table border="0" cellpadding="0" width="200">
<tbody>
<tr>
<td width="126">SALES_ID</td>
<td width="68">NUMBER</td>
</tr>
<tr>
<td>CUST_ID</td>
<td>NUMBER</td>
</tr>
<tr>
<td>SALES_AMT</td>
<td>NUMBER</td>
</tr>
</tbody>
</table>
<p>Some users want to add a column called SALE_CATEGORY, which identifies  the type of the sale: LOW, MEDIUM, HIGH and ULTRA, depending on the  amount of sale and the customer in question. This column will help them  identify the records for appropriate action and routing to the concerned  employee for handling. Here are the logic for values in the column:</p>
<table border="1" cellpadding="2" width="389">
<tbody>
<tr>
<td width="125"><strong>If sale_amt is more than:</strong></td>
<td width="124"><strong>And sale_amt is less than or equal to:</strong></td>
<td width="120"><strong>Then sale_category is:</strong></td>
</tr>
<tr>
<td>0</td>
<td>1000</td>
<td>LOW</td>
</tr>
<tr>
<td>10001</td>
<td>100000</td>
<td>MEDIUM</td>
</tr>
<tr>
<td>100001</td>
<td>1000000</td>
<td>HIGH</td>
</tr>
<tr>
<td>1000001</td>
<td>Unlimited</td>
<td>ULTRA</td>
</tr>
</tbody>
</table>
<p>Although this column is a crucial business requirement, the development  team does not want to change the code to create the necessary logic. Of  course, you could add a new column in the table called sale_category,  and write a trigger to populate the column using the logic shown above—a  fairly trivial exercise. But performance issues would arise due to  context switching from and into the trigger code.</p>
<p>In Oracle Database 11<em>g</em>, you do not need to write a single  line of code in any trigger. All you have to do instead is add a <em>virtual  column</em>. Virtual columns offer the flexibility to add columns that  convey business sense without adding any complexity or performance  impact.</p>
<p>Here&#8217;s how you would create this table:</p>
<pre>SQL&gt; create table sales
  2  (
  3     sales_id      number,
  4     cust_id       number,
  5     sales_amt     number,
  6     sale_category varchar2(6)
  7     generated always as
  8     (
  9        case
 10           when sales_amt &lt;= 10000 then 'LOW'
 11           when sales_amt &gt; 10000 and sales_amt &lt;= 100000 then 'MEDIUM'
 12           when sales_amt &gt; 100000 and sales_amt &lt;= 1000000 then 'HIGH'
 13           else 'ULTRA'
 14        end
 15      ) virtual
 16  );</pre>
<p>Note lines 6-7; the column is specified as &#8220;generated always as&#8221;,  meaning the column values are generated at runtime, not stored as part  of the table. That clause is followed by how the value is calculated in  the elaborate CASE statement. Finally, in line 15,&#8221;virtual&#8221; is specified  to reinforce the fact that this is a virtual column. Now, if you insert  some records:</p>
<pre>SQL&gt; insert into sales (sales_id, cust_id, sales_amt) values (1,1,100);

1 row created.

SQL&gt; insert into sales (sales_id, cust_id, sales_amt) values (2,102,1500);

1 row created.

SQL&gt;insert into sales (sales_id, cust_id, sales_amt) values (3,102,100000);

1 row created.

SQL&gt; commit;

Commit complete.

SQL&gt; select * from sales;

  SALES_ID    CUST_ID  SALES_AMT SALE_C
---------- ---------- ---------- ------
         1          1        100 LOW
         2        102       1500 LOW
         3        102     100000 MEDIUM

3 rows selected.</pre>
<p>the virtual column values are all populated as usual. Even though this  column is not stored, you can refer to it as any other column in the  table. You can even create indexes on it.</p>
<pre>SQL&gt; create index in_sales_cat on sales (sale_category);

Index created.</pre>
<p>The result will be a function-based index.</p>
<pre>SQL&gt; select index_type
  2  from user_indexes
  3  where index_name = 'IN_SALES_CAT';

INDEX_TYPE
---------------------------
FUNCTION-BASED NORMAL

SQL&gt;  select column_expression
  2  from user_ind_expressions
  3  where index_name = 'IN_SALES_CAT';

COLUMN_EXPRESSION
--------------------------------------------------------------------------------
CASE  WHEN "SALES_AMT"&lt;=10000 THEN 'LOW' WHEN ("SALES_AMT"&gt;10000 AND "SALES_AMT"
&lt;=100000) THEN CASE  WHEN "CUST_ID"&lt;101 THEN 'LOW' WHEN ("CUST_ID"&gt;=101 AND "CUS
T_ID"&lt;=200) THEN 'MEDIUM' ELSE 'MEDIUM' END  WHEN ("SALES_AMT"&gt;100000 AND "SALES
_AMT"&lt;=1000000) THEN CASE  WHEN "CUST_ID"&lt;101 THEN 'MEDIUM' WHEN ("CUST_ID"&gt;=101
 AND "CUST_ID"&lt;=200) THEN 'HIGH' ELSE 'ULTRA' END  ELSE 'ULTRA' END</pre>
<p>You can even partition on this column, as you saw in the <a href="http://www.oracle.com/technology/pub/articles/oracle-database-11g-top-features/11g-partioning.html">Partitioning  installment</a> of this series. You can&#8217;t, however, enter a value for  this column. If you try to, you won&#8217;t get far:</p>
<pre>insert into sales values (5,100,300,'HIGH','XX')
            *
ERROR at line 1:
ORA-54013: INSERT operation disallowed on virtual columns</pre>
<br />Filed under: <a href='http://mehrajdba.wordpress.com/category/database/'>Database</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mehrajdba.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mehrajdba.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mehrajdba.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mehrajdba.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mehrajdba.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mehrajdba.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mehrajdba.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mehrajdba.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mehrajdba.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mehrajdba.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mehrajdba.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mehrajdba.wordpress.com/275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mehrajdba.wordpress.com/275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mehrajdba.wordpress.com/275/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=275&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mehrajdba.wordpress.com/2010/04/06/oracle-11g-virtual-columns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cbeac91208b1d3d18eaac1a3c87fdf18?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mehraj</media:title>
		</media:content>
	</item>
		<item>
		<title>PL/SQL Wrapper utility</title>
		<link>http://mehrajdba.wordpress.com/2010/03/24/plsql-wrapper-utility/</link>
		<comments>http://mehrajdba.wordpress.com/2010/03/24/plsql-wrapper-utility/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 09:42:58 +0000</pubDate>
		<dc:creator>Mohammed Mehraj Hussain</dc:creator>
				<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://mehrajdba.wordpress.com/?p=267</guid>
		<description><![CDATA[As a application developer  we do not always want our code displayed to the outside world when writing an application. In some cases, the features are proprietary and we need to protect the intellectual capital that is invested in them. In other cases, we simply want to prevent the code from being modified by the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=267&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As a application developer  we do not always want our code displayed to the outside world<br />
when writing an application. In some cases, the features are proprietary and we<br />
need to protect the intellectual capital that is invested in them. In other cases, we<br />
simply want to prevent the code from being modified by the user in order to avoid<br />
problems .</p>
<p>Oracle provides a way to hide code with the PL/SQL Wrapper utility. When<br />
source code has been wrapped, not only is the file unreadable, but also when it<br />
is loaded into the database, the code cannot be read in the data dictionary.</p>
<p>The wrapper utility does not encrypt the code. Instead, it converts it to<br />
hexadecimal digits so that it cannot be read or edited.</p>
<p>example:</p>
<p>SQL&gt; CREATE TABLE lecturer (<br />
2       id               NUMBER(5) PRIMARY KEY,<br />
3       first_name       VARCHAR2(20),<br />
4       last_name        VARCHAR2(20),<br />
5       major            VARCHAR2(30),<br />
6       current_credits  NUMBER(3)<br />
7       );</p>
<p>Table created.</p>
<p>SQL&gt; INSERT INTO lecturer (id, first_name, last_name, major,current_credits)<br />
2   VALUES (10001, &#8216;Scott&#8217;, &#8216;Lawson&#8217;,'Computer Science&#8217;, 11);</p>
<p>1 row created.<br />
SQL&gt;  INSERT INTO lecturer (id, first_name, last_name, major, current_credits)<br />
2   VALUES (10002, &#8216;Mar&#8217;, &#8216;Wells&#8217;,'History&#8217;, 4);</p>
<p>1 row created.<br />
SQL&gt;  INSERT INTO lecturer (id, first_name, last_name, major,current_credits)<br />
2   VALUES (10003, &#8216;Jone&#8217;, &#8216;Bliss&#8217;,'Computer Science&#8217;, 8);</p>
<p>1 row created.<br />
SQL&gt; INSERT INTO lecturer (id, first_name, last_name, major,current_credits)<br />
2  VALUES (10004, &#8216;Man&#8217;, &#8216;Kyte&#8217;,'Economics&#8217;, 8);</p>
<p>1 row created.<br />
SQL&gt; INSERT INTO lecturer (id, first_name, last_name, major,current_credits)<br />
2  VALUES (10005, &#8216;Pat&#8217;, &#8216;Poll&#8217;,'History&#8217;, 4);</p>
<p>1 row created.<br />
SQL&gt; INSERT INTO lecturer (id, first_name, last_name, major,current_credits)<br />
2  VALUES (10006, &#8216;Tim&#8217;, &#8216;Viper&#8217;,'History&#8217;, 4);</p>
<p>1 row created.<br />
SQL&gt; INSERT INTO lecturer (id, first_name, last_name, major,current_credits)<br />
2  VALUES (10007, &#8216;Barbara&#8217;, &#8216;Blues&#8217;,'Economics&#8217;, 7);</p>
<p>1 row created.<br />
SQL&gt;  INSERT INTO lecturer (id, first_name, last_name, major,current_credits)<br />
2   VALUES (10008, &#8216;David&#8217;, &#8216;Large&#8217;,'Music&#8217;, 4);</p>
<p>1 row created.<br />
SQL&gt;  INSERT INTO lecturer (id, first_name, last_name, major,current_credits)<br />
2   VALUES (10009, &#8216;Chris&#8217;, &#8216;Elegant&#8217;,'Nutrition&#8217;, 8);</p>
<p>1 row created.<br />
SQL&gt;  INSERT INTO lecturer (id, first_name, last_name, major,current_credits)<br />
2   VALUES (10010, &#8216;Rose&#8217;, &#8216;Bond&#8217;,'Music&#8217;, 7);</p>
<p>1 row created.<br />
SQL&gt;  INSERT INTO lecturer (id, first_name, last_name, major,current_credits)<br />
2   VALUES (10011, &#8216;Rita&#8217;, &#8216;Johnson&#8217;,'Nutrition&#8217;, 8);</p>
<p>1 row created.<br />
SQL&gt;  INSERT INTO lecturer (id, first_name, last_name, major,current_credits)<br />
2   VALUES (10012, &#8216;Sharon&#8217;, &#8216;Clear&#8217;,'Computer Science&#8217;, 3);</p>
<p>1 row created.</p>
<p>SQL&gt; commit;</p>
<p>Commit complete.</p>
<p>SQL&gt; select * from lecturer;</p>
<p>ID FIRST_NAME           LAST_NAME            MAJOR                          CURRENT_CREDITS<br />
&#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;&#8212;&#8212;<br />
10001 Scott                Lawson               Computer Science                            11<br />
10002 Mar                  Wells                History                                      4<br />
10003 Jone                 Bliss                Computer Science                             8<br />
10004 Man                  Kyte                 Economics                                    8<br />
10005 Pat                  Poll                 History                                      4<br />
10006 Tim                  Viper                History                                      4<br />
10007 Barbara              Blues                Economics                                    7<br />
10008 David                Large                Music                                        4<br />
10009 Chris                Elegant              Nutrition                                    8<br />
10010 Rose                 Bond                 Music                                        7<br />
10011 Rita                 Johnson              Nutrition                                    8</p>
<p>ID FIRST_NAME           LAST_NAME            MAJOR                          CURRENT_CREDITS<br />
&#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;&#8212;&#8212;<br />
10012 Sharon               Clear                Computer Science                             3</p>
<p>12 rows selected.</p>
<p>i have a file named newrec which has the following stored procedure,</p>
<p>D:\&gt;type newrec.sql<br />
CREATE OR REPLACE PROCEDURE AddNewStudent (<br />
p_FirstName  lecturer.first_name%TYPE,<br />
p_LastName   lecturer.last_name%TYPE,<br />
p_Major      lecturer.major%TYPE) AS<br />
BEGIN<br />
INSERT INTO lecturer (ID, first_name, last_name,<br />
major, current_credits)<br />
VALUES (1, p_FirstName, p_LastName,p_Major, 0);<br />
END AddNewStudent;<br />
/</p>
<p>Now i am going to wrap this file by using the pl/sql wrapper utility.</p>
<p>D:\&gt;wrap iname=newrec.sql oname=newrec_wrap.plb</p>
<p>PL/SQL Wrapper: Release 10.2.0.4.0- Production on Wed Mar 24 15:11:28 2010</p>
<p>Copyright (c) 1993, 2004, Oracle.  All rights reserved.</p>
<p>Processing newrec.sql to newrec_wrap.plb</p>
<p>Now the warped file looks like</p>
<p>D:\&gt;type newrec_wrap.plb<br />
CREATE OR REPLACE PROCEDURE AddNewStudent wrapped<br />
a000000<br />
1<br />
abcd<br />
abcd<br />
abcd<br />
abcd<br />
abcd<br />
abcd<br />
abcd<br />
abcd<br />
abcd<br />
abcd<br />
abcd<br />
abcd<br />
abcd<br />
abcd<br />
abcd<br />
7<br />
13c 10b<br />
Ud07xFlyvsFfWzUuUo/ECDS1uwMwgzLQf5kVfC8CkE7VSPOjV6LB3C2tbCWH2WzMbkWgCl6V<br />
nSCroGKsIM/Pz7vijegUtkZn/gAolngi+O5/5ugOzdwrbhdMtmfpY9CJigmxLkM8mroV9ArS<br />
H7pTJvivJxDeNgnJVjK9+jXaRIB7uiunpPRb2bxYzIXYNVSL84v0EbW3GoAW1uctu/KoC+3Z<br />
PVzqN3aRW3Gd9AoPpceWFSKWUU+0qd9AKYvPfMwrfhnBkGlD</p>
<p>/</p>
<p>Now this wrapper file will get compiled without any errors.</p>
<p>SQL&gt; @D:\newrec_wrap.plb</p>
<p>Procedure created.</p>
<p>Even in the data dictionary only your wrapped code exists.<br />
SQL&gt; select text from user_source where NAME=&#8217;ADDNEWSTUDENT&#8217;;</p>
<p>TEXT<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
PROCEDURE AddNewStudent wrapped<br />
a000000<br />
1<br />
abcd<br />
abcd<br />
abcd<br />
abcd<br />
abcd<br />
abcd<br />
abcd<br />
abcd</p>
<p>TEXT<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
abcd<br />
abcd<br />
abcd<br />
abcd<br />
abcd<br />
abcd<br />
abcd<br />
7<br />
13c 10b<br />
Ud07xFlyvsFfWzUuUo/ECDS1uwMwgzLQf5kVfC8CkE7VSPOjV6LB3C2tbCWH2WzMbkWgCl6V<br />
nSCroGKsIM/Pz7vijegUtkZn/gAolngi+O5/5ugOzdwrbhdMtmfpY9CJigmxLkM8mroV9ArS</p>
<p>TEXT<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
H7pTJvivJxDeNgnJVjK9+jXaRIB7uiunpPRb2bxYzIXYNVSL84v0EbW3GoAW1uctu/KoC+3Z<br />
PVzqN3aRW3Gd9AoPpceWFSKWUU+0qd9AKYvPfMwrfhnBkGlD</p>
<br />Filed under: <a href='http://mehrajdba.wordpress.com/category/database/'>Database</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mehrajdba.wordpress.com/267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mehrajdba.wordpress.com/267/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mehrajdba.wordpress.com/267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mehrajdba.wordpress.com/267/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mehrajdba.wordpress.com/267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mehrajdba.wordpress.com/267/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mehrajdba.wordpress.com/267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mehrajdba.wordpress.com/267/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mehrajdba.wordpress.com/267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mehrajdba.wordpress.com/267/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mehrajdba.wordpress.com/267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mehrajdba.wordpress.com/267/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mehrajdba.wordpress.com/267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mehrajdba.wordpress.com/267/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=267&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mehrajdba.wordpress.com/2010/03/24/plsql-wrapper-utility/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cbeac91208b1d3d18eaac1a3c87fdf18?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mehraj</media:title>
		</media:content>
	</item>
		<item>
		<title>Oracle 10g -Merge enhancements</title>
		<link>http://mehrajdba.wordpress.com/2010/03/15/oracle-10g-merge-enhancements/</link>
		<comments>http://mehrajdba.wordpress.com/2010/03/15/oracle-10g-merge-enhancements/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 07:15:59 +0000</pubDate>
		<dc:creator>Mohammed Mehraj Hussain</dc:creator>
				<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://mehrajdba.wordpress.com/?p=263</guid>
		<description><![CDATA[Today , i have learned about the enhancements in the oracle 10g merge statement  from oracle-developer.net website.Thanks to Adrian Billington , Oracle developer site moderator for sharing this information with us. The MERGE statement was introduced in Oracle 9i as part of Oracle&#8217;s ETL-enabling technology. It enables us to conditionally update or insert data into [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=263&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Today , i have learned about the enhancements in the oracle 10g merge statement  from oracle-developer.net website.Thanks to Adrian Billington , Oracle developer site moderator for sharing this information with us.</p>
<p>The MERGE statement was introduced in Oracle 9i as part of Oracle&#8217;s  ETL-enabling technology. It enables us to conditionally update or insert  data into a target table and in many cases is more flexible and  efficient than previous hand-coded &#8220;UPSERT&#8221; solutions. With the release  of 10g, Oracle has added many enhancements to MERGE, making it a  considerably more flexible and powerful statement than its 9i  predecessor. For example, MERGE can now UPDATE, DELETE and INSERT with  separate conditions for each. It also supports UPDATE-only or  INSERT-only operations. We&#8217;ll examine such improvements in this article.</p>
<h3 id="c441f">setup</h3>
<p>Throughout this article, we&#8217;ll be using a source and target table to  perform the MERGE examples. The target table will have a subset of the  source table&#8217;s data, meaning that with any MERGE, there will be an  &#8220;80-20&#8243; mix of UPDATEs and INSERTs. Note that the target table is  modified to enable NULL in all columns. This will enable us to keep the  column lists short for the INSERT operations in the examples.</p>
<pre>SQL&gt; CREATE TABLE src AS SELECT * FROM all_objects WHERE ROWNUM &lt;= 100;
</pre>
<pre>Table created.
</pre>
<pre>SQL&gt; CREATE TABLE tgt AS SELECT * FROM src WHERE ROWNUM &lt;= 80;
</pre>
<pre>Table created.
</pre>
<pre>SQL&gt; ALTER TABLE tgt MODIFY
  2  ( owner         NULL
  3  , object_name   NULL
  4  , object_id     NULL
  5  , created       NULL
  6  , last_ddl_time NULL
  7  );
</pre>
<pre>Table altered.
</pre>
<h3 id="799d7">recap: merge in oracle 9i</h3>
<p>We&#8217;ll begin by demonstrating a straight MERGE supported by Oracle 9i.  We&#8217;ll pick an arbitrary operation for UPDATE (in this case setting the  OBJECT_NAME to lower case). The DML operations in this example are of  little consequence; rather it is the syntax that is important.</p>
<pre>SQL&gt; MERGE
  2     INTO  tgt
  3     USING src
  4     ON   (src.object_id = tgt.object_id)
  5  WHEN MATCHED
  6  THEN
  7     UPDATE
  8     SET tgt.object_name = LOWER(src.object_name)
  9  WHEN NOT MATCHED
 10  THEN
 11     INSERT (tgt.object_id, tgt.object_name)
 12     VALUES (src.object_id, src.object_name);

100 rows merged.
</pre>
<p>This tells us that we&#8217;ve merged 100 records. From the setup of the  data, we&#8217;d expect there to be 80 lower-cased object names in the target  table. We can check this with a simple regular expression as follows.</p>
<pre>SQL&gt; SELECT COUNT(*)
  2  FROM   tgt
  3  WHERE  REGEXP_LIKE(object_name,'[a-z]');
</pre>
<pre>  COUNT(*)
----------
        80

1 row selected.
</pre>
<p>Now we&#8217;ve revisited the MERGE statement as supported by Oracle 9i, we  can move onto the 10g new features and enhancements.</p>
<h3 id="2ff35">optional insert or update in 10g</h3>
<p>In Oracle 10g, either the INSERT or UPDATE operations are optional  (you must have one, but not necessarily both, unlike in 9i). This is a  critical enhancement and one which makes the MERGE statement <strong>much</strong> more flexible. In particular, this new feature could make updates with  correlated sub-queries a thing of the past as MERGE is easier to code,  easier to understand, more flexible, less error-prone and faster. In the  following example, we&#8217;ll MERGE source into target but ignore new rows  by leaving out the INSERT operation. Note how much easier this is to  code and read than a &#8220;double-correlated UPDATE&#8221;.</p>
<pre>SQL&gt; MERGE
  2     INTO  tgt
  3     USING src
  4     ON   (src.object_id = tgt.object_id)
  5  WHEN MATCHED
  6  THEN
  7     UPDATE
  8     SET tgt.object_name = LOWER(src.object_name);
</pre>
<pre>80 rows merged.
</pre>
<p>The following example demonstrates the opposite by leaving out the  UPDATE operation. This is the logical equivalent of a conditional  INSERT..SELECT statement.</p>
<pre>SQL&gt; MERGE
  2     INTO  tgt
  3     USING src
  4     ON   (src.object_id = tgt.object_id)
  5  WHEN NOT MATCHED
  6  THEN
  7     INSERT (tgt.object_id, tgt.object_name)
  8     VALUES (src.object_id, src.object_name);
</pre>
<pre>20 rows merged.
</pre>
<p>In addition to the conditional INSERT..SELECT above, MERGE also  supports unconditional INSERT..SELECT by way of the 1=0 condition which  Oracle calls a <strong>constant filter predicate</strong>. The purpose of this is  to avoid a join between source and target. Whether this will draw  developers away from coding a straightforward INSERT..SELECT statement  will, of course, be a matter of personal preference!</p>
<pre>SQL&gt; MERGE
  2     INTO  tgt
  3     USING src
  4     ON   (1 = 0)    --constant filter predicate to avoid join
  5  WHEN NOT MATCHED
  6  THEN
  7     INSERT (tgt.object_id, tgt.object_name)
  8     VALUES (src.object_id, src.object_name);

100 rows merged.
</pre>
<p>We can see that the unconditional INSERT..SELECT that this example  implies has loaded all records from source to target. The lack of keys  or constraints on the demonstration tables has allowed this to happen,  though in a real system, this would be likely to fail.</p>
<h3 id="0ca14">conditional dml</h3>
<p>With Oracle 10g, we can can now apply additional conditions to the  UPDATE or INSERT operation within a MERGE. This is extremely useful if  we have different rules for when a record is updated or inserted but we  do not wish to restrict the ON condition that joins source and target  together. To explain this another way, any filters added to the ON  clause, other than the primary join conditions, could increase the  likelihood that a record flips over to the &#8220;NOT MATCHED&#8221; bucket. This  would in all probability be wrong and considered a bug.</p>
<p>We can see this in the following example. We MERGE source to target  but only wish to UDPATE or INSERT specific matched records. We simply  add a suitable predicate (WHERE clause) to the UPDATE and INSERT  statements within the MERGE. This does not affect the join between the  source and target data in any way so does not change the nature of the  MERGE.</p>
<pre>SQL&gt; MERGE
  2     INTO  tgt
  3     USING src
  4     ON   (src.object_id = tgt.object_id)
  5  WHEN MATCHED
  6  THEN
  7     UPDATE
  8     SET tgt.object_name = LOWER(src.object_name)
  9     WHERE src.object_type = 'PACKAGE'
 10  WHEN NOT MATCHED
 11  THEN
 12     INSERT (tgt.object_id, tgt.object_name)
 13     VALUES (src.object_id, src.object_name)
 14     WHERE src.created &gt; TRUNC(SYSDATE) - 365;
</pre>
<pre>20 rows merged.
</pre>
<p>We can see that these predicates have restricted the number of  records merged.</p>
<h3 id="e842a">deleting during a merge</h3>
<p>Possibly the most unexpected 10g enhancement to MERGE is the ability  to conditionally DELETE rows from the target dataset during an UPDATE  operation. There are a couple of important points to note regarding  this. First, the DELETE works against conditions on the <strong>target</strong> data, not the source. Second, the DELETE works only on rows that have  been updated as a result of the MERGE. Any rows in the target table that  are not touched by the MERGE are not deleted, even if they satisfy the  DELETE criteria.</p>
<p>We&#8217;ll begin with a simple example of the DELETE operation. We&#8217;ll  remove any records that are in both the source and target data (i.e.  WHEN MATCHED) that are of OBJECT_TYPE = &#8216;TYPE&#8217;.</p>
<pre>SQL&gt; MERGE
  2     INTO  tgt
  3     USING src
  4     ON   (src.object_id = tgt.object_id)
  5  WHEN MATCHED
  6  THEN
  7     UPDATE
  8     SET tgt.object_name = LOWER(src.object_name)
  9     DELETE
 10     WHERE tgt.object_type = 'TYPE'
 11  WHEN NOT MATCHED
 12  THEN
 13     INSERT (tgt.object_id, tgt.object_name)
 14     VALUES (src.object_id, src.object_name);

100 rows merged.
</pre>
<p>We can now look a bit more closely at the MERGE-UPDATE-DELETE  operation and what data it affects. First, we&#8217;ll populate the target  table with new data and add some of the same records to the source data  to ensure we have matches.</p>
<pre>SQL&gt; TRUNCATE TABLE tgt;
</pre>
<pre>Table truncated.
</pre>
<pre>SQL&gt; TRUNCATE TABLE src;
</pre>
<pre>Table truncated.
</pre>
<pre>SQL&gt; INSERT ALL
  2     WHEN object_type IN ( 'PACKAGE', 'PACKAGE BODY' )
  3     THEN INTO tgt
  4     WHEN object_type IN ( 'PACKAGE', 'PACKAGE BODY' )
  5     AND  object_name LIKE 'DBMS%'
  6     THEN INTO src
  7  SELECT *
  8  FROM   all_objects;
</pre>
<pre>2320 rows created.
</pre>
<pre>SQL&gt; SELECT object_type
  2  ,      COUNT(*)
  3  FROM   src
  4  GROUP  BY
  5         object_type;
</pre>
<pre>OBJECT_TYPE           COUNT(*)
------------------- ----------
PACKAGE                    374
PACKAGE BODY               367

2 rows selected.
</pre>
<pre>SQL&gt; SELECT object_type
  2  ,      COUNT(*)
  3  FROM   tgt
  4  GROUP  BY
  5         object_type;
</pre>
<pre>OBJECT_TYPE           COUNT(*)
------------------- ----------
PACKAGE                    816
PACKAGE BODY               763

2 rows selected.
</pre>
<p>Using ALL_OBJECTS data, we&#8217;ve setup the example such that the source  and target tables contain data relating only to packages. The source  table has a subset of the target data and only contains packages that  begin with &#8216;DBMS&#8217;. The target table contains data for all packages.  Using this data, we can easily demonstrate the effect of a conditional  DELETE. In the following example, we&#8217;ll MERGE the source table into the  target table but include a DELETE of any matched records that have an  OBJECT_TYPE = &#8216;PACKAGE&#8217;. For simplicity, we&#8217;ll use an update-only MERGE.</p>
<pre>SQL&gt; MERGE
  2     INTO  tgt
  3     USING src
  4     ON   (src.object_id = tgt.object_id)
  5  WHEN MATCHED
  6  THEN
  7     UPDATE
  8     SET tgt.object_name = LOWER(src.object_name)
  9     DELETE
 10     WHERE tgt.object_type = 'PACKAGE';

741 rows merged.
</pre>
<p>Remember that the DELETE condition should only be tested against  records that match. In this case, the only records that should match are  those that begin with &#8216;DBMS&#8217; (these were the only packages in the  source table). Following the MERGE, therefore, we should have no  packages in our target table that begin with &#8216;DBMS&#8217;. The records in the  target table that did not have a matching source record should remain.  We can test this by counting both the number of packages and just those  that begin with &#8216;DBMS&#8217; as below.</p>
<pre>SQL&gt; SELECT SUM( CASE object_type
  2                 WHEN 'PACKAGE'
  3                 THEN 1
  4                 ELSE 0
  5              END ) AS package_records
  6  ,      SUM( CASE
  7                 WHEN object_type = 'PACKAGE'
  8                 AND  object_name LIKE 'DBMS%'
  9                 THEN 1
 10                 ELSE 0
 11              END ) AS dbms_package_records
 12  FROM   tgt;
</pre>
<pre>PACKAGE_RECORDS DBMS_PACKAGE_RECORDS
--------------- --------------------
            442                    0

1 row selected.
</pre>
<p>As we can see, despite requesting a DELETE for OBJECT_TYPE =  &#8216;PACKAGE&#8217;, we still have 442 records of this type in the target table.  As stated, this data does not have a match in the source data and  therefore is not subjected to the DELETE.</p>
<p>To demonstrate that we did get some updates, we can look at the data  that would have matched during the MERGE but would not have satisfied  the DELETE criteria. This time, we expect this to be package body  records that begin with &#8216;DBMS&#8217;. For this data, we would expect the  OBJECT_NAME to be lower-cased as a result of the MERGE. We can look at a  small sample as below.</p>
<pre>SQL&gt; SELECT object_name
  2  FROM   tgt
  3  WHERE  object_type = 'PACKAGE BODY'
  4  AND    object_name LIKE 'dbms%'
  5  AND    ROWNUM &lt;= 3;
</pre>
<pre>OBJECT_NAME
------------------------------
dbms_aq_exp_queues
dbms_prvtaqip
dbms_prvtaqis

3 rows selected.
</pre>
<br />Filed under: <a href='http://mehrajdba.wordpress.com/category/database/'>Database</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mehrajdba.wordpress.com/263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mehrajdba.wordpress.com/263/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mehrajdba.wordpress.com/263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mehrajdba.wordpress.com/263/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mehrajdba.wordpress.com/263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mehrajdba.wordpress.com/263/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mehrajdba.wordpress.com/263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mehrajdba.wordpress.com/263/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mehrajdba.wordpress.com/263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mehrajdba.wordpress.com/263/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mehrajdba.wordpress.com/263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mehrajdba.wordpress.com/263/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mehrajdba.wordpress.com/263/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mehrajdba.wordpress.com/263/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=263&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mehrajdba.wordpress.com/2010/03/15/oracle-10g-merge-enhancements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cbeac91208b1d3d18eaac1a3c87fdf18?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mehraj</media:title>
		</media:content>
	</item>
		<item>
		<title>steps to Migrate ASM diskgroups from one SAN to another SAN</title>
		<link>http://mehrajdba.wordpress.com/2009/10/28/steps-to-migrate-asm-diskgroups-from-one-san-to-another-san/</link>
		<comments>http://mehrajdba.wordpress.com/2009/10/28/steps-to-migrate-asm-diskgroups-from-one-san-to-another-san/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 11:12:50 +0000</pubDate>
		<dc:creator>Mohammed Mehraj Hussain</dc:creator>
				<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://mehrajdba.wordpress.com/?p=248</guid>
		<description><![CDATA[1) Backup all your databases and valid the backup . 2) Add the new path (new disks from the new storage) to your asm_disktring to be recognized by ASM: Example: SQL&#62; alter system set asm_disktring = &#8216;/dev/dellpowerc*&#8217; , &#8216;/dev/dellpowerh*&#8217;; Where: &#8216;/dev/dellpowerc*&#8217; are the current disks. Where: &#8216;/dev/dellpowerh*&#8217; are the new disks. 3) Confirm that the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=248&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>1) Backup all your databases and valid the backup .</p>
<p>2) Add the new path (new disks from the new storage) to your asm_disktring to be recognized by ASM:</p>
<p>Example:</p>
<p>SQL&gt; alter system set asm_disktring = &#8216;/dev/dellpowerc*&#8217; , &#8216;/dev/dellpowerh*&#8217;;</p>
<p>Where: &#8216;/dev/dellpowerc*&#8217; are the current disks.<br />
Where: &#8216;/dev/dellpowerh*&#8217; are the new disks.</p>
<p>3) Confirm that the new disks are being detected by ASM:</p>
<p>SQL&gt; select path from v$asm_disk;</p>
<p>4) Add the new disks to your desired diskgroup:</p>
<p>SQL&gt; alter diskgroup &lt;diskgroup name&gt; add disk<br />
‘&lt;new disk 1&gt;’,<br />
‘&lt;new disk 2&gt;’,<br />
‘&lt;new disk 3&gt;’,<br />
‘&lt;new disk 4&gt;’,<br />
.<br />
.<br />
.<br />
‘&lt;new disk N&gt;’;</p>
<p>5) Then wait until the rebalance operation completes:</p>
<p>SQL&gt; select * from v$asm_operation;</p>
<p>6) Finally, remove the old disks:</p>
<p>SQL&gt; alter diskgroup &lt;diskgroup name&gt; drop disk<br />
&lt;disk name A&gt;,<br />
&lt;disk name B&gt;,<br />
&lt;disk name D&gt;,<br />
&lt;disk name E&gt;,<br />
.<br />
.<br />
.<br />
&lt;disk name X&gt;;</p>
<p>7) Then wait until the rebalance operation completes:</p>
<p>SQL&gt; select * from v$asm_operation;</p>
<p>8) Done, your ASM diskgroups and database have been migrated to the new storage.</p>
<p>Note: Alternatively, we can execute add disk &amp; drop disk statements in one operation, in that way only one rebalance operation will be started as follow:</p>
<p>SQL&gt; alter diskgroup &lt;diskgroup name&gt;<br />
add disk &#8216;&lt;new device physical name 1&gt;&#8217;, .., &#8216;&lt;new device physical name N&gt;&#8217;<br />
drop disk &lt;old disk logical name 1&gt;, &lt;old disk logical name 2&gt;, ..,&lt;old disk logical name N&gt;<br />
rebalance &lt;#&gt;;</p>
<p>This is more efficient than separated commands (add disk &amp; drop disk statements).</p>
<br />Posted in Database  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mehrajdba.wordpress.com/248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mehrajdba.wordpress.com/248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mehrajdba.wordpress.com/248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mehrajdba.wordpress.com/248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mehrajdba.wordpress.com/248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mehrajdba.wordpress.com/248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mehrajdba.wordpress.com/248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mehrajdba.wordpress.com/248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mehrajdba.wordpress.com/248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mehrajdba.wordpress.com/248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mehrajdba.wordpress.com/248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mehrajdba.wordpress.com/248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mehrajdba.wordpress.com/248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mehrajdba.wordpress.com/248/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=248&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mehrajdba.wordpress.com/2009/10/28/steps-to-migrate-asm-diskgroups-from-one-san-to-another-san/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cbeac91208b1d3d18eaac1a3c87fdf18?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mehraj</media:title>
		</media:content>
	</item>
		<item>
		<title>Oracle Vs IBM</title>
		<link>http://mehrajdba.wordpress.com/2009/09/11/oracle-vs-ibm/</link>
		<comments>http://mehrajdba.wordpress.com/2009/09/11/oracle-vs-ibm/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 12:15:33 +0000</pubDate>
		<dc:creator>Mohammed Mehraj Hussain</dc:creator>
				<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://mehrajdba.wordpress.com/?p=237</guid>
		<description><![CDATA[Wow &#8230;.. It  will be a great challenge for Oracle to swipe  IBM in Hardware Business. And We can expect a Large improvements in Solaris and Sparc as Larry said. Posted in Database<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=237&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment wp-att-238" href="http://mehrajdba.wordpress.com/2009/09/11/oracle-vs-ibm/sun_customers_lg/"><img class="aligncenter size-full wp-image-238" title="sun_customers_lg" src="http://mehrajdba.files.wordpress.com/2009/09/sun_customers_lg.gif?w=600" alt="sun_customers_lg"   /></a></p>
<p>Wow &#8230;..</p>
<p>It  will be a great challenge for Oracle to swipe  IBM in Hardware Business.</p>
<p>And We can expect  a Large improvements in Solaris and Sparc as Larry said.</p>
<br />Posted in Database  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mehrajdba.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mehrajdba.wordpress.com/237/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mehrajdba.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mehrajdba.wordpress.com/237/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mehrajdba.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mehrajdba.wordpress.com/237/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mehrajdba.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mehrajdba.wordpress.com/237/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mehrajdba.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mehrajdba.wordpress.com/237/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mehrajdba.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mehrajdba.wordpress.com/237/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mehrajdba.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mehrajdba.wordpress.com/237/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=237&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mehrajdba.wordpress.com/2009/09/11/oracle-vs-ibm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cbeac91208b1d3d18eaac1a3c87fdf18?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mehraj</media:title>
		</media:content>

		<media:content url="http://mehrajdba.files.wordpress.com/2009/09/sun_customers_lg.gif" medium="image">
			<media:title type="html">sun_customers_lg</media:title>
		</media:content>
	</item>
		<item>
		<title>Oracle Clusterware</title>
		<link>http://mehrajdba.wordpress.com/2009/09/10/oracle-clusterware/</link>
		<comments>http://mehrajdba.wordpress.com/2009/09/10/oracle-clusterware/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 10:29:43 +0000</pubDate>
		<dc:creator>Mohammed Mehraj Hussain</dc:creator>
				<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://mehrajdba.wordpress.com/?p=232</guid>
		<description><![CDATA[Oracle Clusterware is the cross platform cluster software required to run the Real Application Clusters (RAC) option for Oracle Database. It provides the basic clustering services at the operating system level that enable Oracle software to run in clustering mode. In earlier versions of  Oracle (version 9i and earlier), RAC required a vendor supplied clusterware [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=232&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Oracle Clusterware is the cross platform cluster software required to run the Real Application Clusters (RAC) option for Oracle Database.</p>
<p>It provides the basic clustering services at the operating system level that enable Oracle software to run in clustering mode. In earlier versions of  Oracle (version 9i and earlier), RAC required a vendor supplied clusterware like Sun Cluster or Veritas Cluster Server and with a seperate software for  Linux and Windows.</p>
<p>Oracle clusterware naming Evolution:</p>
<p>In 9i     - Third Party softwares  (Sun Cluster or Veritas Cluster Server)<br />
In 10gR1-Cluster  Ready services (Oracle corporation)<br />
In 10gR2- Oracle Clusterware     (Oracle corporation)</p>
<p>Oracle Clusterware stores configuration information in the Oracle Cluster Repository (OCR),<br />
which must be located on shared storage available to all nodes. The Membership of the cluster is determined using a  file known as the voting disk, which must also be available to all nodes. Voting Disk  acts a tiebreaker during communication failures and  Consistent heartbeat information from all the nodes is sent to voting disk when the cluster is running .</p>
<p>Oracle Clusterware comprises a set of daemons(Background process).</p>
<p>1.Cluster Ready Services Daemon(crsd)</p>
<p>This component manages high availability operations within the cluster. Objects managed by CRS are known as resources and can include databases, instances, services, listeners, virtual IP addresses, and application processes. By default, CRS manages four application process resources: Oracle Net listeners, virtual IP addresses, the Global Services Daemon (GSD), and the Oracle Notification Service (ONS).</p>
<p>Configuration information about each resource is stored in the Oracle Cluster Repository<br />
(OCR). When the status of a resource changes, CRS generates an event.</p>
<p>CRS monitors resources, such as instances and listeners. In the event of the failure of a resource, CRS will attempt to automatically restart the component.</p>
<p>2.Oracle Cluster Synchronization Service Daemon (OCSSD)</p>
<p>This component manages the cluster configuration by controlling which nodes are members of the cluster. When a node joins or leaves the cluster, CSS notifies the other nodes of the change in configuration.<br />
If this process fails, then the cluster will be restarted.</p>
<p>3.Event Volume Manager Daemon (evmd)</p>
<p>The EVM component publishes events created by Oracle Clusterware. It will restart Automatically on failures and death of the evmd process does not halt the instance</p>
<p>4.Process Monitor Daemon (oprocd)</p>
<p>Oprocd provides the I/O Fencing solution for the Oracle Clusterware. It is the process monitor for the oracle clusterware and it uses the hang check timer or watchdog timer (depending on the implementation) for the cluster integrity.</p>
<br />Posted in Database  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mehrajdba.wordpress.com/232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mehrajdba.wordpress.com/232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mehrajdba.wordpress.com/232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mehrajdba.wordpress.com/232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mehrajdba.wordpress.com/232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mehrajdba.wordpress.com/232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mehrajdba.wordpress.com/232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mehrajdba.wordpress.com/232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mehrajdba.wordpress.com/232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mehrajdba.wordpress.com/232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mehrajdba.wordpress.com/232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mehrajdba.wordpress.com/232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mehrajdba.wordpress.com/232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mehrajdba.wordpress.com/232/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=232&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mehrajdba.wordpress.com/2009/09/10/oracle-clusterware/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cbeac91208b1d3d18eaac1a3c87fdf18?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mehraj</media:title>
		</media:content>
	</item>
		<item>
		<title>Dbms_Stats with method_opt</title>
		<link>http://mehrajdba.wordpress.com/2009/08/06/dbms_stats-with-method_opt/</link>
		<comments>http://mehrajdba.wordpress.com/2009/08/06/dbms_stats-with-method_opt/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 12:00:22 +0000</pubDate>
		<dc:creator>Mohammed Mehraj Hussain</dc:creator>
				<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://mehrajdba.wordpress.com/?p=225</guid>
		<description><![CDATA[Hi, Platform: windows server 2003 Database : 10.2.0.4 Recently we have faced an problem with Gathering statistics which leads to an oracle internal error (Ora-00600). There is a  production database which has doing some  large transactions. we usally gather the statistics for this database bettweeen the interval of two weeks . we will gather the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=225&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>Platform: windows server 2003<br />
Database : 10.2.0.4</p>
<p>Recently we have faced an problem with Gathering statistics which leads to<br />
an oracle internal error (Ora-00600).</p>
<p>There is a  production database which has doing some  large transactions.</p>
<p>we usally gather the statistics for this database bettweeen the interval of two weeks .</p>
<p>we will gather the ststistics using the folowing method</p>
<p>exec dbms_stats.gather_schema_stats(ownname=&gt;&#8217;user01&#8242;,estimate_percent=&gt;dbms_stats.auto_sample_size,cascade=&gt;true);</p>
<p>Last night we have gathered statistics for the a schema .<br />
Suddenly  Only the next day morning Our users reported that some Oracle errors is<br />
flashed  on one of our applications when accessing some particular form .</p>
<p>Then we tried to find the table on which that particular form is been accessing,<br />
and we manually quried a simple statement on tht table:</p>
<p>SQL&gt; select * from Tabular_data;<br />
select * from Tabular_data<br />
*<br />
ERROR at line 1:<br />
ORA-00600: internal error code, arguments: [19004], [], [], [], [], [], [], []</p>
<p>After some search about the argument [19004] we finally understood that it is as a Bug .</p>
<p>This bug is due to the miscalculation of the Oracle&#8217;S Automatic Historgram collection on the table<br />
columns .</p>
<p>since we dint mention any method_opt parameter on the above statement , it leads to its default value</p>
<p>method_opt=&gt;&#8217;FOR ALL COLUMNS SIZE AUTO&#8217; (Oracle 10g&#8217;s Default value)</p>
<p>So we decided to include the method_opt parameter with the size 1 which is the default value in<br />
Oracle 9i.</p>
<p>method_opt=&gt;&#8217;FOR ALL COLUMNS SIZE 1&#8242; (Oracle 9i&#8217;s Default value)</p>
<p>This method will disable the collection of Histograms.</p>
<p>if we cant loose histograms , Ofcourse the Another way to escape from this error is to lock the</p>
<p>Statistics for that particular table and to proceed with the older approach .<br />
SQL&gt; exec dbms_stats.lock_table_stats(&#8216;USER01&#8242;, &#8216;TABULAR_DATA&#8217;);</p>
<p>PL/SQL procedure successfully completed.</p>
<p>SQL&gt; SELECT stattype_locked FROM dba_tab_statistics</p>
<p>WHERE table_name=&#8217;TABULAR_DATA&#8217;;</p>
<p>STATTYPE_LOCKED<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
ALL</p>
<p>So you cant able to gather statistics on the locked table.</p>
<br />Posted in Database  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mehrajdba.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mehrajdba.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mehrajdba.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mehrajdba.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mehrajdba.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mehrajdba.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mehrajdba.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mehrajdba.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mehrajdba.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mehrajdba.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mehrajdba.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mehrajdba.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mehrajdba.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mehrajdba.wordpress.com/225/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=225&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mehrajdba.wordpress.com/2009/08/06/dbms_stats-with-method_opt/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cbeac91208b1d3d18eaac1a3c87fdf18?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mehraj</media:title>
		</media:content>
	</item>
		<item>
		<title>Namespaces</title>
		<link>http://mehrajdba.wordpress.com/2009/07/22/namespaces/</link>
		<comments>http://mehrajdba.wordpress.com/2009/07/22/namespaces/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 05:26:56 +0000</pubDate>
		<dc:creator>Mohammed Mehraj Hussain</dc:creator>
				<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://mehrajdba.wordpress.com/?p=222</guid>
		<description><![CDATA[Can we able to create an index with the same name as the table name ? Yes . Because the table and index resides in the different namespaces. A namespace defines a group of object types, within which all names must be uniquely identified—by schema and name. Objects in different namespaces can share the same [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=222&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Can we able to create an index with the same name as the table name ?</p>
<p>Yes . Because the table and index resides in the different namespaces.</p>
<p>A namespace defines a group of object types, within which all names must be uniquely identified—by schema and name. Objects in different namespaces can share the same name.</p>
<p>These object types all share the same namespace:<br />
• Tables<br />
• Views<br />
• Sequences<br />
• Private synonyms<br />
• Stand-alone procedures<br />
• Stand-alone stored functions<br />
• Packages<br />
• Materialized views<br />
• User-defined types</p>
<p>So  it is impossible to create a view with the same name as a table; at least, it<br />
is impossible if they are in the same schema.</p>
<p>These object types each have their own namespace:<br />
• Indexes<br />
• Constraints<br />
• Clusters<br />
• Database triggers<br />
• Private database links<br />
• Dimensions<br />
Thus it is possible for an index to have the same name as a table, even within the<br />
same schema.</p>
<p>SQL&gt; select namespace from v$librarycache;</p>
<p>NAMESPACE<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
SQL AREA<br />
TABLE/PROCEDURE<br />
BODY<br />
TRIGGER<br />
INDEX<br />
CLUSTER<br />
OBJECT<br />
PIPE<br />
JAVA SOURCE<br />
JAVA RESOURCE<br />
JAVA DATA</p>
<p>11 rows selected.</p>
<p>Here there is an small test:</p>
<p>SQL&gt; create table t1 as select *  from user_objects;</p>
<p>Table created.</p>
<p>SQL&gt; create index t1 on t1(object_id);</p>
<p>Index created.</p>
<p>SQL&gt;  CREATE OR REPLACE package t1 as (ENO VARCHAR2);<br />
2  /<br />
CREATE OR REPLACE package t1 as (ENO VARCHAR2);<br />
*<br />
ERROR at line 1:<br />
ORA-00955: name is already used by an existing object</p>
<p>Here we are getting the error because the packages and tables resides in the same namespace.</p>
<br />Posted in Database  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mehrajdba.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mehrajdba.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mehrajdba.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mehrajdba.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mehrajdba.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mehrajdba.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mehrajdba.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mehrajdba.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mehrajdba.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mehrajdba.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mehrajdba.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mehrajdba.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mehrajdba.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mehrajdba.wordpress.com/222/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=222&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mehrajdba.wordpress.com/2009/07/22/namespaces/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cbeac91208b1d3d18eaac1a3c87fdf18?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mehraj</media:title>
		</media:content>
	</item>
		<item>
		<title>Tracing a web application in Oracle</title>
		<link>http://mehrajdba.wordpress.com/2009/07/18/tracing-a-web-application-in-oracle/</link>
		<comments>http://mehrajdba.wordpress.com/2009/07/18/tracing-a-web-application-in-oracle/#comments</comments>
		<pubDate>Sat, 18 Jul 2009 06:29:30 +0000</pubDate>
		<dc:creator>Mohammed Mehraj Hussain</dc:creator>
				<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://mehrajdba.wordpress.com/?p=218</guid>
		<description><![CDATA[In a busy production environment with many active users, tracing a SQL session is time-consuming and complicated, because processing SQL statements in any multitier system that uses a connection pool can span multiple processes, or even different instances. With Oracle Database 10g, Oracle rationalizes SQL tracing through a new built-in package, DBMS_MONITOR, which encompasses the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=218&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In a busy production environment with many active users, tracing a SQL session is time-consuming and complicated,<br />
because processing SQL statements in any multitier system that uses a connection pool can span multiple processes,<br />
or even different instances.</p>
<p>With Oracle Database 10g, Oracle rationalizes SQL tracing through a new built-in package, DBMS_MONITOR,<br />
which encompasses the functionality of previously undocumented trace tools, such as the DBMS_SUPPORT package.<br />
Now you can easily trace any user&#8217;s session from beginning to end—from client machine to middle tier to back end—and generate trace<br />
files based on specific client ID, module, or action.</p>
<p>Now you can add your own reference to the trace file for your easy identification,</p>
<p>alter session set<br />
tracefile_identifier =&#8221;webapp&#8221;;</p>
<p>Trace files generated by this command have the string value with &#8220;webapp&#8221;</p>
<p>The DBMS_MONITOR package has routines for enabling and disabling statistics aggregation as well as for tracing by session ID,<br />
or tracing based upon a combination of service name, module name, and action name.</p>
<p>PL/SQL developers can embed calls into their applications by using the DBMS_APPLICATION_INFO package to set module and action names</p>
<p>The service name is determined by the connect string used to connect to a service. User sessions not associated with a specific service are handled by sys$users (sys$background is the default service for the background processes).<br />
Since we have a service and a module name, we can turn on tracing for this module as follows:</p>
<p>SQL&gt; exec dbms_monitor.serv_mod_act_trace_enable(service_name=&gt;&#8217;test&#8217;, module_name=&gt;&#8217;w3link&#8217;);</p>
<p>PL/SQL procedure successfully completed.</p>
<p>To Disable:</p>
<p>SQL&gt;exec dbms_monitor.serv_mod_act_trace_disable(service_name=&gt;&#8217;test&#8217;, module_name=&gt;&#8217;w3link&#8217;);</p>
<p>PL/SQL procedure successfully completed.<br />
Tracing For a particular session:<br />
 <br />
SQL&gt; select sid, serial#, username<br />
from v$session;</p>
<p>   SID     SERIAL#  USERNAME<br />
     &#8212;&#8212;    &#8212;&#8212;-  &#8212;&#8212;&#8212;&#8212;<br />
       103       4152  SYS<br />
       107       2418  SYSMAN<br />
       129         53  TEST<br />
       130        561  HR<br />
       141          4  DBSNMP<br />
. . .<br />
       168          1<br />
       169          1<br />
       170          1<br />
15 rows selected.<br />
SQL&gt; exec dbms_monitor.session_trace_enable<br />
(session_id=&gt;129, serial_num=&gt;53, waits=&gt;true, binds=&gt;TRUE);<br />
PL/SQL procedure successfully completed.<br />
SQL&gt; exec dbms_monitor.session_trace_disable(129);<br />
PL/SQL procedure successfully completed.</p>
<br />Posted in Database  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mehrajdba.wordpress.com/218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mehrajdba.wordpress.com/218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mehrajdba.wordpress.com/218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mehrajdba.wordpress.com/218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mehrajdba.wordpress.com/218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mehrajdba.wordpress.com/218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mehrajdba.wordpress.com/218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mehrajdba.wordpress.com/218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mehrajdba.wordpress.com/218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mehrajdba.wordpress.com/218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mehrajdba.wordpress.com/218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mehrajdba.wordpress.com/218/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mehrajdba.wordpress.com/218/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mehrajdba.wordpress.com/218/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=218&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mehrajdba.wordpress.com/2009/07/18/tracing-a-web-application-in-oracle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cbeac91208b1d3d18eaac1a3c87fdf18?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mehraj</media:title>
		</media:content>
	</item>
		<item>
		<title>Importance Of SQL Design</title>
		<link>http://mehrajdba.wordpress.com/2009/07/16/importance-of-sql-design/</link>
		<comments>http://mehrajdba.wordpress.com/2009/07/16/importance-of-sql-design/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 12:35:26 +0000</pubDate>
		<dc:creator>Mohammed Mehraj Hussain</dc:creator>
				<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://mehrajdba.wordpress.com/?p=212</guid>
		<description><![CDATA[If the sql statement  is designed poorly, nothing much can be done by optimizer or indexes Few are the well known rules -Enabling indexes to eliminate the need for full table scans -Avoid Cartesian joins –Use UNION ALL instead of UNION – if possible –Use EXIST clause instead of IN &#8211; (Wherever appropiate) –Use order [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=212&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If the sql statement  is designed poorly, nothing much can be done by optimizer or indexes</p>
<p>Few are the well known rules</p>
<p>-Enabling indexes to eliminate the need for full table scans</p>
<p>-Avoid Cartesian joins</p>
<p>–Use UNION ALL instead of UNION – if possible</p>
<p>–Use EXIST clause instead of IN &#8211; (Wherever appropiate)</p>
<p>–Use order by when you really require it – Its very costly</p>
<p>–When joining 2 views that themselves select from other views, check that the 2 views that you are using do not join the same tables!</p>
<p>–Avoid NOT in or NOT = on indexed columns. They prevent the optimizer from using indexes. Use where amount &gt; 0 instead of where amount != 0</p>
<p>- Avoid writing where is not null. nulls can prevent the optimizer from using an index</p>
<p>- Avoid calculations on indexed columns. Write WHERE amount &gt; 26000/3 instead of WHERE approved_amt/3 &gt; 26000</p>
<br />Posted in Database  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mehrajdba.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mehrajdba.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mehrajdba.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mehrajdba.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mehrajdba.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mehrajdba.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mehrajdba.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mehrajdba.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mehrajdba.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mehrajdba.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mehrajdba.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mehrajdba.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mehrajdba.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mehrajdba.wordpress.com/212/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=212&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mehrajdba.wordpress.com/2009/07/16/importance-of-sql-design/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cbeac91208b1d3d18eaac1a3c87fdf18?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mehraj</media:title>
		</media:content>
	</item>
		<item>
		<title>Automatic Storage Management !</title>
		<link>http://mehrajdba.wordpress.com/2009/06/26/automatic-storage-management/</link>
		<comments>http://mehrajdba.wordpress.com/2009/06/26/automatic-storage-management/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 11:28:34 +0000</pubDate>
		<dc:creator>Mohammed Mehraj Hussain</dc:creator>
				<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://mehrajdba.wordpress.com/?p=202</guid>
		<description><![CDATA[ASM is a powerful and portable storage manager designed to manage Oracle Database 10g and 11g database files. ASM simplifies storage management so that DBA&#8217;s worry less about Oracle Database file layout and management . ASM delivers lower total cost of ownership while increasing storage utilization, all without compromising performance or availability. With ASM, a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=202&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>ASM is a powerful and portable storage manager designed to manage Oracle Database 10g and 11g database files. ASM simplifies storage management so that DBA&#8217;s worry less about Oracle Database file layout and management . ASM delivers lower total cost of ownership while increasing storage utilization, all without compromising performance or availability. With ASM, a fraction of the time is needed to manage your database files.</p>
<p><a rel="attachment wp-att-205" href="http://mehrajdba.wordpress.com/2009/06/26/automatic-storage-management/asm-2/"><img class="aligncenter size-full wp-image-205" title="asm" src="http://mehrajdba.files.wordpress.com/2009/06/asm1.jpg?w=600" alt="asm"   /></a></p>
<p>Some important ASM key features are:</p>
<p>· Volume Management<br />
· Database File System with performance of RAW I/O<br />
· Supports clustering (RAC) and single instance<br />
· Automatic data distribution<br />
· Online add/drop/resize disk with automated data relocation<br />
· Automatic file management<br />
· Flexible mirror protection</p>
<p>Basically, ASM is a storage manager designed to manage Oracle Database files with Volume Manager (1MB/128KB striping, Flexible mirroring and Online disk reconfigurations and automatic rebalancing), File System (Even data distribution with optimal performance) and Automatic file management using Oracle Managed Files (OMF).</p>
<p>Files supported by ASM</p>
<p>Only Oracle files are supported:</p>
<p>Data files<br />
Control files<br />
Online redo log files<br />
Archived redo log files<br />
Flash recovery area files<br />
RMAN files (image copy and backup)</p>
<p> Files not Supported:</p>
<p>ORACLE_BASE files( including alert log, trace files, etc)<br />
CRS voting disk and OCR files<br />
Output data from UTL_FILE<br />
Any user or application specific files(e.g. XML or Java files)<br />
Oracle 9i external table files</p>
<br />Posted in Database  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mehrajdba.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mehrajdba.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mehrajdba.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mehrajdba.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mehrajdba.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mehrajdba.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mehrajdba.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mehrajdba.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mehrajdba.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mehrajdba.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mehrajdba.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mehrajdba.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mehrajdba.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mehrajdba.wordpress.com/202/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=202&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mehrajdba.wordpress.com/2009/06/26/automatic-storage-management/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cbeac91208b1d3d18eaac1a3c87fdf18?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mehraj</media:title>
		</media:content>

		<media:content url="http://mehrajdba.files.wordpress.com/2009/06/asm1.jpg" medium="image">
			<media:title type="html">asm</media:title>
		</media:content>
	</item>
		<item>
		<title>Caching a Sequence &#8211; Will it helps !</title>
		<link>http://mehrajdba.wordpress.com/2009/05/27/caching-a-sequence-will-it-helps/</link>
		<comments>http://mehrajdba.wordpress.com/2009/05/27/caching-a-sequence-will-it-helps/#comments</comments>
		<pubDate>Wed, 27 May 2009 09:12:50 +0000</pubDate>
		<dc:creator>Mohammed Mehraj Hussain</dc:creator>
				<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://mehrajdba.wordpress.com/?p=199</guid>
		<description><![CDATA[Yesterday, when I was reviewing AWR report of a busy OLTP database, I came across a dictionary related “Update” statement. This update statement was listed in top 10 SQL’s under “SQL ordered by Parse Calls” and “SQL ordered by Executions” sections of the AWR report and was parsed and executed 698 times during 30 minutes [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=199&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Yesterday, when I was reviewing AWR report of a busy OLTP database, I came across a dictionary related “Update” statement. This update statement was listed in top 10 SQL’s under “SQL ordered by Parse Calls” and “SQL ordered by Executions” sections of the AWR report and was parsed and executed 698 times during 30 minutes (A 30 minutes AWR report).</p>
<p>Here is the complete SQL Statement:</p>
<p>“update seq$ set increment$=:2, minvalue=:3, maxvalue=:4, cycle#=:5, order$=:6, cache=:7, highwater=:8, audit$=:9, flags=:10 where obj#=:1”</p>
<p>Immediately, I queried Oracle data dictionary for a list of sequences of one of our most important schema. Following is the query and its output:</p>
<p><span><span>sql&gt;select</span><span> sequence_name, cache_size, last_number </span><span>from</span><span> dba_sequences</span></span></p>
<p><span><span> where</span><span> sequence_owner = </span><span>&#8216;OM_TEST&#8217;</span><span>;</span></span><span> </span></p>
<p>SEQUENCE_NAME                  CACHE_SIZE       LAST_NUMBER</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;-                         &#8212;&#8212;&#8212;&#8211;</p>
<p>SEQ_AUDIT_DETAILS             0                                     6728991<br />
SEQ_MTR_LOG                             0                                    1<br />
SEQ_TRANS_LOG                        20                                  991</p>
<p>Sequence “SEQ_AUDIT_DETAILS” seems to be a culprit here, it has been used for more than 6 Million times and is not cached.</p>
<p>Upon further investigation, it was revealed that this sequence is used by an audit detail table to generate unique serial.</p>
<p>I altered the sequence definition to cache 1000 values. Caching instructs Oracle to pre-allocate (in my case 1000) values in the memory for faster access.</p>
<p><span><span>SQL&gt; </span><span>alter</span><span> </span><span>sequence</span><span> seq_audit_details cache 1000;</span></span></p>
<p style="text-align:left;"><span><span> </span></span>The above ALTER command did a magic and the UPDATE statement vanished from the AWR reports.</p>
<p style="text-align:left;">We need to cache sequences whenever possible to avoid extra physical I/O.</p>
<br />Posted in Database  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mehrajdba.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mehrajdba.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mehrajdba.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mehrajdba.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mehrajdba.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mehrajdba.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mehrajdba.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mehrajdba.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mehrajdba.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mehrajdba.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mehrajdba.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mehrajdba.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mehrajdba.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mehrajdba.wordpress.com/199/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=199&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mehrajdba.wordpress.com/2009/05/27/caching-a-sequence-will-it-helps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cbeac91208b1d3d18eaac1a3c87fdf18?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mehraj</media:title>
		</media:content>
	</item>
		<item>
		<title>Export Error</title>
		<link>http://mehrajdba.wordpress.com/2009/05/26/export-error/</link>
		<comments>http://mehrajdba.wordpress.com/2009/05/26/export-error/#comments</comments>
		<pubDate>Tue, 26 May 2009 13:01:26 +0000</pubDate>
		<dc:creator>Mohammed Mehraj Hussain</dc:creator>
				<category><![CDATA[Ora-errors]]></category>

		<guid isPermaLink="false">http://mehrajdba.wordpress.com/?p=193</guid>
		<description><![CDATA[Oracle Version- 10.2.0.4 I Have taken an export of a particular user  which dump size is nearly to 14 gb. While I am importing it  , i got an import error which says , illegal lob length marker 65279 bytesread = 00000000000 TABLE =cm_test IMP-00098: INTERNAL ERROR: impgst2 IMP-00018: partial import of previous table completed: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=193&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Oracle Version- 10.2.0.4</p>
<p>I Have taken an export of a particular user  which dump size is nearly to 14 gb.</p>
<p>While I am importing it  , i got an import error which says ,</p>
<p>illegal lob length marker 65279<br />
bytesread = 00000000000<br />
TABLE =cm_test<br />
IMP-00098: INTERNAL ERROR: impgst2<br />
IMP-00018: partial import of previous table completed: 2031183 rows imported<br />
IMP-00008: unrecognized statement in the export file:<br />
ÿþÿþÿþÿ<br />
IMP-00008: unrecognized statement in the export file:<br />
IMP-00008: unrecognized statement in the export file:<br />
IMP-00008: unrecognized statement in the export file:<br />
IMP-00008: unrecognized statement in the export file:<br />
IMP-00008: unrecognized statement in the export file:</p>
<p>All the  googles and forums mentioned that the export dump file is corrupted .</p>
<p>So  later i have taken an export once again with the large buffer size (buffer=300000000)</p>
<p>And then the export has been taken successfully ,</p>
<p>Later i try to import it by setting the same buffer parameter (buffer=300000000) and the import error message seems to be vanished .</p>
<p>This  same issue is been reported as a Bug by oracle support in 10.1.0.3, But this  bug has been fixed in 10.1.0.4 and Later.</p>
<p>Bug no: 3890213  IMP-98 possible importing zero length Lobs with CHUNKSIZE &gt; 32767</p>
<br />Posted in Ora-errors  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mehrajdba.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mehrajdba.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mehrajdba.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mehrajdba.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mehrajdba.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mehrajdba.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mehrajdba.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mehrajdba.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mehrajdba.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mehrajdba.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mehrajdba.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mehrajdba.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mehrajdba.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mehrajdba.wordpress.com/193/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=193&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mehrajdba.wordpress.com/2009/05/26/export-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cbeac91208b1d3d18eaac1a3c87fdf18?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mehraj</media:title>
		</media:content>
	</item>
		<item>
		<title>Is Index Expensive in DML?</title>
		<link>http://mehrajdba.wordpress.com/2009/05/26/is-index-expensive-in-dml/</link>
		<comments>http://mehrajdba.wordpress.com/2009/05/26/is-index-expensive-in-dml/#comments</comments>
		<pubDate>Tue, 26 May 2009 10:14:47 +0000</pubDate>
		<dc:creator>Mohammed Mehraj Hussain</dc:creator>
				<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://mehrajdba.wordpress.com/?p=188</guid>
		<description><![CDATA[Indexes are used to enhance expensive queries to run more quickly. They provide faster access path to table data. But, there is a trade-off using indexes, DML statements against the table would consume more time as all indexes on the table have to be updated during the DML. Here is a small test I performed [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=188&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Indexes are used to enhance expensive queries to run more quickly. They provide faster access path to table data. But, there is a trade-off using indexes, DML statements against the table would consume more time as all indexes on the table have to be updated during the DML.</p>
<p>Here is a small test I performed to see how index existence would affect the DML statements. For the test case, I create a small table without indexes, inserted 100,000 records and measure the time taken. I repeat the same test but this time with indexes on all columns. The difference in timing will show us, how much expensive are our indexes.</p>
<p><span style="font-weight:bold;">Test 1: Without Indexes</span></p>
<p>SQL&gt; set serveroutput on<br />
SQL&gt; create table t(a number, b varchar2(30), c date);</p>
<p>Table created.</p>
<p>SQL&gt; declare<br />
2     x number;<br />
3   begin<br />
4     x := dbms_utility.get_time;<br />
5     for i in 1..100000 loop<br />
6       insert into t values(i, &#8216;value = &#8216; || i, sysdate + mod(i,365));<br />
7     end loop;<br />
8   dbms_output.put_line(&#8216;Time taken WITHOUT indexes : &#8216; ||to_char(dbms_utility.get_time &#8211; x));<br />
9  end;<br />
10  /<br />
Time taken WITHOUT indexes : 1200</p>
<p>PL/SQL procedure successfully completed.</p>
<p>Now, repeat the same test by creating indexes on all the three columns.</p>
<p><span style="font-weight:bold;">Test 2: With Indexes: </span></p>
<p><span><span><br />
</span></span></p>
<p>SQL&gt; drop table t purge;</p>
<p>Table dropped.</p>
<p>SQL&gt; create table t(a number, b varchar2(30), c date);</p>
<p>Table created.</p>
<p>SQL&gt; create index t_idx1 on t(a);</p>
<p>Index created.</p>
<p>SQL&gt; create index t_idx2 on t(b);</p>
<p>Index created.</p>
<p>SQL&gt; create index t_idx3 on t(c);</p>
<p>Index created.</p>
<p>SQL&gt;  declare<br />
2   x number;<br />
3   begin<br />
4     x := dbms_utility.get_time;<br />
5     for i in 1..100000 loop<br />
6       insert into t values(i, &#8216;value = &#8216; || i, sysdate + mod(i,365));<br />
7     end loop;<br />
8     dbms_output.put_line(&#8216;Time taken WITH indexes : &#8216; ||to_char(dbms_utility.get_time &#8211; x));<br />
9   end;<br />
10 /<br />
Time taken WITH indexes : 4772</p>
<p>PL/SQL procedure successfully completed.</p>
<p>Well, it’s evident from the above tests that having too many indexes surely affects performance of DML statements. When I had three indexes, time taken to process 100,000 records was more than double compared to process the same number of records without indexes.   Moral of the test is to create indexes when required and avoid over-creating them</p>
<br />Posted in Database  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mehrajdba.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mehrajdba.wordpress.com/188/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mehrajdba.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mehrajdba.wordpress.com/188/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mehrajdba.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mehrajdba.wordpress.com/188/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mehrajdba.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mehrajdba.wordpress.com/188/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mehrajdba.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mehrajdba.wordpress.com/188/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mehrajdba.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mehrajdba.wordpress.com/188/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mehrajdba.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mehrajdba.wordpress.com/188/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=188&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mehrajdba.wordpress.com/2009/05/26/is-index-expensive-in-dml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cbeac91208b1d3d18eaac1a3c87fdf18?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mehraj</media:title>
		</media:content>
	</item>
		<item>
		<title>GATHER_FIXED_OBJECT_STATS and GATHER_DICTIONARY_STATS</title>
		<link>http://mehrajdba.wordpress.com/2009/05/25/gather_fixed_object_stats-and-gather_dictionary_stats/</link>
		<comments>http://mehrajdba.wordpress.com/2009/05/25/gather_fixed_object_stats-and-gather_dictionary_stats/#comments</comments>
		<pubDate>Mon, 25 May 2009 11:56:42 +0000</pubDate>
		<dc:creator>Mohammed Mehraj Hussain</dc:creator>
				<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://mehrajdba.wordpress.com/?p=184</guid>
		<description><![CDATA[There are two procedures in the DBMS_STATS package for gathering statistics on Oracle native objects: GATHER_FIXED_OBJECT_STATS GATHER_DICTIONARY_STATS GATHER_FIXED_OBJECT_STATS collects statistics for fixed X$ and K$ objects. It needs to be run whenever any init.ora parameter is changed. Fixed objects are the magic tables that are not tables &#8211; they are not &#8220;dictionary&#8221; tables. The x$ [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=184&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There are two procedures in the DBMS_STATS package for gathering statistics on Oracle native objects:</p>
<p>GATHER_FIXED_OBJECT_STATS</p>
<p>GATHER_DICTIONARY_STATS<br />
GATHER_FIXED_OBJECT_STATS collects statistics for fixed X$ and K$ objects. It needs to be run whenever any init.ora parameter is changed. Fixed objects are the magic tables that are not tables &#8211; they are not &#8220;dictionary&#8221; tables. The x$ tables would change size in response to init.ora setting changes generally. Setting processes higher will add rows to various x$ views for example.</p>
<p>So, they could be considered a one time thing unless you make a big change to your parameter<br />
settings.</p>
<p>GATHER_DICTIONARY_STATS collects statistics for SYS schema. It needs to be run whenever you do &#8220;big things&#8221; to the dictionary (loaded a schema &#8211; not put data into the schema, but rather did things in the schema that affect the dictionary like creating and dropping objects&#8230;) &#8211; you would consider gathering statistics.</p>
<p>Look at last_analyzed for the sys tables to see when the dictionary was gathered against. Metalink Note 281793.1 states that the DBA_OPTSTAT_OPERATIONS view may be used to determine the start and end time of all DBMS_STATS operations executed at the schema and database level.</p>
<br />Posted in Database  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mehrajdba.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mehrajdba.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mehrajdba.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mehrajdba.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mehrajdba.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mehrajdba.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mehrajdba.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mehrajdba.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mehrajdba.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mehrajdba.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mehrajdba.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mehrajdba.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mehrajdba.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mehrajdba.wordpress.com/184/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=184&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mehrajdba.wordpress.com/2009/05/25/gather_fixed_object_stats-and-gather_dictionary_stats/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cbeac91208b1d3d18eaac1a3c87fdf18?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mehraj</media:title>
		</media:content>
	</item>
		<item>
		<title>Materialized view with Unique Index</title>
		<link>http://mehrajdba.wordpress.com/2009/05/19/materialized-view-with-unique-index/</link>
		<comments>http://mehrajdba.wordpress.com/2009/05/19/materialized-view-with-unique-index/#comments</comments>
		<pubDate>Tue, 19 May 2009 04:54:47 +0000</pubDate>
		<dc:creator>Mohammed Mehraj Hussain</dc:creator>
				<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://mehrajdba.wordpress.com/?p=177</guid>
		<description><![CDATA[One of the uses of materialized views is replication. Mviews can be used to replicate a table to another database to prevent users from accessing several databases through database links. This can improve the performance of queries which frequently access that table by removing the latency of the database link. Today the refresh job of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=177&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>One of the uses of materialized views is replication. Mviews can be used to replicate a table to another database to prevent users from accessing several databases through database links. This can improve the performance of queries which frequently access that table by removing the latency of the database link.</p>
<p>Today the refresh job of one of the mviews we use for this purpose started getting &#8220;ORA-00001 unique constraint violated&#8221; error. This was an mview with a unique index on it. After a simple search in Metalink I have found the reason of this behavior.</p>
<p>I will provide a simple test case to reproduce the problem.</p>
<p>SQL&gt; select * from v$version;</p>
<p>BANNER<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Oracle9i Enterprise Edition Release 9.2.0.8.0 &#8211; 64bit Production<br />
PL/SQL Release 9.2.0.8.0 &#8211; Production<br />
CORE    9.2.0.8.0       Production<br />
TNS for Solaris: Version 9.2.0.8.0 &#8211; Production<br />
NLSRTL Version 9.2.0.8.0 &#8211; Production</p>
<p>SQL&gt; create table master as select rownum r,&#8217;ROW&#8217;||rownum line from all_objects where rownum&lt;=5;<br />
Table created.</p>
<p>SQL&gt; alter table master add primary key(r);</p>
<p>Table altered.</p>
<p>SQL&gt; create unique index master_ind on master(line);</p>
<p>Index created.</p>
<p>SQL&gt; create materialized view log on master with primary key;</p>
<p>Materialized view log created.</p>
<p>SQL&gt; create materialized view snap refresh fast with primary key as select * from master;</p>
<p>Materialized view created.</p>
<p>SQL&gt; create unique index snap_ind on snap(line);</p>
<p>Index created.</p>
<p>SQL&gt; select * from master;</p>
<p>R LINE<br />
&#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
1 ROW1<br />
2 ROW2<br />
3 ROW3<br />
4 ROW4<br />
5 ROW5</p>
<p>After these steps we have now one master table, an mview log on it and a fast refreshable mview of the master table. Now we make some updates to the master table to switch the LINE column&#8217;s data of two rows.</p>
<p>SQL&gt; update master set line=&#8217;DUMMY&#8217; where r=1;</p>
<p>1 row updated.</p>
<p>SQL&gt; update master set line=&#8217;ROW1&#8242; where r=2;</p>
<p>1 row updated.</p>
<p>SQL&gt; update master set line=&#8217;ROW2&#8242; where r=1;</p>
<p>1 row updated.</p>
<p>SQL&gt; commit;</p>
<p>Commit complete.</p>
<p>SQL&gt; select * from master;</p>
<p>R LINE<br />
&#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
1 ROW2<br />
2 ROW1<br />
3 ROW3<br />
4 ROW4<br />
5 ROW5</p>
<p>Now when we try to refresh the mview we get the error.</p>
<p>SQL&gt; exec dbms_mview.refresh(&#8216;SNAP&#8217;);<br />
BEGIN dbms_mview.refresh(&#8216;SNAP&#8217;); END;</p>
<p>*<br />
ERROR at line 1:<br />
ORA-12008: error in materialized view refresh path<br />
ORA-00001: unique constraint (YAS.SNAP_IND) violated<br />
ORA-06512: at &#8220;SYS.DBMS_SNAPSHOT&#8221;, line 820<br />
ORA-06512: at &#8220;SYS.DBMS_SNAPSHOT&#8221;, line 877<br />
ORA-06512: at &#8220;SYS.DBMS_SNAPSHOT&#8221;, line 858<br />
ORA-06512: at line 1</p>
<p>If we drop the unique index and recreate it as nonunique we can refresh the mview without errors.</p>
<p>SQL&gt; drop index snap_ind;</p>
<p>Index dropped.</p>
<p>SQL&gt; create index snap_ind on snap(line);</p>
<p>Index created.</p>
<p>SQL&gt; exec dbms_mview.refresh(&#8216;SNAP&#8217;);</p>
<p>PL/SQL procedure successfully completed.</p>
<p>SQL&gt; select * from snap;</p>
<p>R LINE<br />
&#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
1 ROW2<br />
2 ROW1<br />
3 ROW3<br />
4 ROW4<br />
5 ROW5</p>
<p>The reason of this error is explained in Metalink note 284101.1. According to that note the refresh mechanism may temporarily leave the data in an inconsistent state during the refresh. The modifications are not made with the same order as the modifications to the master table. Because of this creating unique indexes, foreign keys or primary keys on mviews can cause problems in the refresh process. This totally makes sense as it is better to keep the integrity checks on the master table rather than the mview. An mview is just a copy of the master table, so if we define the integrity constraints on the master table the mview will take care of itself.</p>
<p>This behaviour reproduces in 10G also.</p>
<br />Posted in Database  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mehrajdba.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mehrajdba.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mehrajdba.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mehrajdba.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mehrajdba.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mehrajdba.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mehrajdba.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mehrajdba.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mehrajdba.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mehrajdba.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mehrajdba.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mehrajdba.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mehrajdba.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mehrajdba.wordpress.com/177/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=177&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mehrajdba.wordpress.com/2009/05/19/materialized-view-with-unique-index/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cbeac91208b1d3d18eaac1a3c87fdf18?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mehraj</media:title>
		</media:content>
	</item>
		<item>
		<title>Monitoring Indexes</title>
		<link>http://mehrajdba.wordpress.com/2009/04/22/monitoring-indexes/</link>
		<comments>http://mehrajdba.wordpress.com/2009/04/22/monitoring-indexes/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 11:01:18 +0000</pubDate>
		<dc:creator>Mohammed Mehraj Hussain</dc:creator>
				<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://mehrajdba.wordpress.com/?p=175</guid>
		<description><![CDATA[The SQL engine maintains all indexes defined against a table regardless of their usage. Index maintenance can cause significant amounts of CPU and I/O usage, which can be detrimental to performance in a write-intensive system. With this in mind, it makes sense to identify and remove any indexes that are not being used as they [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=175&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The SQL engine maintains all indexes defined against a table regardless of their usage. Index maintenance can cause significant amounts of CPU and I/O usage, which can be detrimental to performance in a write-intensive system. With this in mind, it makes sense to identify and remove any indexes that are not being used as they are a pointless drain on resources. Index monitoring allows unused indexes to be identified accurately, removing the risks associated with dropping useful indexes.</p>
<p>It is important to make sure that index monitoring is performed over a representative time period. If you only monitor indexes during specific time frames you may incorrectly highlight indexes as being unused. The safest method is to use a monitoring period which spans the whole lifecycle of your application, including any OLTP and batch operations. In a Decision Support System (DSS) this may involve a period of weeks or months, while OLTP systems typically have shorter cycles.</p>
<h2>ALTER INDEX</h2>
<p>Index monitoring is started and stopped using the <code>ALTER INDEX</code> syntax shown below.</p>
<blockquote>
<pre>ALTER INDEX my_index_i MONITORING USAGE;
ALTER INDEX my_index_i NOMONITORING USAGE;</pre>
</blockquote>
<p>Information about the index usage can be displayed using the <code>V$OBJECT_USAGE</code> view.</p>
<blockquote>
<pre>SELECT index_name,
       table_name,
       monitoring,
       used,
       start_monitoring,
       end_monitoring
FROM   v$object_usage
WHERE  index_name = 'MY_INDEX_I'
ORDER BY index_name;

------------------------------------------------

SET PAGESIZE 0
SET FEEDBACK OFF
SET VERIFY OFF
SPOOL temp.sql

SELECT 'ALTER INDEX "' || i.owner || '"."' || i.index_name || '" MONITORING USAGE;'
FROM   dba_indexes i
WHERE  owner      = UPPER('&amp;1')
AND    table_name = DECODE(UPPER('&amp;2'), 'ALL', table_name, UPPER('&amp;2'));

SPOOL OFF

SET PAGESIZE 18
SET FEEDBACK ON

@temp.sql

-----------------------------------------------
SET PAGESIZE 0
SET FEEDBACK OFF
SET VERIFY OFF
SPOOL temp.sql

SELECT 'ALTER INDEX "' || i.owner || '"."' || i.index_name || '" NOMONITORING USAGE;'
FROM   dba_indexes i
WHERE  owner      = UPPER('&amp;1')
AND    table_name = DECODE(UPPER('&amp;2'), 'ALL', table_name, UPPER('&amp;2'));

SPOOL OFF

SET PAGESIZE 18
SET FEEDBACK ON

@temp.sql

------------------------------------------------</pre>
</blockquote>
<h2>Foreign Key Indexes</h2>
<p>To quote the Oracle Database Concepts manual:</p>
<blockquote><p>&#8220;You should almost always index foreign keys. The only exception is when the matching unique or primary key is never updated or deleted.&#8221;</p></blockquote>
<p>When a foreign key is unindexed, DML on the parent primary key results in a share row exclusive table lock (or share-subexclusive table lock, SSX) on the child table, preventing DML from other transactions against the child table. If the DML affects several rows in the parent table, the lock on the child table is obtained and released immediately for each row in turn. Despite the speed of the lock-release process, this can cause significant amounts of contention on the child table during periods of heavy update/delete activity on the parent table.</p>
<p>When a foreign key is indexed, DML on the parent primary key results in a row share table lock (or subshare table lock, SS) on the child table. This type of lock prevents other transactions from issuing whole table locks on the child table, but does not block DML on either the parent or the child table. Only the rows relating to the parent primary key are locked in the child table.</p>
<br />Posted in Database  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mehrajdba.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mehrajdba.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mehrajdba.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mehrajdba.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mehrajdba.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mehrajdba.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mehrajdba.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mehrajdba.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mehrajdba.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mehrajdba.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mehrajdba.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mehrajdba.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mehrajdba.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mehrajdba.wordpress.com/175/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=175&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mehrajdba.wordpress.com/2009/04/22/monitoring-indexes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cbeac91208b1d3d18eaac1a3c87fdf18?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mehraj</media:title>
		</media:content>
	</item>
		<item>
		<title>Resumable space allocation in 10g</title>
		<link>http://mehrajdba.wordpress.com/2009/03/31/resumable-space-allocation-in-10g/</link>
		<comments>http://mehrajdba.wordpress.com/2009/03/31/resumable-space-allocation-in-10g/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 07:09:04 +0000</pubDate>
		<dc:creator>Mohammed Mehraj Hussain</dc:creator>
				<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://mehrajdba.wordpress.com/?p=172</guid>
		<description><![CDATA[  Resumable space allocation, introduced in Oracle 9i, is for all tablespaces at the session level. Database operations are suspended when an out-of-space condition is encountered. These suspended operations automatically resume when the error condition disappears. In Oracle Database 10g, this can be enabled at the instance level. Besides this improvement, automatic alert notification is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=172&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p> </p>
<p>Resumable space allocation, introduced in Oracle 9i, is for all tablespaces at the session level. Database operations are suspended when an out-of-space condition is encountered. These suspended operations automatically resume when the error condition disappears. In Oracle Database 10g, this can be enabled at the instance level. Besides this improvement, automatic alert notification is sent when an operation is suspended.</p>
<p>In  Oracle 10gR1 the parameter RESUMABLE_TIMEOUT<br />
can also be set on system level for all sessions.<br />
SQL*Plus: Release 10.2.0.4.0 &#8211; Production on Tue Mar 31 11:58:08 2009</p>
<p>Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.</p>
<p>Enter user-name: / as sysdba</p>
<p>Connected to:<br />
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 &#8211; Production<br />
With the Partitioning, OLAP, Data Mining and Real Application Testing options</p>
<p>SQL&gt; create user test identified by test<br />
  2  default tablespace example<br />
  3  quota 1m on example;</p>
<p>User created.</p>
<p>SQL&gt; grant create session ,create table to test;</p>
<p>Grant succeeded.</p>
<p>SQL&gt; conn test<br />
Enter password:<br />
Connected.<br />
SQL&gt; create table t1 (eno number);</p>
<p>Table created.<br />
SQL&gt; BEGIN FOR i IN 1..10000 LOOP<br />
  2   INSERT INTO t1 VALUES(i);<br />
  3  END LOOP;<br />
  4   COMMIT;<br />
  5   END;<br />
  6  /</p>
<p>PL/SQL procedure successfully completed.<br />
SQL&gt;  insert into t1 select * from t1;</p>
<p>10000 rows created.</p>
<p>SQL&gt;  insert into t1 select * from t1;</p>
<p>20000 rows created.</p>
<p>SQL&gt;  insert into t1 select * from t1;<br />
 insert into t1 select * from t1<br />
*<br />
ERROR at line 1:<br />
ORA-01536: space quota exceeded for tablespace &#8216;EXAMPLE&#8217;</p>
<p> </p>
<p>SQL&gt; SELECT COUNT(*) FROM t1;</p>
<p>  COUNT(*)<br />
&#8212;&#8212;&#8212;-<br />
     40000</p>
<p>SQL&gt; ALTER SESSION ENABLE RESUMABLE TIMEOUT 600;<br />
ERROR:<br />
ORA-01031: insufficient privileges<br />
SQL&gt; conn sys as sysdba<br />
Enter password:<br />
Connected.<br />
SQL&gt; grant resumable to test;</p>
<p>Grant succeeded.<br />
SQL&gt; conn test<br />
Enter password:<br />
Connected.<br />
SQL&gt;  insert into t1 select * from t1;<br />
 insert into t1 select * from t1<br />
*<br />
ERROR at line 1:<br />
ORA-01536: space quota exceeded for tablespace &#8216;EXAMPLE&#8217;<br />
SQL&gt; ALTER SESSION ENABLE RESUMABLE TIMEOUT 600;</p>
<p>Session altered.</p>
<p>SQL&gt;  insert into t1 select * from t1;(this statement will wait )</p>
<p> </p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;from Another session (session 2) &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>SQL*Plus: Release 10.2.0.4.0 &#8211; Production on Tue Mar 31 12:19:46 2009</p>
<p>Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.<br />
Enter user-name: / as sysdba<br />
SQL&gt; select sid,state,event from v$session_wait where sid=159;</p>
<p>       SID STATE         EVENT<br />
&#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>       159 WAITING     statement suspended, wait error to be cleared</p>
<p> </p>
<p>SQL&gt; alter user test quota unlimited on example;</p>
<p>User altered.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;Now check the SESSION 1&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
SQL&gt;  insert into t1 select * from t1;</p>
<p>40000 rows created.</p>
<br />Posted in Database  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mehrajdba.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mehrajdba.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mehrajdba.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mehrajdba.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mehrajdba.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mehrajdba.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mehrajdba.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mehrajdba.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mehrajdba.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mehrajdba.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mehrajdba.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mehrajdba.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mehrajdba.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mehrajdba.wordpress.com/172/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=172&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mehrajdba.wordpress.com/2009/03/31/resumable-space-allocation-in-10g/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cbeac91208b1d3d18eaac1a3c87fdf18?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mehraj</media:title>
		</media:content>
	</item>
		<item>
		<title>RMAN -Block change tracking</title>
		<link>http://mehrajdba.wordpress.com/2009/03/17/rman-block-change-tracking/</link>
		<comments>http://mehrajdba.wordpress.com/2009/03/17/rman-block-change-tracking/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 06:41:03 +0000</pubDate>
		<dc:creator>Mohammed Mehraj Hussain</dc:creator>
				<category><![CDATA[RMAN]]></category>

		<guid isPermaLink="false">http://mehrajdba.wordpress.com/?p=167</guid>
		<description><![CDATA[Hello DBA&#8217;S, In our Production database(10.2.0.4) , currently we are using a backup  stratergy with a full backup once a month and an incremental backup each week and the archived logs are backed up once a day. All backups are directly taken in the  tape drives through a network , These tape drives are located [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=167&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hello DBA&#8217;S,</p>
<p>In our Production database(10.2.0.4) , currently we are using a backup  stratergy with<br />
a full backup once a month and an incremental backup each week and the archived logs are backed up once a day.<br />
All backups are directly taken in the  tape drives through a network , These tape drives are located in the different server&#8230;</p>
<p>In case of any recovery issues we need to transfer the backup sets from the tape to the disk through the network,so we found that there is some increase in the  recovery time .<br />
And we decided to increase the frequency of the incremental backup in order to reduce its size .So we decided to use the Oracle 10g new feature of Block Change Tracking .</p>
<p><strong>Block change tracking</strong> causes the changed database blocks to be flagged in a file.As data blocks change, the Change Tracking Writer (CTWR) background process tracks the changed blocks in a private area of memory. When a commit is issued against the data block, the block change tracking information is copied to a shared area in Large Pool called the CTWR buffer. During the checkpoint, the CTWR process writes the information from the CTWR RAM buffer to the change-tracking file.To achive this we need to enable the block change traking in our database:</p>
<p>SQL&gt; conn sys as sysdba;<br />
connected.</p>
<p>SQL&gt; SELECT status FROM v$block_change_tracking;</p>
<p>STATUS<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
DISABLED</p>
<p>To enable this you need to create a new file for block change traking.</p>
<p>SQL&gt; ALTER DATABASE ENABLE BLOCK CHANGE TRACKING<br />
  2  using file &#8216;D:\ORACLE\PRODUCT\10.2.0\ORADATA\PRD\change_track_file.dbf&#8217; reuse;</p>
<p>Database altered.</p>
<p>SQL&gt; SELECT status FROM v$block_change_tracking;</p>
<p>STATUS<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
ENABLED</p>
<p>If a block is changed in the database, the fact is recorded in this  file:D:\ORACLE\PRODUCT\10.2.0\ORADATA\PRD\change_track_file.dbf.<br />
During incremental backup, RMAN checks this file to see which blocks need to be backed up instead of checking all the blocks of a data file.</p>
<p>It dramatically reduces CPU cycles and speeds up incremental backup in the process.<br />
The block change tracking file, if present, is used automatically by the incremental backup; no special RMAN syntax is required. Using a block change tracking file saves enough time and CPU cycles  to take incremental backups every  night instead of taking once a week.</p>
<p>In case if you want to disable it ,you can use the below syntax.</p>
<p>SQL&gt; ALTER DATABASE DISABLE BLOCK CHANGE TRACKING;<br />
 <br />
Database altered.</p>
<br />Posted in RMAN  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mehrajdba.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mehrajdba.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mehrajdba.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mehrajdba.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mehrajdba.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mehrajdba.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mehrajdba.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mehrajdba.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mehrajdba.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mehrajdba.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mehrajdba.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mehrajdba.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mehrajdba.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mehrajdba.wordpress.com/167/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mehrajdba.wordpress.com&amp;blog=5749578&amp;post=167&amp;subd=mehrajdba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mehrajdba.wordpress.com/2009/03/17/rman-block-change-tracking/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cbeac91208b1d3d18eaac1a3c87fdf18?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mehraj</media:title>
		</media:content>
	</item>
	</channel>
</rss>
