<?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>Oracle DBA - Tips and Techniques</title>
	<atom:link href="http://gavinsoorma.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://gavinsoorma.wordpress.com</link>
	<description>Knowledge is Power - so share it ....</description>
	<lastBuildDate>Fri, 20 Nov 2009 05:10:22 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='gavinsoorma.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/c45a60c28f870225434dc927f48639fc?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Oracle DBA - Tips and Techniques</title>
		<link>http://gavinsoorma.wordpress.com</link>
	</image>
			<item>
		<title>RMAN Restore Validate Examples</title>
		<link>http://gavinsoorma.wordpress.com/2009/11/20/rman-restore-validate-examples/</link>
		<comments>http://gavinsoorma.wordpress.com/2009/11/20/rman-restore-validate-examples/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 04:34:31 +0000</pubDate>
		<dc:creator>Gavin  Soorma</dc:creator>
				<category><![CDATA[Backup and Recovery]]></category>
		<category><![CDATA[restore validate]]></category>

		<guid isPermaLink="false">http://gavinsoorma.wordpress.com/?p=1841</guid>
		<description><![CDATA[We can use the RMAN RESTORE VALIDATE command to check and verify the integrity of the backups which are stored on tapes or disk as well.
A point to keep in mind is that the RESTORE DATABASE VALIDATE command will only check for the datafile backups and will not check for either the archivelog of controlfile [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1841&subd=gavinsoorma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>We can use the RMAN RESTORE VALIDATE command to check and verify the integrity of the backups which are stored on tapes or disk as well.</p>
<p>A point to keep in mind is that the RESTORE DATABASE VALIDATE command will only check for the datafile backups and will not check for either the archivelog of controlfile backups. We need to issue additional RESTORE ARCHIVELOG VALIDATE as well as RESTORE CONTROLFILE VALIDATE commands. </p>
<p>We can also issue the RESTORE SPFILE VALIDATE command to check the backup of the server parameter file. By default, RMAN only checks for physical corruption while validating. We can also instruct RMAN to check for logical corruption via the VALIDATE CHECK LOGICAL command.</p>
<p>The RESTORE DATABASE VALIDATE command will check for the last level 0 or FULL tape or disk based backup, but the RESTORE ARCHIVELOG ALL command will check for all the archivelog files catalogued based on the retention policy.</p>
<p>So when we are validating the restore of archivelog files, it may be better to check for the existence or accessibility in the tape library or disk of all the archivelog files which have been generated since the last full or level 0 backup.</p>
<p>For example if we are taking daily backups, we would like to check for all archivelog file backups for the past day using the command as shown below:</p>
<p>RMAN&gt; <strong>restore archivelog from time &#8217;sysdate-1&#8242; validate</strong>;</p>
<p>Some other examples of the VALIDATE command are:</p>
<p>RMAN&gt; <strong>restore database validate</strong>;<br />
RMAN&gt; <strong>restore controlfile validate</strong>;<br />
RMAN&gt; <strong>restore spfile validate</strong>;<br />
RMAN&gt; <strong>restore tablespace users validate</strong>;<br />
RMAN&gt; <strong>validate backupset 922</strong>;<br />
RMAN&gt; <strong>validate recovery area</strong>;</p>
<p>An example is shown below where we are checking the validity of a database backup for a database which has a weekly level 0 backup. Note that the RESTORE DATABASE VALIDATE command will cause RMAN to check for the last level 0 backup which has been performed in this case on the 15th of November.</p>
<p>RMAN&gt; <strong>restore database validate</strong>;</p>
<p>Starting restore at 20-NOV-09<br />
using channel ORA_SBT_TAPE_1<br />
using channel ORA_DISK_1</p>
<p>channel ORA_SBT_TAPE_1: starting validation of datafile backup set<br />
channel ORA_SBT_TAPE_1: reading from backup piece vnkud0k5_1_1<br />
channel ORA_SBT_TAPE_1: piece handle=vnkud0k5_1_1 tag=TAG20091115T060908<br />
channel ORA_SBT_TAPE_1: restored backup piece 1<br />
channel ORA_SBT_TAPE_1: validation complete, elapsed time: 00:14:15<br />
Finished restore at 20-NOV-09</p>
<p>RMAN&gt; <strong>list backup of database tag TAG20091115T060908</strong>;</p>
<p>List of Backup Sets<br />
===================</p>
<p>BS Key  Type LV Size       Device Type Elapsed Time Completion Time<br />
&#8212;&#8212;- &#8212;- &#8212; &#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;&#8212;&#8212;<br />
3054    Incr 0  15.59G     SBT_TAPE    00:39:00     15-NOV-09<br />
        BP Key: 3054   Status: AVAILABLE  Compressed: NO  Tag: TAG20091115T060908<br />
        Handle: vnkud0k5_1_1   Media:<br />
  List of Datafiles in backup set 3054<br />
  File LV Type Ckp SCN    Ckp Time  Name<br />
  &#8212;- &#8212; &#8212;- &#8212;&#8212;&#8212;- &#8212;&#8212;&#8212; &#8212;-<br />
  1    0  Incr 23674579905 15-NOV-09 /u04/oradata/emrep/system01.dbf<br />
  2    0  Incr 23674579905 15-NOV-09 /u04/oradata/emrep/undotbs01.dbf<br />
  3    0  Incr 23674579905 15-NOV-09 /u04/oradata/emrep/sysaux01.dbf<br />
  4    0  Incr 23674579905 15-NOV-09 /u04/oradata/emrep/users01.dbf<br />
  5    0  Incr 23674579905 15-NOV-09 /u04/oradata/emrep/mgmt.dbf<br />
  6    0  Incr 23674579905 15-NOV-09 /u04/oradata/emrep/mgmt_ecm_depot1.dbf<br />
  7    0  Incr 23674579905 15-NOV-09 /u04/oradata/emrep/patrol01.dbf</p>
<p>Let us simulate the case where an archivelog is not present on disk and hence the validate will fail as shown below.</p>
<p>[PROD] emrep:/u05/oradata/emrep/arch &gt; <strong>mv arch18053.1.669202302.log arch18053.1.669202302.log.old</strong><br />
[PROD] emrep:/u05/oradata/emrep/arch &gt; <strong>rman target /</strong></p>
<p>Recovery Manager: Release 11.1.0.6.0 &#8211; Production on Fri Nov 20 12:23:31 2009</p>
<p>Copyright (c) 1982, 2007, Oracle.  All rights reserved.</p>
<p>connected to target database: EMREP (DBID=3892233981)</p>
<p>RMAN&gt; <strong>restore archivelog from time &#8217;sysdate-1&#8242; validate;</strong></p>
<p>Starting restore at 20-NOV-09<br />
using target database control file instead of recovery catalog<br />
allocated channel: ORA_SBT_TAPE_1<br />
channel ORA_SBT_TAPE_1: SID=261 device type=SBT_TAPE<br />
channel ORA_SBT_TAPE_1: Data Protection for Oracle: version 5.4.1.0<br />
allocated channel: ORA_DISK_1<br />
channel ORA_DISK_1: SID=221 device type=DISK</p>
<p>RMAN-00571: ===========================================================<br />
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============<br />
RMAN-00571: ===========================================================<br />
RMAN-03002: failure of restore command at 11/20/2009 12:23:37<br />
RMAN-06026: some targets not found &#8211; aborting restore<br />
RMAN-06025: no backup of archived log for thread 1 with sequence 18053 and starting SCN of 23679034351 found to restore</p>
Posted in Backup and Recovery  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gavinsoorma.wordpress.com/1841/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gavinsoorma.wordpress.com/1841/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gavinsoorma.wordpress.com/1841/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gavinsoorma.wordpress.com/1841/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gavinsoorma.wordpress.com/1841/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gavinsoorma.wordpress.com/1841/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gavinsoorma.wordpress.com/1841/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gavinsoorma.wordpress.com/1841/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gavinsoorma.wordpress.com/1841/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gavinsoorma.wordpress.com/1841/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1841&subd=gavinsoorma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.wordpress.com/2009/11/20/rman-restore-validate-examples/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4c7ffc229f14367caa30864d6feb3ac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gavsal</media:title>
		</media:content>
	</item>
		<item>
		<title>11g Flashback Data Archive &#8211; Part One</title>
		<link>http://gavinsoorma.wordpress.com/2009/11/06/11g-flashback-data-archive-part-one/</link>
		<comments>http://gavinsoorma.wordpress.com/2009/11/06/11g-flashback-data-archive-part-one/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 07:22:56 +0000</pubDate>
		<dc:creator>Gavin  Soorma</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Oracle 11g]]></category>
		<category><![CDATA[11G]]></category>
		<category><![CDATA[fbda]]></category>
		<category><![CDATA[flashback archive]]></category>
		<category><![CDATA[total recall]]></category>

		<guid isPermaLink="false">http://gavinsoorma.wordpress.com/?p=1815</guid>
		<description><![CDATA[Businesses are increasingly realizing the immense value that historical data can provide to help them understand market trends and customer behaviour as well. Further, many regulatory and compliance policies
like SOX and BASEL-2 mandate retention of historical data. 
Until now, this unfortunately involved application rewrites,administration overheads or costly third-party software solutions. Total Recall or the new [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1815&subd=gavinsoorma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Businesses are increasingly realizing the immense value that historical data can provide to help them understand market trends and customer behaviour as well. Further, many regulatory and compliance policies<br />
like SOX and BASEL-2 mandate retention of historical data. </p>
<p>Until now, this unfortunately involved application rewrites,administration overheads or costly third-party software solutions. Total Recall or the new Oracle 11g Flashback Data Archive feature has greatly enhanced the flashback technology which was introduced in Oracle 9i to make it far more than just a tool to recover from logical corruptions and human error. It is now an out-of-the  box Information Life Cycle Management tool and provides ease of management of historical information and long term secure data tracking with minimal performance overheads. </p>
<p>11g Flashback Data Archive provides the automated ability to track and store all transactional changes to a table over its lifetime without having to build this intelligence into your application. Prior to 11g, Flashback technology to a large part was based on the availability of undo data or flashback logs and both the undo data as well as flashback logs are subject to recycling when out of space pressure exists. The UNDO tablespace in Oracle was primarily meant for transaction consistency and not data archival.</p>
<p><strong>Flashback Data Archive or Total Recall Features</strong></p>
<li>Easy to configure – apply to all tables, one or a group of tables with simple “enable archive” command</li>
<li>Secure – complete protection from accidental or malicious updates and deletes</li>
<li>Efficiency of performance and storage – capture process is asynchronous background process and data in history tables is partitioned as well as compressed automatically</li>
<li>Easy to access historical data using standard SQL “AS OF” constructs</li>
<li>Automated data management – historical data is automatically purged without any human intervention</li>
<li>Retention policies customised to suit business needs</li>
<p>
<br />
Flashback Data Archive uses a background process <strong>fbda</strong> to capture data asynchronously. It runs every 5 minutes which is the default as well as at more frequent intervals depending on system activity. The Primary source for historical data is the Undo data, but this undo data is not reused until the historical data is written first.</p>
<p><strong>Getting Started </strong></p>
<li>System Privilege &#8211; FLASHBACK ARCHIVE ADMINISTER to create and administer a flashback data archive</li>
<li>Connect as SYSDBA</li>
<li>Object Privilege &#8211; FLASHBACK ARCHIVE privilege on the specific flashback data archive to enable historical data tracking</li>
<li>Quota on the tablespace where the flashback data archive has been created</li>
<p>
</p>
<p><strong>Creating a Flashback Data Archive (lets call it FBDA)</strong></p>
<li>Create a new tablespace or use existing tablespace – tablespace needs to be ASSM</li>
<li>Specify the FBDA as the default (optional)</li>
<li>Assign a quota for the FBDA (optional)</li>
<li>Assign a retention period for the FBDA</li>
<li>Retention period integer denoting days,months or years</li>
<li>Enable flashback archive for a specific table via the CREATE TABLE or ALTER TABLE clause. By default it is turned off.</li>
<p>
</p>
<pre>
SQL&gt; CREATE TABLESPACE his_data_1
  2  DATAFILE '+data' SIZE 500M;

Tablespace created.

SQL&gt; CREATE FLASHBACK ARCHIVE DEFAULT fba1
  2  TABLESPACE his_data_1
  3  RETENTION 2 DAY;

Flashback archive created.

SQL&gt; SELECT FLASHBACK_ARCHIVE_NAME, to_char(CREATE_TIME,'dd-mon-yyyy') Created,
  2  RETENTION_IN_DAYS,STATUS FROM DBA_FLASHBACK_ARCHIVE;

FLASHBACK_ARCHIVE_NA CREATED     RETENTION_IN_DAYS STATUS
-------------------- ----------- ----------------- -------
FBA1                 02-nov-2009                 2 DEFAULT
</pre>
<pre>
SQL&gt; GRANT FLASHBACK ARCHIVE ON fba1 TO scott;

Grant succeeded.

SQL&gt; ALTER TABLE mysales FLASHBACK ARCHIVE fba1;

Table altered.

SQL&gt; CREATE TABLE
  2  EMPSAL_HIS
  3  (EMPNO number,
  4  ENAME VARCHAR2(10),
  5  SAL NUMBER,
  6  FLASHBACK ARCHIVE;

Table created.

SQL&gt; select TABLE_NAME,FLASHBACK_ARCHIVE_NAME,ARCHIVE_TABLE_NAME,STATUS
  2  from USER_FLASHBACK_ARCHIVE_tables;

TABLE_NAME            FLASHBACK_ARCHIVE_NA  ARCHIVE_TABLE_NAME               STATUS
-----------	  --------------------  --------------------	      ------------
MYSALES               FBA1                 SYS_FBA_HIST_77429               ENABLED
EMPSAL_HIS            FBA1                 SYS_FBA_HIST_77419               ENABLED
</pre>
<p><strong>Note: for every table where Flashback Archive is enabled, corresponding internal history tables are created in the flashback archive tablespace as shown below. These tables are automatically partitioned and compressed as well<br />
</strong></p>
<pre>
SQL&gt; select object_id from dba_objects where object_name=‘DEPT';

 OBJECT_ID
----------
     73201

SQL&gt; select table_name,tablespace_name from user_tables;

TABLE_NAME                     TABLESPACE_NAME
------------------------------ ------------------------------
DEPT                           USERS
SYS_FBA_DDL_COLMAP_73201       HIS_DATA_1
SYS_FBA_TCRV_73201             HIS_DATA_1
SYS_FBA_HIST_73201

SQL&gt; desc SYS_FBA_HIST_73201
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 <strong>RID                                                VARCHAR2(4000)
 STARTSCN                                           NUMBER
 ENDSCN                                             NUMBER
 XID                                                RAW(8)
 OPERATION                                          VARCHAR2(1)</strong>
EMPNO                                              NUMBER(4)
 ENAME                                              VARCHAR2(10)
 MGR                                                NUMBER(10)
DEPTNO                                             NUMBER(2)
 JOB                                                VARCHAR2(20)

SQL&gt; SELECT TABLE_NAME,PARTITION_NAME,COMPRESSION from USER_TAB_PARTITIONS;

TABLE_NAME                     PARTITION_NAME                 COMPRESS
------------------------------ ------------------------------ --------
SYS_FBA_HIST_77429            HIGH_PART                      ENABLED
SYS_FBA_HIST_77419            HIGH_PART                      ENABLED
</pre>
Posted in Administration, Oracle 11g  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gavinsoorma.wordpress.com/1815/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gavinsoorma.wordpress.com/1815/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gavinsoorma.wordpress.com/1815/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gavinsoorma.wordpress.com/1815/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gavinsoorma.wordpress.com/1815/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gavinsoorma.wordpress.com/1815/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gavinsoorma.wordpress.com/1815/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gavinsoorma.wordpress.com/1815/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gavinsoorma.wordpress.com/1815/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gavinsoorma.wordpress.com/1815/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1815&subd=gavinsoorma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.wordpress.com/2009/11/06/11g-flashback-data-archive-part-one/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4c7ffc229f14367caa30864d6feb3ac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gavsal</media:title>
		</media:content>
	</item>
		<item>
		<title>Oracle Restart &#8211; new in 11g R2</title>
		<link>http://gavinsoorma.wordpress.com/2009/10/29/11g-release-2-oracle-restart/</link>
		<comments>http://gavinsoorma.wordpress.com/2009/10/29/11g-release-2-oracle-restart/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 07:27:03 +0000</pubDate>
		<dc:creator>Gavin  Soorma</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[High Availability]]></category>
		<category><![CDATA[Oracle 11g release 2]]></category>
		<category><![CDATA[11gR2]]></category>
		<category><![CDATA[ohas]]></category>
		<category><![CDATA[oracle restart]]></category>
		<category><![CDATA[restart]]></category>

		<guid isPermaLink="false">http://gavinsoorma.wordpress.com/?p=1803</guid>
		<description><![CDATA[Similar to the clusterware processes in a RAC environment, in 11g R2 even for a standalone instance, functionality is now available to automatically restart components like the database, listener, ASM diskgroup, service etc in the event of their failure.
This feature is called Oracle Restart and it runs out of the Grid Infrastructure home which is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1803&subd=gavinsoorma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Similar to the clusterware processes in a RAC environment, <strong>in 11g R2 even for a standalone instance</strong>, functionality is now available to automatically restart components like the database, listener, ASM diskgroup, service etc in the event of their failure.</p>
<p>This feature is called Oracle Restart and it runs out of the Grid Infrastructure home which is separate from the database home.</p>
<p>Oracle Restart is managed by CRSCTL utility and it uses Oracle High Availability Services to start and stop the components managed by Oracle Restart.</p>
<p>Using Oracle Restart, we can stop or start all the components running out of a single Oracle Home with a single srvctl command as well as Oracle Restart will automatically start all components on machine reboot in the proper order taking into account dependencies like ASM instance and the managed database instances. So no more do we have to use the dbstart and dbstop scripts to manage this.</p>
<p>Oracle Restart can be extended to Data Guard configurations as well by integrating with Data Guard Broker to manage the start and stop of database services following a data guard role transition.</p>
<p>Let us examine some of the srvctl commands which can be executed in a single instance environment as well as see the use of the crsctl command &#8211; normally previously only used for RAC environments.</p>
<pre>
-bash-3.2$ <strong>crs_stat -t</strong>
Name           Type           Target    State     Host
------------------------------------------------------------
ora.DATA1.dg   ora....up.type ONLINE    ONLINE    redhat64
ora....ER.lsnr ora....er.type ONLINE    ONLINE    redhat64
ora....WARE.dg ora....up.type ONLINE    ONLINE    redhat64
ora.asm        ora.asm.type   ONLINE    ONLINE    redhat64
ora.cssd       ora.cssd.type  ONLINE    ONLINE    redhat64
ora.diskmon    ora....on.type ONLINE    ONLINE    redhat64
ora.eons       ora.eons.type  ONLINE    ONLINE    redhat64
ora.ons        ora.ons.type   ONLINE    ONLINE    redhat64

bash-3.2$ <strong>./crsctl check has</strong>
CRS-4638: Oracle High Availability Services is online

-bash-3.2$ <strong>./crsctl check css</strong>
CRS-4529: Cluster Synchronization Services is online

-bash-3.2$ <strong>./srvctl start listener</strong>

-bash-3.2$ ps -ef |grep tns
oracle   14899     1  0 14:08 ?        00:00:00 /u02/app/oracle/product/11.2.0/grid/bin/tnslsnr LISTENER -inherit

-bash-3.2$ <strong>./srvctl status listener</strong>
Listener LISTENER is enabled
Listener LISTENER is running on node(s): redhat64

-bash-3.2$ <strong>./srvctl status asm</strong>
ASM is running on redhat64

-bash-3.2$ <strong>./srvctl status diskgroup -g DATA1</strong>
Disk Group DATA1 is running on redhat64

-bash-3.2$ <strong>./srvctl config asm</strong>
ASM home: /u02/app/oracle/product/11.2.0/grid
ASM listener: LISTENER
Spfile: +DATA1/asm/asmparameterfile/registry.253.700932479
ASM diskgroup discovery string: /dev/raw/raw*
</pre>
<p>In case a process dies unexpectedly, Oracle Restart will automatically start the process. In the example below, we kill the PMON process of the ora11gr2 instance and find that in less than 5 seconds the instance has been restarted by the Oracle High Availablity Service running in the background constantly monitoring the health of the managed components.</p>
<pre>
-bash-3.2$ ps -ef |grep pmon
oracle   12710     1  0 Oct22 ?        00:00:01 asm_pmon_+ASM
<strong>oracle   15752     1  0 14:14 ?        00:00:00 ora_pmon_ora11gr2</strong>
oracle   15975 18271  0 14:15 pts/2    00:00:00 grep pmon

-bash-3.2$ <strong>kill -9  15752</strong>

-bash-3.2$ ps -ef |grep pmon
oracle   12710     1  0 Oct22 ?        00:00:01 asm_pmon_+ASM
<strong>oracle   16679     1  0 14:22 ?        00:00:00 ora_pmon_ora11gr2</strong>
oracle   16775 18271  0 14:22 pts/2    00:00:00 grep pmon
</pre>
<p>In this example we stop all the components running out of a particular home by executing the srvctl stop home command. After stopping the database home, we find that only the ASM instance is running as it is managed by a seperate home which is the Grid Infrastructure home. After the database home is started, the database instance ora11gr2 also is automatically started.</p>
<pre>
[oracle@redhat346 ~]$ <strong>srvctl stop home -o /u01/app/oracle/product/11.2.0/dbhome_1 -s /tmp/state</strong>

[oracle@redhat346 ~]$ ps -ef |grep pmon
oracle   19841     1  0 Sep18 ?        00:01:24 asm_pmon_+ASM
oracle   31843 27855  0 15:19 pts/1    00:00:00 grep pmon

[oracle@redhat346 ~]$ <strong>srvctl start home -o /u01/app/oracle/product/11.2.0/dbhome_1 -s /tmp/state</strong>

[oracle@redhat346 ~]$ ps -ef |grep pmon
oracle   19841     1  0 Sep18 ?        00:01:24 asm_pmon_+ASM
<strong>oracle   26690     1  0 Oct08 ?        00:00:41 ora_pmon_emrep
oracle   32054     1  0 15:20 ?        00:00:00 ora_pmon_testdb
oracle   32344     1  0 15:20 ?        00:00:00 ora_pmon_ora11gr2</strong>
oracle   32620 27855  0 15:22 pts/1    00:00:00 grep pmon
</pre>
Posted in Administration, High Availability, Oracle 11g release 2  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gavinsoorma.wordpress.com/1803/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gavinsoorma.wordpress.com/1803/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gavinsoorma.wordpress.com/1803/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gavinsoorma.wordpress.com/1803/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gavinsoorma.wordpress.com/1803/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gavinsoorma.wordpress.com/1803/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gavinsoorma.wordpress.com/1803/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gavinsoorma.wordpress.com/1803/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gavinsoorma.wordpress.com/1803/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gavinsoorma.wordpress.com/1803/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1803&subd=gavinsoorma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.wordpress.com/2009/10/29/11g-release-2-oracle-restart/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4c7ffc229f14367caa30864d6feb3ac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gavsal</media:title>
		</media:content>
	</item>
		<item>
		<title>11g Release 2 Grid Infrastructure Installation</title>
		<link>http://gavinsoorma.wordpress.com/2009/10/23/11g-release-2-grid-infrastructure-installation/</link>
		<comments>http://gavinsoorma.wordpress.com/2009/10/23/11g-release-2-grid-infrastructure-installation/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 03:13:58 +0000</pubDate>
		<dc:creator>Gavin  Soorma</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Oracle 11g]]></category>
		<category><![CDATA[Oracle 11g release 2]]></category>
		<category><![CDATA[11gR2]]></category>
		<category><![CDATA[grid insfrastructure]]></category>

		<guid isPermaLink="false">http://gavinsoorma.wordpress.com/?p=1781</guid>
		<description><![CDATA[Let us have a look at the installation screenshots of 11g Release 2 on a Red Hat Linux platform. Currently the 11g R2 software has only been released for the Linux platform with release dates for other platforms like Solaris and AIX set for sometime end October to mid November.
There are quite a few new [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1781&subd=gavinsoorma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Let us have a look at the installation screenshots of 11g Release 2 on a Red Hat Linux platform. Currently the 11g R2 software has only been released for the Linux platform with release dates for other platforms like Solaris and AIX set for sometime end October to mid November.</p>
<p>There are quite a few new installation options available as can be seen from the screenshots below. What we are installing below is &#8220;Grid Infrastructure for a stand alone server&#8221;. </p>
<p>In 11g R2, ASM is now part of what is called the Grid Infrastructure (nothing to do with Grid Control). It is no longer an option available in dbca and there is a command line option asmca which is launched from the Grid Infrastructure home. The ASM instance will be running from the Grid Home and not the database Oracle Home.</p>
<p>Further, the Grid Infrastructure can be installed for a stand alone server or for a cluster deployment. The ASM and Clusterware are instaled in the same home directory and it should be noted that now in 11g R2, the clusterware files like the OCR and the Voting Disk can be located on ASM storage and raw devices is no longer supported.</p>
<p>Also, now there is separation between SYSASM and SYSDBA and if you want to connect to the ASM instance you need to do it as SYSASM. It is recommended to also create a separate group in addition to the DBA group specific for ASM administration and make SYSASM grantees members of this group. In one of the screenshots below we will see an alert being displayed when we have selected the dba group for the ASM installation.</p>
<p><img src="http://gavinsoorma.files.wordpress.com/2009/10/grid1.jpg?w=700&#038;h=504" width="700" height="504" class="aligncenter size-full wp-image-1771" /></p>
<p><img src="http://gavinsoorma.files.wordpress.com/2009/10/grid2.jpg?w=700&#038;h=504" width="700" height="504" class="aligncenter size-full wp-image-1771" /></p>
<p><img src="http://gavinsoorma.files.wordpress.com/2009/10/grid3.jpg?w=700&#038;h=504" width="700" height="504" class="aligncenter size-full wp-image-1771" /></p>
<p><img src="http://gavinsoorma.files.wordpress.com/2009/10/grid4.jpg?w=700&#038;h=504" width="700" height="504" class="aligncenter size-full wp-image-1771" /></p>
<p><img src="http://gavinsoorma.files.wordpress.com/2009/10/grid5.jpg?w=700&#038;h=504" width="700" height="504" class="aligncenter size-full wp-image-1771" /></p>
<p><img src="http://gavinsoorma.files.wordpress.com/2009/10/grid6.jpg?w=500&#038;h=350" width="500" height="350" class="aligncenter size-full wp-image-1771" /></p>
<p><img src="http://gavinsoorma.files.wordpress.com/2009/10/grid7.jpg?w=700&#038;h=504" width="700" height="504" class="aligncenter size-full wp-image-1771" /></p>
<p><img src="http://gavinsoorma.files.wordpress.com/2009/10/grid8.jpg?w=700&#038;h=504" width="700" height="504" class="aligncenter size-full wp-image-1771" /></p>
<p><img src="http://gavinsoorma.files.wordpress.com/2009/10/grid10.jpg?w=700&#038;h=504" width="700" height="504" class="aligncenter size-full wp-image-1771" /></p>
<p><img src="http://gavinsoorma.files.wordpress.com/2009/10/grid11.jpg?w=700&#038;h=504" width="700" height="504" class="aligncenter size-full wp-image-1771" /></p>
<p><img src="http://gavinsoorma.files.wordpress.com/2009/10/grid12.jpg?w=700&#038;h=504" width="700" height="504" class="aligncenter size-full wp-image-1771" /></p>
Posted in Administration, Oracle 11g, Oracle 11g release 2  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gavinsoorma.wordpress.com/1781/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gavinsoorma.wordpress.com/1781/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gavinsoorma.wordpress.com/1781/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gavinsoorma.wordpress.com/1781/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gavinsoorma.wordpress.com/1781/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gavinsoorma.wordpress.com/1781/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gavinsoorma.wordpress.com/1781/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gavinsoorma.wordpress.com/1781/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gavinsoorma.wordpress.com/1781/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gavinsoorma.wordpress.com/1781/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1781&subd=gavinsoorma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.wordpress.com/2009/10/23/11g-release-2-grid-infrastructure-installation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4c7ffc229f14367caa30864d6feb3ac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gavsal</media:title>
		</media:content>

		<media:content url="http://gavinsoorma.files.wordpress.com/2009/10/grid1.jpg" medium="image" />

		<media:content url="http://gavinsoorma.files.wordpress.com/2009/10/grid2.jpg" medium="image" />

		<media:content url="http://gavinsoorma.files.wordpress.com/2009/10/grid3.jpg" medium="image" />

		<media:content url="http://gavinsoorma.files.wordpress.com/2009/10/grid4.jpg" medium="image" />

		<media:content url="http://gavinsoorma.files.wordpress.com/2009/10/grid5.jpg" medium="image" />

		<media:content url="http://gavinsoorma.files.wordpress.com/2009/10/grid6.jpg" medium="image" />

		<media:content url="http://gavinsoorma.files.wordpress.com/2009/10/grid7.jpg" medium="image" />

		<media:content url="http://gavinsoorma.files.wordpress.com/2009/10/grid8.jpg" medium="image" />

		<media:content url="http://gavinsoorma.files.wordpress.com/2009/10/grid10.jpg" medium="image" />

		<media:content url="http://gavinsoorma.files.wordpress.com/2009/10/grid11.jpg" medium="image" />

		<media:content url="http://gavinsoorma.files.wordpress.com/2009/10/grid12.jpg" medium="image" />
	</item>
		<item>
		<title>11g Release 2 ACFS (Automatic Storage Management Cluster File System)</title>
		<link>http://gavinsoorma.wordpress.com/2009/10/16/11g-release-2-acfs-automatic-storage-management-cluster-file-system/</link>
		<comments>http://gavinsoorma.wordpress.com/2009/10/16/11g-release-2-acfs-automatic-storage-management-cluster-file-system/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 01:40:57 +0000</pubDate>
		<dc:creator>Gavin  Soorma</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Oracle 11g]]></category>
		<category><![CDATA[Oracle 11g release 2]]></category>
		<category><![CDATA[11gR2]]></category>
		<category><![CDATA[ACFS]]></category>
		<category><![CDATA[ASM]]></category>
		<category><![CDATA[ASm Cluster File System]]></category>

		<guid isPermaLink="false">http://gavinsoorma.wordpress.com/?p=1751</guid>
		<description><![CDATA[The following are some of the new ASM related features introduced in 11g R2:
In Oracle 11g Release 2, ASM and the Oracle Clusterware are now installed in a common home called the Grid Infrastructure Home.
 The clusterware files like the Voting Disk and the Cluster Registry can no longer be installed on raw devices. They [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1751&subd=gavinsoorma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The following are some of the new ASM related features introduced in 11g R2:</p>
<li>In Oracle 11g Release 2, ASM and the Oracle Clusterware are now installed in a common home called the <strong>Grid Infrastructure </strong>Home.</li>
<li> The clusterware files like the Voting Disk and the Cluster Registry can no longer be installed on raw devices. They can now be installed on ASM Disk Groups </li>
<li>Need to connect as SYSASM to perform any administrative operations on the ASM instance or we will get an ORA-01031 error as shown below</li>
<pre>
[oracle@redhat346 stage]$ sqlplus sys/xxx as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Fri Oct 16 09:10:55 2009

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Automatic Storage Management option

SQL&gt; shutdown immediate;
ORA-01031: insufficient privileges
</pre>
<li>ACFS or Automatic Storage Management Cluster File System is an extension of the ASM technology to support storage of files like Oracle binaries and other application files related to text,video, audio etc </li>
<p></p>
<p>The example below will show how we can configure and mount a ACFS on Red HatLinux with 11g R2.</p>
<p>Note: ASM operations like creating and adding disk groups etc which were earlier performed via DBCA will now be performed via the GUI ASM Configuration Assistant which needs to be launched via the &#8216;<strong>asmca</strong>&#8216; command from the Grid Infrastructure Home.</p>
<p>We first create a disk group called ASMCFS and then create a volume called ASMCFS_VOL1 of 25 GB using the disk group that we just created. </p>
<p>We will then use a mount point /u03 to mount this file system. A configuration script is created which includes the commands to be run as root to mount this file system. After the script is run we will see the ACFS file system mounted on /u03.</p>
<pre>
/bin/mount -t acfs /dev/asm/asmcfs_vol1-44 /u03

chown oracle:dba /u03

chmod 775 /u03

[oracle@redhat346 stage]$ df -k

Filesystem           1K-blocks      Used Available Use% Mounted on
.....
......
/dev/asm/asmcfs_vol1-44
                      26214400     89112  26125288   1% /u03
</pre>
<p><img src="http://gavinsoorma.files.wordpress.com/2009/10/asmca_11gr2.jpg?w=650&#038;h=390" alt="asmca_11gr2" title="asmca_11gr2" width="650" height="390" class="aligncenter size-full wp-image-1743" /></p>
<p><img src="http://gavinsoorma.files.wordpress.com/2009/10/asmca_2.jpg?w=650&#038;h=390" alt="asmca_2" title="asmca_2" width="650" height="390" class="aligncenter size-full wp-image-1743" /></p>
<p><img src="http://gavinsoorma.files.wordpress.com/2009/10/asmca_3.jpg?w=650&#038;h=390" alt="asmca_3" title="asmca_3" width="650" height="390" class="aligncenter size-full wp-image-1743" /></p>
<p><img src="http://gavinsoorma.files.wordpress.com/2009/10/asmca_4.jpg?w=650&#038;h=390" alt="asmca_4" title="asmca_4" width="650" height="390" class="aligncenter size-full wp-image-1743" /></p>
<p><img src="http://gavinsoorma.files.wordpress.com/2009/10/asmca_5.jpg?w=650&#038;h=390" alt="asmca_5" title="asmca_5" width="650" height="390" class="aligncenter size-full wp-image-1743" /></p>
<p><img src="http://gavinsoorma.files.wordpress.com/2009/10/asmca_6.jpg?w=650&#038;h=390" alt="asmca_6" title="asmca_6" width="650" height="390" class="aligncenter size-full wp-image-1743" /></p>
<p><img src="http://gavinsoorma.files.wordpress.com/2009/10/asmca_7.jpg?w=650&#038;h=390" alt="asmca_7" title="asmca_7" width="650" height="390" class="aligncenter size-full wp-image-1743" /></p>
<p><img src="http://gavinsoorma.files.wordpress.com/2009/10/asmca_8.jpg?w=650&#038;h=390" alt="asmca_8" title="asmca_8" width="650" height="390" class="aligncenter size-full wp-image-1743" /></p>
<p><img src="http://gavinsoorma.files.wordpress.com/2009/10/asmca_9.jpg?w=650&#038;h=390" alt="asmca_9" title="asmca_9" width="650" height="390" class="aligncenter size-full wp-image-1743" /></p>
Posted in Administration, Oracle 11g, Oracle 11g release 2  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gavinsoorma.wordpress.com/1751/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gavinsoorma.wordpress.com/1751/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gavinsoorma.wordpress.com/1751/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gavinsoorma.wordpress.com/1751/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gavinsoorma.wordpress.com/1751/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gavinsoorma.wordpress.com/1751/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gavinsoorma.wordpress.com/1751/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gavinsoorma.wordpress.com/1751/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gavinsoorma.wordpress.com/1751/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gavinsoorma.wordpress.com/1751/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1751&subd=gavinsoorma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.wordpress.com/2009/10/16/11g-release-2-acfs-automatic-storage-management-cluster-file-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4c7ffc229f14367caa30864d6feb3ac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gavsal</media:title>
		</media:content>

		<media:content url="http://gavinsoorma.files.wordpress.com/2009/10/asmca_11gr2.jpg" medium="image">
			<media:title type="html">asmca_11gr2</media:title>
		</media:content>

		<media:content url="http://gavinsoorma.files.wordpress.com/2009/10/asmca_2.jpg" medium="image">
			<media:title type="html">asmca_2</media:title>
		</media:content>

		<media:content url="http://gavinsoorma.files.wordpress.com/2009/10/asmca_3.jpg" medium="image">
			<media:title type="html">asmca_3</media:title>
		</media:content>

		<media:content url="http://gavinsoorma.files.wordpress.com/2009/10/asmca_4.jpg" medium="image">
			<media:title type="html">asmca_4</media:title>
		</media:content>

		<media:content url="http://gavinsoorma.files.wordpress.com/2009/10/asmca_5.jpg" medium="image">
			<media:title type="html">asmca_5</media:title>
		</media:content>

		<media:content url="http://gavinsoorma.files.wordpress.com/2009/10/asmca_6.jpg" medium="image">
			<media:title type="html">asmca_6</media:title>
		</media:content>

		<media:content url="http://gavinsoorma.files.wordpress.com/2009/10/asmca_7.jpg" medium="image">
			<media:title type="html">asmca_7</media:title>
		</media:content>

		<media:content url="http://gavinsoorma.files.wordpress.com/2009/10/asmca_8.jpg" medium="image">
			<media:title type="html">asmca_8</media:title>
		</media:content>

		<media:content url="http://gavinsoorma.files.wordpress.com/2009/10/asmca_9.jpg" medium="image">
			<media:title type="html">asmca_9</media:title>
		</media:content>
	</item>
		<item>
		<title>Cross Platform Transportable Tablespace using ASM with Oracle XML DB</title>
		<link>http://gavinsoorma.wordpress.com/2009/10/14/cross-platform-transportable-tablespace-using-asm-with-oracle-xml-db/</link>
		<comments>http://gavinsoorma.wordpress.com/2009/10/14/cross-platform-transportable-tablespace-using-asm-with-oracle-xml-db/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 01:08:16 +0000</pubDate>
		<dc:creator>Gavin  Soorma</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[cross platform transportable tablespace]]></category>

		<guid isPermaLink="false">http://gavinsoorma.wordpress.com/?p=1734</guid>
		<description><![CDATA[In one of my earlier posts How To Transport a Tablespace from 10g ASM to 11g ASM on AIX we discussed how to transport a tablespace stored on ASM storage from Windows to AIX using the DBMS_FILE_TRANSFER package.
We will now look at how the same thing can be done using FTP with Oracle XML DB [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1734&subd=gavinsoorma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In one of my earlier posts <a href="http://gavinsoorma.wordpress.com/2009/08/31/how-to-transport-a-tablespace-from-10g-asm-on-windows-to-11g-asm-on-aix/">How To Transport a Tablespace from 10g ASM to 11g ASM on AIX</a> we discussed how to transport a tablespace stored on ASM storage from Windows to AIX using the DBMS_FILE_TRANSFER package.</p>
<p>We will now look at how the same thing can be done using FTP with Oracle XML DB Repository and its virtual folders.</p>
<p>All we need to do is to run the following script and provide the port numbers which will be used for the FTP and HTTP protocols for accessing the repository.</p>
<p>@?/rdbms/admin/catxdbdbca 8080 7787</p>
<p>In this case we have assigned the port 8080 for the FTP protocol and the port 7787 is for HTTP access.</p>
<p>The ASM related directories on the Windows Oracle database are accessed via the sys/asm virtual folder and then we use FTP to copy the ASM files over the network and then use RMAN to convert it to AIX 64 bit format</p>
<p>The example below shows us how we are connecting to the Windows server via port 8080 using the FTP protocol. Note we are then connecting with a database user &#8211; SYSTEM in this case.</p>
<pre>
testdb:/u01/oracle &gt; <strong>ftp cbdorca261 8080</strong>
Connected to cbdorca261.bankwest.com.
220- cbdorca261
Unauthorised use of this FTP server is prohibited and may be subject to civil and criminal prosecution.
220 cbdorca261 FTP Server (Oracle XML DB/Oracle Database) ready.
Name (cbdorca261:oracle): system
331 pass required for SYSTEM
Password:
230 SYSTEM logged in
ftp&gt; i
200  Type set to I.
ftp&gt; <strong>cd sys/asm</strong>
250 CWD Command successful
ftp&gt; <strong>cd DATA/genua1/datafile</strong>
250 CWD Command successful
ftp&gt; <strong>get test_tts.376.699110247</strong>
200 PORT Command successful
150 BIN Data Connection
226 BIN Transfer Complete
104865792 bytes received in 2.25 seconds (4.551e+04 Kbytes/s)
local: test_tts.376.699110247 remote: test_tts.376.699110247
ftp&gt; quit
221 QUIT Goodbye.

 testdb:/u01/oracle &gt; <strong>rman target /</strong>

Recovery Manager: Release 11.1.0.7.0 - Production on Thu Oct 1 13:50:02 2009

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

connected to target database: TESTDB (DBID=2482257163)

RMAN&gt;  <strong>convert datafile</strong>2&gt;
 <strong>'/u01/oracle/test_tts.376.699110247'</strong>
3&gt; <strong>FORMAT '+DATA'</strong>
4&gt; <strong>from platform 'Microsoft Windows IA (32-bit)';</strong>

Starting conversion at target at 01-OCT-09
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=140 device type=DISK
channel ORA_DISK_1: starting datafile conversion
input file name=/u01/oracle/test_tts.376.699110247
converted datafile=+DATA/testdb/datafile/test_tts.267.699112231
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:03
Finished conversion at target at 01-OCT-09

<strong>imp file=tts.dmp transport_tablespace=y tablespaces=TEST_TTS datafiles=+DATA/testdb/datafile/test_tts.267.699112231</strong>

Import: Release 11.1.0.7.0 - Production on Thu Oct 1 13:57:33 2009

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

Username: sys as sysdba
Password:

Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
With the Partitioning and Real Application Testing options

Export file created by EXPORT:V10.02.01 via conventional path
About to import transportable tablespace(s) metadata...
import done in US7ASCII character set and AL16UTF16 NCHAR character set
import server uses WE8MSWIN1252 character set (possible charset conversion)
export client uses WE8MSWIN1252 character set (possible charset conversion)
. importing SYS's objects into SYS
. importing SYS's objects into SYS
. importing SYSTEM's objects into SYSTEM
. . importing table                    "MYOBJECTS"
. importing SYS's objects into SYS
Import terminated successfully without warnings.

SQL&gt; conn system/oracle
Connected.

SQL&gt; select file_name from dba_data_files
  2  where tablespace_name='TEST_TTS';

FILE_NAME
--------------------------------------------------------------------------------
+DATA/testdb/datafile/test_tts.267.699112231

SQL&gt; select tablespace_name from user_tables
  2  where table_name='MYOBJECTS';

TABLESPACE_NAME
------------------------------
TEST_TTS

SQL&gt; select count (*) from myobjects;

  COUNT(*)
----------
     56454
</pre>
Posted in Administration  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gavinsoorma.wordpress.com/1734/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gavinsoorma.wordpress.com/1734/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gavinsoorma.wordpress.com/1734/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gavinsoorma.wordpress.com/1734/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gavinsoorma.wordpress.com/1734/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gavinsoorma.wordpress.com/1734/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gavinsoorma.wordpress.com/1734/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gavinsoorma.wordpress.com/1734/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gavinsoorma.wordpress.com/1734/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gavinsoorma.wordpress.com/1734/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1734&subd=gavinsoorma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.wordpress.com/2009/10/14/cross-platform-transportable-tablespace-using-asm-with-oracle-xml-db/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4c7ffc229f14367caa30864d6feb3ac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gavsal</media:title>
		</media:content>
	</item>
		<item>
		<title>ASMCMD examples</title>
		<link>http://gavinsoorma.wordpress.com/2009/09/30/asmcmd-examples/</link>
		<comments>http://gavinsoorma.wordpress.com/2009/09/30/asmcmd-examples/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 04:49:04 +0000</pubDate>
		<dc:creator>Gavin  Soorma</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Oracle 11g]]></category>
		<category><![CDATA[asmcmd]]></category>

		<guid isPermaLink="false">http://gavinsoorma.wordpress.com/?p=1716</guid>
		<description><![CDATA[asmcmd is a command line tool that we can use to manage Oracle ASM instances, ASM disk groups, files and dierctories, templates very much as in the same way we would do while working with say a UNIX file system. 
ASMCMD can be launched in interactive or non-interactive modes and we need to first ensure [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1716&subd=gavinsoorma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><strong>asmcmd</strong> is a command line tool that we can use to manage Oracle ASM instances, ASM disk groups, files and dierctories, templates very much as in the same way we would do while working with say a UNIX file system. </p>
<p>ASMCMD can be launched in interactive or non-interactive modes and we need to first ensure that our environment points to the &#8220;Grid Infrastructure Home&#8221; as in 11g R2, ASM is not part of the standard database software installation. Also chec that the ORACLE_SID points to the ASM instance which should be running.</p>
<p>Let us have a quick look at some of the useful command options which are now available with 11g Release 2.</p>
<p><strong>lsct</strong>: Lists information about current Oracle ASM clients from the V$ASM_CLIENT view.</p>
<pre>
ASMCMD&gt; lsct
DB_Name  Status     Software_Version  Compatible_version  Instance_Name  Disk_Group
+ASM     CONNECTED        11.2.0.1.0          11.2.0.1.0  +ASM           DATA
testdb   CONNECTED        11.2.0.1.0          11.2.0.0.0  testdb         DATA
</pre>
<p><strong>cp</strong>: We can copy files from ASM to OS as wel as from OS to ASM disk groups</p>
<pre>
ASMCMD&gt; cp EXAMPLE.265.697907183 /tmp/example01.bak
copying +DATA/TESTDB/DATAFILE/EXAMPLE.265.697907183 -&gt; /tmp/example01.bak

ASMCMD&gt; cp /tmp/example01.bak +DATA/TESTDB/DATAFILE/example01.bak
copying /tmp/example01.bak -&gt; +DATA/TESTDB/DATAFILE/example01.bak

ASMCMD&gt; ls
EXAMPLE.265.697907183
SYSAUX.257.697907095
SYSTEM.256.697907095
UNDOTBS1.258.697907095
USERS.259.697907095
example01.bak
</pre>
<p><strong>du</strong>: Total space in MB used by files &#8211; particular directory can also be specified </p>
<pre>
ASMCMD&gt; pwd
+DATA/TESTDB/DATAFILE

ASMCMD&gt; du
Used_MB      Mirror_used_MB
   1574                1574

ASMCMD&gt; du +DATA/TESTDB/ONLINELOG
Used_MB      Mirror_used_MB
    153                 153
</pre>
<p><strong>find</strong>: we can use the wildcard or can specify a particular file type by using the &#8216;&#8211;type&#8217; clause</p>
<pre>
ASMCMD&gt; find --type ONLINELOG +DATA *
+DATA/TESTDB/ONLINELOG/group_1.261.697907177
+DATA/TESTDB/ONLINELOG/group_2.262.697907179
+DATA/TESTDB/ONLINELOG/group_3.263.697907179

ASMCMD&gt; find +DATA example*
+DATA/ASM/DATAFILE/example01.bak.267.698929915
+DATA/TESTDB/DATAFILE/EXAMPLE.265.697907183
+DATA/TESTDB/DATAFILE/example01.bak
</pre>
<p><strong>ls</strong>: list the contents of an ASM Disk Group directory as well as attributes of files located in the directory</p>
<pre>
ASMCMD&gt; ls -s
Block_Size  Blocks      Bytes      Space  Name
      8192   12801  104865792  106954752  EXAMPLE.265.697907183
      8192   89601  734011392  736100352  SYSAUX.257.697907095
      8192   89601  734011392  736100352  SYSTEM.256.697907095
      8192    7681   62922752   65011712  UNDOTBS1.258.697907095
      8192     641    5251072    6291456  USERS.259.697907095
                                          example01.bak =&gt; +DATA/ASM/DATAFILE/example01.bak.267.698929915

ASMCMD&gt; ls -l
Type      Redund  Striped  Time             Sys  Name
DATAFILE  UNPROT  COARSE   SEP 30 11:00:00  Y    EXAMPLE.265.697907183
DATAFILE  UNPROT  COARSE   SEP 28 23:00:00  Y    SYSAUX.257.697907095
DATAFILE  UNPROT  COARSE   SEP 29 22:00:00  Y    SYSTEM.256.697907095
DATAFILE  UNPROT  COARSE   SEP 18 22:00:00  Y    UNDOTBS1.258.697907095
DATAFILE  UNPROT  COARSE   SEP 18 22:00:00  Y    USERS.259.697907095
                                            N    example01.bak =&gt; +DATA/ASM/DATAFILE/example01.bak.267.698929915
</pre>
<p><strong>iostat</strong>: Uses the V$ASM_DISK_IOSTAT view to display I/O statistics of disks in mounted ASM disk groups</p>
<pre>
ASMCMD&gt; iostat -G DATA
Group_Name  Dsk_Name   Reads        Writes
DATA        DATA_0000  25448671744  19818926592

ASMCMD&gt; iostat -t
Group_Name  Dsk_Name   Reads        Writes       Read_Time    Write_Time
DATA        DATA_0000  25450195456  19819686912  6491.434444  8042.604156
</pre>
<p><strong>lsdg</strong>: Uses V$ASM_DISKGROUP_STAT view to list information about a particular disk group</p>
<pre>
ASMCMD&gt; lsdg DATA
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB    Name
MOUNTED  EXTERN  N         512   4096  1048576     51200    49375                0           49375    DATA/

ASMCMD&gt; lsdsk -t -G DATA
Create_Date  Mount_Date  Repair_Timer  Path
18-SEP-09    18-SEP-09   0             /dev/raw/raw1
</pre>
<p><strong>lsattr</strong>: List attributes of a disk group </p>
<pre>
ASMCMD&gt; lsattr -l -G DATA
Name                     Value
access_control.enabled   FALSE
access_control.umask     066
au_size                  1048576
cell.smart_scan_capable  FALSE
compatible.asm           11.2.0.0.0
compatible.rdbms         10.1.0.0.0
disk_repair_time         3.6h
sector_size              512
</pre>
<p>Use the <strong>setattr </strong>command to change an attribute </p>
<pre>
ASMCMD&gt; setattr -G data compatible.rdbms 11.2.0.0.0
ASMCMD&gt; lsattr -l -G DATA
Name                     Value
access_control.enabled   FALSE
access_control.umask     066
au_size                  1048576
cell.smart_scan_capable  FALSE
compatible.asm           11.2.0.0.0
compatible.rdbms         11.2.0.0.0
disk_repair_time         3.6h
sector_size              512
</pre>
Posted in Administration, Oracle 11g  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gavinsoorma.wordpress.com/1716/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gavinsoorma.wordpress.com/1716/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gavinsoorma.wordpress.com/1716/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gavinsoorma.wordpress.com/1716/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gavinsoorma.wordpress.com/1716/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gavinsoorma.wordpress.com/1716/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gavinsoorma.wordpress.com/1716/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gavinsoorma.wordpress.com/1716/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gavinsoorma.wordpress.com/1716/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gavinsoorma.wordpress.com/1716/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1716&subd=gavinsoorma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.wordpress.com/2009/09/30/asmcmd-examples/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4c7ffc229f14367caa30864d6feb3ac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gavsal</media:title>
		</media:content>
	</item>
		<item>
		<title>10g EM Grid Control Notification Rules and Corrective Action Jobs</title>
		<link>http://gavinsoorma.wordpress.com/2009/09/29/10g-em-grid-control-notification-rules-and-corrective-action-jobs/</link>
		<comments>http://gavinsoorma.wordpress.com/2009/09/29/10g-em-grid-control-notification-rules-and-corrective-action-jobs/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 07:33:45 +0000</pubDate>
		<dc:creator>Gavin  Soorma</dc:creator>
				<category><![CDATA[EM Grid Control]]></category>
		<category><![CDATA[corrective action]]></category>
		<category><![CDATA[Grid control]]></category>
		<category><![CDATA[notification rule]]></category>

		<guid isPermaLink="false">http://gavinsoorma.wordpress.com/?p=1712</guid>
		<description><![CDATA[In 10g Enterprise Manager Grid Control, we can create corrective action or &#8216;fixit&#8217; jobs which can automatically run if say a metric threshold is crossed or a particular event occurs. For example, we may have situations where we monitor the disk space used by the archive log files and as soon as the disk space [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1712&subd=gavinsoorma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In 10g Enterprise Manager Grid Control, we can create corrective action or &#8216;fixit&#8217; jobs which can automatically run if say a metric threshold is crossed or a particular event occurs. For example, we may have situations where we monitor the disk space used by the archive log files and as soon as the disk space free or available comes below a threshold, we would like another action to automatically occur which in this case could be to backup the archive log files to tape and then delete them to free up the disk space.</p>
<p>Read more about this feature in this worked <a href='http://gavinsoorma.files.wordpress.com/2009/09/grid_fixit_job.doc'>example</a> &#8230;&#8230;.</p>
Posted in EM Grid Control  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gavinsoorma.wordpress.com/1712/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gavinsoorma.wordpress.com/1712/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gavinsoorma.wordpress.com/1712/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gavinsoorma.wordpress.com/1712/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gavinsoorma.wordpress.com/1712/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gavinsoorma.wordpress.com/1712/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gavinsoorma.wordpress.com/1712/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gavinsoorma.wordpress.com/1712/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gavinsoorma.wordpress.com/1712/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gavinsoorma.wordpress.com/1712/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1712&subd=gavinsoorma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.wordpress.com/2009/09/29/10g-em-grid-control-notification-rules-and-corrective-action-jobs/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4c7ffc229f14367caa30864d6feb3ac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gavsal</media:title>
		</media:content>
	</item>
		<item>
		<title>11g RMAN Substitution Variables</title>
		<link>http://gavinsoorma.wordpress.com/2009/09/22/11g-rman-substitution-variables/</link>
		<comments>http://gavinsoorma.wordpress.com/2009/09/22/11g-rman-substitution-variables/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 07:12:09 +0000</pubDate>
		<dc:creator>Gavin  Soorma</dc:creator>
				<category><![CDATA[Backup and Recovery]]></category>
		<category><![CDATA[Oracle 11g]]></category>
		<category><![CDATA[11g RMAN]]></category>
		<category><![CDATA[Substitution Variables]]></category>
		<category><![CDATA[USING]]></category>

		<guid isPermaLink="false">http://gavinsoorma.wordpress.com/?p=1704</guid>
		<description><![CDATA[We can now use SQL*PLUS type substitution variables in RMAN like &#38;1, &#38;2 and so on and the same can be linked to shell scripts as shown below with the new clause USING where we are passing the Incremental Level and the backup tag to the actual RMAN command.
Also note that in 11g we can [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1704&subd=gavinsoorma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>We can now use SQL*PLUS type substitution variables in RMAN like &amp;1, &amp;2 and so on and the same can be linked to shell scripts as shown below with the new clause <strong>USING</strong> where we are passing the Incremental Level and the backup tag to the actual RMAN command.</p>
<p>Also note that in 11g we can run RMAN scripts using the &#8216;@&#8217; like a SQL script</p>
<p><strong>testbkp.rcv</strong></p>
<p>connect target sys/oracle<br />
run{<br />
backup incremental level <strong>&amp;1</strong><br />
database<br />
tag <strong>&amp;2</strong>;<br />
}<br />
exit;</p>
<p><strong>testbkp.sh</strong></p>
<p>#! /bin/ksh<br />
export level=$1<br />
export tag=$2_`date +%d%b%y`<br />
<strong>rman  @testbkp.rcv using $level $tag</strong></p>
<p>Note the actual RMAN command that is run &#8230;&#8230;.. it adds a date along with  the tag name (parameter 2) and runs a level 2 backup as the first parameter was &#8216;2&#8242;</p>
<p>apex:/u01/oracle&gt; <strong>./testbkp.sh 2 dly_inc_bkp</strong></p>
<p>Recovery Manager: Release 11.1.0.6.0 &#8211; Production on Tue Sep 22 11:28:05 2009</p>
<p>Copyright (c) 1982, 2007, Oracle.  All rights reserved.</p>
<p>RMAN&gt; connect target *<br />
2&gt; run{<br />
3&gt; backup incremental level <strong>2</strong><br />
4&gt; database<br />
5&gt; tag <strong>dly_inc_bkp_22Sep09</strong>;<br />
6&gt; }<br />
7&gt; exit;<br />
connected to target database: APEX (DBID=1312143933)</p>
<p>Starting backup at 22-SEP-09<br />
using target database control file instead of recovery catalog<br />
allocated channel: ORA_SBT_TAPE_1<br />
channel ORA_SBT_TAPE_1: SID=349 device type=SBT_TAPE<br />
channel ORA_SBT_TAPE_1: Data Protection for Oracle: version 5.5.1.0<br />
channel ORA_SBT_TAPE_1: starting incremental level 2 datafile backup set<br />
channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set<br />
input datafile file number=00003 name=/u02/oradata/apex/undotbs01.dbf<br />
input datafile file number=00002 name=/u02/oradata/apex/sysaux01.dbf<br />
input datafile file number=00001 name=/u02/oradata/apex/system01.dbf<br />
input datafile file number=00005 name=/u02/oradata/apex/monitor_data01.dbf<br />
input datafile file number=00007 name=/u02/oradata/apex/encrypt_data01.dbf<br />
input datafile file number=00008 name=/u02/oradata/apex/disc10_data01.dbf<br />
channel ORA_SBT_TAPE_1: starting piece 1 at 22-SEP-09<br />
channel ORA_SBT_TAPE_1: finished piece 1 at 22-SEP-09<br />
piece handle=a5kpsim9_1_1 tag=DLY_INC_BKP_22SEP09 comment=API Version 2.0,MMS Version 5.5.1.0<br />
channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:25<br />
Finished backup at 22-SEP-09</p>
<p>Starting Control File and SPFILE Autobackup at 22-SEP-09<br />
piece handle=c-1312143933-20090922-05 comment=API Version 2.0,MMS Version 5.5.1.0<br />
Finished Control File and SPFILE Autobackup at 22-SEP-09</p>
<p>Recovery Manager complete.</p>
Posted in Backup and Recovery, Oracle 11g  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gavinsoorma.wordpress.com/1704/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gavinsoorma.wordpress.com/1704/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gavinsoorma.wordpress.com/1704/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gavinsoorma.wordpress.com/1704/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gavinsoorma.wordpress.com/1704/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gavinsoorma.wordpress.com/1704/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gavinsoorma.wordpress.com/1704/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gavinsoorma.wordpress.com/1704/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gavinsoorma.wordpress.com/1704/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gavinsoorma.wordpress.com/1704/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1704&subd=gavinsoorma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.wordpress.com/2009/09/22/11g-rman-substitution-variables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4c7ffc229f14367caa30864d6feb3ac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gavsal</media:title>
		</media:content>
	</item>
		<item>
		<title>11g Release 2 Edition-based Redefinition</title>
		<link>http://gavinsoorma.wordpress.com/2009/09/21/11g-release-2-edition-based-redefinition/</link>
		<comments>http://gavinsoorma.wordpress.com/2009/09/21/11g-release-2-edition-based-redefinition/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 06:04:55 +0000</pubDate>
		<dc:creator>Gavin  Soorma</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Oracle 11g]]></category>
		<category><![CDATA[Oracle 11g release 2]]></category>
		<category><![CDATA[11g R2]]></category>
		<category><![CDATA[edition]]></category>
		<category><![CDATA[redefinition]]></category>

		<guid isPermaLink="false">http://gavinsoorma.wordpress.com/?p=1698</guid>
		<description><![CDATA[11g Release 2 Edition-based redefinition enables you to upgrade or change the database component of an application while it is in use, thereby minimising or eliminating down time which was earlier required when an object like a procedure required to be modified, but we could not do it without any outage as the application was [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1698&subd=gavinsoorma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>11g Release 2 Edition-based redefinition enables you to upgrade or change the database component of an application while it is in use, thereby minimising or eliminating down time which was earlier required when an object like a procedure required to be modified, but we could not do it without any outage as the application was accessing the procedure or package which needed to be modified.</p>
<p>An edition is like a workspace or private environment where database objects are redefined. When we are satisfied with the change that we have made, those changes in the edition can be then rolled out to  all the application users.</p>
<p>Let us see an example of this where we create a procedure, make some changes to the procedure in a new edition and then make those changes visible to other database users.</p>
<pre>
SQL&gt;  GRANT CREATE ANY EDITION, DROP ANY EDITION to sh;

Grant succeeded.

SQL&gt; conn sh/sh
Connected.

SQL&gt; CREATE OR REPLACE PROCEDURE hello IS
  BEGIN
    DBMS_OUTPUT.PUT_LINE('Hello, edition 1.');
  END hello;
/
  2    3    4    5
Procedure created.

SQL&gt; set serverout on

SQL&gt; BEGIN hello(); END;
/
  2  Hello, edition 1.

PL/SQL procedure successfully completed.

SQL&gt; CREATE EDITION e2;

Edition created.

SQL&gt; ALTER SESSION SET EDITION = e2;

Session altered.

SQL&gt; CREATE OR REPLACE PROCEDURE hello IS
  BEGIN
    DBMS_OUTPUT.PUT_LINE('Hello, edition 2.');
  END hello;
/
  2    3    4    5
Procedure created.

SQL&gt; BEGIN hello(); END;
  2  /
Hello, edition 2.

PL/SQL procedure successfully completed.
</pre>
<p>Note, now if we change the edition to the default edition &#8216;ORA$BASE&#8217;, we will now see the original procedure and not the updated one</p>
<pre>
SQL&gt; ALTER SESSION SET EDITION = ora$base;

Session altered.

SQL&gt;  BEGIN hello(); END;
  2  /
Hello, edition 1.
</pre>
<p>Let us now see how this can be rolled out to database user HR</p>
<pre>
SQL&gt; grant execute on hello to hr;

Grant succeeded.

SQL&gt; GRANT USE ON EDITION e2 to public;

Grant succeeded.
</pre>
<p>We now make the default edition of the database, E2 so that all changes in the new edition E2 will be visible to all database users </p>
<pre>
SQL&gt; conn sys as sysdba
Enter password:
Connected.

SQL&gt; ALTER DATABASE DEFAULT EDITION=e2;

Database altered.

SQL&gt; conn hr/hr
Connected.

SQL&gt; set serverout on

SQL&gt;  exec sh.hello;
Hello, edition 2.
</pre>
Posted in Administration, Oracle 11g, Oracle 11g release 2  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gavinsoorma.wordpress.com/1698/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gavinsoorma.wordpress.com/1698/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gavinsoorma.wordpress.com/1698/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gavinsoorma.wordpress.com/1698/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gavinsoorma.wordpress.com/1698/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gavinsoorma.wordpress.com/1698/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gavinsoorma.wordpress.com/1698/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gavinsoorma.wordpress.com/1698/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gavinsoorma.wordpress.com/1698/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gavinsoorma.wordpress.com/1698/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1698&subd=gavinsoorma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.wordpress.com/2009/09/21/11g-release-2-edition-based-redefinition/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4c7ffc229f14367caa30864d6feb3ac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gavsal</media:title>
		</media:content>
	</item>
		<item>
		<title>11g Pending and Published Statistics</title>
		<link>http://gavinsoorma.wordpress.com/2009/09/18/11g-pending-and-published-statistics/</link>
		<comments>http://gavinsoorma.wordpress.com/2009/09/18/11g-pending-and-published-statistics/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 00:44:32 +0000</pubDate>
		<dc:creator>Gavin  Soorma</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Oracle 11g]]></category>
		<category><![CDATA[11g pending statistics]]></category>
		<category><![CDATA[optimizer_use_pending_statistics]]></category>
		<category><![CDATA[publish statistics]]></category>

		<guid isPermaLink="false">http://gavinsoorma.wordpress.com/?p=1688</guid>
		<description><![CDATA[Prior to Oracle 11g, the default behaviour was to make statistics available for the optimizer to use as soon as they were gathered.
While statistics are required to enable the optimizer to generate optimal execution plans, sometimes just by gathering fresh statistics tried and trusted execution plans can abruptly change and thereby adversely affect application performance.
In [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1688&subd=gavinsoorma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Prior to Oracle 11g, the default behaviour was to make statistics available for the optimizer to use as soon as they were gathered.</p>
<p>While statistics are required to enable the optimizer to generate optimal execution plans, sometimes just by gathering fresh statistics tried and trusted execution plans can abruptly change and thereby adversely affect application performance.</p>
<p>In Oracle 11g we can now &#8216;defer&#8217; the publication of statistics until they have been tried and tested and once we have confirmed that the execution plans are correct and optimal. Statistics remain in the pending state until they are published and the parameter optimizer_use_pending_statistics (default value FALSE) which when set at the session level will enables us to test the pending statistics independently of other database sessions.</p>
<p>Let us look at a test case using the SALES table in the SH schema. </p>
<p>If we see the query below, it appears that the data for the column CHANNEL_ID is skewed where majority of the rows have the value 3 and a very small majority have the value 9. </p>
<p>SQL&gt; select channel_id,count(*) from sales<br />
  2  group by channel_id order by 2;</p>
<p>CHANNEL_ID   COUNT(*)<br />
&#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;-<br />
         9       2074<br />
         4     118416<br />
         2     258025<br />
         3     540328</p>
<p>But both the queries below are performing a full table scan of the SALES table when ideally it should be performing an index scan when the value 9 is used in the WHERE clause considering it accounts for a very small proportion of the rows in the SALES table.</p>
<p>SELECT<br />
     S.cust_id<br />
    ,S.prod_id<br />
    ,SUM(S.amount_sold)<br />
  FROM sh.sales S<br />
 WHERE<br />
channel_id=9<br />
 GROUP BY S.cust_id, S.prod_id<br />
 ORDER BY S.cust_id, S.prod_id<br />
/</p>
<p>SELECT<br />
     S.cust_id<br />
    ,S.prod_id<br />
    ,SUM(S.amount_sold)<br />
  FROM sh.sales S<br />
 WHERE<br />
channel_id=3<br />
 GROUP BY S.cust_id, S.prod_id<br />
 ORDER BY S.cust_id, S.prod_id<br />
/</p>
<p>As earlier mentioned, statistics for a table are published immediately by default, so we use the DBMS_STATS package to change this default behaviour.</p>
<pre>
SQL&gt; exec dbms_stats.set_table_prefs('SH','SALES','PUBLISH','FALSE');

PL/SQL procedure successfully completed.

SQL&gt; select dbms_stats.get_prefs('PUBLISH', 'SH', 'SALES' ) FROM DUAL;

DBMS_STATS.GET_PREFS('PUBLISH','SH','SALES')
----------------------------------------------------------------------------------------------
FALSE
</pre>
<p>Since we observed that the data in the table is skewed, we will gather histograms which may help the optimizer make more informed decisions when generating an execution plan.</p>
<p>Note that since we have disabled the publishing of statistics for the table SALES, even though we have analyzed the table, the LAST_ANALYZED column shows that the table has not been recently analyzed.</p>
<pre>
SQL&gt; EXEC DBMS_STATS.GATHER_TABLE_STATS('SH','SALES',METHOD_OPT =&gt; 'FOR ALL COLUMNS SIZE AUTO');

PL/SQL procedure successfully completed.

SQL&gt; SELECT LAST_ANALYZED FROM DBA_TABLES WHERE TABLE_NAME='SALES';

LAST_ANAL
---------
18-AUG-2009
</pre>
<p>However, we we query the DBA_TAB_PENDING_STATS view, it shows that the SALES table which is partitioned has been analyzed today.</p>
<pre>
SQL&gt; SELECT TABLE_NAME,PARTITION_NAME ,LAST_ANALYZED  FROM DBA_TAB_PENDING_STATS;

TABLE_NAME                     PARTITION_NAME                 LAST_ANAL
------------------------------ ------------------------------ ---------
SALES                                                         17-SEP-09
SALES                          SALES_Q3_1998                  17-SEP-09
SALES                          SALES_Q3_1999                  17-SEP-09
SALES                          SALES_Q3_2000                  17-SEP-09
SALES                          SALES_Q3_2001                  17-SEP-09
SALES                          SALES_Q3_2002                  17-SEP-09
SALES                          SALES_Q3_2003                  17-SEP-09
SALES                          SALES_Q4_1998                  17-SEP-09
SALES                          SALES_Q4_1999                  17-SEP-09
SALES                          SALES_Q4_2000                  17-SEP-09
SALES                          SALES_Q4_2001                  17-SEP-09
SALES                          SALES_Q4_2002                  17-SEP-09
SALES                          SALES_Q4_2003                  17-SEP-09
SALES                          SALES_1995                     17-SEP-09
SALES                          SALES_1996                     17-SEP-09
SALES                          SALES_H1_1997                  17-SEP-09
SALES                          SALES_H2_1997                  17-SEP-09
SALES                          SALES_Q1_1998                  17-SEP-09
SALES                          SALES_Q1_1999                  17-SEP-09
SALES                          SALES_Q1_2000                  17-SEP-09
SALES                          SALES_Q1_2001                  17-SEP-09
SALES                          SALES_Q1_2002                  17-SEP-09
SALES                          SALES_Q1_2003                  17-SEP-09
SALES                          SALES_Q2_1998                  17-SEP-09
SALES                          SALES_Q2_1999                  17-SEP-09
SALES                          SALES_Q2_2000                  17-SEP-09
SALES                          SALES_Q2_2001                  17-SEP-09
SALES                          SALES_Q2_2002                  17-SEP-09
SALES                          SALES_Q2_2003                  17-SEP-09
</pre>
<p>We would like to see if the query execution plan has changed or improved after the recent gathering of statistics. We can use the parameter optimizer_use_pending_statistics for this by setting the value to TRUE (default is FALSE)</p>
<p>SQL&gt; alter session set optimizer_use_pending_statistics=TRUE;</p>
<p>Session altered.</p>
<p>We now find that the optimizer is performing an index scan when the value 9 is used as a predicate value for CHANNEL_ID while it performs a full table scan when the value 3 is used which is a much more optimal plan than the original one before gathering fresh statistics.</p>
<pre>
explain plan
for
SELECT
     S.cust_id
    ,S.prod_id
    ,SUM(S.amount_sold)
  FROM sh.sales S
 WHERE
channel_id=3
 GROUP BY S.cust_id, S.prod_id
 ORDER BY S.cust_id, S.prod_id
/  2    3    4    5    6    7    8    9   10   11   12

Explained.

SQL&gt; select * from table(dbms_xplan.display);

PLAN_TABLE_OUTPUT
----------------------------------------------------------------------------------------------
Plan hash value: 3701591983

----------------------------------------------------------------------------------------------
| Id  | Operation            | Name  | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
----------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT     |       |  4992 | 79872 |  2649   (4)| 00:00:32 |       |       |
|   1 |  SORT GROUP BY       |       |  4992 | 79872 |  2649   (4)| 00:00:32 |       |       |
|   2 |   PARTITION RANGE ALL|       |   541K|  8461K|  2601   (2)| 00:00:32 |     1 |    28 |
|*  3 |    TABLE ACCESS FULL | SALES |   541K|  8461K|  2601   (2)| 00:00:32 |     1 |    28 |
----------------------------------------------------------------------------------------------

SQL&gt; explain plan
for
SELECT
     S.cust_id
    ,S.prod_id
    ,SUM(S.amount_sold)
  FROM sh.sales S
 WHERE
channel_id=9
 GROUP BY S.cust_id, S.prod_id
 ORDER BY S.cust_id, S.prod_id
/
  2    3    4    5    6    7    8    9   10   11   12
Explained.

SQL&gt; select * from table(dbms_xplan.display);

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------
Plan hash value: 3360497850

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

| Id  | Operation                           | Name              | Rows  | Bytes | Cost (%CPU)| Time
|

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

|   0 | SELECT STATEMENT                    |                   |   913 | 14608 |   315   (1)| 00:00:04
|

|   1 |  SORT GROUP BY                      |                   |   913 | 14608 |   315   (1)| 00:00:04
|

|   2 |   PARTITION RANGE ALL               |                   |  1423 | 22768 |   314   (0)| 00:00:04
|

|   3 |    TABLE ACCESS BY LOCAL INDEX ROWID| SALES             |  1423 | 22768 |   314   (0)| 00:00:04
|

|   4 |     BITMAP CONVERSION TO ROWIDS     |                   |       |       |            |
|

|*  5 |      BITMAP INDEX SINGLE VALUE      | SALES_CHANNEL_BIX |       |       |            |
|

--------------------------------------------------------------------------------------------------------
</pre>
<p>Since we have now confirmed that the plan is acceptable and the new statistics can be used by the optimizer, we PUBLISH the statistics now for the SALES table. Note that the LAST_ANALYZED column is also updated and the DBA_TAB_PENDING_STATS shows that there are no more pending statistics which need to be published.</p>
<pre>
SQL&gt; EXEC DBMS_STATS.PUBLISH_PENDING_STATS ('SH','SALES');

PL/SQL procedure successfully completed.

SQL&gt; SELECT LAST_ANALYZED FROM DBA_TABLES WHERE TABLE_NAME='SALES';

LAST_ANAL
---------
17-SEP-09

SELECT COUNT(*) FROM DBA_TAB_PENDING_STATS;

  COUNT(*)
----------
         0

SQL&gt;  alter session set optimizer_use_pending_statistics=FALSE;

Session altered.
</pre>
Posted in Administration, Oracle 11g  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gavinsoorma.wordpress.com/1688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gavinsoorma.wordpress.com/1688/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gavinsoorma.wordpress.com/1688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gavinsoorma.wordpress.com/1688/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gavinsoorma.wordpress.com/1688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gavinsoorma.wordpress.com/1688/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gavinsoorma.wordpress.com/1688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gavinsoorma.wordpress.com/1688/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gavinsoorma.wordpress.com/1688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gavinsoorma.wordpress.com/1688/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1688&subd=gavinsoorma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.wordpress.com/2009/09/18/11g-pending-and-published-statistics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4c7ffc229f14367caa30864d6feb3ac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gavsal</media:title>
		</media:content>
	</item>
		<item>
		<title>11g Interval Partitioning</title>
		<link>http://gavinsoorma.wordpress.com/2009/09/15/11g-interval-partitioning/</link>
		<comments>http://gavinsoorma.wordpress.com/2009/09/15/11g-interval-partitioning/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 01:58:06 +0000</pubDate>
		<dc:creator>Gavin  Soorma</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Oracle 11g]]></category>
		<category><![CDATA[11G]]></category>
		<category><![CDATA[interval partitioning]]></category>
		<category><![CDATA[partitioning]]></category>

		<guid isPermaLink="false">http://gavinsoorma.wordpress.com/?p=1681</guid>
		<description><![CDATA[In versions prior to Oracle 11g, we were very likely to have faced the error shown below especially if we used range partitioning and the partition column was a date field.
We needed to ensure that we precreated all the partitions before hand based on the expected values of data that would be inserted (or updated) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1681&subd=gavinsoorma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In versions prior to Oracle 11g, we were very likely to have faced the error shown below especially if we used range partitioning and the partition column was a date field.</p>
<p>We needed to ensure that we precreated all the partitions before hand based on the expected values of data that would be inserted (or updated) in a table.</p>
<p><strong>ERROR at line 1:<br />
ORA-14400: inserted partition key does not map to any partition</strong></p>
<p>While we could use the MAXVALUE clause to create a &#8216;catch-all&#8217; partition, this would not help us when we would like to perform any partition maintenance operations based on a date range or if wanted to use the partitioning feature to perform some kind of data archiving at the partition level.</p>
<p><strong>11g Interval Partitioning</strong></p>
<p>In Oracle 11g, the creation of partitions (for range) is automated and partitions are created as and when needed and takes the task of managing the creation of new partitions from the DBA. All that is required is to define the interval criteria and create the first partition. Subsequent partitions are created automatically based on the interval criteria.</p>
<pre>
create table mypart
   (ename varchar2(20), doj date)
   partition by range (doj)
   <strong>INTERVAL (NUMTOYMINTERVAL(1,'YEAR'))</strong>
   STORE IN (tbs1,tbs2)
  (partition p_2009 values less than (to_date('01-JAN-2010','DD-MON-YYYY'))
  )
;
</pre>
<p>Note the NUMTOYMINTERVAL is an SQL Funtion used to convert a number to an INTERVAL YEAR TO MONTH literal. The accepted values are &#8216;YEAR&#8217; and &#8216;MONTH&#8217;.</p>
<p>The STORE IN clause will create in the partitions in a round robin manner in tablespaces tbs1 and tbs2 as we will see below.</p>
<p>Let us now insert some values into the table.</p>
<pre>
SQL&gt; insert into mypart
  2   values
  3   ('Tom','21-SEP-2009');

1 row created.

SQL&gt; insert into mypart
  2  values
  3  ('Joe','02-JAN-2010');

1 row created.
</pre>
<p>What has happened after the second insert? &#8211; a new partition &#8216;SYS_P42&#8242; has been created for the year 2010 with a high value of &#8216;01-JAN-2011&#8242;.</p>
<p>The first partition that we had precreated has been created in the default tablespace USERS since no tablespace name has been prescribed and the new partition has been created in the tablespace TBS2. The next partition that comes along will be created in tablespace TBS1 and so on.</p>
<pre>
SQL&gt; select partition_name,high_value from user_tab_partitions
  2  where table_name='MYPART';

PARTITION_NAME                 HIGH_VALUE
------------------------------ --------------------------------------------------------------------------------
P_2009                         TO_DATE(' 2010-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA
SYS_P42                        TO_DATE(' 2011-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA
</pre>
<pre>
SQL&gt; select partition_name,tablespace_name from user_tab_partitions
  2  where table_name='MYPART';

PARTITION_NAME                 TABLESPACE_NAME
------------------------------ ------------------------------
P_2009                         USERS
SYS_P43                        TBS2
</pre>
<p>We can use the ALTER TABLE SET INTERVAL command to convert a range partitioned table to an interval partitioned table as shown below.</p>
<pre>
SQL&gt; create table mypart2
   (ename varchar2(20), doj date)
   partition by range (doj)
  (partition p_2009 values less than (to_date('01-JAN-2010','DD-MON-YYYY'))
  )
;    2    3    4    5    6

Table created.

SQL&gt; alter table mypart2
  2  SET INTERVAL (NUMTOYMINTERVAL(1,'YEAR');

Table altered.
</pre>
<p>We need to keep the following points in mind when using Interval Partitioning:</p>
<li>The partitioning column can be only one and it must be of type NUMBER or DATE</li>
<li>We cannot use the MAXVALUE clause</li>
<li>We cannot use this with Index Organised Tables</li>
Posted in Administration, Oracle 11g  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gavinsoorma.wordpress.com/1681/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gavinsoorma.wordpress.com/1681/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gavinsoorma.wordpress.com/1681/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gavinsoorma.wordpress.com/1681/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gavinsoorma.wordpress.com/1681/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gavinsoorma.wordpress.com/1681/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gavinsoorma.wordpress.com/1681/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gavinsoorma.wordpress.com/1681/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gavinsoorma.wordpress.com/1681/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gavinsoorma.wordpress.com/1681/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1681&subd=gavinsoorma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.wordpress.com/2009/09/15/11g-interval-partitioning/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4c7ffc229f14367caa30864d6feb3ac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gavsal</media:title>
		</media:content>
	</item>
		<item>
		<title>11g Real Application Testing &#8211; Part 2</title>
		<link>http://gavinsoorma.wordpress.com/2009/09/14/11g-real-application-testing-part-2/</link>
		<comments>http://gavinsoorma.wordpress.com/2009/09/14/11g-real-application-testing-part-2/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 04:30:50 +0000</pubDate>
		<dc:creator>Gavin  Soorma</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Oracle 11g]]></category>
		<category><![CDATA[11g real application testing]]></category>
		<category><![CDATA[performance analyzer]]></category>
		<category><![CDATA[sql performance analyzer]]></category>
		<category><![CDATA[sql tuning set]]></category>
		<category><![CDATA[sts]]></category>

		<guid isPermaLink="false">http://gavinsoorma.wordpress.com/?p=1672</guid>
		<description><![CDATA[Analyze the impact of change on SQL statements using the SQL Performance Analyzer
In the earlier post, we had discussed the Database Capture and Replay component of 11g Real Application Testing &#8211; (http://gavinsoorma.wordpress.com/2009/09/11/11g-real-application-testing-making-changes-with-confidence/)
We can also analyse the impact of upgrading from 10.2.0.4 to 11.1.0.6 at the SQL statement level by using the other component of 11g [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1672&subd=gavinsoorma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><strong>Analyze the impact of change on SQL statements using the SQL Performance Analyzer</strong></p>
<p>In the earlier post, we had discussed the Database Capture and Replay component of 11g Real Application Testing &#8211; (http://gavinsoorma.wordpress.com/2009/09/11/11g-real-application-testing-making-changes-with-confidence/)</p>
<p>We can also analyse the impact of upgrading from 10.2.0.4 to 11.1.0.6 at the SQL statement level by using the other component of 11g Real Application Testing which is called SQL Performance Analyzer or SPA.</p>
<p>We will use the following two SQL statements to create a SQL Tuning Set (STS) in the 10.2.0.4 environment. This STS is then transported to the 11g target environment and then we will use the GUI Database Control to replay the statements in the STS and generate a Performance Analysis report which will help us identify if any statements have improved or digressed in the changed environment.</p>
<p>SELECT /*+TEST_SPA*/ p.prod_name, s.time_id, t.week_ending_day, SUM(s.amount_sold)<br />
FROM sales s, products p, times t<br />
WHERE s.time_id=t.time_id<br />
AND s.prod_id = p.prod_id<br />
GROUP BY p.prod_name, s.time_id, t.week_ending_day; </p>
<p>SELECT /*+TEST_SPA*/ p.prod_category, t.week_ending_day, s.cust_id, SUM(s.amount_sold)<br />
FROM sales s, products p, times t<br />
WHERE s.time_id = t.time_id<br />
AND s.prod_id = p.prod_id<br />
AND p.prod_category = &#8216;Peripherals and Accessories&#8217;<br />
GROUP BY p.prod_category, t.week_ending_day, s.cust_id; </p>
<p>We are using a ‘tag’ TEST_SPA to help us easily identify these SQL statements in the shared pool.</p>
<p>Source 10.2.0.4 environment – Create and Export SQL Tuning Set</p>
<p>SQL&gt; exec dbms_sqltune.drop_sqlset(&#8216;SH_10204&#8242;);</p>
<p>PL/SQL procedure successfully completed.</p>
<p>SQL&gt; exec dbms_sqltune.create_sqlset(&#8216;SH_10204&#8242;,&#8217;Demo Workload to test SPA&#8217;);</p>
<p>PL/SQL procedure successfully completed.</p>
<p>SQL&gt; DECLARE<br />
  2  stscur dbms_sqltune.sqlset_cursor;<br />
  3  BEGIN<br />
  4  OPEN stscur FOR<br />
  5  SELECT VALUE(P)<br />
  6  FROM TABLE(dbms_sqltune.select_cursor_cache(<br />
  7  &#8217;sql_text like &#8221;SELECT /*+TEST_SPA%&#8221;&#8217;,<br />
  8  null, null, null, null, null, null, &#8216;ALL&#8217;)) P;<br />
  9  &#8212; populate the sqlset<br />
 10  dbms_sqltune.load_sqlset(:sts_name, stscur);<br />
 11  end;<br />
 12  /</p>
<p>PL/SQL procedure successfully completed.</p>
<p>SQL&gt; select sql_id,plan_hash_value,  substr(sql_text,1,40) text, executions<br />
  2  from dba_sqlset_statements<br />
  3  where sqlset_name =&#8217;SH_10204&#8242;<br />
  4  order by sql_id, plan_hash_value;</p>
<p>SQL_ID        PLAN_HASH_VALUE TEXT                                               EXECUTIONS<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;&#8211; &#8212;&#8212;&#8212;-<br />
5930m31ryy4b1      3901800458 SELECT /*+TEST_SPA*/ p.prod_category, t.                    1<br />
5tbr81fmrnyc0      1679814994 SELECT /*+TEST_SPA*/ p.prod_name, s.time                    1</p>
<p>In order to transport the SQL tuning set  that we have just created, we need to create a staging table to hold the contents of the STS and then we will use the export utility to generate a dump file which will then be copied to the target 11g environment.</p>
<p>SQL&gt; execute DBMS_SQLTUNE.CREATE_STGTAB_SQLSET(table_name =&gt;&#8217;SH_STS&#8217;);</p>
<p>PL/SQL procedure successfully completed.</p>
<p>SQL&gt; execute DBMS_SQLTUNE.PACK_STGTAB_SQLSET(sqlset_name =&gt; &#8216;SH_10204&#8242;,staging_table_name =&gt; &#8216;SH_STS&#8217;);</p>
<p>PL/SQL procedure successfully completed.</p>
<p>SQL&gt; select count (*) from sh_sts;</p>
<p>  COUNT(*)<br />
&#8212;&#8212;&#8212;-<br />
         2</p>
<p><a href='http://gavinsoorma.files.wordpress.com/2009/09/analyze-the-impact-of-change-on-sql-statements-using-the-sql-performance-analyzer.doc'>Read More &#8230;..</a></p>
Posted in Administration, Oracle 11g  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gavinsoorma.wordpress.com/1672/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gavinsoorma.wordpress.com/1672/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gavinsoorma.wordpress.com/1672/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gavinsoorma.wordpress.com/1672/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gavinsoorma.wordpress.com/1672/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gavinsoorma.wordpress.com/1672/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gavinsoorma.wordpress.com/1672/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gavinsoorma.wordpress.com/1672/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gavinsoorma.wordpress.com/1672/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gavinsoorma.wordpress.com/1672/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1672&subd=gavinsoorma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.wordpress.com/2009/09/14/11g-real-application-testing-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4c7ffc229f14367caa30864d6feb3ac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gavsal</media:title>
		</media:content>
	</item>
		<item>
		<title>11g Real Application Testing &#8211; making changes with confidence</title>
		<link>http://gavinsoorma.wordpress.com/2009/09/11/11g-real-application-testing-making-changes-with-confidence/</link>
		<comments>http://gavinsoorma.wordpress.com/2009/09/11/11g-real-application-testing-making-changes-with-confidence/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 05:59:01 +0000</pubDate>
		<dc:creator>Gavin  Soorma</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Oracle 11g]]></category>
		<category><![CDATA[11g real application testing]]></category>
		<category><![CDATA[database capture]]></category>
		<category><![CDATA[database replay]]></category>
		<category><![CDATA[dbms_workload_capture]]></category>
		<category><![CDATA[wrc]]></category>

		<guid isPermaLink="false">http://gavinsoorma.wordpress.com/?p=1667</guid>
		<description><![CDATA[CASE STUDY:
Using 11g Real Application Testing to analyse the impact of making the following changes:
1)	Upgrade the database from 10g to 11g
2)	Convert from single instance database to a two node RAC database
3)	Convert from file system based storage to 11g ASM
Overview of Real Application Testing
One of the best new features in Oracle 11g is the Real Application [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1667&subd=gavinsoorma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><strong>CASE STUDY:</strong></p>
<p>Using 11g Real Application Testing to analyse the impact of making the following changes:</p>
<p>1)	<strong>Upgrade the database from 10g to 11g</strong><br />
2)	<strong>Convert from single instance database to a two node RAC database</strong><br />
3)	<strong>Convert from file system based storage to 11g ASM</strong></p>
<p><strong>Overview of Real Application Testing</strong></p>
<p>One of the best new features in Oracle 11g is the Real Application Testing option which enables us to test the result of a change without actually implementing the same in a production environment. Changes such as database version upgrades, optimizer changes, hardware and storage changes all carry with them an element of risk and uncertainty. Using this feature much of that uncertainty and guesswork can be avoided.</p>
<p>Real Application Testing comprises of two components:</p>
<p>a)	Database Replay<br />
b)	SQL Performance Analyzer (SPA) </p>
<p>SPA enables us to test the impact of a change at the level of a particular SQL statement to see if any improvements or regressions occurred in the execution of the SQL statement because of the change. </p>
<p>Database Replay enables us to capture workload real time in a production environment and then replay the same in a clone or copy of the changed production environment with the exact timings, concurrency and transaction characteristics found in the original workload. The AWR comparison and Database Replay reports can easily help us pinpoint any potential problems and errors as well any divergence in performance.</p>
<p>This feature will afford businesses increased confidence and surety when faced with a system change as well as significantly reducing the costs as well as resources associated with the testing phase.</p>
<p>Database Capture is now supported in versions 9.2.0.8 as well as 10.2.0.3 and 10.2.0.4 enabling us to test the impact of upgrades from both 9i as well as 10g to 11g. Note, however, that replay can only be performed in a Oracle 11g database.</p>
<p>At a very high level, the database capture and replay will involve the following steps:</p>
<p>1)	Prepare the source database for capture<br />
2)	Capture the workload<br />
3)	Copy the workload capture files to the target machine<br />
4)	Prepare the target database for replay and process captured workload files<br />
5)	Start the workload replay clients<br />
6)	Once the workload replay has finished, examine the generated reports and make the analysis</p>
<p><a href='http://gavinsoorma.files.wordpress.com/2009/09/10g-to-11g-upgrade-using-11g-rat.doc'>Read More &#8230;.</a></p>
Posted in Administration, Oracle 11g  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gavinsoorma.wordpress.com/1667/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gavinsoorma.wordpress.com/1667/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gavinsoorma.wordpress.com/1667/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gavinsoorma.wordpress.com/1667/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gavinsoorma.wordpress.com/1667/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gavinsoorma.wordpress.com/1667/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gavinsoorma.wordpress.com/1667/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gavinsoorma.wordpress.com/1667/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gavinsoorma.wordpress.com/1667/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gavinsoorma.wordpress.com/1667/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1667&subd=gavinsoorma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.wordpress.com/2009/09/11/11g-real-application-testing-making-changes-with-confidence/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4c7ffc229f14367caa30864d6feb3ac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gavsal</media:title>
		</media:content>
	</item>
		<item>
		<title>Oracle 11g Advanced Compression</title>
		<link>http://gavinsoorma.wordpress.com/2009/09/03/oracle-11g-advanced-compression/</link>
		<comments>http://gavinsoorma.wordpress.com/2009/09/03/oracle-11g-advanced-compression/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 04:32:50 +0000</pubDate>
		<dc:creator>Gavin  Soorma</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Oracle 11g]]></category>
		<category><![CDATA[advanced compression]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[compression=all]]></category>

		<guid isPermaLink="false">http://gavinsoorma.wordpress.com/?p=1657</guid>
		<description><![CDATA[Although table compression was introduced in Oracle 9i and 10g, it was aimed more at bulk load operations for data warehouse environments. The overhead associated with compression and uncompression made it unsuitable for OLTP type shops.
In Oracle 11g, Advanced Compression (which is an additional licensed feature) includes OLTP compression capabilities as well as compression of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1657&subd=gavinsoorma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Although table compression was introduced in Oracle 9i and 10g, it was aimed more at bulk load operations for data warehouse environments. The overhead associated with compression and uncompression made it unsuitable for OLTP type shops.</p>
<p>In Oracle 11g, Advanced Compression (which is an additional licensed feature) includes OLTP compression capabilities as well as compression of unstructured data like images and text with Secure Files and also direct  compression of the export dump file generated by Data Pump which is also directly read without any uncompress while doing an import. </p>
<p>The compression feature has been greatly enhanced so as to remove any overhead associated with dealing with compressed data while performing any DML activities.The COMPRESS FOR ALL OPERATIONS keyword needs to be used for enabling OLTP data compression.</p>
<p>While Oracle does claim compression ratios of 3:1, we were able to see clearly 2:1 ratios in terms of storage reductions and no real performance overhead while performing deletes and inserts on compressed data as shown in the example below.</p>
<p>So this feature could provide us both Storage as well as Performance gains due to the reduced number of blocks which will need to be read while performing I/O.</p>
<p><strong>UNCOMPRESSED DATA</strong></p>
<p>SQL&gt; create table myobjects<br />
  2  as select * from all_objects;</p>
<p>Table created.</p>
<p>SQL&gt;  select sum(bytes)/1048576 from user_segments where segment_name=&#8217;MYOBJECTS&#8217;;</p>
<p>SUM(BYTES)/1048576<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
               <strong> 21</strong></p>
<p>SQL&gt; insert into myobjects<br />
  2  select * from all_objects;</p>
<p>56261 rows created.</p>
<p>Elapsed: 00:00:<strong>09.39</strong></p>
<p>SQL&gt; select count(*) from myobjects where object_type=&#8217;TABLE&#8217;;</p>
<p>  COUNT(*)<br />
&#8212;&#8212;&#8212;-<br />
       444</p>
<p>Elapsed: 00:00:<strong>00.66</strong></p>
<p>SQL&gt; delete myobjects;</p>
<p>168780 rows deleted.</p>
<p>Elapsed: 00:00:<strong>12.22</strong></p>
<p><strong>COMPRESSED DATA</strong></p>
<p>SQL&gt; create table myobjects_compress<br />
  2  <strong>compress for all operations</strong><br />
  3  as select * from all_objects;</p>
<p>SQL&gt; select sum(bytes)/1048576 from user_segments where segment_name=&#8217;MYOBJECTS_COMPRESS&#8217;;</p>
<p>SUM(BYTES)/1048576<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
                 9</p>
<p>SQL&gt; insert into myobjects_compress<br />
  2  select * from all_objects;</p>
<p>56261 rows created.</p>
<p>Elapsed: 00:00:<strong>09.08</strong></p>
<p>SQL&gt;  select count(*) from myobjects_compress where object_type=&#8217;TABLE&#8217;;</p>
<p>  COUNT(*)<br />
&#8212;&#8212;&#8212;-<br />
       444</p>
<p>Elapsed: 00:00:<strong>00.21</strong></p>
<p>SQL&gt; delete myobjects_compress;</p>
<p>168783 rows deleted.</p>
<p>Elapsed: 00:00:<strong>10.96</strong></p>
<p><strong>Compression of Data Pump Exports</strong></p>
<p>While doing an export, we can use the parameter COMPRESSION=ALL (other options are DATA_ONLY or METADATA) and we see that the size of the dumpfile has reduced very significantly while using this compression feature.</p>
<p>The uncompressed dumpfile was 113 MB while the compressed dumpfile was just 13 MB. This feature can be very useful when we need to take a large export on disk but are limited by disk space. The earlier methods required us to use a pipe while performing an export, but we had to then uncompress the file while performing the import as well which is a very costly operation in terms of time and resources.</p>
<p>$ expdp directory=data_file_dir dumpfile=uncompress.dmp schemas=SH <strong>compression=ALL</strong></p>
<p>middba1:/u01/oracle/product/11.1.0/db/demo/schema/sales_history&gt; ls -l *.dmp<br />
-rw-rw&#8212;-    1 oracle   dba       113610752 Sep  3 12:25 uncompress.dmp<br />
-rw-rw&#8212;-    1 oracle   dba        13426688 Sep  3 12:21  compress.dmp</p>
Posted in Administration, Oracle 11g  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gavinsoorma.wordpress.com/1657/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gavinsoorma.wordpress.com/1657/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gavinsoorma.wordpress.com/1657/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gavinsoorma.wordpress.com/1657/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gavinsoorma.wordpress.com/1657/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gavinsoorma.wordpress.com/1657/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gavinsoorma.wordpress.com/1657/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gavinsoorma.wordpress.com/1657/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gavinsoorma.wordpress.com/1657/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gavinsoorma.wordpress.com/1657/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1657&subd=gavinsoorma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.wordpress.com/2009/09/03/oracle-11g-advanced-compression/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4c7ffc229f14367caa30864d6feb3ac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gavsal</media:title>
		</media:content>
	</item>
		<item>
		<title>DBA Monitoring Menu</title>
		<link>http://gavinsoorma.wordpress.com/2009/09/03/dba-monitoring-menu/</link>
		<comments>http://gavinsoorma.wordpress.com/2009/09/03/dba-monitoring-menu/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 02:21:43 +0000</pubDate>
		<dc:creator>Gavin  Soorma</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[monitor database]]></category>
		<category><![CDATA[monitoring menu]]></category>

		<guid isPermaLink="false">http://gavinsoorma.wordpress.com/?p=1648</guid>
		<description><![CDATA[I have created a simple but very useful Unix shell script driven menu to enable easy monitoring of any number of Oracle databases from a single central location. This covers most of the normal DBA day to day standard monitoring requirements as well as a good interface for aiding in performance tuning.
Set up is pretty [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1648&subd=gavinsoorma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I have created a simple but very useful Unix shell script driven menu to enable easy monitoring of any number of Oracle databases from a single central location. This covers most of the normal DBA day to day standard monitoring requirements as well as a good interface for aiding in performance tuning.</p>
<p>Set up is pretty simple requiring a single user called MONITOR in each database with SELECT privilege on the data dictionary tables.</p>
<p>Drop me an email at <strong><a href="mailto:gavin.soorma@bankwest.com.au">gavin.soorma@bankwest.com.au </a></strong>so that I can send you the zip file along with the installation instructions.</p>
<p>A few screen shots of the various menu options are shown below </p>
<pre>
       #######################################################
                        [DBA Menu - PRDU010]

                        Connected to Database- cpsprd
        #######################################################

        (1) Database Overview
        (2) Database Storage
        (3) Database Objects
        (4) Database Security
        (5) Database Monitor
        (6) Database Performance

        Enter your choice (q to quit):

        ########################################################
</pre>
<pre>
        #######################################################
                        Database Monitoring Menu - cpsprd
        #######################################################

        (1)  User Sessions
        (2)  Redo Log File Switches
        (3)  Current SQL (by Unix PID)
        (4)  Current SQL (by SID)
        (5)  Current SQL (by Oracle Username)
        (6)  Rollback Segment Usage
        (7)  Locked Sessions
        (8)  Locked Objects
        (9)  Datafile I/O
        (10) DBMS Jobs Status
        (11) View Long Operations
        (12) Active Transactions
        (13) Idle Sessions
        (14) Flashback Logging
        (15) Sessions With High I/O
        (16) Data Guard Log Shipping
        (17) Redo Generation By Day

        Enter your choice (q to quit):

        #######################################################
</pre>
<pre>
             #######################################################
                        Database Performance Menu - cpsprd
        	  #######################################################

        (1)  Waits - Instance Level (by time waited)
        (2)  Waits - By Class
        (3)  Waits - Waiting Session's SQL
        (4)  Waits - What are users currently waiting on?
        (5)  Waits - Datafile Level
        (6)  Waits - Block &amp; Object Level
        (7)  Locked Sessions
        (8)  Large Objects In Shared Pool
        (9)  Hit Ratios - Quick Check
        (10) Top 5 Problem Queries (Disk Reads)
        (11) Top 5 Problem Queries (Buffer Gets)
        (12) Top 5 Problem Queries (Disk Reads/Executions)
        (13) Top 5 Queries (Executions)
        (14) Top 5 Latch Waits (by sleeps)
        (15) Top 5 Latch Waits (by misses)
        (16) Current Waits On Latches
        (17) Enqueue Waits - By Session
        (18) Enqueue Waits - By Database
        (19) Enqueue Waits - By Object
        (20) Key CBO init.ora Parameters
        (21) Tables ANALYZE Status
        (22) Indexes ANALYZE Status
        (23) Top Segments with most I/O

        Enter your choice (q to quit):

        #######################################################
</pre>
Posted in Administration  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gavinsoorma.wordpress.com/1648/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gavinsoorma.wordpress.com/1648/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gavinsoorma.wordpress.com/1648/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gavinsoorma.wordpress.com/1648/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gavinsoorma.wordpress.com/1648/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gavinsoorma.wordpress.com/1648/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gavinsoorma.wordpress.com/1648/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gavinsoorma.wordpress.com/1648/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gavinsoorma.wordpress.com/1648/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gavinsoorma.wordpress.com/1648/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1648&subd=gavinsoorma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.wordpress.com/2009/09/03/dba-monitoring-menu/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4c7ffc229f14367caa30864d6feb3ac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gavsal</media:title>
		</media:content>
	</item>
		<item>
		<title>11g Snapshot Standby for real time testing</title>
		<link>http://gavinsoorma.wordpress.com/2009/09/02/11g-snapshot-standby-for-real-time-testing/</link>
		<comments>http://gavinsoorma.wordpress.com/2009/09/02/11g-snapshot-standby-for-real-time-testing/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 03:26:33 +0000</pubDate>
		<dc:creator>Gavin  Soorma</dc:creator>
				<category><![CDATA[High Availability]]></category>
		<category><![CDATA[Oracle 11g]]></category>
		<category><![CDATA[active data guard]]></category>
		<category><![CDATA[convert to snapshot]]></category>
		<category><![CDATA[snapshot standby]]></category>

		<guid isPermaLink="false">http://gavinsoorma.wordpress.com/?p=1627</guid>
		<description><![CDATA[One of the very good new features in Oracle 11g is the Snapshot Standby database where we can basically convert the physical standby database into a read-write real time clone of the production database and we can then temporarily use this environment for carrying out any kind of development testing, QA type work or to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1627&subd=gavinsoorma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>One of the very good new features in Oracle 11g is the Snapshot Standby database where we can basically convert the physical standby database into a read-write real time clone of the production database and we can then <strong>temporarily</strong> use this environment for carrying out any kind of development testing, QA type work or to test the impact of a proposed production change on an application.</p>
<p>Basically, the Snapshot Standby database in turn uses the Flashback Database technology to create a guaranteed restore point to which the database can be later flashed back to.</p>
<p>So we need to keep in mind that whatever limitations are present in the Flashback database technology, the same will also be inherent in the Snapshot database fetaure.</p>
<p>Let us illustrate this feature by using an example where we would like to test the impact of the change of some important optimizer related parameters on a key application query using the actual production data.</p>
<p>In production, the SQL query below is shown to be peforming a full table/partition scan and using hash joins. We would like to see if a nested loop join and index usage will prove beneficial to this SQL query that is used frequently by the application.</p>
<pre>
explain plan for
SELECT c.cust_last_name, sum(s.amount_sold) AS dollars,sum(s.quantity_sold) as quantity
FROM sales s , customers c, products p
WHERE c.cust_id = s.cust_id
AND s.prod_id = p.prod_id
AND c.cust_state_province IN ('Dublin','Galway')GROUP BY c.cust_last_name
/

SQL&gt; select * from table(dbms_xplan.display);

PLAN_TABLE_OUTPUT
------------------------------------------------------------------------------------------------------
Plan hash value: 1248656060

------------------------------------------------------------------------------------------------------
| Id  | Operation              | Name        | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT       |             |   519 | 23355 |   935   (6)| 00:00:12 |       |       |
|   1 |  HASH GROUP BY         |             |   519 | 23355 |   935   (6)| 00:00:12 |       |       |
|*  2 |   HASH JOIN            |             | 99644 |  4378K|   927   (5)| 00:00:12 |       |       |
|   3 |    INDEX FULL SCAN     | PRODUCTS_PK |    72 |   288 |     1   (0)| 00:00:01 |       |       |
|*  4 |    HASH JOIN           |             | 99644 |  3989K|   924   (5)| 00:00:12 |       |       |
|*  5 |     TABLE ACCESS FULL  | CUSTOMERS   |   766 | 18384 |   408   (1)| 00:00:05 |       |       |

PLAN_TABLE_OUTPUT
------------------------------------------------------------------------------------------------------
|   6 |     PARTITION RANGE ALL|             |   918K|    14M|   507   (6)| 00:00:07 |     1 |    28 |
|   7 |      TABLE ACCESS FULL | SALES       |   918K|    14M|   507   (6)| 00:00:07 |     1 |    28 |
------------------------------------------------------------------------------------------------------
</pre>
<p>We will now convert the physical standby database to a Snapshot Standby database and note that after the conversion takes place, internally a guaranteed restore point has been created and the database has been opened in read-write mode. Also note the DATABASE_ROLE column.</p>
<pre>
SQL&gt;  ALTER DATABASE CONVERT TO SNAPSHOT STANDBY;

Database altered.

SQL&gt; shutdown immediate;
ORA-01507: database not mounted

ORACLE instance shut down.
SQL&gt; startup;
ORACLE instance started.

Total System Global Area  521936896 bytes
Fixed Size                  2139784 bytes
Variable Size             415238520 bytes
Database Buffers           96468992 bytes
Redo Buffers                8089600 bytes
Database mounted.
Database opened.

SQL&gt; select NAME,GUARANTEE_FLASHBACK_DATABASE from  v$restore_point;

NAME                                                         GUA
------------------------------------------------------------ ---
SNAPSHOT_STANDBY_REQUIRED_09/02/2009 10:12:21                YES

SQL&gt; select open_mode,database_role from v$database;

OPEN_MODE  DATABASE_ROLE
---------- ----------------
READ WRITE SNAPSHOT STANDBY
</pre>
<p>We will now make some changes to some optimizer related parameters:</p>
<pre>
SQL&gt; alter system set optimizer_index_cost_adj=20;

System altered.

SQL&gt; alter system set optimizer_index_caching=10;

System altered.

SQL&gt; alter system set optimizer_mode=FIRST_ROWS;

System altered.
</pre>
<p>We run the same query again and we can see that the plan has changed and the optimizer is now using the index scan with nested loop joins.</p>
<pre>
--------------------------------------------------------------------------------------------------------------
| Id  | Operation                             | Name                 | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                      |                      |   519 | 23355 |   588  (11)| 00:00:08 |
|   1 |  HASH GROUP BY                        |                      |   519 | 23355 |   588  (11)| 00:00:08 |
|   2 |   NESTED LOOPS                        |                      | 99644 |  4378K|   580  (10)| 00:00:07 |
|*  3 |    HASH JOIN                          |                      | 99644 |  3989K|   577  (10)| 00:00:07 |
|*  4 |     TABLE ACCESS BY INDEX ROWID       | CUSTOMERS            |   766 | 18384 |   241   (2)| 00:00:03 |
|   5 |      BITMAP CONVERSION TO ROWIDS      |                      |       |       |            |          |
|   6 |       BITMAP INDEX FULL SCAN          | CUSTOMERS_GENDER_BIX |       |       |            |          |
|   7 |     PARTITION RANGE ALL               |                      |   918K|    14M|   326  (12)| 00:00:04 |
|   8 |      TABLE ACCESS BY LOCAL INDEX ROWID| SALES                |   918K|    14M|   326  (12)| 00:00:04 |
|   9 |       BITMAP CONVERSION TO ROWIDS     |                      |       |       |            |          |
|  10 |        BITMAP INDEX FULL SCAN         | SALES_PROMO_BIX      |       |       |            |          |
|* 11 |    INDEX UNIQUE SCAN                  | PRODUCTS_PK          |     1 |     4 |     1   (0)| 00:00:01 |
--------------------------------------------------------------------------------------------------------------</pre>
<p>While the original physical standby database has been now converted to snapshot database, some changes are happening on the Primary database and those changes are shipped to the standby site but not yet applied. They will accumulate on the standby site and will be applied after the snapshot standby database is converted back to a physical standby database.</p>
<pre>
SQL&gt; create table mytest as select * from sales;

Table created.

SQL&gt; update mytest set prod_id=1;

918843 rows updated.
</pre>
<p>On the standby site, we will now convert the shapshot standby database to the original mode of physical standby database in Active Data Guard mode.</p>
<p>Note that after the physical standby database is opened, changes that were made on the Primary database while it was open in shapshot standby mode are now applied as well.</p>
<pre>
SQL&gt; shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL&gt; startup mount;
ORACLE instance started.

Total System Global Area  521936896 bytes
Fixed Size                  2139784 bytes
Variable Size             415238520 bytes
Database Buffers           96468992 bytes
Redo Buffers                8089600 bytes
Database mounted.
SQL&gt; ALTER DATABASE CONVERT TO PHYSICAL STANDBY;

Database altered.

SQL&gt; shutdown immediate;
ORA-01507: database not mounted

ORACLE instance shut down.

SQL&gt; startup mount;
ORACLE instance started.

Total System Global Area  521936896 bytes
Fixed Size                  2139784 bytes
Variable Size             415238520 bytes
Database Buffers           96468992 bytes
Redo Buffers                8089600 bytes
Database mounted.
SQL&gt;  recover managed standby database disconnect;
Media recovery complete.
SQL&gt; recover managed standby database cancel;
Media recovery complete.
SQL&gt; alter database open;

Database altered.

Elapsed: 00:01:06.29
SQL&gt; recover managed standby database using current logfile disconnect;
Media recovery complete.

SQL&gt; select count(*) from sh.mytest;

  COUNT(*)
----------
    918843

SQL&gt; select distinct prod_id from sh.mytest;

   PROD_ID
----------
         1
</pre>
Posted in High Availability, Oracle 11g  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gavinsoorma.wordpress.com/1627/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gavinsoorma.wordpress.com/1627/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gavinsoorma.wordpress.com/1627/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gavinsoorma.wordpress.com/1627/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gavinsoorma.wordpress.com/1627/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gavinsoorma.wordpress.com/1627/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gavinsoorma.wordpress.com/1627/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gavinsoorma.wordpress.com/1627/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gavinsoorma.wordpress.com/1627/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gavinsoorma.wordpress.com/1627/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1627&subd=gavinsoorma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.wordpress.com/2009/09/02/11g-snapshot-standby-for-real-time-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4c7ffc229f14367caa30864d6feb3ac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gavsal</media:title>
		</media:content>
	</item>
		<item>
		<title>How to transport a tablespace from 10g ASM on Windows to 11g ASM on AIX</title>
		<link>http://gavinsoorma.wordpress.com/2009/08/31/how-to-transport-a-tablespace-from-10g-asm-on-windows-to-11g-asm-on-aix/</link>
		<comments>http://gavinsoorma.wordpress.com/2009/08/31/how-to-transport-a-tablespace-from-10g-asm-on-windows-to-11g-asm-on-aix/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 07:39:05 +0000</pubDate>
		<dc:creator>Gavin  Soorma</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Oracle 11g]]></category>
		<category><![CDATA[ASM]]></category>
		<category><![CDATA[tts]]></category>
		<category><![CDATA[cross platform transportable tablespace]]></category>
		<category><![CDATA[dbms_file_transfer]]></category>

		<guid isPermaLink="false">http://gavinsoorma.wordpress.com/?p=1616</guid>
		<description><![CDATA[This example demonstrates how to transport a tablespace from a 10g ASM on Windows environment to 11g ASM on AIX environment using the DBMS_FILE_TRANSFER package.
The source database on Windows is GENUA1 and the target database is a 11g RAC database RACDB1.
Create the tablespace and the test object in the source database

SQL&#62; create tablespace test_asm
  [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1616&subd=gavinsoorma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This example demonstrates how to transport a tablespace from a 10g ASM on Windows environment to 11g ASM on AIX environment using the <strong>DBMS_FILE_TRANSFER </strong>package.</p>
<p>The source database on Windows is GENUA1 and the target database is a 11g RAC database RACDB1.</p>
<p><strong>Create the tablespace and the test object in the source database</strong></p>
<pre>
SQL&gt; create tablespace test_asm
  2  datafile size 100m;

Tablespace created.

SQL&gt; select file_name from dba_data_files
  2  where tablespace_name='TEST_ASM';

FILE_NAME
--------------------------------------------------------------------------------

+DATA/genua1/datafile/test_asm.376.696333127

SQL&gt; conn system/xxx
Connected.

SQL&gt; create table myobjects
  2  tablespace test_asm
  3  as select * from dba_objects;

Table created.

SQL&gt; select count(*) from system.myobjects;

  COUNT(*)
----------
     56504
</pre>
<p><strong>Create a database link from the source database to the target database</strong></p>
<pre>
SQL&gt; CREATE DATABASE LINK  DBS2 CONNECT TO
  2  system identified by oracle
  3  using 'racdb1';

Database link created.

SQL&gt; select * from dual@dbs2;

D
-
X
</pre>
<p><strong>Create a directory to hold the converted datafile on the source</strong></p>
<pre>
SQL&gt; create directory source_dir as '+DATA/genua1/xtransport/';

Directory created.
</pre>
<p><strong>Create a directory to hold the tablespace meta data dump on the source</strong></p>
<pre>
SQL&gt; create directory source_dir_2 as '+DATA';

Directory created.
</pre>
<p><strong>Create an O/S level directory for the data pump export logfile</strong></p>
<pre>
SQL&gt; create directory test_asm_log as 'd:\oracle\';

Directory created.
</pre>
<p><strong>Create a directory on the target to hold the transported datafile</strong></p>
<pre>
SQL&gt; CREATE OR REPLACE DIRECTORY target_dir  AS '+DATA';

Directory created.
</pre>
<p><strong>Create an O/S level directory for the data pump import logfile</strong></p>
<pre> create directory test_asm_log as '/u01/oracle/';

Directory created.
</pre>
<p><strong>Make the tablespace which is going to be transported read only</strong></p>
<pre>
SQL&gt; alter tablespace test_asm read only;

Tablespace altered.
</pre>
<p><strong>Export the tablespace meta data using Data Pump</strong></p>
<p>C:\Documents and Settings\bwdba_cbduat&gt;expdp directory=source_dir_2 dumpfile=test_asm.dmp transport_tablespaces=TEST_ASM transport_full_check=Y logfile=test_asm_log:exp.log</p>
<pre>
Export: Release 10.2.0.4.0 - Production on Monday, 31 August, 2009 10:41:34

Copyright (c) 2003, 2007, Oracle.  All rights reserved.

Username: system
Password:

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Produc
tion
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
Starting "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01":  system/******** directory=sour
ce_dir_2 dumpfile=test_asm.dmp transport_tablespaces=TEST_ASM transport_full_che
ck=Y logfile=test_asm_log:exp.log
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
Processing object type TRANSPORTABLE_EXPORT/TABLE
Processing object type TRANSPORTABLE_EXPORT/INDEX
Processing object type TRANSPORTABLE_EXPORT/INDEX_STATISTICS
Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
Master table "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01" successfully loaded/unloaded

******************************************************************************
Dump file set for SYSTEM.SYS_EXPORT_TRANSPORTABLE_01 is:
  +DATA/test_asm.dmp
Job "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01" successfully completed at 10:42:16
</pre>
<p><strong>Use DBMS_FILE_TRANSFER to transfer the export dump file to the target </strong></p>
<pre>
SQL&gt; begin
  2   dbms_file_transfer.put_file
  3   (source_directory_object =&gt; 'source_dir_2',
  4   source_file_name =&gt; 'test_asm.dmp',
  5   destination_directory_object =&gt; 'target_dir',
  6  destination_file_name =&gt; 'test_asm.dmp',
  7   destination_database =&gt; 'dbs2');
  8   end;
  9  /

PL/SQL procedure successfully completed.
</pre>
<p><strong>Use RMAN to convert the tablespace to the target AIX 64 bit format </strong></p>
<pre>
Note that the converted datafile will reside in the directory we created in an earlier step - +DATA/genua1/xtransport

RMAN&gt; convert tablespace test_asm to
2&gt; platform 'AIX-Based Systems (64-bit)'
3&gt; format '+DATA';

Starting backup at 31/AUG/09
configuration for DISK channel 2 is ignored
configuration for DISK channel 3 is ignored
configuration for DISK channel 4 is ignored
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=470 instance=genua11 devtype=DISK
channel ORA_DISK_1: starting datafile conversion
input datafile fno=00224 name=+DATA/genua1/datafile/test_asm.376.696333127
converted datafile=+DATA/genua1/xtransport/test_asm.266.696338369
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:07
Finished backup at 31/AUG/09
</pre>
<p><strong>Use DBMS_FILE_TRANSFER to copy the converted datafile to the target </strong></p>
<pre>
SQL&gt; begin
  2    dbms_file_transfer.put_file
  3    (source_directory_object =&gt; 'source_dir',
  4     source_file_name =&gt; 'test_asm.266.696338369',
  5    destination_directory_object =&gt; ' target_dir',
  6    destination_file_name =&gt; 'tts1_db1.dbf',
  7     destination_database =&gt; 'dbs2');
  8    end;
  9     /

PL/SQL procedure successfully completed.
</pre>
<p><strong>On the target import the datafile meta data using Data Pump </strong></p>
<pre>
The imp.par import parameter file has the following contents 

directory=target_dir
dumpfile=test_asm.dmp
logfile=test_asm_log:imp.log
TRANSPORT_DATAFILES='+DATA1/tts1_db1.dbf'
keep_master=y

middba1:/u01/oracle&gt; impdp parfile=imp.par

Import: Release 11.1.0.6.0 - 64bit Production on Monday, 31 August, 2009 11:39:32

Copyright (c) 2003, 2007, Oracle.  All rights reserved.

Username: system
Password:

Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Partitioning, Real Application Clusters and Real Application Testing options
Master table "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_02" successfully loaded/unloaded
Starting "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_02":  system/******** parfile=imp.par
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
Processing object type TRANSPORTABLE_EXPORT/TABLE
Processing object type TRANSPORTABLE_EXPORT/INDEX
Processing object type TRANSPORTABLE_EXPORT/INDEX_STATISTICS
Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
Job "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_02" successfully completed at 11:39:48
</pre>
<p><strong>On the target database RACDB1, check that the TEST_ASM tablespace has been plugged in and the MYOBJECTS table is present </strong></p>
<pre>
middba1:/u01/oracle&gt; sql

SQL*Plus: Release 11.1.0.6.0 - Production on Mon Aug 31 11:41:29 2009

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Partitioning, Real Application Clusters and Real Application Testing options

SQL&gt; select file_name from dba_data_files where tablespace_name='TEST_ASM';

FILE_NAME
--------------------------------------------------------------------------------
+DATA/tts1_db1.dbf

SQL&gt; select count(*) from system.myobjects;

  COUNT(*)
----------
     56504
</pre>
Posted in Administration, Oracle 11g  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gavinsoorma.wordpress.com/1616/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gavinsoorma.wordpress.com/1616/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gavinsoorma.wordpress.com/1616/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gavinsoorma.wordpress.com/1616/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gavinsoorma.wordpress.com/1616/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gavinsoorma.wordpress.com/1616/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gavinsoorma.wordpress.com/1616/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gavinsoorma.wordpress.com/1616/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gavinsoorma.wordpress.com/1616/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gavinsoorma.wordpress.com/1616/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1616&subd=gavinsoorma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.wordpress.com/2009/08/31/how-to-transport-a-tablespace-from-10g-asm-on-windows-to-11g-asm-on-aix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4c7ffc229f14367caa30864d6feb3ac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gavsal</media:title>
		</media:content>
	</item>
		<item>
		<title>Duplicating a database from an ASM to a Non-ASM file system</title>
		<link>http://gavinsoorma.wordpress.com/2009/08/26/duplicating-a-database-from-an-asm-to-a-non-asm-file-system/</link>
		<comments>http://gavinsoorma.wordpress.com/2009/08/26/duplicating-a-database-from-an-asm-to-a-non-asm-file-system/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 05:36:33 +0000</pubDate>
		<dc:creator>Gavin  Soorma</dc:creator>
				<category><![CDATA[Backup and Recovery]]></category>
		<category><![CDATA[ASM]]></category>
		<category><![CDATA[duplicate]]></category>
		<category><![CDATA[non-asm]]></category>
		<category><![CDATA[ORA-19505]]></category>

		<guid isPermaLink="false">http://gavinsoorma.wordpress.com/?p=1598</guid>
		<description><![CDATA[By default, when we are using ASM with a Flash Recovery Area configured, backups to disk will go to the &#8220;backupset&#8221; subdirectory &#8211; unless we use the FORMAT clause while taking the backup to point the backups to another location on disk.
When we try to duplicate a database which is hosted on an ASM storage [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1598&subd=gavinsoorma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>By default, when we are using ASM with a Flash Recovery Area configured, backups to disk will go to the &#8220;backupset&#8221; subdirectory &#8211; unless we use the FORMAT clause while taking the backup to point the backups to another location on disk.</p>
<p>When we try to duplicate a database which is hosted on an ASM storage to a conventional O/S file system, the restore will fail as it will look for the ASM diskgroups where the backup was taken on the target node as well.</p>
<p>We will see an error like &#8230;..</p>
<p>channel ORA_AUX_DISK_1: reading from backup piece +DBATEAM/bwdba/backupset/2009_08_25/nnndf0_tag20090825t131155_0.388.695826727<br />
channel ORA_AUX_DISK_1: ORA-19870: error while restoring backup piece +DBATEAM/bwdba/backupset/2009_08_25/nnndf0_tag20090825t131155_0.388.695826727<br />
ORA-19505: failed to identify file &#8220;+DBATEAM/bwdba/backupset/2009_08_25/nnndf0_tag20090825t131155_0.388.695826727&#8243;<br />
ORA-17503: ksfdopn:2 Failed to open file +DBATEAM/bwdba/backupset/2009_08_25/nnndf0_tag20090825t131155_0.388.695826727<br />
ORA-15001: diskgroup &#8220;DBATEAM&#8221; does not exist or is not mounte<br />
failover to previous backup</p>
<p>In this case we will need to use the BACKUPSET clause of the BACKUP command to relocate that backup from the ASM storage to a O/S file system. We then ftp this backupset to the target node ensuring that the same directory file structure is available on the target node as compared to the source node where the ASM disk backup was restored. We can then proceed as normal with the RMAN Duplicate database procedure.</p>
<pre>
RMAN&gt; list backup of database;

List of Backup Sets
===================

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
14      Full    1.40G      DISK        00:00:47     26-AUG-09
        BP Key: 14   Status: AVAILABLE  Compressed: NO  Tag: TAG20090826T102022
        Piece Name: <strong>+DBATEAM/bwdba/backupset/2009_08_26</strong>/nnndf0_tag20090826t102022_0.397.695902837
  List of Datafiles in backup set 14
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1       Full 2765425    26-AUG-09 +DBATEAM/bwdba/datafile/system.256.695305997
  2       Full 2765425    26-AUG-09 +DBATEAM/bwdba/datafile/sysaux.257.695305999
  3       Full 2765425    26-AUG-09 +DBATEAM/bwdba/datafile/undotbs1.258.695305999
  4       Full 2765425    26-AUG-09 +DBATEAM/bwdba/datafile/users.259.695305999
  5       Full 2765425    26-AUG-09 +DBATEAM/bwdba/datafile/example.267.695306155
  6       Full 2765425    26-AUG-09 +DBATEAM/bwdba/datafile/undotbs2.268.695306391
</pre>
<pre>
RMAN&gt; backup device type disk format '/u01/oracle/backup/bwdba_bkp.%u'
2&gt; backupset 14
3&gt; ;

Starting backup at 26-AUG-09
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=108 instance=bwdba1 device type=DISK
input backup set count=15 STAMP=695902823 creation_time=26-AUG-09
channel ORA_DISK_1: starting piece 1 at 26-AUG-09
channel ORA_DISK_1: backup piece +DBATEAM/bwdba/backupset/2009_08_26/nnndf0_tag20090826t102022_0.397.695902837
piece handle=/u01/oracle/backup/bwdba_bkp.0fknl8j7 comment=NONE
channel ORA_DISK_1: finished piece 1 at 26-AUG-09
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25
Finished backup at 26-AUG-09
</pre>
<p>We will see now that the backup location has changed </p>
<pre>
RMAN&gt; list backup of database;

List of Backup Sets
===================

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
14      Full    1.40G      DISK        00:00:47     26-AUG-09
        BP Key: 18   Status: AVAILABLE  Compressed: NO  Tag: TAG20090826T102022
        Piece Name: <strong>/u01/oracle/backup/bwdba_bkp.0fknl8j7</strong>
  List of Datafiles in backup set 14
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1       Full 2765425    26-AUG-09 +DBATEAM/bwdba/datafile/system.256.695305997
  2       Full 2765425    26-AUG-09 +DBATEAM/bwdba/datafile/sysaux.257.695305999
  3       Full 2765425    26-AUG-09 +DBATEAM/bwdba/datafile/undotbs1.258.695305999
  4       Full 2765425    26-AUG-09 +DBATEAM/bwdba/datafile/users.259.695305999
  5       Full 2765425    26-AUG-09 +DBATEAM/bwdba/datafile/example.267.695306155
  6       Full 2765425    26-AUG-09 +DBATEAM/bwdba/datafile/undotbs2.268.695306391
</pre>
Posted in Backup and Recovery  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gavinsoorma.wordpress.com/1598/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gavinsoorma.wordpress.com/1598/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gavinsoorma.wordpress.com/1598/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gavinsoorma.wordpress.com/1598/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gavinsoorma.wordpress.com/1598/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gavinsoorma.wordpress.com/1598/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gavinsoorma.wordpress.com/1598/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gavinsoorma.wordpress.com/1598/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gavinsoorma.wordpress.com/1598/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gavinsoorma.wordpress.com/1598/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1598&subd=gavinsoorma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.wordpress.com/2009/08/26/duplicating-a-database-from-an-asm-to-a-non-asm-file-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4c7ffc229f14367caa30864d6feb3ac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gavsal</media:title>
		</media:content>
	</item>
		<item>
		<title>11g Adaptive Cursor Sharing</title>
		<link>http://gavinsoorma.wordpress.com/2009/08/21/11g-adaptive-cursor-sharing/</link>
		<comments>http://gavinsoorma.wordpress.com/2009/08/21/11g-adaptive-cursor-sharing/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 07:33:30 +0000</pubDate>
		<dc:creator>Gavin  Soorma</dc:creator>
				<category><![CDATA[Oracle 11g]]></category>
		<category><![CDATA[11G]]></category>
		<category><![CDATA[adaptive cursor]]></category>
		<category><![CDATA[bind peeking]]></category>

		<guid isPermaLink="false">http://gavinsoorma.wordpress.com/?p=1591</guid>
		<description><![CDATA[While one of the performance best practices that is always recommended is the use of bind variables over the literals, Optimizer plan unstability was one of the problems faced by many Oracle 10g shops. When queries that normally perform well, suddenly stopped performing, very often it is found that this bad performance is being observed [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1591&subd=gavinsoorma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>While one of the performance best practices that is always recommended is the use of bind variables over the literals, Optimizer plan unstability was one of the problems faced by many Oracle 10g shops. When queries that normally perform well, suddenly stopped performing, very often it is found that this bad performance is being observed only for a few or specific parameters or values. And this is particularly so on tables with highly skewed data especially the columns which are being referenced via the WHERE clause.</p>
<p>In Oracle 11g however, with Adaptive Cursor Sharing, if the optimizer observes a sub-optimal plan for a particular bind variable value, it will enable particular bind variables or range of bind variable values to use a different execution plan for the same SQL statement.</p>
<p>To illustrate the 11g Adaptive Cursor Sharing, we will create a table called MYOBJECTS which is based on the ALL_OBJECTS view. The data in the OBJECT_TYPE column is skewed &#8211; for example there are more than 50,000 rows with the value &#8216;SYNONYM&#8217; and only 1 row with the value &#8216;RULE&#8217;. The table has about 100,000 rows.</p>
<pre>
SQL&gt; conn sh/sh
Connected.

SQL&gt; create table myobjects
  2  as select * from all_objects;

Table created.

SQL&gt; create index myobject_ind on myobjects (object_type);

Index created.
</pre>
<p>We then gather statistics on the table and see that histograms have been created on the table which has the skewed data.</p>
<pre>
SQL&gt; exec dbms_stats.gather_table_stats(null,'MYOBJECTS', METHOD_OPT =&gt; 'FOR ALL COLUMNS SIZE 10');

PL/SQL procedure successfully completed.

SQL&gt; SELECT column_name, histogram FROM user_tab_cols WHERE  table_name ='MYOBJECTS';

COLUMN_NAME                    HISTOGRAM
------------------------------ ---------------
OWNER                          HEIGHT BALANCED
OBJECT_NAME                    HEIGHT BALANCED
SUBOBJECT_NAME                 HEIGHT BALANCED
OBJECT_ID                      HEIGHT BALANCED
DATA_OBJECT_ID                 HEIGHT BALANCED
OBJECT_TYPE                    HEIGHT BALANCED
CREATED                        HEIGHT BALANCED
LAST_DDL_TIME                  HEIGHT BALANCED
TIMESTAMP                      HEIGHT BALANCED
STATUS                         FREQUENCY
TEMPORARY                      FREQUENCY
GENERATED                      FREQUENCY
SECONDARY                      FREQUENCY
</pre>
<p>If we query the MYOBJECTS Table using the predicate &#8216;RULE&#8217;, we find that an INDEX RANGE SCAN using the MYOBJECTS_IND index is being carried out by the optimizer.</p>
<p> If we change the predicate to &#8216;SYNONYM&#8217; we find that a FULL TABLE SCAN is being performed instead which is the expected behaviour given the distribution of rows in the table.</p>
<pre>
SQL&gt; explain plan for
  2  select * from myobjects where object_type='RULE';

Explained.

SQL&gt; set linesize 120
SQL&gt; select * from table(dbms_xplan.display);

PLAN_TABLE_OUTPUT
---------------------------------------------------------------------------------------------
Plan hash value: 2533318700

--------------------------------------------------------------------------------------------
| Id  | Operation                   | Name         | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT            |              |  1612 |   147K|    56   (0)| 00:00:01 |
|   1 |  TABLE ACCESS BY INDEX ROWID| MYOBJECTS    |  1612 |   147K|    56   (0)| 00:00:01 |
|*  2 |   INDEX RANGE SCAN          | MYOBJECT_IND |  1612 |       |     5   (0)| 00:00:01 |
--------------------------------------------------------------------------------------------

SQL&gt;  explain plan for
  2  select * from myobjects where object_type='SYNONYM';

Explained.

SQL&gt; select * from table(dbms_xplan.display);

PLAN_TABLE_OUTPUT
------------------------------------------------------------------------------------------------
Plan hash value: 2581838392

-------------------------------------------------------------------------------
| Id  | Operation         | Name      | Rows  | Bytes | Cost (%CPU)| Time     |
-------------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |           | 34398 |  3157K|   284   (2)| 00:00:04 |
|*  1 |  TABLE ACCESS FULL| MYOBJECTS | 34398 |  3157K|   284   (2)| 00:00:04 |
-------------------------------------------------------------------------------
</pre>
<p>Let us now see how the optimizer handles bind variables and how it performs the task of bind variable peeking. In the first case, the variable v_obj_type is assigned the value &#8216;SYNONYM&#8217; and in the second case the same variable is assigned the value &#8216;RULE&#8217;.</p>
<p>Remember, when literals were being used, using the value &#8216;RULE&#8217; in the WHERE clause resulted in an index range scan, while usage of the value &#8216;SYNONYM&#8217; resulted in a full table scan.</p>
<pre>
SQL&gt; VARIABLE v_obj_type VARCHAR2(10)
SQL&gt; EXEC :v_obj_type := 'SYNONYM';

PL/SQL procedure successfully completed.

SQL&gt; select * from myobjects where object_type=:v_obj_type;

40156 rows selected.

SQL&gt; select * from table(dbms_xplan.display_cursor);

PLAN_TABLE_OUTPUT
-----------------------------------------------------------------------------------------------
SQL_ID  5utj7m6zxjdsc, child number 0
-------------------------------------
select * from myobjects where object_type=:v_obj_type

Plan hash value: 2581838392

-------------------------------------------------------------------------------
| Id  | Operation         | Name      | Rows  | Bytes | Cost (%CPU)| Time     |
-------------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |           |       |       |   284 (100)|          |
|*  1 |  TABLE ACCESS FULL| MYOBJECTS | 34398 |  3157K|   284   (2)| 00:00:04 |
-------------------------------------------------------------------------------
</pre>
<p>Although the predicate is now the value &#8216;RULE&#8217; based on the bind variable that is being used here, we find that the optimizer is still performing a FULL TABLE SCAN, while in fact it should be actually performing an index scan. </p>
<p>But since bind peeking is being performed here, the optimizer will use the same plan even though the value of the variable is different. If the data is skewed as in this case, it can cause a lot of performance problems and optimizer unstability depending on which bind variable value is assigned at hard parse.</p>
<pre>
SQL&gt; VARIABLE v_obj_type VARCHAR2(10)
SQL&gt; EXEC :v_obj_type := 'RULE';

PL/SQL procedure successfully completed.

SQL&gt; select * from myobjects where object_type=:v_obj_type;

no rows selected

SQL&gt; /

no rows selected

SQL&gt; /

no rows selected

SQL&gt;  select * from table(dbms_xplan.display_cursor);

PLAN_TABLE_OUTPUT
----------------------------------------------------------------------------------------------
SQL_ID  5utj7m6zxjdsc, child number 0
-------------------------------------
select * from myobjects where object_type=:v_obj_type

Plan hash value: 2581838392

-------------------------------------------------------------------------------
| Id  | Operation         | Name      | Rows  | Bytes | Cost (%CPU)| Time     |
-------------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |           |       |       |   284 (100)|          |
|*  1 |  TABLE ACCESS FULL| MYOBJECTS | 34398 |  3157K|   284   (2)| 00:00:04 |
-------------------------------------------------------------------------------
</pre>
<p>But if we query the V$SQL view, we find that for this particular SQL_ID, the column IS_BIND_SENSITIVE shows &#8216;Y&#8217; but the column &#8216;IS_BIND_AWARE&#8217; still shows &#8216;N&#8217;.</p>
<p>This means that Oracle is aware that this query can require different execution plans based on the bind variable values but has not yet acted on this at this stage.</p>
<pre>
SQL&gt; SELECT sql_id, child_number, is_bind_sensitive, is_bind_aware
 from v$sql
 WHERE  sql_text ='select * from myobjects where object_type=:v_obj_type';  2    3

SQL_ID        CHILD_NUMBER I I
------------- ------------ - -
5utj7m6zxjdsc            0 Y N
</pre>
<p>We then execute the same SQL statement once again using the same bind variable value, and we find that this time a more optimal execution plan has been chosen which in this case is an INDEX RANGE SCAN</p>
<pre>
SQL&gt;  VARIABLE v_obj_type VARCHAR2(10)
SQL&gt; EXEC :v_obj_type := 'RULE';

PL/SQL procedure successfully completed.

SQL&gt; select * from myobjects where object_type=:v_obj_type;

no rows selected

SQL&gt; select * from table(dbms_xplan.display_cursor);

PLAN_TABLE_OUTPUT
-----------------------------------------------------------------------------------------------
SQL_ID  5utj7m6zxjdsc, child number 1
-------------------------------------
select * from myobjects where object_type=:v_obj_type

Plan hash value: 2745750972

---------------------------------------------------------------------------------------------
| Id  | Operation                   | Name          | Rows  | Bytes | Cost (%CPU)| Time     |
---------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT            |               |       |       |    30 (100)|          |
|   1 |  TABLE ACCESS BY INDEX ROWID| MYOBJECTS     |   823 | 83946 |    30   (0)| 00:00:01 |

PLAN_TABLE_OUTPUT
-------------------------------------------------------------------------------------------------
|*  2 |   INDEX RANGE SCAN          | MYOBJECTS_IND |   823 |       |     3   (0)| 00:00:01 |
---------------------------------------------------------------------------------------------
</pre>
<p>If we now query the V$SQL view, we find that this optimizer change is also reflected in the column IS_BIND_SENSITIVE showing the value &#8216;Y&#8217; instead of &#8216;N&#8217; which was the earlier value.</p>
<pre>
SQL&gt; SELECT sql_id, child_number, is_bind_sensitive, is_bind_aware
 from v$sql
 WHERE  sql_text ='select * from myobjects where object_type=:v_obj_type';  2    3

SQL_ID        CHILD_NUMBER I I
------------- ------------ - -
5utj7m6zxjdsc            0 Y N
5utj7m6zxjdsc            1 Y Y
</pre>
Posted in Oracle 11g  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gavinsoorma.wordpress.com/1591/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gavinsoorma.wordpress.com/1591/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gavinsoorma.wordpress.com/1591/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gavinsoorma.wordpress.com/1591/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gavinsoorma.wordpress.com/1591/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gavinsoorma.wordpress.com/1591/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gavinsoorma.wordpress.com/1591/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gavinsoorma.wordpress.com/1591/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gavinsoorma.wordpress.com/1591/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gavinsoorma.wordpress.com/1591/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1591&subd=gavinsoorma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.wordpress.com/2009/08/21/11g-adaptive-cursor-sharing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4c7ffc229f14367caa30864d6feb3ac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gavsal</media:title>
		</media:content>
	</item>
		<item>
		<title>DBUPGDIAG script to check integrity of database before 11g upgrade</title>
		<link>http://gavinsoorma.wordpress.com/2009/08/20/dbupgdiag-script-to-check-integrity-of-database-before-11g-upgrade/</link>
		<comments>http://gavinsoorma.wordpress.com/2009/08/20/dbupgdiag-script-to-check-integrity-of-database-before-11g-upgrade/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 01:48:21 +0000</pubDate>
		<dc:creator>Arjun  Raja</dc:creator>
				<category><![CDATA[Scripts]]></category>
		<category><![CDATA[11g upgrade]]></category>
		<category><![CDATA[dbupgdiag]]></category>

		<guid isPermaLink="false">http://gavinsoorma.wordpress.com/?p=1585</guid>
		<description><![CDATA[Script to check integrity of a 9i or 10g database before upgrade to 11g.
Run this script connected as sysdba in the 9i or 10g database.
NAME:  DBUPGDIAG.SQL  
This script can be downloaded from Oracle Metalink note 556610.1
&#8211; PURPOSE:
&#8211; This script is intended to provide a user friendly output to diagonise
&#8211; the status of the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1585&subd=gavinsoorma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Script to check integrity of a 9i or 10g database before upgrade to 11g.</p>
<p>Run this script connected as sysdba in the 9i or 10g database.</p>
<p>NAME:  DBUPGDIAG.SQL  </p>
<p>This script can be downloaded from Oracle Metalink note 556610.1</p>
<p>&#8211; PURPOSE:<br />
&#8211; This script is intended to provide a user friendly output to diagonise<br />
&#8211; the status of the database before (or) after upgrade. The script will<br />
&#8211; create a file called db_upg_diag__.log in your local<br />
&#8211; working directory. This does not make any DDL / DML modifications.<br />
&#8211;<br />
&#8211; This script will work in both Windows and Unix platforms from database<br />
&#8211; version 9.2 or higher.</p>
<p>col TODAY	NEW_VALUE	_DATE<br />
col VERSION NEW_VALUE _VERSION<br />
set termout off<br />
select to_char(SYSDATE,&#8217;fmMonth DD, YYYY&#8217;) TODAY from DUAL;<br />
select version from v$instance;<br />
set termout on<br />
set echo off<br />
set feedback off<br />
set head off<br />
set verify off<br />
Prompt<br />
PROMPT Enter location for Spooled output:<br />
Prompt<br />
DEFINE log_path = &amp;1<br />
column timecol new_value timestamp<br />
column spool_extension new_value suffix<br />
SELECT to_char(sysdate,&#8217;dd-Mon-yyyy_hhmi&#8217;) timecol,&#8217;.log&#8217; spool_extension FROM<br />
sys.dual;<br />
column output new_value dbname<br />
SELECT value || &#8216;_&#8217; output FROM v$parameter WHERE name = &#8216;db_name&#8217;;<br />
spool &amp;log_path/db_upg_diag_&amp;&amp;dbname&amp;&amp;timestamp&amp;&amp;suffix<br />
set linesize 150<br />
set pages 100<br />
set trim on<br />
set trims on<br />
col Compatible for a35<br />
col comp_id for a12<br />
col comp_name for a40<br />
col org_version for a11<br />
col prv_version for a11<br />
col owner for a12<br />
col object_name for a40<br />
col object_type for a40<br />
col Wordsize for a25<br />
col Metadata for a8<br />
col &#8216;Initial DB Creation Info&#8217; for a35<br />
col &#8216;Total Invalid JAVA objects&#8217; for a45<br />
col &#8216;Role&#8217; for a30<br />
col &#8216;User Existence&#8217; for a27<br />
col &#8220;JAVAVM TESTING&#8221; for a15<br />
Prompt<br />
Prompt<br />
set feedback off head off<br />
select LPAD(&#8216;*** Start of LogFile ***&#8217;,50) from dual;<br />
select LPAD(&#8216;Oracle Database Upgrade Diagnostic Utility&#8217;,44)||<br />
       LPAD(TO_CHAR(SYSDATE, &#8216;MM-DD-YYYY HH24:MI:SS&#8217;),26) from dual;<br />
Prompt<br />
Prompt ===============<br />
Prompt Database Uptime<br />
Prompt ===============<br />
SELECT to_char(startup_time, &#8216;HH24:MI DD-MON-YY&#8217;) &#8220;Startup Time&#8221;<br />
FROM v$instance;<br />
Prompt<br />
Prompt =================<br />
Prompt Database Wordsize<br />
Prompt =================<br />
SELECT distinct(&#8216;This is a &#8216; || (length(addr)*4) || &#8216;-bit database&#8217;) &#8220;WordSize&#8221;<br />
FROM v$process;<br />
Prompt<br />
Prompt ================<br />
Prompt Software Verison<br />
Prompt ================<br />
SELECT * FROM v$version;<br />
Prompt<br />
Prompt =============<br />
Prompt Compatibility<br />
Prompt =============<br />
SELECT &#8216;Compatibility is set as &#8216;||value Compatible<br />
FROM v$parameter WHERE name =&#8217;compatible&#8217;;<br />
Prompt<br />
Prompt ================<br />
Prompt Component Status<br />
Prompt ================<br />
Prompt<br />
SET SERVEROUTPUT ON;<br />
DECLARE</p>
<p>ORG_VERSION varchar2(12);<br />
PRV_VERSION varchar2(12);<br />
P_VERSION VARCHAR2(10);</p>
<p>BEGIN </p>
<p>SELECT version INTO p_version<br />
FROM registry$ WHERE cid=&#8217;CATPROC&#8217; ;</p>
<p>IF SUBSTR(p_version,1,5) = &#8216;9.2.0&#8242; THEN</p>
<p>DBMS_OUTPUT.PUT_LINE(RPAD(&#8216;Comp ID&#8217;, <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> ||RPAD(&#8216;Component&#8217;,35)||<br />
   RPAD(&#8216;Status&#8217;,10) ||RPAD(&#8216;Version&#8217;, 15));</p>
<p>DBMS_OUTPUT.PUT_LINE(RPAD(&#8216; &#8216;,8,&#8217;-') ||RPAD(&#8216; &#8216;,35,&#8217;-')||<br />
   RPAD(&#8216; &#8216;,10,&#8217;-') ||RPAD(&#8216; &#8216;,15,&#8217;-'));</p>
<p>FOR x in (SELECT SUBSTR(dr.comp_id,1,8) comp_id,<br />
 SUBSTR(dr.comp_name,1,35) comp_name,<br />
 dr.status Status,SUBSTR(dr.version,1,15) version<br />
 FROM dba_registry dr,registry$ r<br />
 WHERE dr.comp_id=r.cid and dr.comp_name=r.cname<br />
 ORDER BY 1)</p>
<p>LOOP</p>
<p>DBMS_OUTPUT.PUT_LINE(RPAD(SUBSTR(x.comp_id,1,8),8) ||<br />
   RPAD(SUBSTR(x.comp_name,1,35),35)||<br />
   RPAD(x.status,10) || RPAD(x.version, 15));<br />
END LOOP;</p>
<p>ELSIF SUBSTR(p_version,1,5) != &#8216;9.2.0&#8242; THEN</p>
<p>DBMS_OUTPUT.PUT_LINE(RPAD(&#8216;Comp ID&#8217;, <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> ||RPAD(&#8216;Component&#8217;,35)||<br />
   RPAD(&#8216;Status&#8217;,10) ||RPAD(&#8216;Version&#8217;, 15)||<br />
   RPAD(&#8216;Org_Version&#8217;,15)||RPAD(&#8216;Prv_Version&#8217;,15));</p>
<p>DBMS_OUTPUT.PUT_LINE(RPAD(&#8216; &#8216;,8,&#8217;-') ||RPAD(&#8216; &#8216;,35,&#8217;-')||<br />
   RPAD(&#8216; &#8216;,10,&#8217;-')||RPAD(&#8216; &#8216;,15,&#8217;-')||RPAD(&#8216; &#8216;,15,&#8217;-')||<br />
   RPAD(&#8216; &#8216;,15,&#8217;-'));</p>
<p>FOR y in (SELECT SUBSTR(dr.comp_id,1,8) comp_id,<br />
 SUBSTR(dr.comp_name,1,35) comp_name, dr.status Status,<br />
 SUBSTR(dr.version,1,11) version,org_version,prv_version<br />
 FROM dba_registry dr,registry$ r<br />
 WHERE dr.comp_id=r.cid and dr.comp_name=r.cname<br />
 ORDER BY 1)</p>
<p>LOOP</p>
<p>DBMS_OUTPUT.PUT_LINE(RPAD(substr(y.comp_id,1,8), <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> ||<br />
    RPAD(substr(y.comp_name,1,35),35)||RPAD(y.status,10) ||<br />
    RPAD(y.version, 15)||RPAD(y.org_version,15)||RPAD(y.prv_version,15));</p>
<p>END LOOP;</p>
<p>END IF;<br />
END;<br />
/<br />
SET SERVEROUTPUT OFF<br />
Prompt<br />
Prompt<br />
Prompt ======================================================<br />
Prompt List of Invalid Database Objects Owned by SYS / SYSTEM<br />
Prompt ======================================================<br />
Prompt<br />
set head on<br />
SELECT case count(object_name)<br />
WHEN 0 THEN &#8216;There are no Invalid Objects&#8217;<br />
ELSE &#8216;There are &#8216;||count(object_name)||&#8217; Invalid objects&#8217;<br />
END &#8220;Number of Invalid Objects&#8221;<br />
FROM dba_objects<br />
WHERE status=&#8217;INVALID&#8217;<br />
AND owner in (&#8216;SYS&#8217;,'SYSTEM&#8217;);<br />
Prompt<br />
DOC<br />
################################################################</p>
<p> If there are no Invalid objects below will result in zero rows.</p>
<p>################################################################<br />
#<br />
Prompt<br />
set feedback on<br />
SELECT owner,object_name,object_type<br />
FROM dba_objects<br />
WHERE status=&#8217;INVALID&#8217;<br />
AND owner in (&#8216;SYS&#8217;,'SYSTEM&#8217;)<br />
ORDER BY owner,object_type;<br />
set feedback off<br />
Prompt<br />
Prompt ================================<br />
Prompt List of Invalid Database Objects<br />
Prompt ================================<br />
Prompt<br />
set head on<br />
SELECT case count(object_name)<br />
WHEN 0 THEN &#8216;There are no Invalid Objects&#8217;<br />
ELSE &#8216;There are &#8216;||count(object_name)||&#8217; Invalid objects&#8217;<br />
END &#8220;Number of Invalid Objects&#8221;<br />
FROM dba_objects<br />
WHERE status=&#8217;INVALID&#8217;<br />
AND owner not in (&#8216;SYS&#8217;,'SYSTEM&#8217;);<br />
Prompt<br />
DOC<br />
################################################################</p>
<p> If there are no Invalid objects below will result in zero rows.</p>
<p>################################################################<br />
#<br />
Prompt<br />
set feedback on<br />
SELECT owner,object_name,object_type<br />
FROM dba_objects<br />
WHERE status=&#8217;INVALID&#8217;<br />
AND owner not in (&#8216;SYS&#8217;,'SYSTEM&#8217;)<br />
ORDER BY owner,object_type;<br />
set feedback off<br />
Prompt<br />
Prompt ==============================================================<br />
Prompt Identifying whether a database was created as 32-bit or 64-bit<br />
Prompt ==============================================================<br />
Prompt<br />
DOC<br />
###########################################################################</p>
<p> Result referencing the string &#8216;B023&#8242; ==&gt; Database was created as 32-bit<br />
 Result referencing the string &#8216;B047&#8242; ==&gt; Database was created as 64-bit<br />
 When String results in &#8216;B023&#8242; and when upgrading database to 10.2.0.3.0<br />
 (64-bit) , For known issue refer below articles</p>
<p> Note 412271.1 ORA-600 [22635] and ORA-600 [KOKEIIX1] Reported While<br />
               Upgrading Or Patching Databases To 10.2.0.3<br />
 Note 579523.1 ORA-600 [22635], ORA-600 [KOKEIIX1], ORA-7445 [KOPESIZ] and<br />
              OCI-21500 [KOXSIHREAD1] Reported While Upgrading To 11.1.0.6</p>
<p>###########################################################################<br />
#<br />
Prompt<br />
SELECT SUBSTR(metadata,109,4) &#8220;Metadata&#8221;,<br />
CASE SUBSTR(metadata,109,4)<br />
WHEN &#8216;B023&#8242; THEN &#8216;Database was created as 32-bit&#8217;<br />
WHEN &#8216;B047&#8242; THEN &#8216;Database was created as 64-bit&#8217;<br />
ELSE &#8216;Metadata not Matching&#8217;<br />
END &#8220;Initial DB Creation Info&#8221;<br />
FROM sys.kopm$;<br />
Prompt<br />
Prompt ===================================================<br />
Prompt Number of Duplicate Objects Owned by SYS and SYSTEM<br />
Prompt ===================================================<br />
Prompt<br />
Prompt Counting duplicate objects &#8230;.<br />
Prompt<br />
SELECT count(1)<br />
FROM dba_objects<br />
WHERE object_name||object_type in<br />
   (SELECT object_name||object_type<br />
    from dba_objects<br />
    where owner = &#8216;SYS&#8217;)<br />
and owner = &#8216;SYSTEM&#8217;;<br />
Prompt<br />
Prompt =========================================<br />
Prompt Duplicate Objects Owned by SYS and SYSTEM<br />
Prompt =========================================<br />
Prompt<br />
Prompt Querying duplicate objects &#8230;.<br />
Prompt<br />
SELECT object_name, object_type<br />
FROM dba_objects<br />
WHERE object_name||object_type in<br />
   (SELECT object_name||object_type<br />
    FROM dba_objects<br />
    WHERE owner = &#8216;SYS&#8217;)<br />
AND owner = &#8216;SYSTEM&#8217;;<br />
Prompt<br />
DOC</p>
<p>################################################################################</p>
<p> If any objects found please follow below article.<br />
 Note 1030426.6 How to Clean Up Duplicate Objects Owned by SYS and SYSTEM schema<br />
 Read the Exceptions carefully before taking actions.</p>
<p>################################################################################<br />
#<br />
Prompt<br />
Prompt ================<br />
Prompt JVM Verification<br />
Prompt ================<br />
Prompt<br />
SET SERVEROUTPUT ON<br />
DECLARE</p>
<p>V_CT NUMBER;<br />
P_VERSION VARCHAR2(10);</p>
<p>BEGIN</p>
<p>&#8211; If so, get the version of the JAVAM component<br />
EXECUTE IMMEDIATE &#8216;SELECT version FROM registry$ WHERE cid=&#8221;JAVAVM&#8221;<br />
		   AND status  99&#8242; INTO p_version;</p>
<p>SELECT count(*) INTO v_ct FROM dba_objects<br />
WHERE object_type LIKE &#8216;%JAVA%&#8217; AND owner=&#8217;SYS&#8217;;</p>
<p>IF SUBSTR(p_version,1,5) = &#8216;8.1.7&#8242; THEN<br />
	IF v_ct&gt;=6787 THEN<br />
	DBMS_OUTPUT.PUT_LINE(&#8216;JAVAVM &#8211; Installed properly&#8217;);<br />
	ELSE<br />
	DBMS_OUTPUT.PUT_LINE(&#8216;JAVAVM &#8211; Not Installed properly&#8217;);<br />
	END IF;<br />
ELSIF SUBSTR(p_version,1,5) = &#8216;9.0.1&#8242; THEN<br />
	IF v_ct&gt;=8585 THEN<br />
	DBMS_OUTPUT.PUT_LINE(&#8216;JAVAVM &#8211; Installed properly&#8217;);<br />
	ELSE<br />
	DBMS_OUTPUT.PUT_LINE(&#8216;JAVAVM &#8211; Not Installed properly&#8217;);<br />
	END IF;<br />
ELSIF SUBSTR(p_version,1,5) = &#8216;9.2.0&#8242; THEN<br />
	IF v_ct&gt;=8585 THEN<br />
	DBMS_OUTPUT.PUT_LINE(&#8216;JAVAVM &#8211; Installed properly&#8217;);<br />
	ELSE<br />
	DBMS_OUTPUT.PUT_LINE(&#8216;JAVAVM &#8211; Not Installed properly&#8217;);<br />
	END IF;<br />
ELSIF SUBSTR(p_version,1,6) = &#8216;10.1.0&#8242; THEN<br />
	IF v_ct&gt;=13866 THEN<br />
	DBMS_OUTPUT.PUT_LINE(&#8216;JAVAVM &#8211; Installed properly&#8217;);<br />
	ELSE<br />
	DBMS_OUTPUT.PUT_LINE(&#8216;JAVAVM &#8211; Not Installed properly&#8217;);<br />
	END IF;<br />
ELSIF SUBSTR(p_version,1,6) = &#8216;10.2.0&#8242; THEN<br />
	IF v_ct&gt;=14113 THEN<br />
	DBMS_OUTPUT.PUT_LINE(&#8216;JAVAVM &#8211; Installed properly&#8217;);<br />
	ELSE<br />
	DBMS_OUTPUT.PUT_LINE(&#8216;JAVAVM &#8211; Not Installed properly&#8217;);<br />
	END IF;<br />
END IF;</p>
<p>EXCEPTION WHEN NO_DATA_FOUND THEN<br />
	DBMS_OUTPUT.PUT_LINE(&#8216;JAVAVM &#8211; NOT Installed. Below results can be ignored&#8217;);</p>
<p>END;<br />
/<br />
SET SERVEROUTPUT OFF<br />
Prompt<br />
Prompt ================================================<br />
Prompt Checking Existence of Java-Based Users and Roles<br />
Prompt ================================================<br />
Prompt<br />
DOC</p>
<p>################################################################################</p>
<p> There should not be any Java Based users for database version 9.0.1 and above.<br />
 If any users found, it is faulty JVM.</p>
<p>################################################################################<br />
#</p>
<p>Prompt<br />
SELECT CASE count(username)<br />
WHEN 0 THEN &#8216;No Java Based Users&#8217;<br />
ELSE &#8216;There are &#8216;||count(*)||&#8217; JAVA based users&#8217;<br />
END &#8220;User Existence&#8221;<br />
FROM dba_users WHERE username LIKE &#8216;%AURORA%&#8217; AND username LIKE &#8216;%OSE%&#8217;;<br />
Prompt<br />
DOC</p>
<p>###############################################################</p>
<p> Healthy JVM Should contain Six Roles.<br />
 If there are more or less than six role, JVM is inconsistent.</p>
<p>###############################################################<br />
#</p>
<p>Prompt<br />
SELECT CASE count(role)<br />
WHEN 0 THEN &#8216;No JAVA related Roles&#8217;<br />
ELSE &#8216;There are &#8216;||count(role)||&#8217; JAVA related roles&#8217;<br />
END &#8220;Role&#8221;<br />
FROM dba_roles<br />
WHERE role LIKE &#8216;%JAVA%&#8217;;<br />
Prompt<br />
Prompt Roles<br />
Prompt<br />
SELECT role FROM dba_roles WHERE role LIKE &#8216;%JAVA%&#8217;;<br />
set head off<br />
Prompt<br />
Prompt =========================================<br />
Prompt List of Invalid Java Objects owned by SYS<br />
Prompt =========================================<br />
SELECT CASE count(*)<br />
       WHEN 0 THEN &#8216;There are no SYS owned invalid JAVA objects&#8217;<br />
       ELSE &#8216;There are &#8216;||count(*)||&#8217; SYS owned invalid JAVA objects&#8217;<br />
       END &#8220;Total Invalid JAVA objects&#8221;<br />
FROM dba_objects<br />
WHERE object_type LIKE &#8216;%JAVA%&#8217;<br />
AND status=&#8217;INVALID&#8217;<br />
AND owner=&#8217;SYS&#8217;;<br />
Prompt<br />
DOC</p>
<p>#################################################################</p>
<p> Check the status of the main JVM interface packages DBMS_JAVA<br />
 and INITJVMAUX and make sure it is VALID.<br />
 If there are no Invalid objects below will result in zero rows.</p>
<p>#################################################################<br />
#<br />
Prompt<br />
set feedback on<br />
SELECT owner,object_name,object_type<br />
FROM dba_objects<br />
WHERE object_type LIKE &#8216;%JAVA%&#8217;<br />
AND status=&#8217;INVALID&#8217;<br />
AND owner=&#8217;SYS&#8217;;<br />
set feedback off<br />
Prompt<br />
Prompt INFO: Below query should succeed with &#8216;foo&#8217; as result.<br />
set heading on<br />
select dbms_java.longname(&#8216;foo&#8217;) &#8220;JAVAVM TESTING&#8221; from dual;<br />
set heading off<br />
Prompt </p>
<p>set feedback off head off<br />
select LPAD(&#8216;*** End of LogFile ***&#8217;,50) from dual;<br />
set feedback on head on<br />
Prompt<br />
spool off<br />
Prompt<br />
set heading off<br />
set heading off<br />
set feedback off<br />
select &#8216;Upload db_upg_diag_&amp;&amp;dbname&amp;&amp;timestamp&amp;&amp;suffix from &#8220;&amp;log_path&#8221; directory&#8217;<br />
from dual;<br />
set heading on<br />
set feedback on<br />
Prompt<br />
&#8211; &#8211; - &#8211; - &#8211; - &#8211; - &#8211; - &#8211; - &#8211; - &#8211; Script ends here &#8211; - &#8211; - &#8211; - &#8211; - &#8211; - &#8211; - &#8211; - </p>
Posted in Scripts  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gavinsoorma.wordpress.com/1585/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gavinsoorma.wordpress.com/1585/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gavinsoorma.wordpress.com/1585/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gavinsoorma.wordpress.com/1585/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gavinsoorma.wordpress.com/1585/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gavinsoorma.wordpress.com/1585/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gavinsoorma.wordpress.com/1585/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gavinsoorma.wordpress.com/1585/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gavinsoorma.wordpress.com/1585/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gavinsoorma.wordpress.com/1585/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1585&subd=gavinsoorma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.wordpress.com/2009/08/20/dbupgdiag-script-to-check-integrity-of-database-before-11g-upgrade/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1f41e3f69f27bbc7bfd135405ea56c62?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">arjunraja</media:title>
		</media:content>
	</item>
		<item>
		<title>ORA-27504 error creating ASM instance on 11g RAC</title>
		<link>http://gavinsoorma.wordpress.com/2009/08/19/ora-27504-error-creating-asm-instance-on-11g-rac/</link>
		<comments>http://gavinsoorma.wordpress.com/2009/08/19/ora-27504-error-creating-asm-instance-on-11g-rac/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 02:22:02 +0000</pubDate>
		<dc:creator>Gavin  Soorma</dc:creator>
				<category><![CDATA[Oracle 11g]]></category>
		<category><![CDATA[Real Application Clusters]]></category>
		<category><![CDATA[ASM]]></category>
		<category><![CDATA[no -o]]></category>
		<category><![CDATA[ora-27504]]></category>
		<category><![CDATA[RAC]]></category>

		<guid isPermaLink="false">http://gavinsoorma.wordpress.com/?p=1579</guid>
		<description><![CDATA[While creating the ASM instance using DBCA in an 11g RAC environment on 64 bit AIX 5L, we got the ORA-27504 error along with others as shown below.

The problem was caused by incorrect UDP and TCP packet settings and is documented in Metalink note 300956.1 
As root, the following changes need to be made 
# [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1579&subd=gavinsoorma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>While creating the ASM instance using DBCA in an 11g RAC environment on 64 bit AIX 5L, we got the ORA-27504 error along with others as shown below.</p>
<p><img src="http://gavinsoorma.files.wordpress.com/2009/08/asmdb7.jpg?w=754&#038;h=540" alt="asmdb7" title="asmdb7" width="754" height="540" class="aligncenter size-full wp-image-1578" /></img></p>
<p>The problem was caused by incorrect UDP and TCP packet settings and is documented in Metalink note <b>300956.1 </b></p>
<p>As root, the following changes need to be made </p>
<p># no -o tcp_sendspace=262144<br />
# no -o tcp_recvspace=262144<br />
# no -o udp_sendspace=65536<br />
# no -o udp_recvspace=262144<br />
# no -o rfc1323=1</p>
<p>Adding these entries to the /etc/rc.net will ensure that these parameters take effect on every machine reboot.</p>
Posted in Oracle 11g, Real Application Clusters  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gavinsoorma.wordpress.com/1579/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gavinsoorma.wordpress.com/1579/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gavinsoorma.wordpress.com/1579/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gavinsoorma.wordpress.com/1579/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gavinsoorma.wordpress.com/1579/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gavinsoorma.wordpress.com/1579/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gavinsoorma.wordpress.com/1579/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gavinsoorma.wordpress.com/1579/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gavinsoorma.wordpress.com/1579/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gavinsoorma.wordpress.com/1579/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1579&subd=gavinsoorma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.wordpress.com/2009/08/19/ora-27504-error-creating-asm-instance-on-11g-rac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4c7ffc229f14367caa30864d6feb3ac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gavsal</media:title>
		</media:content>

		<media:content url="http://gavinsoorma.files.wordpress.com/2009/08/asmdb7.jpg" medium="image">
			<media:title type="html">asmdb7</media:title>
		</media:content>
	</item>
		<item>
		<title>Using FLASHBACK to rollback a TRUNCATE</title>
		<link>http://gavinsoorma.wordpress.com/2009/08/18/using-flashback-to-rollback-a-truncate/</link>
		<comments>http://gavinsoorma.wordpress.com/2009/08/18/using-flashback-to-rollback-a-truncate/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 05:59:29 +0000</pubDate>
		<dc:creator>Gavin  Soorma</dc:creator>
				<category><![CDATA[Backup and Recovery]]></category>
		<category><![CDATA[High Availability]]></category>
		<category><![CDATA[flashback]]></category>
		<category><![CDATA[recover]]></category>
		<category><![CDATA[truncate]]></category>

		<guid isPermaLink="false">http://gavinsoorma.wordpress.com/?p=1558</guid>
		<description><![CDATA[This scenario will show how we can use a combination of FLASHBACK database and also recovery to take a database back in time to undo a TRUNCATE operation and then roll forward the database after the flashback operation to bring it to the current point in time.
INSERT ROWS INTO TABLE MYOBJ &#8211; THIS WILL BE [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1558&subd=gavinsoorma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This scenario will show how we can use a combination of FLASHBACK database and also recovery to take a database back in time to undo a TRUNCATE operation and then roll forward the database after the flashback operation to bring it to the current point in time.</p>
<p><strong>INSERT ROWS INTO TABLE MYOBJ &#8211; THIS WILL BE TRUNCATED</strong></p>
<pre>
SQL&gt; insert into scott.myobj select * from all_objects;

50496 rows created.

SQL&gt; /

50496 rows created.

SQL&gt; select count(*) from scott.myobj;

  COUNT(*)
----------
    100992
</pre>
<p><strong>OBTAIN THE CURRENT SCN &#8211; FLASHBACK WILL HAPPEN TO THIS SCN</strong></p>
<pre>
SQL&gt; select current_scn from v$database;

          CURRENT_SCN
---------------------
          15633908021

<strong>TRUNCATE THE TABLE</strong>

SQL&gt; truncate table scott.myobj;

Table truncated.

SQL&gt; select count(*) from scott.myobj;

  COUNT(*)
----------
         0
</pre>
<p><strong><br />
AT THE SAME TIME OTHER CHANGES ARE HAPPENING IN THE DATABASE AND THESE CHANGES WILL BE RECOVERED AFTER THE FLASHBACK IS DONE<br />
</strong></p>
<pre>
SQL&gt; insert into scott.myobj2 select * from scott.myobj2;

356874 rows created.

SQL&gt; /

713748 rows created.

SQL&gt; commit;

Commit complete.
</pre>
<p><strong>SHUTDOWN THE DATABASE AND PERFORM THE FLASHBACK TO THE SCN BEFORE THE TRUNCATE WAS DONE</strong></p>
<pre>
SQL&gt; shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL&gt; startup mount;
ORACLE instance started.

Total System Global Area  469762048 bytes
Fixed Size                  2084880 bytes
Variable Size             377491440 bytes
Database Buffers           83886080 bytes
Redo Buffers                6299648 bytes
Database mounted.

SQL&gt; FLASHBACK DATABASE TO SCN 15633908021;

Flashback complete.
</pre>
<p><strong>OPEN THE DATABASE IN READ ONLY MODE AND EXPORT THE TABLE THAT WAS TRUNCATED EARLIER. THIS TABLE WILL BE IMPORTED AFTER THE RECOVERY IS DONE</strong></p>
<pre>
SQL&gt; alter database open read only;

Database altered.

SQL&gt;  select count(*) from scott.myobj;

  COUNT(*)
----------
         100992

SQL&gt; quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
crashdb:/u03/oradata/crashdb/arch&gt; exp file=scott.dmp tables=myobj

Export: Release 10.2.0.4.0 - Production on Fri Feb 6 09:53:00 2009

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

Username: scott
Password:

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
server uses WE8ISO8859P1 character set (possible charset conversion)

About to export specified tables via Conventional Path ...
. . exporting table                          MYOBJ          100992 rows exported
Export terminated successfully without warnings.
</pre>
<p><strong>NOW SHUTDOWN THE DATABASE,STARTUP MOUNT AND PERFORM THE RECOVERY </strong></p>
<pre>
SQL&gt; shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL&gt; startup mount;
ORACLE instance started.

Total System Global Area  696254464 bytes
Fixed Size                  2086616 bytes
Variable Size             184551720 bytes
Database Buffers          503316480 bytes
Redo Buffers                6299648 bytes
Database mounted.
SQL&gt; recover database;
Media recovery complete.
SQL&gt; alter database open;

Database altered.
</pre>
<p><strong>AS EXPECTED TABLE MYOBJ WHICH WAS TRUNCATED NOW AGAIN HAS 0 ROWS AFTER THE RECOVERY &#8211; WE CAN IMPORT THE DUMP WE TOOK AFTER THE FLASHBACK</strong></p>
<pre>
SQL&gt; select count(*) from scott.myobj;

  COUNT(*)
----------
         0
</pre>
<p><strong>CONFIRM THAT OTHER COMMITTED CHANGES IN THE DATABASE HAVE BEEN RECOVERED </strong></p>
<pre>
SQL&gt; select count(*) from scott.myobj2;

  COUNT(*)
----------
  713748
</pre>
Posted in Backup and Recovery, High Availability  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gavinsoorma.wordpress.com/1558/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gavinsoorma.wordpress.com/1558/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gavinsoorma.wordpress.com/1558/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gavinsoorma.wordpress.com/1558/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gavinsoorma.wordpress.com/1558/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gavinsoorma.wordpress.com/1558/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gavinsoorma.wordpress.com/1558/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gavinsoorma.wordpress.com/1558/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gavinsoorma.wordpress.com/1558/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gavinsoorma.wordpress.com/1558/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1558&subd=gavinsoorma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.wordpress.com/2009/08/18/using-flashback-to-rollback-a-truncate/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4c7ffc229f14367caa30864d6feb3ac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gavsal</media:title>
		</media:content>
	</item>
		<item>
		<title>11g RAC  Software Relink Error on AIX</title>
		<link>http://gavinsoorma.wordpress.com/2009/08/18/11g-rac-software-relink-error-on-aix/</link>
		<comments>http://gavinsoorma.wordpress.com/2009/08/18/11g-rac-software-relink-error-on-aix/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 01:04:02 +0000</pubDate>
		<dc:creator>Gavin  Soorma</dc:creator>
				<category><![CDATA[Oracle 11g]]></category>
		<category><![CDATA[Real Application Clusters]]></category>
		<category><![CDATA[11g RAC]]></category>
		<category><![CDATA[ld:0706]]></category>
		<category><![CDATA[relink]]></category>
		<category><![CDATA[rsct.basic.rte]]></category>

		<guid isPermaLink="false">http://gavinsoorma.wordpress.com/?p=1537</guid>
		<description><![CDATA[While relinking the Oracle 11g RAC software on 64 bit AIX platform, we got the error as shown below:

Looking at the installation log we found the following lines:
ld: 0706-006 Cannot find or open library file: -l ha_gs_r
ld:open(): A file or directory in the path name does not exist.
ld: 0706-006 Cannot find or open library file: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1537&subd=gavinsoorma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>While relinking the Oracle 11g RAC software on 64 bit AIX platform, we got the error as shown below:</p>
<p><img src="http://gavinsoorma.files.wordpress.com/2009/08/ora11.jpg?w=648&#038;h=514" alt="ora11" title="ora11" width="648" height="514" class="aligncenter size-full wp-image-1536" /></img></p>
<p>Looking at the installation log we found the following lines:</p>
<p>ld: 0706-006 Cannot find or open library file: -l ha_gs_r<br />
ld:open(): A file or directory in the path name does not exist.<br />
ld: 0706-006 Cannot find or open library file: -l ha_em_r<br />
ld:open(): A file or directory in the path name does not exist.<br />
make: 1254-004 The error code from the last command is 255 </p>
<p>The cause of this error is that a particluar fileset <b>rsct.basic.rte </b> which is required specifically for a 11g RAC installation has not been installed at the OS level. After the fileset was installed we could relink the software without the same ld errors as mentioned above.</p>
<p>We can check if the fileset has been installed by running the command &#8216;lslpp&#8217; as shown below.</p>
<p>testdb:/u02/oradata/testdb&gt; <strong>lslpp -l rsct.basic.rte</strong><br />
lslpp: Fileset rsct.basic.rte not installed.</p>
<p>After the fileset is installed we can confirm the same&#8230;</p>
<pre>
middba1:/u01/oracle/dump&gt; <strong>lslpp -l rsct.basic.rte</strong>
 Fileset                      Level  State      Description
  ----------------------------------------------------------------------------
Path: /usr/lib/objrepos
  rsct.basic.rte            2.4.10.0  COMMITTED  RSCT Basic Function
</pre>
<p>This package is part of the OS Patch <b>IY98287</b> which is one of the mandatory required patches to be installed on AIX if we are configuring a 11g RAC environment.</p>
<p>This is also documented in <b> Metalink Note 471701.1</b></p>
Posted in Oracle 11g, Real Application Clusters  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gavinsoorma.wordpress.com/1537/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gavinsoorma.wordpress.com/1537/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gavinsoorma.wordpress.com/1537/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gavinsoorma.wordpress.com/1537/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gavinsoorma.wordpress.com/1537/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gavinsoorma.wordpress.com/1537/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gavinsoorma.wordpress.com/1537/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gavinsoorma.wordpress.com/1537/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gavinsoorma.wordpress.com/1537/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gavinsoorma.wordpress.com/1537/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1537&subd=gavinsoorma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.wordpress.com/2009/08/18/11g-rac-software-relink-error-on-aix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4c7ffc229f14367caa30864d6feb3ac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gavsal</media:title>
		</media:content>

		<media:content url="http://gavinsoorma.files.wordpress.com/2009/08/ora11.jpg" medium="image">
			<media:title type="html">ora11</media:title>
		</media:content>
	</item>
		<item>
		<title>11g RAC Transparent Application Failover (TAF)</title>
		<link>http://gavinsoorma.wordpress.com/2009/08/14/11g-rac-transparent-application-failover-taf/</link>
		<comments>http://gavinsoorma.wordpress.com/2009/08/14/11g-rac-transparent-application-failover-taf/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 03:17:51 +0000</pubDate>
		<dc:creator>Gavin  Soorma</dc:creator>
				<category><![CDATA[High Availability]]></category>
		<category><![CDATA[Oracle 11g]]></category>
		<category><![CDATA[Real Application Clusters]]></category>
		<category><![CDATA[11G]]></category>
		<category><![CDATA[failover]]></category>
		<category><![CDATA[service relocate]]></category>
		<category><![CDATA[TAF]]></category>

		<guid isPermaLink="false">http://gavinsoorma.wordpress.com/?p=1530</guid>
		<description><![CDATA[This example illustrates Transparent Application Failover (TAF) in a two node AIX 11g RAC configuration. 
The database name is racdb and the two instances are racdb1 and racdb2.
Node 1 &#8211; middba1 which hosts instance racdb1.
Node2 &#8211; middba2 which hosts instance racdb2
We have defined two services racdb1 and racdb2. For service racdb1 the preferred instance is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1530&subd=gavinsoorma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This example illustrates Transparent Application Failover (TAF) in a two node AIX 11g RAC configuration. </p>
<p>The database name is racdb and the two instances are racdb1 and racdb2.</p>
<p>Node 1 &#8211; middba1 which hosts instance racdb1.<br />
Node2 &#8211; middba2 which hosts instance racdb2</p>
<p>We have defined two services racdb1 and racdb2. For service racdb1 the preferred instance is racdb1 and<br />
for service racdb2 the preferred instance is racdb2.</p>
<p>The following srvctl commands illustrates the same.</p>
<p>middba1:/u01/oracle/dump&gt; <strong>srvctl status service -d racdb -s racdb1</strong><br />
Service racdb1 is running on instance(s) racdb1</p>
<p>middba1:/u01/oracle/dump&gt; <strong>srvctl config service -d racdb -s racdb1</strong><br />
racdb1 PREF: racdb1 AVAIL: racdb2</p>
<p>middba1:/u01/oracle/dump&gt; <strong>srvctl status service -d racdb -s racdb2</strong><br />
Service racdb2 is running on instance(s) racdb2</p>
<p>middba1:/u01/oracle/dump&gt; <strong>srvctl config service -d racdb -s racdb2</strong><br />
racdb2 PREF: racdb2 AVAIL: racdb1</p>
<p>From a SQL*PLUS client, we establish a session as user SYSTEM  using the service racdb1. Note the machine name where this service is running from.</p>
<pre>
testdb:/u01/oracle&gt; <strong>sqlplus system/xxx@racdb1</strong>

SQL*Plus: Release 11.1.0.6.0 - Production on Fri Aug 14 10:37:03 2009

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Partitioning, Real Application Clusters and Real Application Testing options

SQL&gt; select host_name from v$instance;

HOST_NAME
----------------------------------------------------------------
middba1
</pre>
<p>We then execute a long running SELECT statement </p>
<pre>
SQL&gt; select * from sh.sales;
</pre>
<p>While this statement is running we reboot the node middba1 where this service is currently connected to.</p>
<p>We will note that the screen will <strong>momentarily freeze </strong>while the service gets relocated to the other functional node racdb2 and then the query continues from where it got interrupted. The session will not get disconnected &#8211; so for the end user it is transparent from which instance the query is being serviced.</p>
<p>If we check the status of the cluster resources, we will find that the VIP from node middba1 has now relocated to middba2. Other resources that were originally running from node middba1 are now offline.</p>
<pre>
middba2:/u01/oracle&gt; crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora....SM1.asm application    ONLINE    OFFLINE
ora....A1.lsnr application    ONLINE    OFFLINE
ora....ba1.gsd application    ONLINE    OFFLINE
ora....ba1.ons application    ONLINE    OFFLINE
<strong>ora....ba1.vip application    ONLINE    ONLINE    middba2</strong>
ora....SM2.asm application    ONLINE    ONLINE    middba2
ora....A2.lsnr application    ONLINE    ONLINE    middba2
ora....ba2.gsd application    ONLINE    ONLINE    middba2
ora....ba2.ons application    ONLINE    ONLINE    middba2
<strong>ora....ba2.vip application    ONLINE    ONLINE    middba2</strong>
ora.racdb.db   application    ONLINE    ONLINE    middba2
ora....cdb1.cs application    ONLINE    ONLINE    middba2
ora....b1.inst application    ONLINE    OFFLINE
ora....db1.srv application    ONLINE    ONLINE    middba2
ora....cdb2.cs application    ONLINE    ONLINE    middba2
ora....b2.inst application    ONLINE    ONLINE    middba2
ora....db2.srv application    ONLINE    ONLINE    middba2
</pre>
<p>If we check the status of the service, we will find that the service racdb1 is now running on node middba2 connecting to the instance racdb2.</p>
<p>middba2:/u01/oracle&gt; <strong>srvctl status service -d racdb -s racdb1</strong><br />
Service racdb1 is running on instance(s) racdb2</p>
<p>Once the node middba1 which was rebooted finally does come online, we will find that the VIP will relocate<br />
to its original node middba1 once the cluster services are brought online after the reboot.</p>
<pre>
middba2:/u01/oracle&gt; crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora....SM1.asm application    ONLINE    ONLINE    middba1
ora....A1.lsnr application    ONLINE    ONLINE    middba1
ora....ba1.gsd application    ONLINE    ONLINE    middba1
ora....ba1.ons application    ONLINE    ONLINE    middba1
<strong>ora....ba1.vip application    ONLINE    ONLINE    middba1</strong>
ora....SM2.asm application    ONLINE    ONLINE    middba2
ora....A2.lsnr application    ONLINE    ONLINE    middba2
ora....ba2.gsd application    ONLINE    ONLINE    middba2
ora....ba2.ons application    ONLINE    ONLINE    middba2
<strong>ora....ba2.vip application    ONLINE    ONLINE    middba2</strong>
ora.racdb.db   application    ONLINE    ONLINE    middba2
ora....cdb1.cs application    ONLINE    ONLINE    middba2
ora....b1.inst application    ONLINE    ONLINE    middba1
ora....db1.srv application    ONLINE    ONLINE    middba2
ora....cdb2.cs application    ONLINE    ONLINE    middba2
ora....b2.inst application    ONLINE    ONLINE    middba2
ora....db2.srv application    ONLINE    ONLINE    middba2
</pre>
<p>Note however, that the <strong>service racdb1 will continue running on node middba2 </strong>(instance racdb2)even though the original node which it was running on middba1 has been brought online.</p>
<p>We will have to relocate the service back to its original node using the srvctl command</p>
<p>middba1:/u01/oracle&gt; <strong>srvctl relocate service -d racdb -s racdb1 -i racdb2 -t racdb1</strong></p>
Posted in High Availability, Oracle 11g, Real Application Clusters  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gavinsoorma.wordpress.com/1530/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gavinsoorma.wordpress.com/1530/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gavinsoorma.wordpress.com/1530/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gavinsoorma.wordpress.com/1530/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gavinsoorma.wordpress.com/1530/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gavinsoorma.wordpress.com/1530/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gavinsoorma.wordpress.com/1530/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gavinsoorma.wordpress.com/1530/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gavinsoorma.wordpress.com/1530/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gavinsoorma.wordpress.com/1530/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gavinsoorma.wordpress.com&blog=8224194&post=1530&subd=gavinsoorma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gavinsoorma.wordpress.com/2009/08/14/11g-rac-transparent-application-failover-taf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4c7ffc229f14367caa30864d6feb3ac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gavsal</media:title>
		</media:content>
	</item>
	</channel>
</rss>