<?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>R3visions's Blog</title>
	<atom:link href="http://r3visions.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://r3visions.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Mon, 07 Jun 2010 02:46:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='r3visions.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>R3visions's Blog</title>
		<link>http://r3visions.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://r3visions.wordpress.com/osd.xml" title="R3visions&#039;s Blog" />
	<atom:link rel='hub' href='http://r3visions.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Cloning a RAC database using RMAN in 11gR2</title>
		<link>http://r3visions.wordpress.com/2010/06/07/cloning-a-rac-database-using-rman-in-11gr2/</link>
		<comments>http://r3visions.wordpress.com/2010/06/07/cloning-a-rac-database-using-rman-in-11gr2/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 02:10:12 +0000</pubDate>
		<dc:creator>r3visions</dc:creator>
				<category><![CDATA[Oracle 11g]]></category>
		<category><![CDATA[RAC]]></category>

		<guid isPermaLink="false">http://r3visions.wordpress.com/?p=40</guid>
		<description><![CDATA[This blog covers cloning of a RAC database using RMAN. In Oracle 11gr2, RMAN can create a duplicate database using two methods 1. Directly from the source database &#8211; If the nodes are across the network, then there will be network latency. Also, this can cause I/O issues on the source due to the read [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=r3visions.wordpress.com&amp;blog=6865144&amp;post=40&amp;subd=r3visions&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This blog covers cloning of a RAC database using RMAN.</p>
<p>In Oracle 11gr2, RMAN can create a duplicate database using two methods</p>
<p>1. <strong>Directly from the source database</strong> &#8211; If the nodes are across the network, then there will be network latency. Also, this can cause I/O issues on the source due to the read work for the RMAN copy.</p>
<p><strong>2. Another method is to create duplicate database from the RMAN backup of the source</strong>. This way the clone process does not have to make any connection to the source database at all.<br />
This is useful for big databases where the cloned environment is not in the same cluster and the source database is huge in size. The RMAN backup of the source database can be taken on the local media server using NFS mount, copied over across the network. This can be used to create the cloned environment.</p>
<p>In this example, I have created a clone of a two nodes database, RAC. Two instances are RAC1 and RAC2 residing on nodes rac1 and rac2 respectively. This has been cloned as DUP with instances as DUP1 and DUP2 on two nodes respectively.</p>
<p><strong>Step 1</strong>: Create a password file</p>
<p>[oracle@rac1 rac]$ orapwd file=/u01/app/oracle/product/11.2.0/db_1/dbs/orapwDUP entries=25</p>
<p>Enter password for SYS: </p>
<p><strong>Step 2</strong>  Create pfile for the cloned environment<br />
SQL&gt; create pfile=&#8217;/u01/app/oracle/product/11.2.0/db_1/dbs/initDUP.ora&#8217; from spfile ;</p>
<p>File created.</p>
<p><strong>Step 3:</strong> Modify the init file to comment out all cluster related parameters viz. cluster_database, instance_number,  instance_name etc.</p>
<p><strong>Step 4:</strong> Create folders for the database DUP under ORACLE_BASE as neededed as per the parameter file.</p>
<p><strong>Step 5:Start this as auxiliary instance in nomounT</strong><br />
RMAN&gt; connect auxiliary / ;</p>
<p>connected to auxiliary database: DUP (not mounted)</p>
<p><strong>Step 6: Run the duplicate database command from RMAN</strong></p>
<p>RMAN&gt;<br />
DUPLICATE DATABASE TO DUP<br />
  UNTIL TIME &#8220;TO_DATE(&#8217;06/06/2010 11:51:00&#8242;, &#8216;MM/DD/YYYY HH24:MI:SS&#8217;)&#8221;<br />
  SPFILE<br />
  BACKUP LOCATION &#8216;/u01/rman/rac&#8217;<br />
  NOFILENAMECHECK;</p>
<p>RMAN&gt; connect auxiliary /</p>
<p>connected to auxiliary database: DUP (not mounted)</p>
<p>RMAN&gt; DUPLICATE DATABASE TO DUP<br />
2&gt; UNTIL TIME &#8220;TO_DATE(&#8217;06/06/2010 11:51:00&#8242;, &#8216;MM/DD/YYYY HH24:MI:SS&#8217;)&#8221;<br />
3&gt; BACKUP LOCATION &#8216;/u01/rman/rac&#8217;<br />
4&gt; NOFILENAMECHECK;</p>
<p>Starting Duplicate Db at 06-JUN-10</p>
<p>contents of Memory Script:<br />
{<br />
   sql clone &#8220;create spfile from memory&#8221;;<br />
}<br />
executing Memory Script</p>
<p>sql statement: create spfile from memory</p>
<p>contents of Memory Script:<br />
{<br />
   shutdown clone immediate;<br />
   startup clone nomount;<br />
}<br />
executing Memory Script</p>
<p>Oracle instance shut down</p>
<p>connected to auxiliary database (not started)<br />
connected to auxiliary database (not started)<br />
Oracle instance started</p>
<p>Total System Global Area     849530880 bytes</p>
<p>Fixed Size                     1339824 bytes<br />
Variable Size                503320144 bytes<br />
Database Buffers             339738624 bytes<br />
Redo Buffers                   5132288 bytes</p>
<p>contents of Memory Script:<br />
{<br />
   sql clone &#8220;alter system set  control_files =<br />
  &#8221;+DATA/dup/controlfile/current.314.720985707&#8221; comment=<br />
 &#8221;Set by RMAN&#8221; scope=spfile&#8221;;<br />
   sql clone &#8220;alter system set  db_name =<br />
 &#8221;RAC&#8221; comment=<br />
 &#8221;Modified by RMAN duplicate&#8221; scope=spfile&#8221;;<br />
   sql clone &#8220;alter system set  db_unique_name =<br />
 &#8221;DUP&#8221; comment=<br />
 &#8221;Modified by RMAN duplicate&#8221; scope=spfile&#8221;;<br />
   shutdown clone immediate;<br />
   startup clone force nomount<br />
   restore clone primary controlfile from  &#8216;/u01/rman/rac/RAC_DB_0klfi2kv_20_1&#8242;;<br />
   alter clone database mount;<br />
}<br />
executing Memory Script</p>
<p>sql statement: alter system set  control_files =   &#8221;+DATA/dup/controlfile/current.314.720985707&#8221; comment= &#8221;Set by RMAN&#8221; scope=spfile</p>
<p>sql statement: alter system set  db_name =  &#8221;RAC&#8221; comment= &#8221;Modified by RMAN duplicate&#8221; scope=spfile</p>
<p>sql statement: alter system set  db_unique_name =  &#8221;DUP&#8221; comment= &#8221;Modified by RMAN duplicate&#8221; scope=spfile</p>
<p>Oracle instance started</p>
<p>Total System Global Area     849530880 bytes</p>
<p>Fixed Size                     1339824 bytes<br />
Variable Size                503320144 bytes<br />
Database Buffers             339738624 bytes<br />
Redo Buffers                   5132288 bytes</p>
<p>Starting restore at 06-JUN-10<br />
allocated channel: ORA_AUX_DISK_1<br />
channel ORA_AUX_DISK_1: SID=28 device type=DISK</p>
<p>channel ORA_AUX_DISK_1: restoring control file<br />
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07<br />
output file name=+DATA/dup/controlfile/current.314.720985707<br />
Finished restore at 06-JUN-10</p>
<p>database mounted<br />
released channel: ORA_AUX_DISK_1<br />
allocated channel: ORA_AUX_DISK_1<br />
channel ORA_AUX_DISK_1: SID=28 device type=DISK</p>
<p>contents of Memory Script:<br />
{<br />
   set until scn  5582084;<br />
   set newname for clone datafile  1 to new;<br />
   set newname for clone datafile  2 to new;<br />
   set newname for clone datafile  3 to new;<br />
   set newname for clone datafile  4 to new;<br />
   set newname for clone datafile  5 to new;<br />
   set newname for clone datafile  6 to new;<br />
   restore<br />
   clone database<br />
   ;<br />
}<br />
executing Memory Script</p>
<p>executing command: SET until clause</p>
<p>executing command: SET NEWNAME</p>
<p>executing command: SET NEWNAME</p>
<p>executing command: SET NEWNAME</p>
<p>executing command: SET NEWNAME</p>
<p>executing command: SET NEWNAME</p>
<p>executing command: SET NEWNAME</p>
<p>Starting restore at 06-JUN-10<br />
using channel ORA_AUX_DISK_1</p>
<p>channel ORA_AUX_DISK_1: starting datafile backup set restore<br />
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set<br />
channel ORA_AUX_DISK_1: restoring datafile 00001 to +DATA<br />
channel ORA_AUX_DISK_1: restoring datafile 00002 to +DATA<br />
channel ORA_AUX_DISK_1: restoring datafile 00003 to +DATA<br />
channel ORA_AUX_DISK_1: restoring datafile 00004 to +DATA<br />
channel ORA_AUX_DISK_1: restoring datafile 00005 to +DATA<br />
channel ORA_AUX_DISK_1: restoring datafile 00006 to +DATA<br />
channel ORA_AUX_DISK_1: reading from backup piece /u01/rman/rac/RAC_DB_0jlfi2c1_19_1<br />
channel ORA_AUX_DISK_1: piece handle=/u01/rman/rac/RAC_DB_0jlfi2c1_19_1 tag=TAG20100606T114609<br />
channel ORA_AUX_DISK_1: restored backup piece 1<br />
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:06:33<br />
Finished restore at 06-JUN-10</p>
<p>contents of Memory Script:<br />
{<br />
   switch clone datafile all;<br />
}<br />
executing Memory Script</p>
<p>datafile 1 switched to datafile copy<br />
input datafile copy RECID=7 STAMP=720986311 file name=+DATA/dup/datafile/system.323.720985927<br />
datafile 2 switched to datafile copy<br />
input datafile copy RECID=8 STAMP=720986311 file name=+DATA/dup/datafile/sysaux.321.720985917<br />
datafile 3 switched to datafile copy<br />
input datafile copy RECID=9 STAMP=720986311 file name=+DATA/dup/datafile/undotbs1.319.720985933<br />
datafile 4 switched to datafile copy<br />
input datafile copy RECID=10 STAMP=720986312 file name=+DATA/dup/datafile/users.324.720985937<br />
datafile 5 switched to datafile copy<br />
input datafile copy RECID=11 STAMP=720986312 file name=+DATA/dup/datafile/example.320.720985935<br />
datafile 6 switched to datafile copy<br />
input datafile copy RECID=12 STAMP=720986312 file name=+DATA/dup/datafile/undotbs2.322.720985935</p>
<p>contents of Memory Script:<br />
{<br />
   set until time  &#8220;TO_DATE(&#8217;06/06/2010 11:51:00&#8242;, &#8216;MM/DD/YYYY HH24:MI:SS&#8217;)&#8221;;<br />
   recover<br />
   clone database<br />
    delete archivelog<br />
   ;<br />
}<br />
executing Memory Script</p>
<p>executing command: SET until clause</p>
<p>Starting recover at 06-JUN-10<br />
using channel ORA_AUX_DISK_1</p>
<p>starting media recovery</p>
<p>channel ORA_AUX_DISK_1: starting archived log restore to default destination<br />
channel ORA_AUX_DISK_1: restoring archived log<br />
archived log thread=1 sequence=114<br />
channel ORA_AUX_DISK_1: restoring archived log<br />
archived log thread=2 sequence=83<br />
channel ORA_AUX_DISK_1: reading from backup piece /u01/rman/rac/RAC_DB_0llfi2ld_21_1<br />
channel ORA_AUX_DISK_1: piece handle=/u01/rman/rac/RAC_DB_0llfi2ld_21_1 tag=TAG20100606T115108<br />
channel ORA_AUX_DISK_1: restored backup piece 1<br />
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:02<br />
archived log file name=+DATA/dup/archivelog/2010_06_06/thread_1_seq_114.316.720986321 thread=1 sequence=114<br />
archived log file name=+DATA/dup/archivelog/2010_06_06/thread_2_seq_83.271.720986321 thread=2 sequence=83<br />
channel clone_default: deleting archived log(s)<br />
archived log file name=+DATA/dup/archivelog/2010_06_06/thread_1_seq_114.316.720986321 RECID=2 STAMP=720986321<br />
channel clone_default: deleting archived log(s)<br />
archived log file name=+DATA/dup/archivelog/2010_06_06/thread_2_seq_83.271.720986321 RECID=1 STAMP=720986321<br />
media recovery complete, elapsed time: 00:00:05<br />
Finished recover at 06-JUN-10</p>
<p>contents of Memory Script:<br />
{<br />
   shutdown clone immediate;<br />
   startup clone nomount;<br />
   sql clone &#8220;alter system set  db_name =<br />
 &#8221;DUP&#8221; comment=<br />
 &#8221;Reset to original value by RMAN&#8221; scope=spfile&#8221;;<br />
   sql clone &#8220;alter system reset  db_unique_name scope=spfile&#8221;;<br />
   shutdown clone immediate;<br />
   startup clone nomount;<br />
}<br />
executing Memory Script</p>
<p>database dismounted<br />
Oracle instance shut down</p>
<p>connected to auxiliary database (not started)<br />
Oracle instance started</p>
<p>Total System Global Area     849530880 bytes</p>
<p>Fixed Size                     1339824 bytes<br />
Variable Size                503320144 bytes<br />
Database Buffers             339738624 bytes<br />
Redo Buffers                   5132288 bytes</p>
<p>sql statement: alter system set  db_name =  &#8221;DUP&#8221; comment= &#8221;Reset to original value by RMAN&#8221; scope=spfile</p>
<p>sql statement: alter system reset  db_unique_name scope=spfile</p>
<p>Oracle instance shut down</p>
<p>connected to auxiliary database (not started)<br />
Oracle instance started</p>
<p>Total System Global Area     849530880 bytes</p>
<p>Fixed Size                     1339824 bytes<br />
Variable Size                503320144 bytes<br />
Database Buffers             339738624 bytes<br />
Redo Buffers                   5132288 bytes<br />
sql statement: CREATE CONTROLFILE REUSE SET DATABASE &#8220;DUP&#8221; RESETLOGS ARCHIVELOG<br />
  MAXLOGFILES    192<br />
  MAXLOGMEMBERS      3<br />
  MAXDATAFILES     1024<br />
  MAXINSTANCES    32<br />
  MAXLOGHISTORY      292<br />
 LOGFILE<br />
  GROUP  1  SIZE 50 M ,<br />
  GROUP  2  SIZE 50 M<br />
 DATAFILE<br />
  &#8216;+DATA/dup/datafile/system.323.720985927&#8242;<br />
 CHARACTER SET AL32UTF8</p>
<p>sql statement: ALTER DATABASE ADD LOGFILE </p>
<p>  INSTANCE &#8216;i2&#8242;<br />
  GROUP  3  SIZE 50 M ,<br />
  GROUP  4  SIZE 50 M </p>
<p>contents of Memory Script:<br />
{<br />
   set newname for clone tempfile  1 to new;<br />
   switch clone tempfile all;<br />
   catalog clone datafilecopy  &#8220;+DATA/dup/datafile/sysaux.321.720985917&#8243;,<br />
 &#8220;+DATA/dup/datafile/undotbs1.319.720985933&#8243;,<br />
 &#8220;+DATA/dup/datafile/users.324.720985937&#8243;,<br />
 &#8220;+DATA/dup/datafile/example.320.720985935&#8243;,<br />
 &#8220;+DATA/dup/datafile/undotbs2.322.720985935&#8243;;<br />
   switch clone datafile all;<br />
}<br />
executing Memory Script</p>
<p>executing command: SET NEWNAME</p>
<p>renamed tempfile 1 to +DATA in control file</p>
<p>cataloged datafile copy<br />
datafile copy file name=+DATA/dup/datafile/sysaux.321.720985917 RECID=1 STAMP=720986834<br />
cataloged datafile copy<br />
datafile copy file name=+DATA/dup/datafile/undotbs1.319.720985933 RECID=2 STAMP=720986836<br />
cataloged datafile copy<br />
datafile copy file name=+DATA/dup/datafile/users.324.720985937 RECID=3 STAMP=720986838<br />
cataloged datafile copy<br />
datafile copy file name=+DATA/dup/datafile/example.320.720985935 RECID=4 STAMP=720986840<br />
cataloged datafile copy<br />
datafile copy file name=+DATA/dup/datafile/undotbs2.322.720985935 RECID=5 STAMP=720986840</p>
<p>datafile 2 switched to datafile copy<br />
input datafile copy RECID=1 STAMP=720986834 file name=+DATA/dup/datafile/sysaux.321.720985917<br />
datafile 3 switched to datafile copy<br />
input datafile copy RECID=2 STAMP=720986836 file name=+DATA/dup/datafile/undotbs1.319.720985933<br />
datafile 4 switched to datafile copy<br />
input datafile copy RECID=3 STAMP=720986838 file name=+DATA/dup/datafile/users.324.720985937<br />
datafile 5 switched to datafile copy<br />
input datafile copy RECID=4 STAMP=720986840 file name=+DATA/dup/datafile/example.320.720985935<br />
datafile 6 switched to datafile copy<br />
input datafile copy RECID=5 STAMP=720986840 file name=+DATA/dup/datafile/undotbs2.322.720985935</p>
<p>contents of Memory Script:<br />
{<br />
   Alter clone database open resetlogs;<br />
}<br />
executing Memory Script</p>
<p>database opened<br />
Finished Duplicate Db at 06-JUN-10</p>
<p>RMAN&gt; </p>
<p>Step 7: Convert this into RAC from single instance</p>
<p>a) Shutdown the database.<br />
b) Rename the spfile<br />
c) From the init file, uncomment the RAC related parameters and rename the init file as initDUP1.ora<br />
d) Copy this init file to node 2 under ORACLE_HOME/dbs. Save it as initDUP2.ora. Edit this file and change all DUP1 entries with DUP2 entries.</p>
<p><strong> e) Update the cluster entry by adding information of the database and instance</strong><br />
srvctl add database -d DUP -o /u01/app/oracle/product/11.2.0/db_1<br />
srvctl add instance -d DUP -i DUP1 -n rac1<br />
srvctl add instance -d DUP -i DUP2 -n rac2</p>
<p><strong>f) Start the cluster database DUP clone of RAC</strong><br />
srvctl start database -d DUP<br />
Create spfile from pfile and restart the database.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/r3visions.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/r3visions.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/r3visions.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/r3visions.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/r3visions.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/r3visions.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/r3visions.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/r3visions.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/r3visions.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/r3visions.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/r3visions.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/r3visions.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/r3visions.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/r3visions.wordpress.com/40/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=r3visions.wordpress.com&amp;blog=6865144&amp;post=40&amp;subd=r3visions&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://r3visions.wordpress.com/2010/06/07/cloning-a-rac-database-using-rman-in-11gr2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9dffe68219d060df54135ec8c4abaf96?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">r3visions</media:title>
		</media:content>
	</item>
		<item>
		<title>Changing SYSMAN Password</title>
		<link>http://r3visions.wordpress.com/2009/11/30/changing-sysman-password/</link>
		<comments>http://r3visions.wordpress.com/2009/11/30/changing-sysman-password/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 03:08:17 +0000</pubDate>
		<dc:creator>r3visions</dc:creator>
				<category><![CDATA[Grid Control]]></category>

		<guid isPermaLink="false">http://r3visions.wordpress.com/?p=31</guid>
		<description><![CDATA[It is very common to forget SYSMAN password and googling to find the steps to reset the password. Following steps cover all you need to do to reset SYSMAN password 1. Connect to the repository database and change the SYSMAN password in the database SQL&#62; alter user sysman identified by &#60;new password&#62; ; 2. Shutdown [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=r3visions.wordpress.com&amp;blog=6865144&amp;post=31&amp;subd=r3visions&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It is very common to forget SYSMAN password and googling to find the steps to reset the password.</p>
<p>Following steps cover all you need to do to reset SYSMAN password</p>
<p><strong>1. Connect to the repository database and change the SYSMAN password in the database</strong></p>
<p>SQL&gt; alter user sysman identified by &lt;new password&gt; ;</p>
<p><strong>2. Shutdown OMS and the agent</strong></p>
<p>[oracle@localhost log]$ $OMS_HOME/opmn/bin/opmnctl stopall</p>
<p><strong>3. Shutdown agent</strong></p>
<p>[oracle@localhost log]$ $AGENT_HOME/bin/emctl stop agent</p>
<p><strong>4. Change emoms.properties</strong></p>
<p>Take a backup of this file and edit following section as shown below</p>
<p>eml.mntr.emdRepPwd=<span style="color:#000080;">new_password</span><br />
oracle.sysman.eml.mntr.emdRepPwdEncrypted=<span style="color:#000080;">FALSE</span></p>
<p><strong>5. Change targets.xml</strong></p>
<p>Take a backup of this file and change the following section as follows:</p>
<p>&lt;Property NAME=&#8221;password&#8221; &#8221;<span style="color:#000080;">newpassword</span>&#8221; ENCRYPTED &#8221;<span style="color:#000080;">FALSE</span>&#8221;/&gt;</p>
<p><strong>6. Start agent and OMS</strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/r3visions.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/r3visions.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/r3visions.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/r3visions.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/r3visions.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/r3visions.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/r3visions.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/r3visions.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/r3visions.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/r3visions.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/r3visions.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/r3visions.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/r3visions.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/r3visions.wordpress.com/31/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=r3visions.wordpress.com&amp;blog=6865144&amp;post=31&amp;subd=r3visions&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://r3visions.wordpress.com/2009/11/30/changing-sysman-password/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9dffe68219d060df54135ec8c4abaf96?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">r3visions</media:title>
		</media:content>
	</item>
		<item>
		<title>Managing ASM</title>
		<link>http://r3visions.wordpress.com/2009/07/12/managing-asm/</link>
		<comments>http://r3visions.wordpress.com/2009/07/12/managing-asm/#comments</comments>
		<pubDate>Sun, 12 Jul 2009 03:21:15 +0000</pubDate>
		<dc:creator>r3visions</dc:creator>
				<category><![CDATA[ASM]]></category>

		<guid isPermaLink="false">http://r3visions.wordpress.com/?p=28</guid>
		<description><![CDATA[In the last blog we created an ASM instance manually. Here we&#8217;ll perform some common maintenance tasks. 1. Adding a directory Once a Diskgroup is created, a hierachy can be defined using directories. This is a logical way of arranging files of different categories. For example, if there is one ASM instance on a node [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=r3visions.wordpress.com&amp;blog=6865144&amp;post=28&amp;subd=r3visions&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In the last blog we created an ASM instance manually.</p>
<p>Here we&#8217;ll perform some common maintenance tasks.</p>
<p><strong>1. Adding a directory</strong></p>
<p>Once a Diskgroup is created, a hierachy can be defined using directories. This is a logical way of arranging files of different categories. For example, if there is one ASM instance on a node having DATA_1 diskgroup which can house datafiles from multiple databases, then we can create directories under this Diskgroup for every database and keep the files of one database under its own directory</p>
<p><span style="color:#003366;">SQL&gt; select name from v$asm_diskgroup ;</p>
<p>NAME<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
DATA_1</p>
<p>SQL&gt; alter diskgroup data_1<br />
2  add directory &#8216;+DATA_1/emrep&#8217; ;</p>
<p>Diskgroup altered.</p>
<p>SQL&gt; select * from v$asm_alias ;</p>
<p>NAME                                             GROUP_NUMBER FILE_NUMBER<br />
&#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 />
FILE_INCARNATION ALIAS_INDEX ALIAS_INCARNATION PARENT_INDEX REFERENCE_INDEX A S<br />
&#8212;&#8212;&#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;&#8212;&#8212; &#8211; -<br />
emrep                                                       1  4294967295<br />
4294967295           0                 1     16777216        16777269 Y N</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/r3visions.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/r3visions.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/r3visions.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/r3visions.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/r3visions.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/r3visions.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/r3visions.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/r3visions.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/r3visions.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/r3visions.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/r3visions.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/r3visions.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/r3visions.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/r3visions.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=r3visions.wordpress.com&amp;blog=6865144&amp;post=28&amp;subd=r3visions&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://r3visions.wordpress.com/2009/07/12/managing-asm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9dffe68219d060df54135ec8c4abaf96?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">r3visions</media:title>
		</media:content>
	</item>
		<item>
		<title>Creating an ASM instance on Linux</title>
		<link>http://r3visions.wordpress.com/2009/07/10/creating-an-asm-instance-on-linux/</link>
		<comments>http://r3visions.wordpress.com/2009/07/10/creating-an-asm-instance-on-linux/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 00:42:24 +0000</pubDate>
		<dc:creator>r3visions</dc:creator>
				<category><![CDATA[ASM]]></category>

		<guid isPermaLink="false">http://r3visions.wordpress.com/?p=15</guid>
		<description><![CDATA[This blog is to get started with ASM. It shows how to create an ASM instance in Oracle 10g on Linux RedHat4.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=r3visions.wordpress.com&amp;blog=6865144&amp;post=15&amp;subd=r3visions&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>ASM is a feature started from Oracle 10g to provide volume manager&#8217;s capability within the database itself.</p>
<p>This blog covers creation of an ASM instance manually on Linux RAW Devices</p>
<p><strong>Adding disk for ASM</strong></p>
<p>First I added a new 500g disk on my lab server with intention of using ASM</p>
<p>After rebooting the server with the new disk, I created four partitions of 125G each as follows:</p>
<p>fdisk /dev/sdb</p>
<p>used n for new partition and ending cylinder was specified as +125000M to create each partition as 125G</p>
<p>fdisk -l showed that four disks were created as below:</p>
<p>/dev/sdb1</p>
<p>/dev/sdb2</p>
<p>/dev/sdb3</p>
<p>/dev/sdb4</p>
<p><strong>Mounting RAW device</strong></p>
<p>/dev/hdb1 was configured as raw device.</p>
<p>An entry was added in /etc/sysconfig/rawdevices file as follows:</p>
<p><span style="color:#000080;">/dev/raw/raw1 /dev/sdb1</span></p>
<p>Then rawdevice service was started</p>
<p><span style="color:#000080;">service rawdevices start</span></p>
<p><span style="color:#000080;">[root@localhost sysconfig]# raw -qa<br />
/dev/raw/raw1:  bound to major 8, minor 17</span></p>
<p>Change theowner:group to oracle:dba</p>
<p><span style="color:#000080;">[root@localhost sysconfig]# ls -l /dev/raw/raw[1234]<br />
crw-rw&#8212;-  1 oracle dba 162, 1 Jul  9 20:01 /dev/raw/raw1<br />
[root@localhost sysconfig]#</span></p>
<p><strong>Creation of ASM instance</strong></p>
<p>ASM instance can be created using dbca utility or manually. The following example shows manual creation of the instance.</p>
<p>1. Create the parameter file</p>
<p>This is much like creation of init file for a regular instance. Specifying instance_type=asm is mandatory here.</p>
<p><span style="color:#003366;">instance_type=asm<br />
large_pool_size=40M<br />
background_dump_dest=/u00/app/oracle/admin/+ASM/bdump<br />
core_dump_dest=/u00/app/oracle/admin/+ASM/cdump</span><span style="color:#003366;">user_dump_dest=/u00/app/oracle/admin/+ASM/udump</span></p>
<p><span style="color:#003366;">asm_diskstring=/dev/raw/*</span></p>
<p><span style="color:#000080;"><span style="color:#000000;">asm_diskstring specifies the location where disks are located. If there are multiple paths, they can be specified by seperated by comma. Wild card specification is allowed here.</span></span></p>
<p>2. Start the Instance</p>
<p>SQL&gt;startup pfile=&#8217;/u00/app/oracle/admin/+ASM/pfile/init.ora&#8217;</p>
<p>Instance will be mounted but not opened gviving error on DISKGROUP not found</p>
<p>spfile needs be created and instance is mounted again using the spfile</p>
<p><span style="color:#003366;">SQL&gt;create spfile from pfile=&#8217;/u00/app/oracle/admin/+ASM/pfile/init.ora&#8217;</span></p>
<p><span style="color:#003366;">SQL&gt;shutdown immediate ;</span></p>
<p><span style="color:#003366;">SQL&gt;startup ;</span></p>
<p>3. Creation of DISKGROUPS</p>
<p>DISKGROUP can be created with NORMAL (Double Mirroring), HIGH(Triple Mirroring) or External (none)</p>
<p>Here we create a diskgroup with External redundancy. FAILGROUP controller1 can be specified if FAILGROUPs are created. This way anything written to disks on one FAILGROUP will be written to the disks of the another FAILGROUP as well. Each FAILGROUP is connected to one disk controller. In the event of failure of one disk controller, the environment can still be availbal without any data loss. The exercise carried out here did not use any FAILGROUP though</p>
<p><span style="color:#000080;">SQL&gt; create diskgroup DATA_1 external redundancy<br />
2  DISK &#8216;/dev/raw/raw1&#8242; ;</span></p>
<p><span style="color:#000080;">Diskgroup created.</span></p>
<p><span style="color:#000080;">SQL&gt; select name, total_mb, free_mb from v$asm_diskgroup ;</span></p>
<p>NAME                             TOTAL_MB    FREE_MB<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;-<br />
DATA_1                             119216     119165</p>
<p><img class="aligncenter size-medium wp-image-26" title="asm_grid" src="http://r3visions.files.wordpress.com/2009/07/asm_grid.png?w=300&#038;h=225" alt="asm_grid" width="300" height="225" /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/r3visions.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/r3visions.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/r3visions.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/r3visions.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/r3visions.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/r3visions.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/r3visions.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/r3visions.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/r3visions.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/r3visions.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/r3visions.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/r3visions.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/r3visions.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/r3visions.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=r3visions.wordpress.com&amp;blog=6865144&amp;post=15&amp;subd=r3visions&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://r3visions.wordpress.com/2009/07/10/creating-an-asm-instance-on-linux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9dffe68219d060df54135ec8c4abaf96?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">r3visions</media:title>
		</media:content>

		<media:content url="http://r3visions.files.wordpress.com/2009/07/asm_grid.png?w=300" medium="image">
			<media:title type="html">asm_grid</media:title>
		</media:content>
	</item>
		<item>
		<title>Oracle 11g Upgrade: Manual Method</title>
		<link>http://r3visions.wordpress.com/2009/07/02/oracle-11g-upgrade-manual-method/</link>
		<comments>http://r3visions.wordpress.com/2009/07/02/oracle-11g-upgrade-manual-method/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 02:15:55 +0000</pubDate>
		<dc:creator>r3visions</dc:creator>
				<category><![CDATA[Oracle 11g]]></category>

		<guid isPermaLink="false">http://r3visions.wordpress.com/2009/07/02/oracle-11g-upgrade-manual-method/</guid>
		<description><![CDATA[Oracle 11g upgrade is not much different than Oracle 10g upgrade. DBAs have to make a choice between the following threee options: 1. Manual Upgrade 2. Upgrade using Upgrade Assistant 3. Using Oracle Export/Data Pump Manual upgrade gives complete control to the DBA, however, there are chance of human errors. This blog covers the manual [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=r3visions.wordpress.com&amp;blog=6865144&amp;post=11&amp;subd=r3visions&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Oracle 11g upgrade is not much different than Oracle 10g upgrade. DBAs have to make a choice between the following threee options:</p>
<p>1. Manual Upgrade<br />
2. Upgrade using Upgrade Assistant<br />
3. Using Oracle Export/Data Pump</p>
<p>Manual upgrade gives complete control to the DBA, however, there are chance of human errors.</p>
<p>This blog covers the manual upgrade process from Oracle 10.2.0.1 to 11.1.0.6.</p>
<p><strong>Planning for Upgrade</strong></p>
<p>1.Take a good backup</p>
<p>2. Follow the Metalink Upgrade Document</p>
<p> </p>
<p><strong>Upgrade Pre-Work</strong></p>
<p><strong>1.</strong> Run utlu111i.sql from the ORACLE_HOME/rdbms/admin folder of the 11i software on the existing 10g databases</p>
<p>Following shows output of this script. It suggests if any sizing change, init/spfile parameter incompatibility,dictionary stats requirement etc.</p>
<p><span style="color:#000080;">**********************************************************************</span></p>
<p><span style="color:#000080;">&#8211; No update parameter changes are required.</span></p>
<p><span style="color:#000080;">.</span></p>
<p><span style="color:#000080;">**********************************************************************</span></p>
<p><span style="color:#000080;">Renamed Parameters: [Update Oracle Database 11.1 init.ora or spfile]</span></p>
<p><span style="color:#000080;">**********************************************************************</span></p>
<p><span style="color:#000080;">&#8211; No renamed parameters found. No changes are required.</span></p>
<p><span style="color:#000080;">.</span></p>
<p><span style="color:#000080;">**********************************************************************</span></p>
<p><span style="color:#000080;">Obsolete/Deprecated Parameters: [Update Oracle Database 11.1 init.ora or spfile]**********************************************************************</span></p>
<p><span style="color:#000080;">&#8211;&gt; &#8220;background_dump_dest&#8221; replaced by &#8220;diagnostic_dest&#8221;</span></p>
<p><span style="color:#000080;">&#8211;&gt; &#8220;user_dump_dest&#8221; replaced by &#8220;diagnostic_dest&#8221;</span></p>
<p><span style="color:#000080;">&#8211;&gt; &#8220;core_dump_dest&#8221; replaced by &#8220;diagnostic_dest&#8221;</span></p>
<p><span style="color:#000080;">.</span></p>
<p><span style="color:#000080;">**********************************************************************</span></p>
<p><span style="color:#000080;">Components: [The following database components will be upgraded or installed]</span></p>
<p><span style="color:#000080;">**********************************************************************</span></p>
<p><span style="color:#000080;">&#8211;&gt; Oracle Catalog Views [upgrade] VALID</span></p>
<p><span style="color:#000080;">&#8211;&gt; Oracle Packages and Types [upgrade] VALID</span></p>
<p><span style="color:#000080;">&#8211;&gt; Oracle Workspace Manager [upgrade] VALID</span></p>
<p><span style="color:#000080;">.</span></p>
<p><span style="color:#000080;">**********************************************************************</span></p>
<p><span style="color:#000080;">Miscellaneous Warnings</span></p>
<p><span style="color:#000080;">**********************************************************************</span></p>
<p><span style="color:#000080;">WARNING: &#8211;&gt; Database is using an old timezone file version.</span></p>
<p><span style="color:#000080;">&#8230;. Patch the 10.2.0.1.0 database to timezone file version 4</span></p>
<p><span style="color:#000080;">&#8230;. BEFORE upgrading the database. Re-run utlu111i.sql after</span></p>
<p><span style="color:#000080;">&#8230;. patching the database to record the new timezone file version.</span></p>
<p><span style="color:#000080;">WARNING: &#8211;&gt; Database contains stale optimizer statistics.</span></p>
<p><span style="color:#000080;">&#8230;. Refer to the 11g Upgrade Guide for instructions to update</span></p>
<p><span style="color:#000080;">&#8230;. statistics prior to upgrading the database.</span></p>
<p><span style="color:#000080;">&#8230;. Component Schemas with stale statistics:</span></p>
<p><span style="color:#000080;">&#8230;. SYS</span></p>
<p><span style="color:#000080;">WARNING: &#8211;&gt; Database contains INVALID objects prior to upgrade.</span></p>
<p><span style="color:#000080;">&#8230;. USER PUBLIC has 58 INVALID objects.</span></p>
<p><span style="color:#000080;">&#8230;. USER SYSMAN has 37 INVALID objects.</span></p>
<p><span style="color:#000080;">&#8230;. USER SYS has 26 INVALID objects.</span></p>
<p><span style="color:#000080;">.</span></p>
<p><span style="color:#000080;">PL/SQL procedure successfully completed</span>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/r3visions.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/r3visions.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/r3visions.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/r3visions.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/r3visions.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/r3visions.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/r3visions.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/r3visions.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/r3visions.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/r3visions.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/r3visions.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/r3visions.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/r3visions.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/r3visions.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=r3visions.wordpress.com&amp;blog=6865144&amp;post=11&amp;subd=r3visions&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://r3visions.wordpress.com/2009/07/02/oracle-11g-upgrade-manual-method/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9dffe68219d060df54135ec8c4abaf96?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">r3visions</media:title>
		</media:content>
	</item>
		<item>
		<title>Interval Partitioning in Oracle 11G</title>
		<link>http://r3visions.wordpress.com/2009/03/19/interval-partitioning-in-oracle-11g/</link>
		<comments>http://r3visions.wordpress.com/2009/03/19/interval-partitioning-in-oracle-11g/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 03:13:14 +0000</pubDate>
		<dc:creator>r3visions</dc:creator>
				<category><![CDATA[Oracle 11g]]></category>

		<guid isPermaLink="false">http://r3visions.wordpress.com/2009/03/19/interval-partitioning-in-oracle-11g/</guid>
		<description><![CDATA[I&#8217;d rate partitioning as one of the best features Oracle has introduced. Oracle kept on enriching this with every new version. Before Oracle 11g, focus was more on how many different ways data can be partitioned. Over a period of time, management of partitions started becoming a challenge for the DBAs. Imagine a table, partitioned [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=r3visions.wordpress.com&amp;blog=6865144&amp;post=4&amp;subd=r3visions&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;d rate partitioning as one of the best features Oracle has introduced. Oracle kept on enriching this with every new version. Before Oracle 11g, focus was more on how many different ways data can be partitioned. Over a period of time, management of partitions started becoming a challenge for the DBAs.</p>
<p>Imagine a table, partitioned on a date column with granularity on a daily basis. So, for every year, 365 such partitions need to be opened to accommodate all transactions for that year. I wish Oracle was smart enough to understand my needs and does that for me. With Oracle 11g, it can do exactly that.</p>
<p>Lets look at the example below to see how this can be done in Oracle 11g:</p>
<p>Here we create an old fashioned range partition table</p>
<p><span style="color:#000080;">SQL&gt; create table test_interval_part<br />
(id varchar2(5),<br />
testdate date,<br />
testdesc varchar2(2000),<br />
num number)<br />
partition by range (testdate)<br />
(<br />
partition month_0109 values less than(to_date(&#8217;01-FEB-2009&#8242;,&#8217;DD-MON-YYYY&#8217;)),<br />
partition month_0209 values less than(to_date(&#8217;01-MAR-2009&#8242;,&#8217;DD-MON-YYYY&#8217;)),<br />
partition month_0309 values less than(to_date(&#8217;01-APR-2009&#8242;,&#8217;DD-MON-YYYY&#8217;))<br />
)    ;</span></p>
<p><span style="color:#000080;">Table created.</span></p>
<p>This will allow us to add data older than April &#8217;09</p>
<p><span style="color:#000080;">SQL&gt; insert into test_interval_part<br />
2  values(&#8216;abcde&#8217;,&#8217;01-JAN-2009&#8242;, &#8216;TEST DATA&#8217;,1) ;</span></p>
<p>1 row created.</p>
<p>SQL&gt; insert into test_interval_part<br />
2  values(&#8216;abcdf&#8217;,&#8217;01-FEB-2009&#8242;,&#8217;MORE TEST DATA&#8217;,2);</p>
<p>1 row created.</p>
<p>SQL&gt; insert into test_interval_part<br />
2  values(&#8216;abcdf&#8217;,&#8217;01-MAR-2009&#8242;,&#8217;SOME MORE DATA&#8217;,3) ;</p>
<p>1 row created.</p>
<p>SQL&gt; COMMIT;</p>
<p>Commit complete.</p>
<p>As we have partitions created up to March &#8217;09 only, data newer than March &#8217;09 will not be accepted.</p>
<p><span style="color:#000080;">SQL&gt; insert into test_interval_part<br />
2   values(&#8216;abcdg&#8217;,&#8217;01-APR-2009&#8242;,&#8217;TEST&#8217;,4) ;<br />
insert into test_interval_part<br />
*<br />
ERROR at line 1:<br />
ORA-14400: inserted partition key does not map to any partition</span></p>
<p>Now, lets see how interval partitioning introduced in Oracle 11g handles it.</p>
<p>An existing partitioned table can be converted to interval partitioning by a simple command without touching the data in it.</p>
<p><span style="color:#000080;">SQL&gt; alter table test_interval_part<br />
2  set interval(</span><span style="color:#000080;">NUMTOYMINTERVAL</span><span style="color:#000080;">(1,&#8217;MONTH&#8217;)) ;</span></p>
<p>Table altered.</p>
<p><span style="color:#000000;">NUMTOYMINTERVAL function is used for year-to-month literals. For day-to-second literals, NUMTODSINTERVAL is used.</span></p>
<p><span style="color:#000000;">Now we try to insert the same row again which failed earlier due to the lack of appropriate partition.</span></p>
<p><span style="color:#000080;">SQL&gt; insert into test_interval_part<br />
2  values(&#8216;abcdg&#8217;,&#8217;01-APR-2009&#8242;,&#8217;TEST&#8217;,4) ;</span></p>
<p>1 row created.</p>
<p>SQL&gt; commit;</p>
<p><span style="color:#000080;">SQL&gt;  select table_name, partition_name from user_tab_partitions ;</span></p>
<p>TABLE_NAME                     PARTITION_NAME<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
TEST_INTERVAL_PART             MONTH_0109<br />
TEST_INTERVAL_PART             MONTH_0209<br />
TEST_INTERVAL_PART             MONTH_0309<br />
TEST_INTERVAL_PART             SYS_P41</p>
<p><span style="color:#000080;"><span style="color:#000000;">What I don&#8217;t like here is Oracle creates a partition by a system given name. However, the good part is that you don&#8217;t have to wake up in the middle of night to add partition for some unexpected future dated data. Oracle opens a partition of the desired size for you and you can later change the name as per your convention.</span></span></p>
<p><span style="color:#000080;"><span style="color:#000000;"><span style="color:#000080;">SQL&gt; alter table TEST_INTERVAL_PART<br />
2  rename partition SYS_P41 to MONTH_0409 ;</span></span></span></p>
<p>Table altered.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/r3visions.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/r3visions.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/r3visions.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/r3visions.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/r3visions.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/r3visions.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/r3visions.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/r3visions.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/r3visions.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/r3visions.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/r3visions.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/r3visions.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/r3visions.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/r3visions.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=r3visions.wordpress.com&amp;blog=6865144&amp;post=4&amp;subd=r3visions&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://r3visions.wordpress.com/2009/03/19/interval-partitioning-in-oracle-11g/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9dffe68219d060df54135ec8c4abaf96?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">r3visions</media:title>
		</media:content>
	</item>
	</channel>
</rss>
