<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5288221630246612894</id><updated>2011-12-08T14:19:33.277-08:00</updated><title type='text'>ROHIT Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default?start-index=101&amp;max-results=100'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>127</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-146761056555090506</id><published>2011-12-08T14:15:00.000-08:00</published><updated>2011-12-08T14:19:33.445-08:00</updated><title type='text'>Upgrading the Protection Mode and Downgrading the Protection Mode</title><content type='html'>Upgrading the Protection Mode&lt;br /&gt;Use the following steps to upgrade the protection mode from the default of Maximum Performance. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Identify the current configuration: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Primary Database (TNS Service Name):    TESTDB_VMLINUX3.IDEVELOPMENT.INFO &lt;br /&gt;Standby Database (TNS Service Name):    TESTDB_VMLINUX4.IDEVELOPMENT.INFO &lt;br /&gt;Current Protection Mode:    Maximum Performance mode using ARCH &lt;br /&gt;&lt;br /&gt;Both of the higher protection modes (Maximum Availability and Maximum Protection) require the use of standby redo logs on the destination standby database. If standby redo logs do not exist for the standby database, create them now. &lt;br /&gt;&lt;br /&gt;[Connect to the standby database]&lt;br /&gt;&lt;br /&gt;SQL&gt; connect sys/change_on_install@testdb_vmlinux4.idevelopment.info as sysdba&lt;br /&gt;&lt;br /&gt;[Verify if using oracle managed files]&lt;br /&gt;&lt;br /&gt;SQL&gt; select value from v$parameter where name = 'db_create_online_log_dest_1';&lt;br /&gt;&lt;br /&gt;VALUE&lt;br /&gt;-------------------&lt;br /&gt;/u02/oradata/TESTDB&lt;br /&gt;&lt;br /&gt;[Do any standby redo logs exist on the standby database?]&lt;br /&gt;&lt;br /&gt;SQL&gt; select group#, bytes, 'online' as type from v$log&lt;br /&gt;  2  union&lt;br /&gt;  3  select group#, bytes, 'standby' as type from v$standby_log&lt;br /&gt;  4  order by 1;&lt;br /&gt;&lt;br /&gt;    GROUP#      BYTES TYPE&lt;br /&gt;---------- ---------- -------&lt;br /&gt;         1  104857600 ONLINE&lt;br /&gt;         2  104857600 ONLINE&lt;br /&gt;         3  104857600 ONLINE&lt;br /&gt;&lt;br /&gt;[Need to first cancel Managed Recovery mode if it is running]&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database recover managed standby database cancel; &lt;br /&gt;&lt;br /&gt;[Create appropriate number standby redo log files on the standby database]&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database add standby logfile group 4 size 100m;&lt;br /&gt;SQL&gt; alter database add standby logfile group 5 size 100m;&lt;br /&gt;SQL&gt; alter database add standby logfile group 6 size 100m;&lt;br /&gt;SQL&gt; alter database add standby logfile group 7 size 100m;&lt;br /&gt;&lt;br /&gt;[Put standby database back into Managed Recovery mode]&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database recover managed standby database disconnect from session;&lt;br /&gt;&lt;br /&gt;[Verify new standby redo logs on standby database]&lt;br /&gt;&lt;br /&gt;SQL&gt; select group#, bytes, 'online' as type from v$log&lt;br /&gt;  2  union&lt;br /&gt;  3  select group#, bytes, 'standby' as type from v$standby_log&lt;br /&gt;  4  order by 1;&lt;br /&gt;&lt;br /&gt;    GROUP#      BYTES TYPE&lt;br /&gt;---------- ---------- -------&lt;br /&gt;         1  104857600 ONLINE&lt;br /&gt;         2  104857600 ONLINE&lt;br /&gt;         3  104857600 ONLINE&lt;br /&gt;         4  104857600 STANDBY&lt;br /&gt;         5  104857600 STANDBY&lt;br /&gt;         6  104857600 STANDBY&lt;br /&gt;         7  104857600 STANDBY&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ensure that the attributes for LOG_ARCHIVE_DEST_n are configured on the primary instance to support the desired protection mode. Also note that the destination standby database should be enabled to support the target protection mode as documented in this article. &lt;br /&gt;&lt;br /&gt;   For the mode of Maximum Protection, the standby database must be up and mounted! &lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Set the LOG_ARCHIVE_DEST_n initialization parameter on the primary database to support the required protection mode: &lt;br /&gt;&lt;br /&gt;[Connect to the primary database]&lt;br /&gt;&lt;br /&gt;SQL&gt; connect sys/change_on_install@testdb_vmlinux3.idevelopment.info as sysdba&lt;br /&gt;&lt;br /&gt;[Configure log transport services to support the desired protection mode]&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system set log_archive_dest_2='service=testdb_vmlinux4.idevelopment.info LGWR SYNC AFFIRM';&lt;br /&gt;SQL&gt; alter system set log_archive_dest_state_2=enable;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The primary database will need to be closed and then placed in the MOUNT stage. &lt;br /&gt;&lt;br /&gt;SQL&gt; shutdown immediate&lt;br /&gt;SQL&gt; startup mount&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;On the primary database, change the protection mode and open the database: &lt;br /&gt;&lt;br /&gt;For Maximum Protection mode: &lt;br /&gt;&lt;br /&gt;SQL&gt; alter database set standby database to maximize protection;&lt;br /&gt;SQL&gt; alter database open;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For Maximum Availability mode: &lt;br /&gt;&lt;br /&gt;SQL&gt; alter database set standby database to maximize availability;&lt;br /&gt;SQL&gt; alter database open;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Query the data dictionary on the primary database to verify the new protection mode: &lt;br /&gt;&lt;br /&gt;SQL&gt; SELECT PROTECTION_MODE, PROTECTION_LEVEL, DATABASE_ROLE FROM V$DATABASE;&lt;br /&gt;&lt;br /&gt;PROTECTION_MODE     PROTECTION_LEVEL    DATABASE_ROLE&lt;br /&gt;------------------- ------------------- --------------&lt;br /&gt;MAXIMUM PROTECTION  MAXIMUM PROTECTION  PRIMARY&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;(Optional) Although the steps in this section are optional, there are highly recommended so that the primary database can easily and quickly switchover to a standby role without the need for DBA intervention. For example, standby redo logs are only used on the physical standby database; however, creating and having standby redo logs ready to go on the physical primary database makes role transition much easier if the primary would every have to become the standby: &lt;br /&gt;&lt;br /&gt;[Connect to the primary database]&lt;br /&gt;&lt;br /&gt;SQL&gt; connect sys/change_on_install@testdb_vmlinux3.idevelopment.info as sysdba&lt;br /&gt;&lt;br /&gt;[Do any standby redo logs exist on the primary database?]&lt;br /&gt;&lt;br /&gt;SQL&gt; select group#, bytes, 'online' as type from v$log&lt;br /&gt;  2  union&lt;br /&gt;  3  select group#, bytes, 'standby' as type from v$standby_log&lt;br /&gt;  4  order by 1;&lt;br /&gt;&lt;br /&gt;    GROUP#      BYTES TYPE&lt;br /&gt;---------- ---------- -------&lt;br /&gt;         1  104857600 ONLINE&lt;br /&gt;         2  104857600 ONLINE&lt;br /&gt;         3  104857600 ONLINE&lt;br /&gt;&lt;br /&gt;[Create appropriate number standby redo log files on the primary database]&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database add standby logfile group 4 size 100m;&lt;br /&gt;SQL&gt; alter database add standby logfile group 5 size 100m;&lt;br /&gt;SQL&gt; alter database add standby logfile group 6 size 100m;&lt;br /&gt;SQL&gt; alter database add standby logfile group 7 size 100m;&lt;br /&gt;&lt;br /&gt;[Verify new standby redo logs on primary database]&lt;br /&gt;&lt;br /&gt;SQL&gt; select group#, bytes, 'online' as type from v$log&lt;br /&gt;  2  union&lt;br /&gt;  3  select group#, bytes, 'standby' as type from v$standby_log&lt;br /&gt;  4  order by 1;&lt;br /&gt;&lt;br /&gt;    GROUP#      BYTES TYPE&lt;br /&gt;---------- ---------- -------&lt;br /&gt;         1  104857600 ONLINE&lt;br /&gt;         2  104857600 ONLINE&lt;br /&gt;         3  104857600 ONLINE&lt;br /&gt;         4  104857600 STANDBY&lt;br /&gt;         5  104857600 STANDBY&lt;br /&gt;         6  104857600 STANDBY&lt;br /&gt;         7  104857600 STANDBY&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Also, on the standby database(s), configure the LOG_ARCHIVE_DEST_n parameter attributes so the Data Guard configuration can continue to operate in the new protection mode after a switchover: &lt;br /&gt;&lt;br /&gt;[Connect to the standby database]&lt;br /&gt;&lt;br /&gt;SQL&gt; connect sys/change_on_install@testdb_vmlinux4.idevelopment.info as sysdba&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system set log_archive_dest_2='service=testdb_vmlinux3.idevelopment.info LGWR SYNC AFFIRM';&lt;br /&gt;SQL&gt; alter system set log_archive_dest_state_2=defer;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Downgrading the Protection Mode&lt;br /&gt;Use the following steps to downgrade the protection mode from the current higher protection mode. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Identify the current configuration: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Primary Database (TNS Service Name):    TESTDB_VMLINUX3.IDEVELOPMENT.INFO &lt;br /&gt;Standby Database (TNS Service Name):    TESTDB_VMLINUX4.IDEVELOPMENT.INFO &lt;br /&gt;Current Protection Mode:    Maximum protection using LGWR SYNC AFFIRM &lt;br /&gt;&lt;br /&gt;Configure the attributes for LOG_ARCHIVE_DEST_n on the primary instance to support the new desired protection mode: &lt;br /&gt;&lt;br /&gt;[Connect to the primary database]&lt;br /&gt;&lt;br /&gt;SQL&gt; connect sys/change_on_install@testdb_vmlinux3.idevelopment.info as sysdba&lt;br /&gt;&lt;br /&gt;[Configure log transport services to support the desired protection mode]&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system set log_archive_dest_2='service=testdb_vmlinux4.idevelopment.info ARCH';&lt;br /&gt;SQL&gt; alter system set log_archive_dest_state_2=enable;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Shutdown and mount the primary and standby database: &lt;br /&gt;&lt;br /&gt;[Connect to the primary database]&lt;br /&gt;&lt;br /&gt;SQL&gt; connect sys/change_on_install@testdb_vmlinux3.idevelopment.info as sysdba&lt;br /&gt;SQL&gt; shutdown immediate&lt;br /&gt;SQL&gt; startup mount&lt;br /&gt;&lt;br /&gt;[Connect to the standby database]&lt;br /&gt;&lt;br /&gt;SQL&gt; connect sys/change_on_install@testdb_vmlinux4.idevelopment.info as sysdba&lt;br /&gt;SQL&gt; alter database recover managed standby database cancel;&lt;br /&gt;SQL&gt; shutdown immediate&lt;br /&gt;SQL&gt; startup nomount&lt;br /&gt;SQL&gt; alter database mount standby database;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Downgrade the primary database to the desired protection mode: &lt;br /&gt;&lt;br /&gt;[Connect to the primary database]&lt;br /&gt;&lt;br /&gt;SQL&gt; connect sys/change_on_install@testdb_vmlinux3.idevelopment.info as sysdba&lt;br /&gt;[For Maximum Performance mode]&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database set standby database to maximize performance;&lt;br /&gt;[For Maximum Availability mode]&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database set standby database to maximize availability;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Both of the higher protection modes (Maximum Availability and Maximum Protection) require the use of standby redo logs on the destination standby database. It you were to downgrade from Maximum Protection mode to Maximum Availability mode, you would need to keep the standby redo logs that exist for the standby database. If downgrading to Maximum Performance mode, you can drop the standby redo logs from the standby unless you are going to be configuring log transport services to use LGWR. For this example, I am going to be downgrading to maximum performance mode and using ARCH for log transport services and can therefore drop any standby redo logs from the standby database (and the primary if they exist): &lt;br /&gt;&lt;br /&gt;[Connect to the standby database]&lt;br /&gt;&lt;br /&gt;SQL&gt; connect sys/change_on_install@testdb_vmlinux4.idevelopment.info as sysdba&lt;br /&gt;&lt;br /&gt;[Drop any standby redo logs from the standby database]&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database drop standby logfile group 4;&lt;br /&gt;SQL&gt; alter database drop standby logfile group 5;&lt;br /&gt;SQL&gt; alter database drop standby logfile group 6;&lt;br /&gt;SQL&gt; alter database drop standby logfile group 7;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If standby redo logs exist on the primary and you are downgrading to Maximum Performance mode, they can be removed: &lt;br /&gt;&lt;br /&gt;[Connect to the primary database]&lt;br /&gt;&lt;br /&gt;SQL&gt; connect sys/change_on_install@testdb_vmlinux3.idevelopment.info as sysdba&lt;br /&gt;&lt;br /&gt;[Drop any standby redo logs from the primary database]&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database drop standby logfile group 4;&lt;br /&gt;SQL&gt; alter database drop standby logfile group 5;&lt;br /&gt;SQL&gt; alter database drop standby logfile group 6;&lt;br /&gt;SQL&gt; alter database drop standby logfile group 7;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Put the standby database in managed recovery mode and open the primary database with the new protection mode enabled: &lt;br /&gt;&lt;br /&gt;[Connect to the standby database]&lt;br /&gt;&lt;br /&gt;SQL&gt; connect sys/change_on_install@testdb_vmlinux4.idevelopment.info as sysdba&lt;br /&gt;SQL&gt; alter database recover managed standby database disconnect from session;&lt;br /&gt;&lt;br /&gt;[Connect to the primary database]&lt;br /&gt;&lt;br /&gt;SQL&gt; connect sys/change_on_install@testdb_vmlinux3.idevelopment.info as sysdba&lt;br /&gt;SQL&gt; alter database open;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Query the data dictionary on the primary database to verify the new protection mode: &lt;br /&gt;&lt;br /&gt;SQL&gt; select protection_mode, protection_level, database_role from v$database;&lt;br /&gt;&lt;br /&gt;PROTECTION_MODE      PROTECTION_LEVEL     DATABASE_ROLE&lt;br /&gt;-------------------- -------------------- --------------&lt;br /&gt;MAXIMUM PERFORMANCE  MAXIMUM PERFORMANCE  PRIMARY&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-146761056555090506?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/146761056555090506/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2011/12/upgrading-protection-mode-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/146761056555090506'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/146761056555090506'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2011/12/upgrading-protection-mode-and.html' title='Upgrading the Protection Mode and Downgrading the Protection Mode'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-519383302958367757</id><published>2011-12-08T13:53:00.000-08:00</published><updated>2011-12-08T13:54:35.425-08:00</updated><title type='text'>Different kind of protection modes Oracle offers in a Data Guard Environment</title><content type='html'>&lt;span style="font-family:times new roman;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:times new roman;"&gt;Maximum Protection—This mode offers the highest level of data protection. Data is synchronously transmitted to the standby database from the primary database and transactions are not committed on the primary database unless the redo data is available on at least one standby database configured in this mode. If the last standby database configured in this mode becomes unavailable, processing stops on the primary database. This mode ensures no-data-loss.&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:times new roman;"&gt;Maximum Availability—This mode is similar to the maximum protection mode, including zero data loss. However, if a standby database becomes unavailable (for example, because of network connectivity problems), processing continues on the primary database. When the fault is corrected, the standby database is automatically resynchronized with the primary database.&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:times new roman;"&gt;Maximum Performance—This mode offers slightly less data protection on the primary database, but higher performance than maximum availability mode. In this mode, as the primary database processes transactions, redo data is asynchronously shipped to the standby database. The commit operation of the primary database does not wait for the standby database to acknowledge receipt of redo data before completing write operations on the primary database. If any standby destination becomes unavailable, processing continues on the primary database and there is little effect on primary database performance.&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-519383302958367757?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/519383302958367757/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2011/12/different-kind-of-protection-modes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/519383302958367757'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/519383302958367757'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2011/12/different-kind-of-protection-modes.html' title='Different kind of protection modes Oracle offers in a Data Guard Environment'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-1295808743333194887</id><published>2011-11-15T07:07:00.000-08:00</published><updated>2011-11-15T07:09:03.378-08:00</updated><title type='text'>How to find log sequences used during the recovery</title><content type='html'>&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:trackmoves/&gt;   &lt;w:trackformatting/&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:donotpromoteqf/&gt;   &lt;w:lidthemeother&gt;EN-US&lt;/w:LidThemeOther&gt;   &lt;w:lidthemeasian&gt;X-NONE&lt;/w:LidThemeAsian&gt;   &lt;w:lidthemecomplexscript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:splitpgbreakandparamark/&gt;    &lt;w:dontvertaligncellwithsp/&gt;    &lt;w:dontbreakconstrainedforcedtables/&gt;    &lt;w:dontvertalignintxbx/&gt;    &lt;w:word11kerningpairs/&gt;    &lt;w:cachedcolbalance/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;   &lt;m:mathpr&gt;    &lt;m:mathfont val="Cambria Math"&gt;    &lt;m:brkbin val="before"&gt;    &lt;m:brkbinsub val="&amp;#45;-"&gt;    &lt;m:smallfrac val="off"&gt;    &lt;m:dispdef/&gt;    &lt;m:lmargin val="0"&gt;    &lt;m:rmargin val="0"&gt;    &lt;m:defjc val="centerGroup"&gt;    &lt;m:wrapindent val="1440"&gt;    &lt;m:intlim val="subSup"&gt;    &lt;m:narylim val="undOvr"&gt;   &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" defunhidewhenused="true" defsemihidden="true" defqformat="false" defpriority="99" latentstylecount="267"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Normal"&gt;   &lt;w:lsdexception locked="false" priority="9" semihidden="false" unhidewhenused="false" qformat="true" name="heading 1"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 2"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 3"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 4"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 5"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 6"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 7"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 8"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 9"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 1"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 2"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 3"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 4"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 5"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 6"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 7"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 8"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 9"&gt;   &lt;w:lsdexception locked="false" priority="35" qformat="true" name="caption"&gt;   &lt;w:lsdexception locked="false" priority="10" semihidden="false" unhidewhenused="false" qformat="true" name="Title"&gt;   &lt;w:lsdexception locked="false" priority="1" name="Default Paragraph Font"&gt;   &lt;w:lsdexception locked="false" priority="11" semihidden="false" unhidewhenused="false" qformat="true" name="Subtitle"&gt;   &lt;w:lsdexception locked="false" priority="22" semihidden="false" unhidewhenused="false" qformat="true" name="Strong"&gt;   &lt;w:lsdexception locked="false" priority="20" semihidden="false" unhidewhenused="false" qformat="true" name="Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="0" name="No List"&gt;   &lt;w:lsdexception locked="false" priority="59" semihidden="false" unhidewhenused="false" name="Table Grid"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Placeholder Text"&gt;   &lt;w:lsdexception locked="false" priority="1" semihidden="false" unhidewhenused="false" qformat="true" name="No Spacing"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Revision"&gt;   &lt;w:lsdexception locked="false" priority="34" semihidden="false" unhidewhenused="false" qformat="true" name="List Paragraph"&gt;   &lt;w:lsdexception locked="false" priority="29" semihidden="false" unhidewhenused="false" qformat="true" name="Quote"&gt;   &lt;w:lsdexception locked="false" priority="30" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Quote"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference"&gt;   &lt;w:lsdexception locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference"&gt;   &lt;w:lsdexception locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title"&gt;   &lt;w:lsdexception locked="false" priority="37" name="Bibliography"&gt;   &lt;w:lsdexception locked="false" priority="39" qformat="true" name="TOC Heading"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable  {mso-style-name:"Table Normal";  mso-tstyle-rowband-size:0;  mso-tstyle-colband-size:0;  mso-style-noshow:yes;  mso-style-priority:99;  mso-style-qformat:yes;  mso-style-parent:"";  mso-padding-alt:0in 5.4pt 0in 5.4pt;  mso-para-margin-top:0in;  mso-para-margin-right:0in;  mso-para-margin-bottom:10.0pt;  mso-para-margin-left:0in;  line-height:115%;  mso-pagination:widow-orphan;  font-size:10.0pt;  font-family:"Times New Roman","serif";  mso-fareast-font-family:"Times New Roman";} &lt;/style&gt; &lt;![endif]--&gt;&lt;pre&gt;RMAN&amp;gt; restore database preview;&lt;br /&gt;&lt;br /&gt;Starting restore at 2009-MAY-22 11:24:50&lt;br /&gt;&lt;br /&gt;using channel ORA_DISK_1&lt;br /&gt;&lt;br /&gt;List of Backup Sets&lt;br /&gt;&lt;br /&gt;===================&lt;br /&gt;&lt;br /&gt;BS Key&lt;span style=""&gt;  &lt;/span&gt;Type LV Size&lt;span style=""&gt;       &lt;/span&gt;Device Type Elapsed Time Completion Time&lt;span style=""&gt;     &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;------- ---- -- ---------- ----------- ------------ --------------------&lt;br /&gt;&lt;br /&gt;1&lt;span style=""&gt;       &lt;/span&gt;Full&lt;span style=""&gt;    &lt;/span&gt;209.16M&lt;span style=""&gt;    &lt;/span&gt;DISK&lt;span style=""&gt;        &lt;/span&gt;00:01:50&lt;span style=""&gt;     &lt;/span&gt;2009-MAY-22 11:21:04&lt;br /&gt;&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;BP Key: 1&lt;span style=""&gt;   &lt;/span&gt;Status: AVAILABLE&lt;span style=""&gt;  &lt;/span&gt;Compressed: YES&lt;span style=""&gt;  &lt;/span&gt;Tag: TAG20090522T111914&lt;br /&gt;&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;Piece Name: /u01/app/oracle/flash_recovery_area/ORCL/backupset/2009_05_22/o1_mf_nnndf_TAG20090522T111914_51d6fm3b_.bkp&lt;br /&gt;&lt;br /&gt;&lt;span style=""&gt;  &lt;/span&gt;List of Datafiles in backup set 1&lt;br /&gt;&lt;br /&gt;&lt;span style=""&gt;  &lt;/span&gt;File LV Type Ckp SCN&lt;span style=""&gt;    &lt;/span&gt;Ckp Time&lt;span style=""&gt;             &lt;/span&gt;Name&lt;br /&gt;&lt;br /&gt;&lt;span style=""&gt;  &lt;/span&gt;---- -- ---- ---------- -------------------- ----&lt;br /&gt;&lt;br /&gt;&lt;span style=""&gt;  &lt;/span&gt;1&lt;span style=""&gt;       &lt;/span&gt;Full 1621673&lt;span style=""&gt;    &lt;/span&gt;2009-MAY-22 11:19:15 /u01/app/oracle/oradata/ORCL/system01.dbf&lt;br /&gt;&lt;br /&gt;&lt;span style=""&gt;  &lt;/span&gt;2&lt;span style=""&gt;       &lt;/span&gt;Full 1621673&lt;span style=""&gt;    &lt;/span&gt;2009-MAY-22 11:19:15 /u01/app/oracle/oradata/ORCL/sysaux01.dbf&lt;br /&gt;&lt;br /&gt;&lt;span style=""&gt;  &lt;/span&gt;3&lt;span style=""&gt;       &lt;/span&gt;Full 1621673&lt;span style=""&gt;    &lt;/span&gt;2009-MAY-22 11:19:15 /u01/app/oracle/oradata/ORCL/undotbs01.dbf&lt;br /&gt;&lt;br /&gt;&lt;span style=""&gt;  &lt;/span&gt;4&lt;span style=""&gt;       &lt;/span&gt;Full 1621673&lt;span style=""&gt;    &lt;/span&gt;2009-MAY-22 11:19:15 /u01/app/oracle/oradata/ORCL/users01.dbf&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;List of Archived Log Copies for database with db_unique_name ORCL&lt;br /&gt;&lt;br /&gt;=====================================================================&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Key&lt;span style=""&gt;     &lt;/span&gt;Thrd Seq&lt;span style=""&gt;     &lt;/span&gt;S Low Time&lt;span style=""&gt;            &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;------- ---- ------- - --------------------&lt;br /&gt;&lt;br /&gt;30&lt;span style=""&gt;      &lt;/span&gt;1&lt;span style=""&gt;    &lt;/span&gt;97&lt;span style=""&gt;      &lt;/span&gt;A 2009-MAY-22 11:11:24&lt;br /&gt;&lt;br /&gt;&lt;span style=""&gt;        &lt;/span&gt;Name: /u01/app/oracle/flash_recovery_area/ORCL/archivelog/2009_05_22/o1_mf_1_97_51d6kvcr_.arc&lt;br /&gt;&lt;br /&gt;Media recovery start SCN is 1621093&lt;br /&gt;&lt;br /&gt;Recovery must be done beyond SCN 1621673 to clear datafile fuzziness&lt;br /&gt;&lt;br /&gt;Finished restore at 2009-MAY-22 11:24:51&lt;br /&gt;&lt;br /&gt;RMAN&amp;gt; exit&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Recovery Manager complete.&lt;/pre&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;How to find log sequences used during the recovery&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;From above restore preview, we confirm that all redo logs generated from SCN 1621093 and 1621673 will be used.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;SQL&amp;gt; select thread#,sequence# from v$archived_log&lt;br /&gt;&lt;br /&gt;&lt;span style=""&gt;  &lt;/span&gt;2&lt;span style=""&gt;  &lt;/span&gt;where --cross begin backup only (sample SEQ# 90)&lt;br /&gt;&lt;br /&gt;&lt;span style=""&gt;  &lt;/span&gt;3&lt;span style=""&gt;  &lt;/span&gt;(first_change#&amp;lt;=1621093 and next_change#&amp;gt;=1621093 and next_change#&amp;lt;=1621673)&lt;br /&gt;&lt;br /&gt;&lt;span style=""&gt;  &lt;/span&gt;4&lt;span style=""&gt;  &lt;/span&gt;or&lt;span style=""&gt;    &lt;/span&gt;--within begin backup and end backup (sample SEQ# 91,92)&lt;br /&gt;&lt;br /&gt;&lt;span style=""&gt;  &lt;/span&gt;5&lt;span style=""&gt;  &lt;/span&gt;(first_change#&amp;gt;=1621093 and next_change#&amp;lt;=1621673)&lt;br /&gt;&lt;br /&gt;&lt;span style=""&gt;  &lt;/span&gt;6&lt;span style=""&gt;  &lt;/span&gt;or&lt;span style=""&gt;   &lt;/span&gt;--cross end backup only (sample SEQ# 93)&lt;br /&gt;&lt;br /&gt;&lt;span style=""&gt;  &lt;/span&gt;7&lt;span style=""&gt;  &lt;/span&gt;(first_change#&amp;gt;=1621093 and first_change#&amp;lt;=1621673 and next_change#&amp;gt;=1621673)&lt;br /&gt;&lt;br /&gt;&lt;span style=""&gt;  &lt;/span&gt;8&lt;span style=""&gt;  &lt;/span&gt;or&lt;span style=""&gt;   &lt;/span&gt;--cross begin backup and end backup (sample SEQ# 150)&lt;br /&gt;&lt;br /&gt;&lt;span style=""&gt;  &lt;/span&gt;9&lt;span style=""&gt;  &lt;/span&gt;(first_change#&amp;lt;=1621093 and next_change#&amp;gt;=1621673)&lt;br /&gt;&lt;br /&gt;&lt;span style=""&gt; &lt;/span&gt;10&lt;span style=""&gt;  &lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=""&gt;   &lt;/span&gt;THREAD#&lt;span style=""&gt;  &lt;/span&gt;SEQUENCE#&lt;br /&gt;&lt;br /&gt;---------- ----------&lt;br /&gt;&lt;br /&gt;&lt;span style=""&gt;         &lt;/span&gt;1&lt;span style=""&gt;         &lt;/span&gt;97&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-1295808743333194887?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/1295808743333194887/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2011/11/how-to-find-log-sequences-used-during.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/1295808743333194887'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/1295808743333194887'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2011/11/how-to-find-log-sequences-used-during.html' title='How to find log sequences used during the recovery'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-6991428689451885286</id><published>2011-11-15T06:55:00.000-08:00</published><updated>2011-11-15T07:06:21.281-08:00</updated><title type='text'>Oracle dba Interview Questions</title><content type='html'>&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:trackmoves/&gt;   &lt;w:trackformatting/&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:donotpromoteqf/&gt;   &lt;w:lidthemeother&gt;EN-US&lt;/w:LidThemeOther&gt;   &lt;w:lidthemeasian&gt;X-NONE&lt;/w:LidThemeAsian&gt;   &lt;w:lidthemecomplexscript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:splitpgbreakandparamark/&gt;    &lt;w:dontvertaligncellwithsp/&gt;    &lt;w:dontbreakconstrainedforcedtables/&gt;    &lt;w:dontvertalignintxbx/&gt;    &lt;w:word11kerningpairs/&gt;    &lt;w:cachedcolbalance/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;   &lt;m:mathpr&gt;    &lt;m:mathfont val="Cambria Math"&gt;    &lt;m:brkbin val="before"&gt;    &lt;m:brkbinsub val="&amp;#45;-"&gt;    &lt;m:smallfrac val="off"&gt;    &lt;m:dispdef/&gt;    &lt;m:lmargin val="0"&gt;    &lt;m:rmargin val="0"&gt;    &lt;m:defjc val="centerGroup"&gt;    &lt;m:wrapindent val="1440"&gt;    &lt;m:intlim val="subSup"&gt;    &lt;m:narylim val="undOvr"&gt;   &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" defunhidewhenused="true" defsemihidden="true" defqformat="false" defpriority="99" latentstylecount="267"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Normal"&gt;   &lt;w:lsdexception locked="false" priority="9" semihidden="false" unhidewhenused="false" qformat="true" name="heading 1"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 2"&gt;   &lt;w:lsdexception locked="false" priority="0" qformat="true" name="heading 3"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 4"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 5"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 6"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 7"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 8"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 9"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 1"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 2"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 3"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 4"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 5"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 6"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 7"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 8"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 9"&gt;   &lt;w:lsdexception locked="false" priority="35" qformat="true" name="caption"&gt;   &lt;w:lsdexception locked="false" priority="10" semihidden="false" unhidewhenused="false" qformat="true" name="Title"&gt;   &lt;w:lsdexception locked="false" priority="1" name="Default Paragraph Font"&gt;   &lt;w:lsdexception locked="false" priority="11" semihidden="false" unhidewhenused="false" qformat="true" name="Subtitle"&gt;   &lt;w:lsdexception locked="false" priority="22" semihidden="false" unhidewhenused="false" qformat="true" name="Strong"&gt;   &lt;w:lsdexception locked="false" priority="20" semihidden="false" unhidewhenused="false" qformat="true" name="Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="0" name="No List"&gt;   &lt;w:lsdexception locked="false" priority="59" semihidden="false" unhidewhenused="false" name="Table Grid"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Placeholder Text"&gt;   &lt;w:lsdexception locked="false" priority="1" semihidden="false" unhidewhenused="false" qformat="true" name="No Spacing"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Revision"&gt;   &lt;w:lsdexception locked="false" priority="34" semihidden="false" unhidewhenused="false" qformat="true" name="List Paragraph"&gt;   &lt;w:lsdexception locked="false" priority="29" semihidden="false" unhidewhenused="false" qformat="true" name="Quote"&gt;   &lt;w:lsdexception locked="false" priority="30" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Quote"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference"&gt;   &lt;w:lsdexception locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference"&gt;   &lt;w:lsdexception locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title"&gt;   &lt;w:lsdexception locked="false" priority="37" name="Bibliography"&gt;   &lt;w:lsdexception locked="false" priority="39" qformat="true" name="TOC Heading"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable  {mso-style-name:"Table Normal";  mso-tstyle-rowband-size:0;  mso-tstyle-colband-size:0;  mso-style-noshow:yes;  mso-style-priority:99;  mso-style-qformat:yes;  mso-style-parent:"";  mso-padding-alt:0in 5.4pt 0in 5.4pt;  mso-para-margin-top:0in;  mso-para-margin-right:0in;  mso-para-margin-bottom:10.0pt;  mso-para-margin-left:0in;  line-height:115%;  mso-pagination:widow-orphan;  font-size:10.0pt;  font-family:"Times New Roman","serif";  mso-fareast-font-family:"Times New Roman";} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;em&gt;&lt;b style=""&gt;&lt;u&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;Oracle dba Interview Questions&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/em&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt; --------------------&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Wingdings;"&gt;&lt;span style=""&gt;à&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.5in;"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;Because you did not perform the restore and recovery when connected to the recovery catalog, the recovery catalog contains no records for any of the restored files or the procedures performed during the test. Likewise, the control file of the &lt;/span&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;trgta&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt; database is completely unaffected by the test.&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: black;"&gt; &lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;strong&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;Q-1: One of my control file corrupted and I am unable start database, How can I perform recovery?&lt;/span&gt;&lt;/strong&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt; &lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;If one of your control file is missing or corrupted then we have 2 options to recover it. Check alert.log for exact name and location of corrupted control file. Delete it manually and copy from available rest of control file and rename it and start database. Another option is delete corrupted control file and remove name from parameter file/ spfile. After removing said control file from spfile, start your database.&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;Q-2: What is incremental checkpoint?&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt; &lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;In incremental checkpoint process, CKPT process records lowest Low RBA to the control file to keep advancing the Buffer checkpoint Queue (BCQ) to make easy and fastest Active Checkpoint Queue (ACQ).&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;Q-3: Does incremental checkpoint recorded in Alert.log? How to disable it?&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;We can enable disable recording incremental checkpoint in alert.log .We can enable/disable recording using parameter log_checkpoints_to_alert=true/false.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;Q-4: I am working as Oracle DBA in 24/7 running large production database. Size of database is around 800 GB. We take hot backup every day night. But one day at around 4:00 PM, by mistake one table is dropped by application user. Table is very useful. How to recover that dropped table?&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;If your database is running on Oracle 10g version then there is new feature available called Recyclebin. You can recover dropped table from user_recyclebin or dba_recyclebin.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;Q-5: In continuation of above scenario, No. Recyclebin doesn’t enable in my database then how to I recover my table in above scenario?&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt; &lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;Then you should need to restore backup on your UAT or test database server and enable time based recovery for applying all archives before drop command execution. For an instance, apply archives up to 3:55 PM here.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;Q-6: In continuation of above scenario, why I should need to perform recovery in UAT or test database server? Can I restore backup in production database server?&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt; &lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;No. It is not recommended because your production database is large database and running 24/7 environment. Restoration and recovery will take downtime. It is better to perform restoration and recovery process on UAT or Test database.&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;Q-7: What is the meaning of LGWR SYNC and LGWR ASYNC in log archive destination parameter for standby configuration?&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt; &lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;When use LGWR with SYNC, it means once network I/O initiated, LGWR has to wait for completion of network I/O before write processing. LGWR with ASYNC, means LGWR doesn’t wait to finish network I/O and continuing write processing.&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt; &lt;/span&gt;&lt;strong&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;Q-8: How can I know my require table is available in export dump file or not?&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;Create indexfile of export dump file using import with indexfile command. A text file will be generating with all table and index object name with number of rows. You can confirm your require table object from this text file.&lt;/span&gt;&lt;strong&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;Q-9: Archive log are being generated around 20 GB in my production large database. But one day almost double archives were generated. What is the reason behind this? How can I check it?&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;There are lots of reason behind increasing size of archives like If more database changes were performed using batch jobs  or any special task like merging 2 database or data etc. You can check it using enabling Log Minor utility.&lt;/span&gt;&lt;strong&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;Q-10: How do you recover from the loss of datafile if the DB is running in ARCHIVELOG mode?&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;We can perform this recovery in 2 ways. One is open database mode and another is database mount mode.  After taking offline lost datafile, we can bring database open and after that restore lost datafile from last backup. After restoration of datafile we can perform datafile level recovery for applying archive logs and make it online. In database mount mode, we can restore datafile from backup and perform datafile recovery using “Recover datafile” command.&lt;/span&gt;&lt;strong&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;Q-11: What is a Complete Recovery?&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt; &lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;During this recovery we are applying all database changes using archives log and make it to up to date. Complete recovery can be done full database level or datafile level or tablespace level. Main concept is to apply all data changes using archive logs and bring database up to recent time.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;Q-12: Why we should need to open database using RESETLOGS after finishing incomplete recovery?&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt; &lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;When we are performing incomplete recovery it means we bring database to past time or rewind period of time using change based, cancel based or time based recovery. These all recovery make database in prior state of database. The forward sequence number already available after performing recovery, due to mismatching of this sequence numbers and prior state of database, it needs to open database with new sequence number of Redo log and archive logs.&lt;/span&gt;&lt;strong&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;Q-13: Why export backup called as logical backup?&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt; &lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;Export dump file doesn’t backup or contain any physical structure of database like datafile, control file, redo log file, parameter file, password file. Instead of physical structure, export dump contains logical structure of database like definition of tablespaces, segments, schemas, data of segments etc. Due to these reasons  export dump is called as logical backup.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;Q-14: Have you faced any recovery scenario? Explain us how you resolved it?&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;2 months back, a potential table was dropped by an application developer on our large 24/7 running production database. Immediately he informed us. We have standby database for our production database. We checked that archives didn’t apply to standby database up to dropped timing. We stopped archive applying on standby immediately and open database read only. Took export of dropped table and imported in production database. After finishing appropriate checking of table, again we started archive applying in standby database for refreshing.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;Q-15: Which command I should need to execute to take backup of database which is running on NOARCHIVELOG mode?&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;Shutdown immediate. Because without shutdown, we can’t perform online backup of database, which running on NOARCHIVELOG mode. We should need to take cold backup of database.&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: black;"&gt; &lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-6991428689451885286?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/6991428689451885286/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2011/11/oracle-dba-interview-questions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/6991428689451885286'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/6991428689451885286'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2011/11/oracle-dba-interview-questions.html' title='Oracle dba Interview Questions'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-4305892046447288442</id><published>2011-11-06T23:22:00.000-08:00</published><updated>2011-11-06T23:23:12.680-08:00</updated><title type='text'>Voting disk and OCR Management</title><content type='html'>&lt;h1 style="font-family: times new roman;" class="entry-title"&gt;&lt;span style="font-size:100%;"&gt;Voting disk and OCR Management&lt;/span&gt;&lt;/h1&gt;              &lt;div style="font-family: times new roman;" class="entry-content"&gt;       &lt;p&gt;&lt;span style="font-size:100%;"&gt;The recommendations for the addition or removal of a voting  disk is shutdown Oracle Cluster ware first on all nodes and then utilize  the commands below as root user where path is completely qualified path  for the additional voting disk. In the case of new voting disk over the  network file system (NFS), create an empty voting disk file location  with the correct owner and permissions before execute of commands  mentioned below. Three extra raw partitions &lt;strong&gt;/dev/raw/raw3/, dev/raw/raw4, /dev/raw/raw5 &lt;/strong&gt;have been created in order to practice following excercises&lt;span id="more-381"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;ul&gt;&lt;li&gt; &lt;h3&gt;&lt;span style="font-size:100%;"&gt;Run the following command to find path of voting disks&lt;/span&gt;&lt;/h3&gt; &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;strong&gt;[oracle@crs1 ~]$ crsctl query css votedisk&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt; 0.     0    /dev/raw/raw2&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;located 1 votedisk(s).&lt;/span&gt;&lt;/p&gt; &lt;ul&gt;&lt;li&gt; &lt;h3&gt;&lt;span style="font-size:100%;"&gt;Run the following command as the &lt;code&gt;root&lt;/code&gt; user to add a voting disk&lt;/span&gt;&lt;/h3&gt; &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;strong&gt;﻿﻿﻿[root@crs1 oracle]# crsctl stop crs&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;strong&gt;[root@crs2 oracle]# crsctl stop crs&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;strong&gt;[root@crs1 oracle]# crsctl add css votedisk /dev/raw/raw3 -force&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;Now formatting voting disk: /dev/raw/raw3&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;successful addition of votedisk /dev/raw/raw3.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;strong&gt;[root@crs1 oracle]# crsctl start crs&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt; &lt;strong&gt;[root@crs2 oracle]# crsctl start crs&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;strong&gt;[oracle@crs2 oracle]$ crsctl query css votedisk&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt; 0.     0    /dev/raw/raw2&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt; 1.     0    /dev/raw/raw3&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt; located 2 votedisk(s).&lt;/span&gt;&lt;/p&gt; &lt;ul&gt;&lt;li&gt; &lt;h3&gt;&lt;span style="font-size:100%;"&gt;Run the following command as the root user to remove a voting disk&lt;/span&gt;&lt;/h3&gt; &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;strong&gt;# crsctl delete css votedisk &lt;/strong&gt;&lt;strong&gt;path&lt;/strong&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;ul&gt;&lt;li&gt; &lt;h3&gt;&lt;span style="font-size:100%;"&gt;Backup and Recovery of Voting Disk&lt;/span&gt;&lt;/h3&gt; &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;Back up the voting&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;dd if=voting_disk_name of=backup_file_name&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;strong&gt;[oracle@crs1 ~]$ dd if=/dev/raw/raw2 of=/home/oracle/backup/votdisk1&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;Recovering Voting Disks        &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;dd if=backup_file_name of=voting_disk_name&lt;/span&gt;&lt;/p&gt; &lt;ul&gt;&lt;li&gt; &lt;h3&gt;&lt;span style="font-size:100%;"&gt;Administering the Oracle Cluster Registry in Oracle Real Application Clusters&lt;/span&gt;&lt;/h3&gt; &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;OCR file location is in following file&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;For Sun Solaris                      /var/opt/oracle/ocr.loc&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;For Linux                 /etc/oracle/ocr.loc&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt; If OCR resides on a cluster, file system file or if the OCR is on a  network file system, then create the target OCR file before adding OCR.&lt;/span&gt;&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt; Use the OCRCHECK utility to verify the OCR integrity&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt; The things displayed by OCRCHECK utility are – the version of the  OCR’s block format; total space used and available; OCRID; and the OCR  locations that have been configured. A block-by-block checksum operation  for all of the blocks in all the configured OCRs is performed by  OCRCHECK. It also returns an individual status for each file as well as a  result for the overall OCR integrity check.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt; &lt;strong&gt;[root@crs1 oracle]# ocrcheck&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;strong&gt; &lt;/strong&gt;Status of Oracle Cluster Registry is as follows :&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;  Version                  :          2&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;  Total space (kbytes)     :     524184&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;  Used space (kbytes)      :       5644&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;   Available space (kbytes) :     518540&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;  ID                       :   87847809&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;  Device/File Name         : /dev/raw/raw1&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;  Device/File integrity check succeeded&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt; &lt;strong&gt;Device/File not configured&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt; Cluster registry integrity check succeeded&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt; &lt;strong&gt;Device/File not configured means ocrmirror is not configured&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;strong&gt; &lt;/strong&gt;OCRCHECK creates a log file in the directory CRS_Home&lt;code&gt;/log/&lt;/code&gt;hostname&lt;code&gt;/client&lt;/code&gt;. To change amount of logging, edit the file CRS_Home&lt;code&gt;/srvm/admin/ocrlog.ini&lt;/code&gt;.&lt;/span&gt;&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt; Run the following command to add an OCR mirror location using  either destination_file or disk to designate the target location of the  additional OCR&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt; &lt;h4&gt;&lt;span style="font-size:100%;"&gt; &lt;strong&gt;First, make sure you have proper backup of ocr&lt;/strong&gt;&lt;/span&gt;&lt;/h4&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt; &lt;strong&gt;[root@crs2 oracle]# ocrconfig –showbackup&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;strong&gt; &lt;/strong&gt;Run the following command to add an OCR location  using either destination_file or disk to designate the target location  of the additional OCR&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt; &lt;strong&gt;ocrconfig -replace ocr &lt;/strong&gt;&lt;strong&gt;destination_file or disk&lt;/strong&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;strong&gt;ocrconfig -replace ocrmirror &lt;/strong&gt;&lt;strong&gt;destination_file or disk&lt;/strong&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;strong&gt; &lt;/strong&gt;First zero out the raw device&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt; If your OCR configuration were altered while a particular node is  stopped, you would be required to repair the OCR configuration on that  particular node. For instance, there may be need to repair the OCR on a  node that was not up at the time of removing, replacing or adding an  OCR. For repairing an OCR configuration, run the following command on  the node on which the Oracle Clusterware daemon was stopped.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt; &lt;strong&gt;ocrconfig –repair ocrmirror device_name &lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;strong&gt; &lt;/strong&gt;This operation only changes the OCR configuration  on the node from which you run this command. For example, if the OCR  mirror device name is &lt;code&gt;/dev/raw1&lt;/code&gt;, then use the command syntax &lt;code&gt;ocrconfig -repair ocrmirror /dev/raw1&lt;/code&gt; on this node to repair its OCR configuration.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt; You &lt;strong&gt;cannot&lt;/strong&gt; perform this operation on a node on which the Oracle Clusterware daemon is running.&lt;/span&gt;&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt; Run the following command on any node in the cluster to remove the OCR&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt; &lt;strong&gt;ocrconfig -replace ocr&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt; Run the following command on any node in the cluster to remove the mirrored OCR&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt; &lt;strong&gt;ocrconfig -replace ocrmirror&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;The above commands update the OCR configuration on all of the nodes on which Oracle Clusterware is running.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt; The ocrconfig Command Options&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt; &lt;table width="73%" border="1" cellpadding="0" cellspacing="0"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="26%"&gt;&lt;span style="font-size:100%;"&gt;Option&lt;/span&gt;&lt;/td&gt; &lt;td valign="top" width="73%"&gt;&lt;span style="font-size:100%;"&gt;Purpose&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="26%"&gt;&lt;span style="font-size:100%;"&gt;-backuploc&lt;/span&gt;&lt;/td&gt; &lt;td valign="top" width="73%"&gt;&lt;span style="font-size:100%;"&gt;To change an OCR backup file location. For this entry , use a full path that is accessible by all of the nodes.&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="26%"&gt;&lt;span style="font-size:100%;"&gt;-downgrade&lt;/span&gt;&lt;/td&gt; &lt;td valign="top" width="73%"&gt;&lt;span style="font-size:100%;"&gt;To downgrade an OCR to an earlier version.&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="26%"&gt;&lt;span style="font-size:100%;"&gt;-export&lt;/span&gt;&lt;/td&gt; &lt;td valign="top" width="73%"&gt;&lt;span style="font-size:100%;"&gt;To export the contents of an OCR into a target file.&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="26%"&gt;&lt;span style="font-size:100%;"&gt;-help&lt;/span&gt;&lt;/td&gt; &lt;td valign="top" width="73%"&gt;&lt;span style="font-size:100%;"&gt;To display help for the ocrconfig commands.&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="26%"&gt;&lt;span style="font-size:100%;"&gt;-import&lt;/span&gt;&lt;/td&gt; &lt;td valign="top" width="73%"&gt;&lt;span style="font-size:100%;"&gt;To import the OCR contents from a previously exported OCR file.&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="26%"&gt;&lt;span style="font-size:100%;"&gt;-overwrite&lt;/span&gt;&lt;/td&gt; &lt;td valign="top" width="73%"&gt;&lt;span style="font-size:100%;"&gt;To update an OCR configuration that is  recorded on the OCR with the current OCR configuration information that  is found on the node from which you are running this command.&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="26%"&gt;&lt;span style="font-size:100%;"&gt;-repair&lt;/span&gt;&lt;/td&gt; &lt;td valign="top" width="73%"&gt;&lt;span style="font-size:100%;"&gt;To update an OCR configuration on the node  from which you are running this command with the new configuration  information specified by this command.&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="26%"&gt;&lt;span style="font-size:100%;"&gt;-replace&lt;/span&gt;&lt;/td&gt; &lt;td valign="top" width="73%"&gt;&lt;span style="font-size:100%;"&gt;To add, replace, or remove an OCR location.&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="26%"&gt;&lt;span style="font-size:100%;"&gt;-restore&lt;/span&gt;&lt;/td&gt; &lt;td valign="top" width="73%"&gt;&lt;span style="font-size:100%;"&gt;To restore an OCR from an automatically created OCR backup file.&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="26%"&gt;&lt;span style="font-size:100%;"&gt;showbackup&lt;/span&gt;&lt;/td&gt; &lt;td valign="top" width="73%"&gt;&lt;span style="font-size:100%;"&gt;To display the location, timestamp, and the  originating node name of the backup files that Oracle created in the  past 4 hours, 8 hours, 12 hours, and in the last day and week. You do  not have to be the root user to execute the -showbackup option.&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="26%"&gt;&lt;span style="font-size:100%;"&gt;-upgrade&lt;/span&gt;&lt;/td&gt; &lt;td valign="top" width="73%"&gt;&lt;span style="font-size:100%;"&gt;To upgrade an OCR to a later version.&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt; For example, to export the OCR contents to a binary file, use the ocrconfig command with the following syntax where &lt;em&gt;file_name&lt;/em&gt; is the file to which you want to export the OCR contents as follows&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;ocrconfig -export &lt;em&gt;file_name&lt;/em&gt;&lt;/span&gt;&lt;/p&gt; &lt;ul&gt;&lt;li&gt; &lt;h3&gt;&lt;span style="font-size:100%;"&gt;Managing Backups and Recovering the OCR Using OCR Backup Files&lt;/span&gt;&lt;/h3&gt; &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;This section explains the two methods for the purpose of copying of  OCR content and further utilizing it for recovery. The first method uses  automatically generated OCR file copies and the second method uses  manually created OCR export files.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;The Oracle Clusterware automatically creates OCR backups every four  hours. At any one time, Oracle always retains the last three backup  copies of the OCR. The CRSD process that creates the backups also  creates and retains an OCR backup for each full day and at the end of  each week.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;strong&gt;Restoring the Oracle Cluster Registry on UNIX-Based Systems: &lt;/strong&gt;use &lt;strong&gt;&lt;em&gt;oracheck&lt;/em&gt;&lt;/strong&gt; to check OCR status&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;Use the following procedure to restore the OCR on UNIX-based systems:&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;Identify the OCR backups using the &lt;code&gt;ocrconfig -showbackup&lt;/code&gt; command. Review the contents of the backup using &lt;code&gt;ocrdump -backupfile&lt;/code&gt; file_name where file_name is the name of the backup file.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;Stop Oracle Clusterware on all of the nodes in your Oracle RAC database by executing the &lt;code&gt;init.crs stop&lt;/code&gt;&lt;/span&gt; command on all of the nodes.&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;Perform the restore by applying an OCR backup file that you  identified in Step 1 using the following command where file_name is the  name of the OCR that you want to restore. Make sure that the OCR devices  that you specify in the OCR configuration exist and that these OCR  devices are valid before running this command.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;ocrconfig -restore file_name&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;Restart Oracle Clusterware on all of the nodes in your cluster by restarting each node or by running the &lt;code&gt;init.crs start&lt;/code&gt; command.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;Run the following command to verify the OCR integrity where the &lt;code&gt;-n all&lt;/code&gt; argument retrieves a listing of all of the cluster nodes that are configured as part of your cluster.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;strong&gt;cluvfy comp ocr -n all [-verbose]&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;strong&gt; &lt;/strong&gt;Use the OCRDUMP utility to write the OCR contents to a file so that you can examine the OCR content.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;strong&gt;ocrdump [&lt;em&gt;file_name&lt;/em&gt;|-stdout] [-backupfile &lt;em&gt;backup_file_name&lt;/em&gt;] [-keyname &lt;em&gt;keyname&lt;/em&gt;] [-xml] [-noheader] &lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;strong&gt;&lt;em&gt;OCRDUMP Options and Option Descriptions&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;table width="77%" border="1" cellpadding="0" cellspacing="0"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="32%"&gt;&lt;span style="font-size:100%;"&gt;Options&lt;/span&gt;&lt;/td&gt; &lt;td valign="top" width="67%"&gt;&lt;span style="font-size:100%;"&gt;Description&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="32%"&gt;&lt;span style="font-size:100%;"&gt;&lt;em&gt;file_name&lt;/em&gt;&lt;/span&gt;&lt;/td&gt; &lt;td valign="top" width="67%"&gt;&lt;span style="font-size:100%;"&gt;Name of a file to which you want OCRDUMP to write output.&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="32%"&gt;&lt;span style="font-size:100%;"&gt;-stdout&lt;/span&gt;&lt;/td&gt; &lt;td valign="top" width="67%"&gt;&lt;span style="font-size:100%;"&gt;The predefined output location that you can redirect with, for example, a filename.&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="32%"&gt;&lt;span style="font-size:100%;"&gt;-keyname&lt;/span&gt;&lt;/td&gt; &lt;td valign="top" width="67%"&gt;&lt;span style="font-size:100%;"&gt;The name of an OCR key whose subtree is to be dumped.&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="32%"&gt;&lt;span style="font-size:100%;"&gt;-xml&lt;/span&gt;&lt;/td&gt; &lt;td valign="top" width="67%"&gt;&lt;span style="font-size:100%;"&gt;Writes the output in XML format.&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="32%"&gt;&lt;span style="font-size:100%;"&gt;-noheader&lt;/span&gt;&lt;/td&gt; &lt;td valign="top" width="67%"&gt;&lt;span style="font-size:100%;"&gt;Does not print the time at which you ran the command and when the OCR configuration occurred.&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="32%"&gt;&lt;span style="font-size:100%;"&gt;-backupfile&lt;/span&gt;&lt;/td&gt; &lt;td valign="top" width="67%"&gt;&lt;span style="font-size:100%;"&gt;Option to identify a backup file.&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="32%"&gt;&lt;span style="font-size:100%;"&gt;&lt;em&gt;backup_file_name&lt;/em&gt;&lt;/span&gt;&lt;/td&gt; &lt;td valign="top" width="67%"&gt;&lt;span style="font-size:100%;"&gt;The name of the backup file the content of  which you want to view. You can query the backups using the ocrconfig  -showbackup command&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;ul&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt; &lt;strong&gt;OCR Exports/Imports&lt;/strong&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;strong&gt;ocrconfig -export &lt;/strong&gt;&lt;strong&gt;file_name&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;strong&gt;ocrconfig -import &lt;/strong&gt;&lt;strong&gt;file_name&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;Restart Oracle Clusterware on all of the nodes in your cluster by restarting each node.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;Run the following Cluster Verification Utility (CVU) command to verify the OCR integrity where the &lt;code&gt;-n all&lt;/code&gt;&lt;/span&gt; argument retrieves a listing of all of the cluster nodes that are configured as part of your cluster:&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;strong&gt;cluvfy comp ocr -n all [-verbose]&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;            &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-4305892046447288442?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/4305892046447288442/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2011/11/voting-disk-and-ocr-management.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/4305892046447288442'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/4305892046447288442'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2011/11/voting-disk-and-ocr-management.html' title='Voting disk and OCR Management'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-707672632381080737</id><published>2011-11-06T23:08:00.000-08:00</published><updated>2011-11-06T23:12:43.299-08:00</updated><title type='text'>Managing Data Guard using DGMGRL</title><content type='html'>&lt;h1  style="font-weight: normal; color: rgb(0, 51, 51);font-family:times new roman;" class="entry-title"&gt;&lt;span style="font-size:100%;"&gt;Managing Data Guard using DGMGRL&lt;/span&gt;&lt;/h1&gt;       &lt;div  class="entry-meta" style="font-family:times new roman;"&gt;       &lt;span class="meta-prep meta-prep-author"&gt;&lt;/span&gt;&lt;span class="comments-link"&gt;&lt;br /&gt;&lt;/span&gt;      &lt;/div&gt;       &lt;div style="font-family: times new roman;" class="entry-content"&gt;       &lt;ul&gt;&lt;li&gt; &lt;strong&gt;Make dg_broker_start= TRUE on both primary (ocmdb) and secondary (phyocm) databases.&lt;/strong&gt;&lt;/li&gt;&lt;p&gt;&lt;strong&gt;SQL&amp;gt;&lt;/strong&gt; SHOW PARAMETER dg&lt;br /&gt;&lt;strong&gt;SQL&amp;gt;&lt;/strong&gt; ALTER SYSTEM SET dg_broker_start=TRUE SCOPE=BOTH;&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;Configure listener.ora for DGMGRL&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;em&gt;&lt;strong&gt;﻿&lt;/strong&gt;These ‘&lt;db_unique_name&gt;_DGMGRL’ entries  in the listener.ora files on each system are required for Broker  operations invoked using DGMGRL that require connecting remotely to a  database to function normally.  Without them, the Broker cannot connect  to the target database when it is down, as is the case in a switchover  or failover or any other operation that requires a restart of a  database.&lt;span id="more-357"&gt;&lt;/span&gt;&lt;/db_unique_name&gt;&lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;em&gt;As non-default port, local listener is used for ocmdb and phyocm.  Add SID_DESC for DGMGRL for both Primary and Secondary on non-default  port listener SID_LIST as mentioned in BOLD&lt;/em&gt;&lt;/p&gt; &lt;p&gt;SID_LIST_LISTENER_OCM =&lt;br /&gt; (SID_LIST =&lt;br /&gt;   (SID_DESC =&lt;br /&gt;     (GLOBAL_DBNAME = ocmdb)&lt;br /&gt;     (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)&lt;br /&gt;     (SID_NAME = ocmdb)&lt;br /&gt;   )&lt;br /&gt;  &lt;strong&gt;(SID_DESC =&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;      (GLOBAL_DBNAME = ocmdb_DGMGRL)&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;      (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;      (SID_NAME = ocmdb)&lt;/strong&gt;&lt;br /&gt;   &lt;strong&gt;)&lt;/strong&gt;&lt;br /&gt;)&lt;/p&gt; &lt;p&gt;SID_LIST_LISTENER_PHYOCM =&lt;br /&gt; (SID_LIST =&lt;br /&gt;   (SID_DESC =&lt;br /&gt;     (GLOBAL_DBNAME = phyocm)&lt;br /&gt;     (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)&lt;br /&gt;     (SID_NAME = phyocm)&lt;br /&gt;   )&lt;br /&gt; &lt;strong&gt;(SID_DESC =&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;      (GLOBAL_DBNAME = phyocm_DGMGRL)&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;      (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;      (SID_NAME = phyocm)&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;    )&lt;/strong&gt;&lt;br /&gt;)&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;Run “netmgr” and verify that the Oracle Net pre-requisites for using the DGMGRL command line interface have been satisfied.&lt;/strong&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Commands to get dgmgrl help&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt;help edit&lt;br /&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt;help remove&lt;br /&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; help enable&lt;br /&gt;&lt;strong&gt;DGMGRL&amp;gt; &lt;/strong&gt;help start&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;DGMGRL Create Configuration&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;[oracle@ocm ~]$&lt;/strong&gt; dgmgrl&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; connect &lt;a href="mailto:sys@ocmdb"&gt;sys@ocmdb&lt;/a&gt;&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;Create configuration with “ocmdb” as the Primary database. Add in the information about the physical standby database&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; CREATE CONFIGURATION OCMDB AS PRIMARY DATABASE IS OCMDB&lt;br /&gt; CONNECT IDENTIFIER IS OCMDB;&lt;br /&gt;Configuration “ocmdb” created with primary database “ocmdb”&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; ADD DATABASE phyocm AS CONNECT IDENTIFIER IS phyocm&lt;br /&gt; MAINTAINED AS PHYSICAL;&lt;br /&gt;Database “phyocm” added&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; enable configuration;&lt;br /&gt;Enabled.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; show configuration;&lt;br /&gt;Configuration&lt;br /&gt; Name:                ocmdb&lt;br /&gt; Enabled:             YES&lt;br /&gt; Protection Mode:     MaxPerformance&lt;br /&gt; Fast-Start Failover: DISABLED&lt;br /&gt; Databases:&lt;br /&gt;   ocmdb  – Primary database&lt;br /&gt;   phyocm – Physical standby database&lt;/p&gt; &lt;p&gt;Current status for “ocmdb”:&lt;br /&gt;SUCCESS&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; show database verbose ocmdb ;&lt;br /&gt;Database&lt;br /&gt; Name:            ocmdb&lt;br /&gt; Role:            PRIMARY&lt;br /&gt; Enabled:         YES&lt;br /&gt; Intended State:  ONLINE&lt;br /&gt; Instance(s):&lt;br /&gt;   ocmdb&lt;/p&gt; &lt;p&gt;  Properties:&lt;br /&gt;   InitialConnectIdentifier        = ‘ocmdb’&lt;br /&gt;   LogXptMode                      = ‘ASYNC’&lt;br /&gt;   Dependency                      = ”&lt;br /&gt;   DelayMins                       = ’0′&lt;br /&gt;   Binding                         = ‘OPTIONAL’&lt;br /&gt;   MaxFailure                      = ’0′&lt;br /&gt;   MaxConnections                  = ’1′&lt;br /&gt;   ReopenSecs                      = ’300′&lt;br /&gt;   NetTimeout                      = ’180′&lt;br /&gt;   LogShipping                     = ‘ON’&lt;br /&gt;   PreferredApplyInstance          = ”&lt;br /&gt;   ApplyInstanceTimeout            = ’0′&lt;br /&gt;   ApplyParallel                   = ‘AUTO’&lt;br /&gt;   StandbyFileManagement           = ‘AUTO’&lt;br /&gt;   ArchiveLagTarget                = ’0′&lt;br /&gt;   LogArchiveMaxProcesses          = ’2′&lt;br /&gt;   LogArchiveMinSucceedDest        = ’1′&lt;br /&gt;   DbFileNameConvert               = ”&lt;br /&gt;   LogFileNameConvert              = ‘phyocm, ocmdb’&lt;br /&gt;   FastStartFailoverTarget         = ”&lt;br /&gt;   StatusReport                    = ‘(monitor)’&lt;br /&gt;   InconsistentProperties          = ‘(monitor)’&lt;br /&gt;   InconsistentLogXptProps         = ‘(monitor)’&lt;br /&gt;   SendQEntries                    = ‘(monitor)’&lt;br /&gt;   LogXptStatus                    = ‘(monitor)’&lt;br /&gt;   RecvQEntries                    = ‘(monitor)’&lt;br /&gt;   HostName                        = ‘ocm.prusolutions.com’&lt;br /&gt;   SidName                         = ‘ocmdb’&lt;br /&gt;   LocalListenerAddress            = ‘(ADDRESS=(PROTOCOL=TCP)(HOST=ocm.prusolutions.com)(PORT=2010))’&lt;br /&gt;   StandbyArchiveLocation          = ‘location=use_db_recovery_file_dest’&lt;br /&gt;   AlternateLocation               = ”&lt;br /&gt;   LogArchiveTrace                 = ’0′&lt;br /&gt;   LogArchiveFormat                = ‘%t_%s_%r.dbf’&lt;br /&gt;   LatestLog                       = ‘(monitor)’&lt;br /&gt;   TopWaitEvents                   = ‘(monitor)’&lt;/p&gt; &lt;p&gt;Current status for “ocmdb”:&lt;br /&gt;SUCCESS&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;Managing Databases using DGMGRL&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;em&gt;You can view and change database properties using dgmgrl&lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; show database ocmdb logxptmode;&lt;br /&gt; LogXptMode = ‘ASYNC’&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; show database ocmdb nettimeout;&lt;br /&gt; NetTimeout = ’180′&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; show database phyocm logxptmode;&lt;br /&gt; LogXptMode = ‘ASYNC’&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; show database phyocm nettimeout;&lt;br /&gt; NetTimeout = ’180′&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;Using sqlplus connect to primary database and change value of log_archive_max_processes parameter&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;SQL&amp;gt;&lt;/strong&gt; SHOW PARAMETER log_archive_max_processes;&lt;/p&gt; &lt;p&gt;The current value is two, increase it to five and again check database configuration from dgmgrl&lt;/p&gt; &lt;p&gt;&lt;strong&gt;SQL&amp;gt;&lt;/strong&gt; ALTER SYSTEM SET LOG_ARCHIVE_MAX_PROCESSES=5 SCOPE=MEMORY;&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;Use show configuration command to get Dataguard status&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;DGMGRL&amp;gt; &lt;/strong&gt;show configuration;&lt;/p&gt; &lt;p&gt;Configuration&lt;br /&gt; Name:                ocmdb&lt;br /&gt; Enabled:             YES&lt;br /&gt; Protection Mode:     MaxPerformance&lt;br /&gt; Fast-Start Failover: DISABLED&lt;br /&gt; Databases:&lt;br /&gt;   ocmdb – Primary database&lt;br /&gt;   phyocm – Physical standby database&lt;/p&gt; &lt;p&gt;Current status for “ocmdb”:&lt;br /&gt;Warning: ORA-16608: one or more databases have warnings&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt; Use show database verbose ocmdb to get ocmdb database details&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt; &lt;/strong&gt;show database verbose ocmdb ;&lt;/p&gt; &lt;p&gt;Database&lt;br /&gt; Name:            ocmdb&lt;br /&gt; Role:            PRIMARY&lt;br /&gt; Enabled:         YES&lt;br /&gt; Intended State:  ONLINE&lt;br /&gt; Instance(s):&lt;br /&gt;   ocmdb&lt;/p&gt; &lt;p&gt;  Properties:&lt;br /&gt;   InitialConnectIdentifier        = ‘ocmdb’&lt;br /&gt;   LogXptMode                      = ‘ASYNC’&lt;br /&gt;   Dependency                      = ”&lt;br /&gt;   DelayMins                       = ’0′&lt;br /&gt;   Binding                         = ‘OPTIONAL’&lt;br /&gt;   MaxFailure                      = ’0′&lt;br /&gt;   MaxConnections                  = ’1′&lt;br /&gt;   ReopenSecs                      = ’300′&lt;br /&gt;   NetTimeout                      = ’180′&lt;br /&gt;   LogShipping                     = ‘ON’&lt;br /&gt;   PreferredApplyInstance          = ”&lt;br /&gt;   ApplyInstanceTimeout            = ’0′&lt;br /&gt;   ApplyParallel                   = ‘AUTO’&lt;br /&gt;   StandbyFileManagement           = ‘AUTO’&lt;br /&gt;   ArchiveLagTarget                = ’0′&lt;br /&gt;   LogArchiveMaxProcesses          = ’2′&lt;br /&gt;   LogArchiveMinSucceedDest        = ’1′&lt;br /&gt;   DbFileNameConvert               = ”&lt;br /&gt;   LogFileNameConvert              = ‘phyocm, ocmdb’&lt;br /&gt;   FastStartFailoverTarget         = ”&lt;br /&gt;   StatusReport                    = ‘(monitor)’&lt;br /&gt;   InconsistentProperties          = ‘(monitor)’&lt;br /&gt;   InconsistentLogXptProps         = ‘(monitor)’&lt;br /&gt;   SendQEntries                    = ‘(monitor)’&lt;br /&gt;   LogXptStatus                    = ‘(monitor)’&lt;br /&gt;   RecvQEntries                    = ‘(monitor)’&lt;br /&gt;   HostName                        = ‘ocm.prusolutions.com’&lt;br /&gt;   SidName                         = ‘ocmdb’&lt;br /&gt;   LocalListenerAddress            = ‘(ADDRESS=(PROTOCOL=TCP)(HOST=ocm.prusolutions.com)(PORT=2010))’&lt;br /&gt;   StandbyArchiveLocation          = ‘location=use_db_recovery_file_dest’&lt;br /&gt;   AlternateLocation               = ”&lt;br /&gt;   LogArchiveTrace                 = ’0′&lt;br /&gt;   LogArchiveFormat                = ‘%t_%s_%r.dbf’&lt;br /&gt;   LatestLog                       = ‘(monitor)’&lt;br /&gt;   TopWaitEvents                   = ‘(monitor)’&lt;/p&gt; &lt;p&gt;Current status for “ocmdb”:&lt;br /&gt;Warning: ORA-16792: configuration property value is inconsistent with database setting&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;Get database inconsistent properties and fix the problem&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; show database ocmdb inconsistentproperties;&lt;/p&gt; &lt;p&gt;INCONSISTENT PROPERTIES&lt;br /&gt;  INSTANCE_NAME        PROPERTY_NAME         MEMORY_VALUE         SPFILE_VALUE         BROKER_VALUE&lt;br /&gt;          ocmdb LogArchiveMaxProcesses                    5                    2                    2&lt;/p&gt; &lt;p&gt;&lt;strong&gt;SQL&amp;gt;&lt;/strong&gt; ALTER SYSTEM SET LOG_ARCHIVE_MAX_PROCESSES=2 SCOPE=MEMORY;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; show database ocmdb inconsistentproperties;&lt;/p&gt; &lt;p&gt;INCONSISTENT PROPERTIES&lt;br /&gt;  INSTANCE_NAME        PROPERTY_NAME         MEMORY_VALUE         SPFILE_VALUE         BROKER_VALUE&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; show configuration;&lt;/p&gt; &lt;p&gt;Configuration&lt;br /&gt; Name:                ocmdb&lt;br /&gt; Enabled:             YES&lt;br /&gt; Protection Mode:     MaxPerformance&lt;br /&gt; Fast-Start Failover: DISABLED&lt;br /&gt; Databases:&lt;br /&gt;   ocmdb  – Primary database&lt;br /&gt;   phyocm – Physical standby database&lt;/p&gt; &lt;p&gt;Current status for “ocmdb”:&lt;br /&gt;SUCCESS&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;Open new terminals connect to ocmdb and phyocm using sqlplus and execute following sql&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;SQL&amp;gt;&lt;/strong&gt;SELECT db_unique_name,&lt;br /&gt;        database_role,&lt;br /&gt;        protection_mode,&lt;br /&gt;         protection_level&lt;br /&gt;  FROM   v$database;&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;Edit Database property using DG Broker&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; edit database ocmdb set property LogArchiveMaxProcesses=10;&lt;br /&gt;Property “logarchivemaxprocesses” updated&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; edit database ocmdb set property LogArchiveMaxProcesses=10;&lt;br /&gt;Property “logarchivemaxprocesses” updated&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;Change configuration set Protection Mode to MaxAvailability from MaxPerformance&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;When you try to change set Protection Mode to MaxAvailability, it  will give error, as Standby database phyocm property logxptmode is  ‘ASYNC’&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; edit configuration set protection mode as maxavailability;&lt;br /&gt;Error: ORA-16627: operation disallowed since no standby databases would remain to support protection mode&lt;br /&gt;Failed.&lt;/p&gt; &lt;p&gt;Check database property logxptmode&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; show database ocmdb logxptmode;&lt;br /&gt; LogXptMode = ‘ASYNC’&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; show database phyocm logxptmode;&lt;br /&gt; LogXptMode = ‘ASYNC’&lt;/p&gt; &lt;p&gt;&lt;em&gt;&lt;strong&gt;Change LogXptMode to SYNC of Physical Standby database PHYOCM ONLY and then change the protection mode&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; edit database phyocm set property logxptmode=’SYNC’;&lt;br /&gt;Property “logxptmode” updated&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt; &lt;/strong&gt;show database phyocm logxptmode;&lt;br /&gt; LogXptMode = ‘SYNC’&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; edit configuration set protection mode as maxavailability;&lt;br /&gt;Operation requires shutdown of instance “ocmdb” on database “ocmdb”&lt;br /&gt;Shutting down instance “ocmdb”…&lt;br /&gt;Database closed.&lt;br /&gt;Database dismounted.&lt;br /&gt;ORACLE instance shut down.&lt;br /&gt;Operation requires startup of instance “ocmdb” on database “ocmdb”&lt;br /&gt;Starting instance “ocmdb”…&lt;br /&gt;ORACLE instance started.&lt;br /&gt;Database mounted.&lt;/p&gt; &lt;p&gt;Now change the property LogXptMode of ocmdb database to ‘SYNC’&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; edit database ocmdb set property logxptmode=’SYNC’;&lt;br /&gt;Property “logxptmode” updated&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; show database ocmdb logxptmode;&lt;br /&gt; LogXptMode = ‘SYNC’&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; show configuration;&lt;/p&gt; &lt;p&gt;Configuration&lt;br /&gt; Name:                ocmdb&lt;br /&gt; Enabled:             YES&lt;br /&gt; Protection Mode:     MaxAvailability&lt;br /&gt; Fast-Start Failover: DISABLED&lt;br /&gt; Databases:&lt;br /&gt;   ocmdb  – Primary database&lt;br /&gt;   phyocm – Physical standby database&lt;/p&gt; &lt;p&gt;Current status for “ocmdb”:&lt;br /&gt;SUCCESS&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;If due to some reason, the Dataguard Protection modes is not change to MaxAvailability using DGMGRL then do it from SQLPLUS&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE AVAILABILITY;&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;Open new terminals connect to ocmdb and phyocm using sqlplus and execute following sql&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;SQL&amp;gt;&lt;/strong&gt;SELECT db_unique_name,&lt;br /&gt;        database_role,&lt;br /&gt;        protection_mode,&lt;br /&gt;         protection_level&lt;br /&gt;  FROM   v$database;&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;Switch Over to Standby database phyocm&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; switchover to phyocm;&lt;br /&gt;Performing switchover NOW, please wait…&lt;br /&gt;Operation requires shutdown of instance “ocmdb” on database “ocmdb”&lt;br /&gt;Shutting down instance “ocmdb”…&lt;br /&gt;ORA-01109: database not open&lt;/p&gt; &lt;p&gt;Database dismounted.&lt;br /&gt;ORACLE instance shut down.&lt;br /&gt;Operation requires shutdown of instance “phyocm” on database “phyocm”&lt;br /&gt;Shutting down instance “phyocm”…&lt;br /&gt;ORA-01109: database not open&lt;/p&gt; &lt;p&gt;Database dismounted.&lt;br /&gt;ORACLE instance shut down.&lt;br /&gt;Operation requires startup of instance “ocmdb” on database “ocmdb”&lt;br /&gt;Starting instance “ocmdb”…&lt;br /&gt;ORACLE instance started.&lt;br /&gt;Database mounted.&lt;br /&gt;Operation requires startup of instance “phyocm” on database “phyocm”&lt;br /&gt;Starting instance “phyocm”…&lt;br /&gt;ORACLE instance started.&lt;br /&gt;Database mounted.&lt;br /&gt;Switchover succeeded, new primary is “phyocm”&lt;/p&gt; &lt;p&gt;&lt;strong&gt;If instances are down start them in mount mode, the primary database will automatically open&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;SQL&amp;gt;&lt;/strong&gt; STARTUP MOUNT;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; show configuration;&lt;/p&gt; &lt;p&gt;Configuration&lt;br /&gt; Name:                ocmdb&lt;br /&gt; Enabled:             YES&lt;br /&gt; Protection Mode:     MaxAvailability&lt;br /&gt; Fast-Start Failover: DISABLED&lt;br /&gt; Databases:&lt;br /&gt;   ocmdb  – Physical standby database&lt;br /&gt;   phyocm – Primary database&lt;/p&gt; &lt;p&gt;Current status for “ocmdb”:&lt;br /&gt;SUCCESS&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Open new terminals connect to ocmdb and phyocm using sqlplus and execute following sql&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;SQL&amp;gt;&lt;/strong&gt;SELECT db_unique_name,&lt;br /&gt;        database_role,&lt;br /&gt;        protection_mode,&lt;br /&gt;         protection_level&lt;br /&gt;  FROM   v$database;&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;Switchover back to ocmdb&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; switchover to ocmdb;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; show configuration;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;SQL&amp;gt;&lt;/strong&gt;SELECT db_unique_name,&lt;br /&gt;        database_role,&lt;br /&gt;        protection_mode,&lt;br /&gt;         protection_level&lt;br /&gt;  FROM   v$database;&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt; Failover to phyocm&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;From sqlplus shutdown, abort primary database&lt;/strong&gt;&lt;/p&gt; &lt;p&gt; [oracle@ocm ~]$ echo $ORACLE_SID&lt;br /&gt;ocmdb&lt;/p&gt; &lt;p&gt;&lt;strong&gt;SQL&amp;gt; &lt;/strong&gt;SHUTDOWN abort;&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;Using dgmgrl connect to new phyocm&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;[oracle@ocm ~]$&lt;/strong&gt; dgmgrl &lt;a href="mailto:sys/oracle@phyocm"&gt;sys/oracle@phyocm&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; failover to phyocm;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; show configuration;&lt;/p&gt; &lt;p&gt;Configuration&lt;br /&gt; Name:                ocmdb&lt;br /&gt; Enabled:             YES&lt;br /&gt; Protection Mode:     MaxPerformance&lt;br /&gt; Fast-Start Failover: DISABLED&lt;br /&gt; Databases:&lt;br /&gt;   ocmdb  – Physical standby database (disabled)&lt;br /&gt;   phyocm – Primary database&lt;/p&gt; &lt;p&gt;Current status for “ocmdb”:&lt;br /&gt;SUCCESS&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;The Protection Mode automatically goes back to MaxPerformance, but the logxptmode &lt;/strong&gt;&lt;strong&gt;properties remains ‘SYNC’&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; show database ocmdb logxptmode;&lt;br /&gt; LogXptMode = ‘SYNC’&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; show database phyocm logxptmode;&lt;br /&gt; LogXptMode = ‘SYNC’&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;Open a new terminal and set ORACLE_SID for phyocm&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;[oracle@ocm scripts]$&lt;/strong&gt; export ORACLE_SID=phyocm&lt;/p&gt; &lt;p&gt;&lt;strong&gt;SQL&amp;gt;&lt;/strong&gt;SELECT db_unique_name,&lt;br /&gt;        database_role,&lt;br /&gt;        protection_mode,&lt;br /&gt;         protection_level&lt;br /&gt;  FROM   v$database;&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;Connect to ocmdb and startup database in mount state&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;SQL&amp;gt; &lt;/strong&gt;STARTUP mount;&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;Now reinstate database ocmdb as physical standby&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; reinstate database ocmdb;&lt;br /&gt;Reinstating database “ocmdb”, please wait…&lt;br /&gt;Operation requires shutdown of instance “ocmdb” on database “ocmdb”&lt;br /&gt;Shutting down instance “ocmdb”…&lt;br /&gt;ORA-01109: database not open&lt;/p&gt; &lt;p&gt;Database dismounted.&lt;br /&gt;ORACLE instance shut down.&lt;br /&gt;Operation requires startup of instance “ocmdb” on database “ocmdb”&lt;br /&gt;Starting instance “ocmdb”…&lt;br /&gt;ORACLE instance started.&lt;br /&gt;Database mounted.&lt;br /&gt;Continuing to reinstate database “ocmdb” …&lt;br /&gt;Reinstatement of database “ocmdb” succeeded&lt;/p&gt; &lt;p&gt;&lt;strong&gt;If reinstate fails for first time again start ocmdb database  in mount state and reinstate, it will succeed in second or third  attempt.&lt;/strong&gt;&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;Switchover back to ocmdb to make ocmdb as Primary Database&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt; &lt;/strong&gt;switchover to ocmdb;&lt;/p&gt; &lt;p&gt;Performing switchover NOW, please wait…&lt;br /&gt;Operation requires shutdown of instance “phyocm” on database “phyocm”&lt;br /&gt;Shutting down instance “phyocm”…&lt;br /&gt;ORA-01109: database not open&lt;/p&gt; &lt;p&gt;Database dismounted.&lt;br /&gt;ORACLE instance shut down.&lt;br /&gt;Operation requires shutdown of instance “ocmdb” on database “ocmdb”&lt;br /&gt;Shutting down instance “ocmdb”…&lt;br /&gt;ORA-01109: database not open&lt;/p&gt; &lt;p&gt;Database dismounted.&lt;br /&gt;ORACLE instance shut down.&lt;br /&gt;Operation requires startup of instance “phyocm” on database “phyocm”&lt;br /&gt;Starting instance “phyocm”…&lt;br /&gt;ORACLE instance started.&lt;br /&gt;Database mounted.&lt;br /&gt;Operation requires startup of instance “ocmdb” on database “ocmdb”&lt;br /&gt;Starting instance “ocmdb”…&lt;br /&gt;ORACLE instance started.&lt;br /&gt;Database mounted.&lt;br /&gt;Switchover succeeded, new primary is “ocmdb”&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; show configuration;&lt;/p&gt; &lt;p&gt;Configuration&lt;br /&gt; Name:                ocmdb&lt;br /&gt; Enabled:             YES&lt;br /&gt; Protection Mode:     MaxPerformance&lt;br /&gt; Fast-Start Failover: DISABLED&lt;br /&gt; Databases:&lt;br /&gt;   ocmdb  – Primary database&lt;br /&gt;   phyocm – Physical standby database&lt;/p&gt; &lt;p&gt;Current status for “ocmdb”:&lt;br /&gt;SUCCESS&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;Fast Start Failover&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;Connect to physical standby using dgmgrl&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;[oracle@ocm ~]$ &lt;/strong&gt;dgmgrl &lt;a href="mailto:sys/oracle@phyocm"&gt;sys/oracle@phyocm&lt;/a&gt;&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;Currently the Protection Mode is MaxPerformance, For fast start failover the Protection Mode should be MaxAvailability.&lt;/strong&gt;&lt;/li&gt;&lt;p&gt;&lt;em&gt; Anytime to change configuration to “MaxAvailability” make sure  the primary database property is logxptmode is “ASYNC” and standby  database “logxptmode” is “SYNC then only it can be changed to  “MaxAvailability” otherwise it will fail. If maxavailability does not  work with DGMGRL then you do it from SQLPLUS&lt;/em&gt;&lt;/p&gt;&lt;/ul&gt; &lt;p&gt;ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE AVAILABILITY;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt; &lt;/strong&gt;show database phyocm logxptmode;&lt;br /&gt;LogXptMode = ‘SYNC’&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; show database ocmdb logxptmode;&lt;br /&gt;LogXptMode = ‘SYNC’&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; edit database ocmdb set property logxptmode=’ASYNC’;&lt;br /&gt;Property “logxptmode” updated&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt; &lt;/strong&gt;show database ocmdb logxptmode;&lt;br /&gt; LogXptMode = ‘ASYNC’&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; edit configuration set protection mode as maxavailability;&lt;/p&gt; &lt;p&gt;Operation requires shutdown of instance “ocmdb” on database “ocmdb”&lt;br /&gt;Shutting down instance “ocmdb”…&lt;br /&gt;Database closed.&lt;br /&gt;Database dismounted.&lt;br /&gt;ORACLE instance shut down.&lt;br /&gt;Operation requires startup of instance “ocmdb” on database “ocmdb”&lt;br /&gt;Starting instance “ocmdb”…&lt;br /&gt;ORACLE instance started.&lt;br /&gt;Database mounted.&lt;br /&gt;Now make primary database “logxptmode” is “SYNC&lt;br /&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; edit database ocmdb set property logxptmode=’SYNC’;&lt;br /&gt;Property “logxptmode” updated&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;Make sure both primary and secondary databases have FLASHBACK ON&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;SQL&amp;gt; &lt;/strong&gt;SELECT db_unique_name,&lt;br /&gt;        database_role,&lt;br /&gt;        open_mode,&lt;br /&gt;        flashback_on&lt;br /&gt;   FROM v$database;&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;Edit database property faststartfailovertarget and enable fast_start failover&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; edit database phyocm set property faststartfailovertarget=ocmdb;&lt;br /&gt;Property “faststartfailovertarget” updated&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; edit database ocmdb set property faststartfailovertarget=phyocm;&lt;br /&gt;Property “faststartfailovertarget” updated&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; enable fast_start failover;&lt;br /&gt;Enabled.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; show configuration;&lt;/p&gt; &lt;p&gt;Configuration&lt;br /&gt; Name:                ocmdb&lt;br /&gt; Enabled:             YES&lt;br /&gt; Protection Mode:     MaxAvailability&lt;br /&gt; Fast-Start Failover: ENABLED&lt;br /&gt; Databases:&lt;br /&gt;   ocmdb  – Primary database&lt;br /&gt;   phyocm – Physical standby database&lt;br /&gt;          – Fast-Start Failover target&lt;/p&gt; &lt;p&gt;Current status for “ocmdb”:&lt;br /&gt;Warning: ORA-16608: one or more databases have warnings&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; show database verbose ocmdb;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;You will see warning in the end mentioned below&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Current status for “ocmdb”:&lt;br /&gt;Warning: ORA-16819: Fast-Start Failover observer not started&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;Connect to ocmdb using sqlplus and execute following commands&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;SQL&amp;gt;&lt;/strong&gt; SELECT fs_failover_status, fs_failover_current_target, fs_failover_threshold&lt;br /&gt;    FROM v$database;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;SQL&amp;gt;&lt;/strong&gt; SELECT fs_failover_observer_present, fs_failover_observer_host&lt;br /&gt;        FROM v$database;&lt;/p&gt; &lt;p&gt;&lt;em&gt;Now go to FSFO Observer window and start it &amp;gt;it is best  recommended to use the ‘-logfile’ qualifier on the DGMGRL command to  direct any of its output message to a file that can be examined in case  of a problem. Additionally it is also suggested to specify unique data  file name that Observer uses. This can be done by adding the ‘FILE=’  command to the ‘start observer’ command.&lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;em&gt;This will also allow you to start multiple Observers for multiple  Primary/Standby pairs on the same Observer system using the same Oracle  Home. In this example, since everything is on the same system, the log  in was made using the current ORACLE_SID, which was setup to be the  standby database phyocm.  In a real setup neither of your databases  should be on the Observer system so you would have to use the &lt;a href="mailto:%E2%80%98@tnsname%E2%80%99"&gt;‘@tnsname’&lt;/a&gt; qualifier on the ‘sys/password’ login&lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;[oracle@ocm ~]$&lt;/strong&gt; export ORACLE_SID=phyocm&lt;/p&gt; &lt;p&gt;&lt;strong&gt;[oracle@ocm ~]$&lt;/strong&gt; echo $ORACLE_SID&lt;br /&gt;phyocm&lt;/p&gt; &lt;p&gt;&lt;strong&gt;[oracle@ocm ~]$&lt;/strong&gt; dgmgrl -logfile $ORACLE_HOME/rdbms/log/dgmgrlOCMDB.LOG sys/oracle&lt;br /&gt;DGMGRL for Linux: Version 10.2.0.1.0 – Production&lt;/p&gt; &lt;p&gt;Copyright (c) 2000, 2005, Oracle. All rights reserved.&lt;/p&gt; &lt;p&gt;Welcome to DGMGRL, type “help” for information.&lt;br /&gt;Connected.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; start observer file=’/u01/app/oracle/afoocmdb.dat’;&lt;/p&gt; &lt;p&gt;&lt;em&gt;&lt;strong&gt;Make sure to correct observer file correctly having “afo&lt;db_name&gt;.dat” in start&lt;/db_name&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt; &lt;p&gt;Connect to ocmdb using sqlplus and execute following commands&lt;br /&gt;&lt;strong&gt;SQL&amp;gt;&lt;/strong&gt; SELECT fs_failover_status, fs_failover_current_target, fs_failover_threshold&lt;br /&gt;    FROM v$database;&lt;/p&gt; &lt;p&gt;FS_FAILOVER_STATUS    FS_FAILOVER_CURRENT_TARGET     FS_FAILOVER_THRESHOLD&lt;br /&gt;——————— —————————— ———————&lt;br /&gt;SYNCHRONIZED          phyocm                                  30&lt;/p&gt; &lt;p&gt;&lt;strong&gt;SQL&amp;gt;&lt;/strong&gt; SELECT fs_failover_observer_present, fs_failover_observer_host&lt;br /&gt;    FROM v$database;&lt;/p&gt; &lt;p&gt;FS_FAIL FS_FAILOVER_OBSERVER_HOST&lt;br /&gt;——- —————————————-&lt;br /&gt;YES     ocm.prusolutions.com&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;Open a new session using dgmgrl and connect to standby database phyocm&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;[oracle@ocm ~]$&lt;/strong&gt; dgmgrl &lt;a href="mailto:sys/oracle@phyocm"&gt;sys/oracle@phyocm&lt;/a&gt;&lt;br /&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; show configuration;&lt;/p&gt; &lt;p&gt;Configuration&lt;br /&gt; Name:                ocmdb&lt;br /&gt; Enabled:             YES&lt;br /&gt; Protection Mode:     MaxAvailability&lt;br /&gt; Fast-Start Failover: ENABLED&lt;br /&gt; Databases:&lt;br /&gt;   ocmdb  – Primary database&lt;br /&gt;   phyocm – Physical standby database&lt;br /&gt;          – Fast-Start Failover target&lt;/p&gt; &lt;p&gt;Current status for “ocmdb”:&lt;br /&gt;SUCCESS&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;Connect to ocmdb database and shutdown abort;&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;SQL&amp;gt; &lt;/strong&gt;SHUTDOWN abort;&lt;br /&gt;ORACLE instance shut down.&lt;/p&gt; &lt;p&gt;OR&lt;/p&gt; &lt;p&gt;&lt;strong&gt;$ps –ef | grep –i pmon&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;em&gt;&lt;strong&gt;Kill pmon process to primary database ocmdb to failover&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; show configuration;&lt;/p&gt; &lt;p&gt;Configuration&lt;br /&gt; Name:                ocmdb&lt;br /&gt; Enabled:             YES&lt;br /&gt; Protection Mode:     MaxAvailability&lt;br /&gt; Fast-Start Failover: ENABLED&lt;br /&gt; Databases:&lt;br /&gt;   ocmdb  – Physical standby database (disabled)&lt;br /&gt;          – Fast-Start Failover target&lt;br /&gt;   phyocm – Primary database&lt;/p&gt; &lt;p&gt;Current status for “ocmdb”:&lt;br /&gt;Warning: ORA-16608: one or more databases have warnings&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; show database ocmdb;&lt;/p&gt; &lt;p&gt;Database&lt;br /&gt; Name:            ocmdb&lt;br /&gt; Role:            PHYSICAL STANDBY&lt;br /&gt; Enabled:         NO&lt;br /&gt; Intended State:  ONLINE&lt;br /&gt; Instance(s):&lt;br /&gt;   ocmdb&lt;/p&gt; &lt;p&gt;Current status for “ocmdb”:&lt;br /&gt;Error: ORA-16661: the standby database needs to be reinstated&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;Connect to ocmdb instance and startup&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;[oracle@ocm ~]$&lt;/strong&gt; export ORACLE_SID=ocmdb&lt;/p&gt; &lt;p&gt;&lt;strong&gt;[oracle@ocm ~]$ &lt;/strong&gt;sqlplus / as sysdba&lt;/p&gt; &lt;p&gt;&lt;strong&gt;SQL&amp;gt;&lt;/strong&gt; STARTUP;&lt;br /&gt;ORACLE instance started.&lt;/p&gt; &lt;p&gt;Total System Global Area  536870912 bytes&lt;br /&gt;Fixed Size                  1220460 bytes&lt;br /&gt;Variable Size             209715348 bytes&lt;br /&gt;Database Buffers          314572800 bytes&lt;br /&gt;Redo Buffers               11362304 bytes&lt;br /&gt;Database mounted.&lt;br /&gt;ORA-16649: database will open after Data Guard broker has evaluated Fast-Start&lt;br /&gt;Failover status&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;It will take few minutes to get database synchronized. Execute following sql on both &lt;/strong&gt;&lt;strong&gt;primary and secondary.&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;SQL&amp;gt;&lt;/strong&gt; SELECT db_unique_name, open_mode, database_role FROM v$database;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;SQL&amp;gt;&lt;/strong&gt; SELECT fs_failover_status, fs_failover_current_target, fs_failover_threshold&lt;br /&gt;    FROM v$database;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; show configuration;&lt;/p&gt; &lt;p&gt;Configuration&lt;br /&gt; Name:                ocmdb&lt;br /&gt; Enabled:             YES&lt;br /&gt; Protection Mode:     MaxAvailability&lt;br /&gt; Fast-Start Failover: ENABLED&lt;br /&gt; Databases:&lt;br /&gt;   ocmdb  – Physical standby database&lt;br /&gt;          – Fast-Start Failover target&lt;br /&gt;   phyocm – Primary database&lt;/p&gt; &lt;p&gt;Current status for “ocmdb”:&lt;br /&gt;SUCCESS&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; STOP OBSERVER;&lt;br /&gt;Done.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; disable fast_start failover;&lt;br /&gt;Disabled.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; show configuration;&lt;/p&gt; &lt;p&gt;Configuration&lt;br /&gt; Name:                ocmdb&lt;br /&gt; Enabled:             YES&lt;br /&gt; Protection Mode:     MaxAvailability&lt;br /&gt; Fast-Start Failover: DISABLED&lt;br /&gt; Databases:&lt;br /&gt;   ocmdb  – Physical standby database&lt;br /&gt;   phyocm – Primary database&lt;/p&gt; &lt;p&gt;Current status for “ocmdb”:&lt;br /&gt;SUCCESS&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;Switchover back to ocmdb&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;DGMGRL&amp;gt;&lt;/strong&gt; switchover to ocmdb;&lt;/p&gt; &lt;p&gt;Performing switchover NOW, please wait…&lt;br /&gt;Operation requires shutdown of instance “phyocm” on database “phyocm”&lt;br /&gt;Shutting down instance “phyocm”…&lt;br /&gt;ORA-01109: database not open&lt;/p&gt; &lt;p&gt;Database dismounted.&lt;br /&gt;ORACLE instance shut down.&lt;br /&gt;Operation requires shutdown of instance “ocmdb” on database “ocmdb”&lt;br /&gt;Shutting down instance “ocmdb”…&lt;br /&gt;ORA-01109: database not open&lt;/p&gt; &lt;p&gt;Database dismounted.&lt;br /&gt;ORACLE instance shut down.&lt;br /&gt;Operation requires startup of instance “phyocm” on database “phyocm”&lt;br /&gt;Starting instance “phyocm”…&lt;br /&gt;ORACLE instance started.&lt;br /&gt;Database mounted.&lt;br /&gt;Operation requires startup of instance “ocmdb” on database “ocmdb”&lt;br /&gt;Starting instance “ocmdb”…&lt;br /&gt;ORACLE instance started.&lt;br /&gt;Database mounted.&lt;br /&gt;Switchover succeeded, new primary is “ocmdb”&lt;/p&gt;            &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-707672632381080737?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/707672632381080737/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2011/11/managing-data-guard-using-dgmgrl.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/707672632381080737'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/707672632381080737'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2011/11/managing-data-guard-using-dgmgrl.html' title='Managing Data Guard using DGMGRL'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-3802655869551360246</id><published>2011-11-06T22:52:00.001-08:00</published><updated>2011-11-06T22:52:39.143-08:00</updated><title type='text'></title><content type='html'>&lt;h1 style="font-family: times new roman;" class="entry-title"&gt;Recovery Scenarios through RMAN&lt;/h1&gt;       &lt;div style="font-family: times new roman;" class="entry-meta"&gt;       &lt;span class="meta-prep meta-prep-author"&gt;&lt;/span&gt;&lt;span class="comments-link"&gt;&lt;br /&gt;&lt;/span&gt;      &lt;/div&gt;              &lt;p style="font-family: times new roman;"&gt;&lt;strong&gt;&lt;/strong&gt; &lt;strong&gt;Complete Recovery when SYSTEM tablespace is missing.&lt;/strong&gt;&lt;/p&gt; &lt;ul style="font-family: times new roman;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;strong&gt;Problem Generation&lt;/strong&gt;&lt;/ul&gt; &lt;p style="font-family: times new roman;"&gt;Delete system tablespace datafile from operating system when database is up and running.&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;[oracle@ocm ocmdb]$ rm -i /u01/app/oracle/oradata/disk3/ocmdb/system01.dbf&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;&lt;strong&gt;Solution&lt;/strong&gt;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;i. [oracle@ocm ocmdb]$ sqlplus / as sysdba&lt;br /&gt;ii. SQL&amp;gt; SHUTDOWN abort;&lt;br /&gt;iii. SQL&amp;gt; STARTUP mount;&lt;br /&gt;iv. SQL&amp;gt; SELECT file#, name FROM v$datafile;&lt;br /&gt;v. Using rman connect to target database and catalog database or directly to target database.&lt;br /&gt;[oracle@oem scripts]$ rman target &lt;a href="mailto:sys/oracle@ocmdb"&gt;sys/oracle@ocmdb&lt;/a&gt; catalog &lt;a href="mailto:rman/rman@oemdb"&gt;rman/rman@oemdb&lt;/a&gt;&lt;br /&gt;vi.  RMAN&amp;gt; run&lt;br /&gt;{&lt;br /&gt;  restore datafile 1;&lt;br /&gt;  recover datafile 1;&lt;br /&gt;  sql ‘ alter database open ‘;&lt;br /&gt;}&lt;span id="more-209"&gt;&lt;/span&gt;&lt;/p&gt; &lt;ul style="font-family: times new roman;"&gt;&lt;li&gt;&lt;strong&gt;Complete Recovery when NON-SYSTEM tablespace is missing and database is open and restoring datafile to different location.&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p style="font-family: times new roman;"&gt;&lt;strong&gt;Problem Generation&lt;/strong&gt;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;i. Delete USERS tablespace datafile from operating system&lt;br /&gt;[oracle@ocm ocmdb]$ rm -i users01.dbf&lt;br /&gt;ii. Connect as user sh/sh and create a table in users tablespace&lt;br /&gt;SQL&amp;gt; CREATE TABLE sales_test&lt;br /&gt;   TABLESPACE users&lt;br /&gt;         AS&lt;br /&gt;     SELECT *&lt;br /&gt;     FROM sales&lt;br /&gt;     WHERE ROWNUM &amp;lt; 10;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;ERROR at line 3:&lt;br /&gt;ORA-01116: error in opening database file 4&lt;br /&gt;ORA-01110: data file 4: ‘/u01/app/oracle/oradata/disk3/ocmdb/users01.dbf’&lt;br /&gt;ORA-27041: unable to open file&lt;br /&gt;Linux Error: 2: No such file or directory&lt;br /&gt;Additional information: 3&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;&lt;strong&gt;Solution&lt;/strong&gt;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;i. As DBA user make datafile users01.dbf off line&lt;br /&gt;SQL&amp;gt; SELECT file#, name FROM v$datafile;&lt;br /&gt;SQL&amp;gt; ALTER DATABASE DATAFILE 4 OFFLINE;&lt;br /&gt;ii. Restoring and recovering datafile 4 at new location&lt;br /&gt;RMAN&amp;gt; run&lt;br /&gt; {&lt;br /&gt; set newname for datafile 4 to ‘/u01/app/oracle/oradata/disk5/ocmdb/users01.dbf’;&lt;br /&gt;  restore datafile 4;&lt;br /&gt; switch datafile 4;&lt;br /&gt; recover datafile 4;&lt;br /&gt; sql ‘ alter database datafile 4 online’;&lt;br /&gt; }&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;iii. Connect as user sh/sh and create a table in users tablespace&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;SQL&amp;gt; CREATE TABLE sales_test&lt;br /&gt;   TABLESPACE users&lt;br /&gt;   AS&lt;br /&gt;     SELECT *&lt;br /&gt;     FROM sales&lt;br /&gt;     WHERE ROWNUM &amp;lt; 10;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;Table created.&lt;/p&gt; &lt;ul style="font-family: times new roman;"&gt;&lt;li&gt;&lt;strong&gt;Complete Recovery when NON-SYSTEM tablespace is missing and database is closed and restoring datafile to different location.&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p style="font-family: times new roman;"&gt;&lt;strong&gt;Problem Generation&lt;/strong&gt;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;i. Shutdown the database.&lt;br /&gt;SQL&amp;gt; SHUTDOWN immediate;&lt;br /&gt;ii. Delete USERS tablespace datafile from operating system&lt;br /&gt;[oracle@ocm ocmdb]$ rm -i users01.dbf&lt;br /&gt;iii. Start the database&lt;br /&gt;SQL&amp;gt; STARTUP;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;ORACLE instance started.&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;Total System Global Area  536870912 bytes&lt;br /&gt;Fixed Size                  1220460 bytes&lt;br /&gt;Variable Size             213909652 bytes&lt;br /&gt;Database Buffers          318767104 bytes&lt;br /&gt;Redo Buffers                2973696 bytes&lt;br /&gt;Database mounted.&lt;br /&gt;ORA-01157: cannot identify/lock data file 4 – see DBWR trace file&lt;br /&gt;ORA-01110: data file 4: ‘/u01/app/oracle/oradata/disk5/ocmdb/users01.dbf’&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;&lt;strong&gt;Solution&lt;/strong&gt;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;i. Make datafile 4 offline&lt;br /&gt;SQL&amp;gt; ALTER DATABASE DATAFILE 4 OFFLINE;&lt;br /&gt;ii. Open the database with datafile 4 oflfine&lt;br /&gt;SQL&amp;gt; ALTER DATABASE OPEN;&lt;br /&gt;iii. Using RMAN again connect to target database&lt;br /&gt;[oracle@oem scripts]$ rman target &lt;a href="mailto:sys/oracle@ocmdb"&gt;sys/oracle@ocmdb&lt;/a&gt; catalog &lt;a href="mailto:rman/rman@oemdb"&gt;rman/rman@oemdb&lt;/a&gt;&lt;br /&gt;iv. Restoring and recovering datafile 4 at new location&lt;br /&gt; RMAN&amp;gt; run&lt;br /&gt;  {&lt;br /&gt;set newname for datafile 4 to ‘/u01/app/oracle/oradata/disk3/ocmdb/users01.dbf’;&lt;br /&gt; restore datafile 4;&lt;br /&gt; switch datafile 4;&lt;br /&gt; recover datafile 4;&lt;br /&gt; sql ‘ alter database datafile 4 online’;&lt;br /&gt; }&lt;/p&gt; &lt;ul style="font-family: times new roman;"&gt;&lt;li&gt;&lt;strong&gt;Recovery of datafile which has no backups&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p style="font-family: times new roman;"&gt;&lt;strong&gt;Problem Generation&lt;/strong&gt;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;i. Create Oracle Managed File tablespace&lt;br /&gt;SQL&amp;gt; CREATE TABLESPACE reco_test;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;ii. Create table sh_sales on tablespace reco_test.&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;SQL&amp;gt; CREATE TABLE sh_sales&lt;br /&gt;   TABLESPACE reco_test&lt;br /&gt;   AS&lt;br /&gt;     SELECT *&lt;br /&gt;     FROM sh.sales&lt;br /&gt;     WHERE ROWNUM &amp;lt; 10;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;iii. Delete RECO_TEST tablespace datafile from operating system.&lt;br /&gt;[oracle@ocm ~]$ rm –i /u01/app/oracle/oradata/disk5/OCMDB/datafile/o1_mf_reco_tes_6n8dnc7z_.dbf&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;iv. Select from table sh_sales.&lt;br /&gt;SQL&amp;gt; SELECT COUNT (*) FROM sh_sales;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;                     *&lt;br /&gt;ERROR at line 1:&lt;br /&gt;ORA-01116: error in opening database file 5&lt;br /&gt;ORA-01110: data file 5:&lt;br /&gt;‘/u01/app/oracle/oradata/disk5/OCMDB/datafile/o1_mf_reco_tes_6n8dnc7z_.dbf’&lt;br /&gt;ORA-27041: unable to open file&lt;br /&gt;Linux Error: 2: No such file or directory&lt;br /&gt;Additional information: 3&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;&lt;strong&gt;Solution&lt;/strong&gt;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;i. Recover Datafile 5.&lt;br /&gt;RMAN&amp;gt; run {&lt;br /&gt;  sql ‘ alter database datafile 5 offline ‘;&lt;br /&gt;  restore datafile 5;&lt;br /&gt;  recover datafile 5;&lt;br /&gt;  sql ‘ alter database datafile 5 online ‘;&lt;br /&gt;  }&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;ii. Select from table sh_sales.&lt;br /&gt;SQL&amp;gt; SELECT COUNT (*) FROM sh_sales;&lt;/p&gt; &lt;ul style="font-family: times new roman;"&gt;&lt;li&gt;&lt;strong&gt;Recover of missing controlfile ( Copy other controlfile and mount database).&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p style="font-family: times new roman;"&gt;&lt;strong&gt;Problem Generation&lt;/strong&gt;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;i. Shutdown the Database&lt;br /&gt;SQL&amp;gt; SHUTDOWN immediate;&lt;br /&gt;ii. Delete Control file control01.ctl from operating system&lt;br /&gt;[oracle@ocm ocmdb]$ rm -i /u01/app/oracle/oradata/disk1/ocmdb/control01.ctl&lt;br /&gt;iii. Startup Database.&lt;br /&gt;SQL&amp;gt; STARTUP;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;ORACLE instance started.&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;Total System Global Area  536870912 bytes&lt;br /&gt;Fixed Size                  1220460 bytes&lt;br /&gt;Variable Size             218103956 bytes&lt;br /&gt;Database Buffers          314572800 bytes&lt;br /&gt;Redo Buffers                2973696 bytes&lt;br /&gt;ORA-00205: error in identifying control file, check alert log for more info&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;&lt;strong&gt;Solution&lt;/strong&gt;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;i. Check the control file location&lt;br /&gt;SQL&amp;gt; SHOW PARAMETER control&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;NAME                                 TYPE        VALUE&lt;br /&gt;———————————— ———– ——————————&lt;br /&gt;control_file_record_keep_time        integer     7&lt;br /&gt;control_files                         string      /u01/app/oracle/oradata/disk1/&lt;br /&gt;                                                     ocmdb/control01.ctl, /u01/app/&lt;br /&gt;                                                    oracle/admin/ocmdb/control/con&lt;br /&gt;                                                   trol02.ctl&lt;br /&gt;ii. Copy control01.ctl from control02.ctl&lt;br /&gt;[oracle@ocm ocmdb]$ cp /u01/app/oracle/admin/ocmdb/control/control02.ctl /u01/app/oracle/oradata/disk1/ocmdb/control01.ctl&lt;br /&gt;iii. Mount the Database and Open it.&lt;br /&gt;SQL&amp;gt; ALTER DATABASE MOUNT;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;SQL&amp;gt; ALTER DATABASE OPEN;&lt;/p&gt; &lt;ul style="font-family: times new roman;"&gt;&lt;li&gt;&lt;strong&gt;Incomplete recovery is required when archived log, redo log  is missing, then recovery can only be made until the previous sequence,  or when an important object was dropped and recovery needs to be made  until before the object was dropped. Use until sequence or until time or  until cancel for incomplete recovery&lt;/strong&gt;.&lt;/li&gt;&lt;/ul&gt; &lt;p style="font-family: times new roman;"&gt;&lt;strong&gt;Problem Generation&lt;/strong&gt;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;i. Shutdown Database.&lt;br /&gt;SQL&amp;gt; SHUTDOWN immediate;&lt;br /&gt;ii. Delete redo log files from operating system&lt;br /&gt;[oracle@ocm ocmdb]$ rm -i  /u01/app/oracle/oradata/disk4/ocmdb/redo01b.log[oracle@ocm ocmdb]$ rm -i  /u01/app/oracle/oradata/disk2/ocmdb/redo01a.log&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;If redo log file is lost when database is up , always switch logfile  few times until sql statement hangs to archive the available redo  logfiles, which are still not archived.&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;iii. Startup the Database.&lt;br /&gt;SQL&amp;gt; STARTUP;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;ORACLE instance started.&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;Total System Global Area  536870912 bytes&lt;br /&gt;Fixed Size                  1220460 bytes&lt;br /&gt;Variable Size             218103956 bytes&lt;br /&gt;Database Buffers          314572800 bytes&lt;br /&gt;Redo Buffers                2973696 bytes&lt;br /&gt;Database mounted.&lt;br /&gt;ORA-00313: open failed for members of log group 1 of thread 1&lt;br /&gt;ORA-00312: online log 1 thread 1:&lt;br /&gt;‘/u01/app/oracle/oradata/disk2/ocmdb/redo01a.log’&lt;br /&gt;ORA-00312: online log 1 thread 1:&lt;br /&gt;‘/u01/app/oracle/oradata/disk4/ocmdb/redo01b.log’&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;&lt;strong&gt;Solution&lt;/strong&gt;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;i. Complete database restore is required ,execute sql below to get  latest sequence# archived ,add 1 to last sequence  and then use in RMAN  to recover database.&lt;br /&gt;SQL&amp;gt; SELECT thread#,&lt;br /&gt;            resetlogs_change#,&lt;br /&gt;            archived,&lt;br /&gt;             sequence#,&lt;br /&gt;            TO_CHAR (completion_time, ‘YYYY-MM-DD:HH24:MI:SS’) completion_time&lt;br /&gt;     FROM v$archived_log&lt;br /&gt;     WHERE archived = ‘YES’&lt;br /&gt;     AND completion_time = (SELECT MAX (completion_time)&lt;br /&gt;                                FROM v$archived_log&lt;br /&gt;                               WHERE archived = ‘YES’);&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;THREAD# RESETLOGS_CHANGE# ARC SEQUENCE# COMPLETION_TIME&lt;br /&gt;———-     —————–          —      ———-   ——————-&lt;br /&gt;1                  1          YES           58     2011-01-29:21:02:46&lt;br /&gt;&lt;br /&gt;ii. Connect to target database using RMAN catalog&lt;br /&gt;[oracle@oem scripts]$ rman target &lt;a href="mailto:sys/oracle@ocmdb"&gt;sys/oracle@ocmdb&lt;/a&gt; catalog &lt;a href="mailto:rman/rman@oemdb"&gt;rman/rman@oemdb&lt;/a&gt;&lt;br /&gt;iii. RMAN command to recover database.&lt;br /&gt;RMAN&amp;gt; run&lt;br /&gt; {&lt;br /&gt;  restore database;&lt;br /&gt;  recover database until sequence 59 thread 1;&lt;br /&gt;  sql ‘ alter database open resetlogs ‘;&lt;br /&gt;  }&lt;br /&gt;iv. After database is open switch logfile few times&lt;br /&gt;SQL&amp;gt; ALTER SYSTEM SWITCH LOGFILE;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;SQL&amp;gt; ALTER SYSTEM SWITCH LOGFILE;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;SQL&amp;gt; ALTER SYSTEM SWITCH LOGFILE;&lt;/p&gt; &lt;ul style="font-family: times new roman;"&gt;&lt;li&gt; &lt;strong&gt;Recovery if all controlfiles are missing&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p style="font-family: times new roman;"&gt;&lt;strong&gt;Problem Generation&lt;/strong&gt;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;i. Shutdown Database.&lt;br /&gt;SQL&amp;gt;  SHUTDOWN immediate;&lt;br /&gt;ii. Delete all  Control files from operating system&lt;br /&gt;[oracle@ocm ocmdb]$ rm -i  /u01/app/oracle/oradata/disk1/ocmdb/control01.ctl&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;[oracle@ocm ocmdb]$ rm -i /u01/app/oracle/admin/ocmdb/control/control02.ctl&lt;br /&gt;iii. Connect as sysdba and startup Database.&lt;br /&gt;[oracle@ocm ocmdb]$ sqlplus / as sysdba&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;SQL&amp;gt; STARTUP;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;ORACLE instance started.&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;Total System Global Area  536870912 bytes&lt;br /&gt;Fixed Size                  1220460 bytes&lt;br /&gt;Variable Size             222298260 bytes&lt;br /&gt;Database Buffers          310378496 bytes&lt;br /&gt;Redo Buffers                2973696 bytes&lt;br /&gt;ORA-00205: error in identifying control file, check alert log for more info&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;&lt;strong&gt;Solution&lt;/strong&gt;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;i. Using RMAN restore contolfile from Autobackup and Recover Database&lt;br /&gt;RMAN&amp;gt; run&lt;br /&gt;  {&lt;br /&gt;  restore controlfile from autobackup;&lt;br /&gt;  sql ‘ alter database mount’;&lt;br /&gt;  recover database;&lt;br /&gt;  sql ‘ alter database open resetlogs’;&lt;br /&gt; }&lt;br /&gt;ii. List Database Incarnation&lt;br /&gt;RMAN&amp;gt; list incarnation;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;List of Database Incarnations&lt;br /&gt;DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time&lt;br /&gt;——- ——- ——– —————- — ———- ———-&lt;br /&gt;1       2         OCMDB    4083722939       PARENT  1            15-JAN-11&lt;br /&gt;1       1415    OCMDB    4083722939       PARENT  503961     29-JAN-11&lt;br /&gt;1       1867    OCMDB    4083722939       CURRENT 519078     29-JAN-11&lt;br /&gt;iii. After database is open switch logfile few times&lt;br /&gt;SQL&amp;gt; ALTER SYSTEM SWITCH LOGFILE;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;SQL&amp;gt; ALTER SYSTEM SWITCH LOGFILE;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;SQL&amp;gt; ALTER SYSTEM SWITCH LOGFILE;&lt;br /&gt;v. Always backup controlfile after open resetlogs even if CONTROLFILE  AUTOBACKUP ON. Let us NOT BACKUP controlfile and see what happens in  next scenario.&lt;br /&gt;RMAN&amp;gt; backup current controlfile;  — For now do not execute this command&lt;/p&gt; &lt;ul style="font-family: times new roman;"&gt;&lt;li&gt;&lt;strong&gt;Recover if all controlfiles,datafiles,spfile,redologs  are lost&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p style="font-family: times new roman;"&gt;&lt;strong&gt;Problem Generation  &lt;/strong&gt;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;i. Shutdown Database.&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;SQL&amp;gt;  SHUTDOWN immediate;&lt;br /&gt;ii. Delete all the datafiles ,controlfiles ,redo logfiles ,spfile ,initocmdb.ora files from Operating System&lt;br /&gt;iii. Startup Database&lt;br /&gt;SQL&amp;gt; STARTUP;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;ORA-01078: failure in processing system parameters&lt;br /&gt;LRM-00109: could not open parameter file ‘/u01/app/oracle/product/10.2.0/db_1/dbs/initocmdb.ora’&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;&lt;strong&gt;Make sure you have lost all the files not just spfile, if  only spfile is lost , then too you will get above error you need to  create only spfile.&lt;/strong&gt;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;&lt;strong&gt;Solution&lt;/strong&gt;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;i. Using RMAN connect to target database using catalog&lt;br /&gt;[oracle@oem scripts]$ rman target &lt;a href="mailto:sys/oracle@ocmdb"&gt;sys/oracle@ocmdb&lt;/a&gt; catalog &lt;a href="mailto:rman/rman@oemdb"&gt;rman/rman@oemdb&lt;/a&gt;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;Recovery Manager: Release 10.2.0.1.0 – Production on Sun Jan 30 06:02:44 2011&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;Copyright (c) 1982, 2005, Oracle.  All rights reserved.&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;connected to target database (not started)&lt;br /&gt;connected to recovery catalog database&lt;br /&gt;ii. Set Database DBID&lt;br /&gt;RMAN&amp;gt; set dbid &lt;dbid&gt; — dbid 4083722939&lt;br /&gt;iii. Startup Database in Nomount State&lt;br /&gt;RMAN&amp;gt; startup nomount;&lt;br /&gt;iv. Restore spfile from Autobackup&lt;br /&gt;RMAN&amp;gt; restore spfile from autobackup;&lt;/dbid&gt;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;v. Again start the Database in Nomount State&lt;br /&gt;RMAN&amp;gt; startup force nomount;&lt;br /&gt;vi. Restore controlfile from Autobackup&lt;br /&gt;RMAN&amp;gt; restore controlfile from autobackup;&lt;br /&gt;vii. Mount Database&lt;br /&gt;RMAN&amp;gt; alter database mount;&lt;br /&gt;viii. Open a terminal in OCMDB machine and check archive log completion time&lt;br /&gt;[oracle@ocm ~]$ sqlplus / as sysdba&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;SQL&amp;gt; SELECT thread#,&lt;br /&gt;            resetlogs_change#,&lt;br /&gt;            archived,&lt;br /&gt;            sequence#,&lt;br /&gt;            TO_CHAR (completion_time, ‘YYYY-MM-DD:HH24:MI:SS’)&lt;br /&gt;   completion_time&lt;br /&gt;      FROM v$archived_log&lt;br /&gt;      WHERE archived = ‘YES’&lt;br /&gt;      AND completion_time = (SELECT MAX (completion_time)&lt;br /&gt;                                FROM v$archived_log&lt;br /&gt;                               WHERE archived = ‘YES’);&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;   THREAD# RESETLOGS_CHANGE# ARC SEQUENCE# COMPLETION_TIME&lt;br /&gt;———-   —————–         —       ———-           ——————-&lt;br /&gt;1        519078         YES          1           2011-01-29:23:18:17&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;ix. By executing the command below we may not be able to recover  database because control file is from older incarnation. This is because  we have not taken backup of controlfile after reset logs and  immediately crashed the database after recovery in previous scenario.&lt;br /&gt; RMAN&amp;gt; run&lt;br /&gt;{&lt;br /&gt;restore database;&lt;br /&gt;recover database until  sequence 1 thread 1;&lt;br /&gt;sql ‘ alter database open resetlogs’;&lt;br /&gt;}&lt;br /&gt;x. Now, we have to reset database to older incarnation and recover the database.&lt;br /&gt;xi. List Database Incarnation.&lt;br /&gt;RMAN&amp;gt; list incarnation;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;List of Database Incarnations&lt;br /&gt;DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time&lt;br /&gt;——- ——- ——– —————- — ———- ———-&lt;br /&gt;1       2       OCMDB    4083722939       PARENT  1          15-JAN-11&lt;br /&gt;1       1415    OCMDB    4083722939       PARENT  503961     29-JAN-11&lt;br /&gt;1       1867    OCMDB    4083722939       CURRENT 519078     29-JAN-11&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;xii. Open a terminal in OCMDB machine and check archive log completion time.&lt;br /&gt;SQL&amp;gt; SELECT thread#,&lt;br /&gt;            resetlogs_change#,&lt;br /&gt;            archived,&lt;br /&gt;            sequence#,&lt;br /&gt;            TO_CHAR (completion_time, ‘YYYY-MM-DD:HH24:MI:SS’)&lt;br /&gt;          completion_time&lt;br /&gt;     FROM v$archived_log&lt;br /&gt;     WHERE archived = ‘YES’&lt;br /&gt;          ORDER BY completion_time;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;  THREAD# RESETLOGS_CHANGE# ARC  SEQUENCE# COMPLETION_TIME&lt;br /&gt;———-  —————–   —  ———-    ——————-&lt;br /&gt;1            503961   YES          4     2011-01-29:22:18:18&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;Add 1 to the latest sequence of last incarnation i.e. 4+1 =5&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;xiii. Reset the Database to old incarnation and recover.&lt;br /&gt;RMAN&amp;gt; reset DATABASE TO incarnation 1415;&lt;/p&gt; &lt;p style="font-family: times new roman;"&gt;RMAN&amp;gt; run&lt;br /&gt;{&lt;br /&gt;restore database;&lt;br /&gt;recover database until  sequence 5 thread 1;&lt;br /&gt;sql ‘ alter database open resetlogs’;&lt;br /&gt;}&lt;/p&gt; &lt;ul style="font-family: times new roman;"&gt;&lt;li&gt;&lt;strong&gt;Recovery if Temporary tablespace is lost&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p style="font-family: times new roman;"&gt;Recreate the temporary tablespace.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-3802655869551360246?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/3802655869551360246/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2011/11/recovery-scenarios-through-rman.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/3802655869551360246'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/3802655869551360246'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2011/11/recovery-scenarios-through-rman.html' title=''/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-4663101014695557525</id><published>2011-07-30T01:08:00.000-07:00</published><updated>2011-07-30T01:11:30.235-07:00</updated><title type='text'>Differential backup and Cumulative backup</title><content type='html'>&lt;span style="font-size:85%;"&gt;&lt;a style="font-family: georgia;" name="4148583817907080561"&gt;&lt;/a&gt;&lt;/span&gt;  &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;strong style="font-family: georgia;"&gt;Differencial backup:&lt;/strong&gt;&lt;span style="font-family:georgia;"&gt; This is the default type of incremental backup which backs up all blocks changed after the most recent backup at level &lt;/span&gt;&lt;strong style="font-family: georgia;"&gt;n&lt;/strong&gt;&lt;span style="font-family:georgia;"&gt; or &lt;/span&gt;&lt;strong style="font-family: georgia;"&gt;lower&lt;/strong&gt;&lt;span style="font-family:georgia;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong style="font-family: georgia;"&gt;Cumulative backup: &lt;/strong&gt;&lt;/span&gt;   &lt;span style="font-size:85%;"&gt;&lt;span style="font-family:georgia;"&gt;Backup all blocks cahnged after the most recent backup at level &lt;/span&gt;&lt;strong style="font-family: georgia;"&gt;n-1&lt;/strong&gt;&lt;span style="font-family:georgia;"&gt; or &lt;/span&gt;&lt;strong style="font-family: georgia;"&gt;lower&lt;/strong&gt;&lt;span style="font-family:georgia;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt; &lt;div class="row2"  style="font-family:georgia;"&gt;                                 &lt;p class="margin_none"&gt;&lt;span style="font-size:85%;"&gt;A cumulative incremental backup is the backup of all files that have changed since the last full backup. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;A differential incremental backup is the backup of all files that have changed since the last backup. &lt;/span&gt;&lt;/p&gt;                    &lt;/div&gt; &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;   &lt;div style="font-family: georgia;" class="post-header"&gt;  &lt;/div&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:georgia;"&gt;   Hi,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;      Here I'm descrbing RMAN backups Types,Commands and Usage in Brief in Oracle 11g Database.Hope it will help one and all.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:georgia;" &gt;&lt;span style="font-weight: bold;"&gt;RMAN BACKUPS:&lt;br /&gt;----------------&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;   &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:georgia;" &gt;1)RMAN HOT BACKUP&lt;/span&gt;&lt;/span&gt;  &lt;span style="font-size:85%;"&gt;&lt;span style="font-family:georgia;"&gt;  =&amp;gt;database up &amp;amp; running&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:georgia;" &gt;2)RMAN COLD BACKUP&lt;/span&gt;&lt;span style="font-family:georgia;"&gt; =&amp;gt;database is not up(shutdown =&amp;gt;mount(now take backup).&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; 1)RMAN HOT BACKUP: OPEN STATE  (ARCHIVE_LOG MODE)&lt;/span&gt;&lt;/span&gt;   &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; 2)RMAN COLD BACKUP:MOUNT STATE (NO ARCHIVE LOG MODE)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:georgia;" &gt;&lt;span style="font-weight: bold;"&gt;INCREMENTAL BACKUP:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;   &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; 1)DIFFERENTIAL BACKUP =&amp;gt;BY DEFAULT INCREMENTAL BACKUP IS DIFFERENTIAL.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;                       =&amp;gt;BACKUP FROM SAME OR LOWER LEVEL.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;                       =&amp;gt;LEVEL 0,LEVEL 1,LEVEL 2.....&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; 2)CUMMULATIVE BACKUP  =&amp;gt;BACKUP FROM LEVEL 0(LOWEST LEVEL)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;                       =&amp;gt;LEVEL 0,LEVEL 1,LEVEL 2.....&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; WHERE: &lt;/span&gt;&lt;/span&gt; &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; LEVEL 0=FULL BACKUP&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; LEVEL 1=CHANGE DATA FROM LEVEL 0 &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; LEVEL 2=CHANGE DATA FROM LEVEL 1...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; BACKUP STRATERGY:&lt;/span&gt;&lt;/span&gt;  &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; --------------------&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; SUNDAY =LEVEL 0  =&amp;gt;INCREMENTAL (DIFFERENTIAL)=&amp;gt;BACKUP LEVEL 0(LOWEST LEVEL)&lt;/span&gt;&lt;/span&gt; &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; MONDAY =LEVEL 1  =&amp;gt;INCREMENTAL&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; TUESDAY=LEVEL 2  =&amp;gt;INCREMENTAL&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; WED    =LEVEL 0  =&amp;gt;INCREMENTAL (CUMMULATIVE) =&amp;gt;BACKUP LEVEL 0(LOWEST LEVEL)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; THUR   =LEVEL 1  =&amp;gt;INCREMENTAL&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; FRI    =LEVEL 2  =&amp;gt;INCREMENTAL &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; SAT=   =LEVEL 1  =&amp;gt;CUMMULATIVE =&amp;gt;BACKUP LEVEL 1(CHANGE DATA FROM LEVEL 0) &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:georgia;" &gt;&lt;span style="font-weight: bold;"&gt;TIMESTAMP SYMBOLS:&lt;br /&gt;-------------------&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;   &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; %U=UNIQUE BACKUPSET NAME&lt;/span&gt;&lt;/span&gt; &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; %T= TIMESTAMP OF TIME OF BACKUPSET&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:georgia;" &gt;&lt;span style="font-weight: bold;"&gt;RMAN COMMANDS:&lt;br /&gt;----------------&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;  &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:georgia;" &gt;&lt;span style="font-weight: bold;"&gt;INCREMENTAL BACKUP:&lt;br /&gt;---------------------&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;  &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:georgia;" &gt;1)DIFFERENTIAL BACKUP&lt;br /&gt;2)CUMULATIVE BACKUP&lt;/span&gt;&lt;/span&gt;  &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:georgia;" &gt;1)DIFFERENTIAL BACKUP:&lt;/span&gt;&lt;/span&gt;  &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:georgia;" &gt;-- INCREMENTAL LEVEL 0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; run{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; Allocate channel ch1 type disk format 'D:\RMAN_BACKUP\ORCL_data_BACKUP2_%T_%U';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; Backup incremental level=0 database tag='complete_backup';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; Release channel ch1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; allocate channel c1 type disk;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; copy current controlfile to 'D:\RMAN_BACKUP\ORCL_ctrl_BACKUP2_%U_%T';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; Release channel c1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:georgia;" &gt;-- INCREMENTAL LEVEL 1&lt;/span&gt;&lt;/span&gt;   &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; run{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; Allocate channel ch1 type disk format 'D:\RMAN_BACKUP\ORCL_data_BACKUP2_%T_%U';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; Backup incremental level=1 database tag='complete_backup';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; Release channel ch1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; allocate channel c1 type disk;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; copy current controlfile to 'D:\RMAN_BACKUP\ORCL_ctrl_BACKUP2_%U_%T';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; Release channel c1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:georgia;" &gt;-- INCREMENTAL LEVEL 2&lt;/span&gt;&lt;/span&gt;  &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; run{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; Allocate channel ch1 type disk format 'D:\RMAN_BACKUP\ORCL_data_BACKUP2_%T_%U';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; Backup incremental level=2 database tag='complete_backup';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; Release channel ch1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; allocate channel c1 type disk;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; copy current controlfile to 'D:\RMAN_BACKUP\ORCL_ctrl_BACKUP2_%U_%T';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; Release channel c1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:georgia;" &gt;&lt;span style="font-weight: bold;"&gt;2)CUMULATIVE BACKUP:&lt;br /&gt;----------------------&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;  &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:georgia;" &gt;-- CUMMULATIVE BACKUP&lt;/span&gt;&lt;/span&gt;  &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; RMAN&amp;gt; run{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; 2&amp;gt; Allocate channel ch1 type disk format 'D:\RMAN_BACKUP\ORCL_data_BACKUP2_%T_%U';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; 3&amp;gt; Backup incremental level=0 CUMULATIVE database tag='complete_backup';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; 4&amp;gt; Release channel ch1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; 5&amp;gt; allocate channel c1 type disk;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; 6&amp;gt; copy current controlfile to 'D:\RMAN_BACKUP\ORCL_ctrl_BACKUP2_%U_%T';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; 7&amp;gt; Release channel c1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; 8&amp;gt; }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; released channel: ORA_DISK_1&lt;/span&gt;&lt;/span&gt; &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; allocated channel: ch1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; channel ch1: SID=73 device type=DISK&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; Starting backup at 24-JUL-11&lt;/span&gt;&lt;/span&gt; &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; channel ch1: starting incremental level 0 datafile backup set&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; channel ch1: specifying datafile(s) in backup set&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; input datafile file number=00004 name=D:\APP\RAFIALVI\ORADATA\ORCL\USERS01.DBF&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; channel ch1: starting piece 1 at 24-JUL-11&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; channel ch1: finished piece 1 at 24-JUL-11&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; piece handle=D:\RMAN_BACKUP\ORCL_DATA_BACKUP2_20110724_1HMI7EPO_1_1 tag=COMPLETE_BACKUP comment=NONE&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; channel ch1: backup set complete, elapsed time: 00:00:01&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; channel ch1: starting incremental level 0 datafile backup set&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; channel ch1: specifying datafile(s) in backup set&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; input datafile file number=00001 name=D:\APP\RAFIALVI\ORADATA\ORCL\SYSTEM01.DBF&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; input datafile file number=00002 name=D:\APP\RAFIALVI\ORADATA\ORCL\SYSAUX01.DBF&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; input datafile file number=00003 name=D:\APP\RAFIALVI\ORADATA\ORCL\UNDOTBS01.DBF&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; input datafile file number=00005 name=D:\APP\RAFIALVI\ORADATA\ORCL\EXAMPLE01.DBF&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; channel ch1: starting piece 1 at 24-JUL-11&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; channel ch1: finished piece 1 at 24-JUL-11&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; piece handle=D:\RMAN_BACKUP\ORCL_DATA_BACKUP2_20110724_1IMI7EPP_1_1 tag=COMPLETE_BACKUP comment=NONE&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; channel ch1: backup set complete, elapsed time: 00:01:15&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; channel ch1: starting incremental level 0 datafile backup set&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; channel ch1: specifying datafile(s) in backup set&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; including current control file in backup set&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; including current SPFILE in backup set&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; channel ch1: starting piece 1 at 24-JUL-11&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; channel ch1: finished piece 1 at 24-JUL-11&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; piece handle=D:\RMAN_BACKUP\ORCL_DATA_BACKUP2_20110724_1JMI7ES5_1_1 tag=COMPLETE_BACKUP comment=NONE&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; channel ch1: backup set complete, elapsed time: 00:00:01&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; Finished backup at 24-JUL-11&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; released channel: ch1&lt;/span&gt;&lt;/span&gt; &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:georgia;" &gt;-- CUMULATIVE BACKUP LEVEL LOWEST(0)&lt;/span&gt;&lt;/span&gt;  &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; run{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; Allocate channel ch1 type disk format 'D:\RMAN_BACKUP\ORCL_data_BACKUP2_%T_%U';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; BACKUP INCREMENTAL LEVEL=0 CUMULATIVE DATABASE FILESPERSET 4 tag='cumulative';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;  tag='complete_cummulative_backup';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; Release channel ch1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; allocate channel c1 type disk;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; copy current controlfile to 'D:\RMAN_BACKUP\ORCL_ctrl_BACKUP2_%U_%T';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; Release channel c1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:georgia;" &gt;-- CUMULATIVE BACKUP LEVEL LOWEST(1)&lt;/span&gt;&lt;/span&gt;   &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; run{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; Allocate channel ch1 type disk format 'D:\RMAN_BACKUP\ORCL_data_BACKUP2_%T_%U';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; BACKUP INCREMENTAL LEVEL=1 CUMULATIVE DATABASE tag='cumulative_LEVEL1';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; Release channel ch1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; allocate channel c1 type disk;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; copy current controlfile to 'D:\RMAN_BACKUP\ORCL_ctrl_BACKUP2_%U_%T';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; Release channel c1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; RMAN&amp;gt; run{&lt;/span&gt;&lt;/span&gt; &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; 2&amp;gt; Allocate channel ch1 type disk format 'D:\RMAN_BACKUP\ORCL_data_BACKUP2_%T_%U';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; 3&amp;gt; BACKUP INCREMENTAL LEVEL=1 CUMULATIVE DATABASE tag='cumulative_LEVEL1';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; 4&amp;gt; Release channel ch1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; 5&amp;gt; allocate channel c1 type disk;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; 6&amp;gt; copy current controlfile to 'D:\RMAN_BACKUP\ORCL_ctrl_BACKUP2_%U_%T';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; 7&amp;gt; Release channel c1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; 8&amp;gt; }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; released channel: ORA_DISK_1&lt;/span&gt;&lt;/span&gt; &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; allocated channel: ch1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; channel ch1: SID=73 device type=DISK&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; Starting backup at 24-JUL-11&lt;/span&gt;&lt;/span&gt; &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; channel ch1: starting incremental level 1 datafile backup set&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; channel ch1: specifying datafile(s) in backup set&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; input datafile file number=00004 name=D:\APP\RAFIALVI\ORADATA\ORCL\USERS01.DBF&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; channel ch1: starting piece 1 at 24-JUL-11&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; channel ch1: finished piece 1 at 24-JUL-11&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; piece handle=D:\RMAN_BACKUP\ORCL_DATA_BACKUP2_20110724_1NMI7F9M_1_1 tag=CUMULATIVE_LEVEL1 comment=NONE&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; channel ch1: backup set complete, elapsed time: 00:01:25&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; channel ch1: starting incremental level 1 datafile backup set&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; channel ch1: specifying datafile(s) in backup set&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; input datafile file number=00001 name=D:\APP\RAFIALVI\ORADATA\ORCL\SYSTEM01.DBF&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; input datafile file number=00002 name=D:\APP\RAFIALVI\ORADATA\ORCL\SYSAUX01.DBF&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; input datafile file number=00003 name=D:\APP\RAFIALVI\ORADATA\ORCL\UNDOTBS01.DBF&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; input datafile file number=00005 name=D:\APP\RAFIALVI\ORADATA\ORCL\EXAMPLE01.DBF&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; channel ch1: starting piece 1 at 24-JUL-11&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; channel ch1: finished piece 1 at 24-JUL-11&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; piece handle=D:\RMAN_BACKUP\ORCL_DATA_BACKUP2_20110724_1OMI7FCC_1_1 tag=CUMULATIVE_LEVEL1 comment=NONE&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; channel ch1: backup set complete, elapsed time: 00:00:35&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; channel ch1: starting incremental level 1 datafile backup set&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; channel ch1: specifying datafile(s) in backup set&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; including current control file in backup set&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; including current SPFILE in backup set&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; channel ch1: starting piece 1 at 24-JUL-11&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; channel ch1: finished piece 1 at 24-JUL-11&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; piece handle=D:\RMAN_BACKUP\ORCL_DATA_BACKUP2_20110724_1PMI7FDF_1_1 tag=CUMULATIVE_LEVEL1 comment=NONE&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; channel ch1: backup set complete, elapsed time: 00:00:01&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; Finished backup at 24-JUL-11&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; released channel: ch1&lt;/span&gt;&lt;/span&gt; &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; allocated channel: c1&lt;/span&gt;&lt;/span&gt; &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; channel c1: SID=73 device type=DISK&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; Starting backup at 24-JUL-11&lt;/span&gt;&lt;/span&gt; &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; channel c1: starting datafile copy&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; copying current control file&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; output file name=D:\RMAN_BACKUP\ORCL_CTRL_BACKUP2_CF_D-ORCL_ID-1280115002_1QMI7FDK_20110724 tag=TAG20110724T055044 R&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; D=31 STAMP=757317045&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; channel c1: datafile copy complete, elapsed time: 00:00:01&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; Finished backup at 24-JUL-11&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; released channel: c1&lt;/span&gt;&lt;/span&gt; &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:georgia;" &gt;&lt;span style="font-weight: bold;"&gt;ARCHIVE LOG DELETION POLICY FOR A DATABASE:&lt;br /&gt;----------------------------------------------&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;   &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; run {&lt;/span&gt;&lt;/span&gt; &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; allocate channel for maintenance device type disk;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; delete archivelog until time 'sysdate -5';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;  I do backups from the primary database to a local drive and have been puzzled &lt;/span&gt;&lt;/span&gt; &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; how to delete the standby archive logs after they ship.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; The ‘obvious’ solution is the documented feature in RMAN:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;&lt;/span&gt;&lt;/span&gt; &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:georgia;" &gt;COMPRESSION LEVEL ORACLE 11g:&lt;br /&gt;----------------------------------&lt;/span&gt;&lt;/span&gt;   &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; basic =DEFAULT&lt;/span&gt;&lt;/span&gt; &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; none  =Not recomended&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; medium = license&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; high =license&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:georgia;" &gt;&lt;span style="font-weight: bold;"&gt;Drawbacks:&lt;br /&gt;------------&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;   &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; medium =&amp;gt;consume hight system resource&lt;/span&gt;&lt;/span&gt; &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; high =&amp;gt;consume high system resource&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:georgia;" &gt;&lt;span style="font-weight: bold;"&gt;II)RMAN COLD BACKUP:&lt;br /&gt;----------------------&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;  &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; =&amp;gt;NOARCHIVE LOG MODE&lt;/span&gt;&lt;/span&gt; &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; =&amp;gt;MOUNT STATE&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; =&amp;gt; DEVELOPMENT  =&amp;gt; MUCH DISK SPACE IS NOT THERE&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; =&amp;gt;DOWNTIME TOLERABLE..&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:georgia;" &gt;run_orcl.txt&lt;/span&gt;&lt;/span&gt;   &lt;span style="font-size:85%;"&gt;&lt;span style="font-family:georgia;"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; -----------------------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; *&lt;/span&gt;&lt;/span&gt;  &lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;font-family:georgia;" &gt;SNAPSHOT CONTROLFILE:&lt;/span&gt;&lt;span style="font-family:georgia;"&gt;RMAN USES FOR BACKUP OF CONTROL FILE.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; Configure setting in RMAN :&lt;/span&gt;&lt;/span&gt; &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; ----------------------------&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;               We can use configure command to change any setting in RMAN.I would definetly like to outside my script like below.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; $rman target / catalog rman/rman@catdb&lt;/span&gt;&lt;/span&gt; &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; RMAN&amp;gt;CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'D:\RMAN_BACKUP\snapcf_orcl.f';&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:georgia;" &gt;rman_cold.txt:&lt;br /&gt;--------------&lt;/span&gt;&lt;/span&gt;  &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; run{&lt;/span&gt;&lt;/span&gt; &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; shutdown immediate;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; startup mount;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; allocate channel ch1 device type disk format 'D:\RMAN_BACKUP\orcl_BK_SET1_%U_%T' maxpiecesize 5G;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; allocate channel ch2 device type disk format 'D:\RMAN_BACKUP\orcl_BK_SET2_%U_%T';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; backup database TAG='ORCL_BACKUP_WEEKLY';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; allocate channel c1 type disk;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; copy current controlfile to 'D:\RMAN_BACKUP\TESTDB_ctrl_%U_%T';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; Release channel c1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; configure retention policy to recovery window of 7 days;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'D:\RMAN_BACKUP\snapcf_orcl.f';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; CROSSCHECK BACKUP;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; release channel ch1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; release channel ch2;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; alter database open;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:georgia;" &gt;rman_orcl.bat:&lt;br /&gt;---------------&lt;/span&gt;&lt;/span&gt;   &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; -- orcl DB RMAN COLD BACKUP&lt;/span&gt;&lt;/span&gt; &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; set ORACLE_SID=orcl&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; set ORACLE_HOME=D:\app\RafiAlvi\product\11.2.0\dbhome_1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; set ORACLE_BASE=D:\app\RafiAlvi\&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; rman target sys/orcldba @D:\RMAN_BACKUP_SCRIPTS\run_ORCL.txt log=D:\RMAN_BACKUP_SCRIPTS\LOGS\rman_cold_orcl_24july_cum.log&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:georgia;" &gt;Note:&lt;/span&gt;&lt;/span&gt;  &lt;span style="font-size:85%;"&gt;&lt;span style="font-family:georgia;"&gt; In Unix environment use &lt;/span&gt;&lt;span style="font-weight: bold;font-family:georgia;" &gt;export&lt;/span&gt;&lt;span style="font-family:georgia;"&gt;  for setting the enviromnmet and Write shell script 'rman_orcl.sh',rest  all script is almost same and can fit as per our path in Unix  environment.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:georgia;" &gt;&lt;span style="font-weight: bold;"&gt;RMAN BACKUP DETAILS Views:&lt;br /&gt;---------------------------------&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;  &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;  We can use Dictionary Views for checking the status of rman backups.&lt;/span&gt;&lt;/span&gt; &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:georgia;" &gt;1)USE AFTER SCHEDULING RMAN BACKUP:&lt;/span&gt;&lt;/span&gt;  &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; SELECT START_TIME||' '||END_TIME||' '||STATUS FROM V$RMAN_BACKUP_JOB_DETAILS;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:georgia;" &gt;2)USE TO CHECK BYYES PROCESSED IN RMAN BACKUP:&lt;/span&gt;&lt;/span&gt;  &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; SELECT SID||' '||STATUS||' '||MBYTES_PROCESSED||' '||START_TIME||' '||END_TIME&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; FROM V$RMAN_STATUS;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:georgia;" &gt;3)USE TO CHECK SESSION AND RMAN BACKUP OUTPUT:&lt;/span&gt;&lt;/span&gt;  &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; SELECT SID||' '||RECID||' '||OUTPUT||' '||SESSION_STAMP&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt; FROM V$RMAN_OUTPUT;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:georgia;" &gt;Note:&lt;/span&gt;&lt;/span&gt;  &lt;span style="font-size:85%;"&gt;&lt;span style="font-family:georgia;"&gt;On Unix terminal,It will be very much useful to check the process in order to check the status by using 'ps' command.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:georgia;" &gt;$ps -eaf|grep rman&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;  &lt;h3 class="post-title entry-title"  style="font-family:georgia;"&gt;&lt;span style="font-size:85%;"&gt; Incremental backup and restore in oracle 10g &lt;/span&gt;&lt;/h3&gt;  &lt;div style="font-family: georgia;" class="post-header"&gt;  &lt;/div&gt;   &lt;div  style="text-align: justify;font-family:georgia;"&gt;&lt;span style="font-size:85%;"&gt;Here I am presenting the simple steps  to  demonstrate how to take incremental level backup,perform restore and  recovery using RMAN.One can learn Rman incremental level backup easily  by going through this post. I used oracle 10g express edition.&lt;br /&gt;&lt;br /&gt;Difference between differential and cumulative incremental backup will be clear by going through this simple demo.&lt;br /&gt;&lt;br /&gt;Simple scenarios has been taken.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 153, 102);font-size:130%;" &gt;Demonstrating DIFFERENTIAL INCREMENTAL BACKUP&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt; &lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(255, 153, 102);font-family:georgia;" &gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt; &lt;div  style="text-align: justify;font-family:georgia;"&gt;&lt;span style="font-size:85%;"&gt;1. Database is in NOARCHIVELOG mode.&lt;br /&gt;2. Not using recovery catalog.&lt;br /&gt;3. RMAN configuration setting that I used is following. I am posting the output of&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;RMAN&amp;gt; SHOW ALL;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;using target database control file instead of recovery catalog&lt;br /&gt;RMAN configuration parameters are:&lt;br /&gt;CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default&lt;br /&gt;CONFIGURE BACKUP OPTIMIZATION ON;&lt;br /&gt;CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default&lt;br /&gt;CONFIGURE CONTROLFILE AUTOBACKUP ON;&lt;br /&gt;CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/usr/lib/oracle/xe/backup/cf_%F';&lt;br /&gt;CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default&lt;br /&gt;CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default&lt;br /&gt;CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default&lt;br /&gt;CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE 400 M FORMAT   '/usr/lib/oracle/xe/backup/df_%U';&lt;br /&gt;CONFIGURE MAXSETSIZE TO UNLIMITED; # default&lt;br /&gt;CONFIGURE ENCRYPTION FOR DATABASE OFF; # default&lt;br /&gt;CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default&lt;br /&gt;CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default&lt;br /&gt;CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/dbs/snapcf_XE.f'; # default&lt;br /&gt;&lt;br /&gt;4.  Since database is in NOARCHIVELOG mode, it is necessary to shut down  the database cleanly using immediate,normal or transactional options.&lt;br /&gt;&lt;br /&gt;RMAN&amp;gt; shutdown&lt;br /&gt;&lt;br /&gt;5. To take  incremental 0 level backup,mount the database. This step is required even in non-incremental backups.&lt;br /&gt;&lt;br /&gt;RMAN&amp;gt; startup mount&lt;br /&gt;&lt;br /&gt;6. Issue&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;RMAN&amp;gt; BACKUP INCREMENTAL LEVEL 0 DATABASE TAG 'FULL_INC'&lt;/span&gt;;&lt;br /&gt;This takes the full backup of the database and also includes controlfile as well as spfile.&lt;br /&gt;&lt;br /&gt;7. Issue&lt;br /&gt;SQL&amp;gt; select * from v$log;&lt;br /&gt;&lt;br /&gt;GROUP#    THREAD#  SEQUENCE#      BYTES    MEMBERS ARC STATUS&lt;br /&gt;---------- ---------- ---------- ---------- ---------- --- ----------------&lt;br /&gt;FIRST_CHANGE# FIRST_TIM&lt;br /&gt;------------- ---------&lt;br /&gt;1     1        0   52428800      1 YES UNUSED&lt;br /&gt; 0&lt;br /&gt;&lt;br /&gt;2     1        1   52428800      1 NO  CURRENT&lt;br /&gt;  1077758 08-MAR-11&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&amp;gt; select checkpoint_change# from v$database;&lt;br /&gt;&lt;br /&gt;CHECKPOINT_CHANGE#&lt;br /&gt;------------------&lt;br /&gt;1084366&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;8. RMAN&amp;gt; ALTER DATABASE OPEN;&lt;br /&gt;&lt;br /&gt;9. Now, perform some DML operations. For example,&lt;br /&gt;&lt;br /&gt;SQL&amp;gt; CREATE TABLE T1(C1 NUMBER);&lt;br /&gt;SQL&amp;gt; INSERT INTO T1 VALUES(10);&lt;br /&gt;SQL&amp;gt; /&lt;br /&gt;SQL&amp;gt; /&lt;br /&gt;SQL&amp;gt; COMMIT;&lt;br /&gt;&lt;br /&gt;10. Again, shutdown the database to take incremental level backup.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;RMAN&amp;gt;SHUTDOWN&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;RMAN&amp;gt;STARTUP MOUNT&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;RMAN&amp;gt; BACKUP INCREMENTAL LEVEL 1 DATABASE TAG 'INC_1';&lt;/span&gt;&lt;br /&gt;It backups only the changes made since the last incremental level n or lower backup.&lt;br /&gt;&lt;br /&gt;11. Open the database again to perform some insertions.&lt;br /&gt;RMAN&amp;gt; ALTER DATABASE OPEN;&lt;br /&gt;&lt;br /&gt;12. SQL&amp;gt; INSERT INTO T1 VALUES(1);&lt;br /&gt;SQL&amp;gt; /&lt;br /&gt;SQL&amp;gt; /&lt;br /&gt;SQL&amp;gt; /&lt;br /&gt;SQL&amp;gt; COMMIT;&lt;br /&gt;&lt;br /&gt;13. Shutdown the database again to take incremental level 2 backup.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;RMAN&amp;gt; SHUTDOWN&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;RMAN&amp;gt; STARTUP MOUNT&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;RMAN&amp;gt; BACKUP INCREMENTAL LEVEL 2 DATABASE TAG 'INC_1';&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;14. Open database again to made some insertions.&lt;br /&gt;RMAN&amp;gt; ALTER DATABASE OPEN;&lt;br /&gt;SQL&amp;gt; INSERT INTO T1 VALUES(9);&lt;br /&gt;SQL&amp;gt; /&lt;br /&gt;SQL&amp;gt; /&lt;br /&gt;SQL&amp;gt; COMMI;&lt;br /&gt;&lt;br /&gt;15. select * from v$log;&lt;br /&gt;&lt;br /&gt;GROUP#    THREAD#  SEQUENCE#      BYTES    MEMBERS ARC STATUS&lt;br /&gt;---------- ---------- ---------- ---------- ---------- --- ----------------&lt;br /&gt;FIRST_CHANGE# FIRST_TIM&lt;br /&gt;------------- ---------&lt;br /&gt; 1        1           0   52428800         1 YES UNUSED&lt;br /&gt;    0&lt;br /&gt;&lt;br /&gt; 2        1           1   52428800         1 NO  CURRENT&lt;br /&gt;  1077758 08-MAR-11&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&amp;gt; select checkpoint_change# from v$database;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;CHECKPOINT_CHANGE#&lt;br /&gt;------------------&lt;br /&gt;1084663&lt;br /&gt;&lt;br /&gt;Here all the changes since the last backup has been stored in the redo logs.&lt;br /&gt;&lt;br /&gt;16. Now, delete controlfile.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;$ mv oradata/XE/controlfile cf.bak&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;17. RMAN&amp;gt; SHUTDOWN ABORT;&lt;br /&gt;&lt;br /&gt;18. RMAN&amp;gt; STARTUP&lt;br /&gt;Database will not open. Database will only go upto the NOMOUNT state since controlfile has been lost.&lt;br /&gt;&lt;br /&gt;19. RMAN&amp;gt; Now following steps are needed &lt;span style="font-weight: bold;"&gt;to recover the database&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;20. RMAN&amp;gt; SET CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/usr/lib/oracle/xe/backup/cf_%F';&lt;br /&gt;If controlfile autobackup is located in default location, then we can skip this step.&lt;br /&gt;&lt;br /&gt;21. &lt;span style="font-weight: bold;"&gt;RMAN&amp;gt; RESTORE CONTROLFILE FROM AUTOBACKU&lt;/span&gt;P&lt;br /&gt;&lt;br /&gt;22. &lt;span style="font-weight: bold;"&gt;RMAN&amp;gt; ALTER DATABASE MOUNT;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;23. &lt;span style="font-weight: bold;"&gt;RMAN&amp;gt; RESTORE DATABASE&lt;/span&gt;;&lt;br /&gt;It will restore the database using the 0 level backup.&lt;br /&gt;&lt;br /&gt;24. &lt;span style="font-weight: bold;"&gt;RMAN&amp;gt; RECOVER DATABASE&lt;/span&gt;&lt;br /&gt;Watch  the output carefully. You can recognise various backups that are being  applied. Look for the tags that you have given to backupsets. It will  applies all the incrementals one by one. First it will apply level 1  incremental, and then level 2. Then it will search for appropriate log  sequence and applies the same if found. If log switching has not been  taken place after the last incremental backup, then we get all the data  without any data loss. And database will restore upto the current point  in time. In our case no log switching has taken place and all the data  since the last backup exist in the redologs. &lt;span style="font-weight: bold;"&gt;NOREDO &lt;/span&gt;option is needed when log switching has taken place. NOREDO option is not needed if log switch has not taken place.&lt;br /&gt;&lt;br /&gt;25.&lt;span style="font-weight: bold;"&gt;RMAN&amp;gt; ALTER DATABASE OPEN RESETLOGS;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;26. Now, view the table t1 and you will find the table restored upto the latest point in time if all the redos has been applied.&lt;br /&gt;&lt;br /&gt;27. Always take full backup of the database after opening the database in resetlogs mode.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 153, 102);font-size:130%;" &gt;Demonstrating CUMULATIVE INCREMENTAL BACKUP&lt;/span&gt;&lt;span style="color: rgb(255, 153, 102);font-size:130%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Here we will utilize same scenario as above,i.e. no recovery catalog mode,no archivelog mode.&lt;br /&gt;We will start here by taking incremental level 0 backup.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1. RMAN&amp;gt; SHUTDOWN &lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2. RMAN&amp;gt; STARTUP MOUNT &lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;3. RMAN&amp;gt; BACKUP INCREMENTAL LEVEL 0 DATABASE TAG 'FULL_INC';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;4. RMAN&amp;gt; ALTER DATABASE OPEN;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;5. SQL&amp;gt; SELECT CHECKPOINT_CHANGE# FROM V$DATABASE;&lt;br /&gt;6. Make some insertion.&lt;br /&gt;SQL&amp;gt; INSERT INTO T1 VALUES(2);&lt;br /&gt;SQL&amp;gt; /&lt;br /&gt;SQL&amp;gt; /&lt;br /&gt;SQL&amp;gt; COMMIT;&lt;br /&gt;&lt;br /&gt;7.  Again shutdown the database to take incremental level 1 database which  will copies only the changed blocks since the last incremental level 0  backup.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;RMAN&amp;gt; BACKUP INCREMENTAL LEVEL 1 DATABASE TAG 'INC_1';&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;8.ALTER DATABASE OPEN;&lt;br /&gt;&lt;br /&gt;9. SQL&amp;gt; INSERT INTO T1 VALUES(3);&lt;br /&gt;SQL&amp;gt; /&lt;br /&gt;SQL&amp;gt; /&lt;br /&gt;SQL&amp;gt; COMMIT;&lt;br /&gt;&lt;br /&gt;10.  Again shutdown the database to take cumulative incremental level 1  backup, this time. This backups all the changes made after the last n-1  or lower backup,here it will backup all the changes since the  incremental level 0 backup.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;RMAN&amp;gt; BACKUP INCREMENTAL LEVEL 1 CUMULATIVE DATABASE TAG 'CUM_1'&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;11. RMAN&amp;gt; ALTER DATABASE OPEN;&lt;br /&gt;&lt;br /&gt;12. Perform some DML again.&lt;br /&gt;SQL&amp;gt; INSERT INTO T1 VALUES(9);&lt;br /&gt;SQL&amp;gt;/&lt;br /&gt;SQL&amp;gt; /&lt;br /&gt;SQL&amp;gt; COMMIT;&lt;br /&gt;&lt;br /&gt;13. Now, we will shutdown the database to take incremental level 1 backup this time.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;RMAN&amp;gt; SHUTDOWN&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;RMAN&amp;gt; STARTUP MOUNT&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;RMAN&amp;gt; BACKUP INCREMENTAL LEVEL 1 DATABASE TAG 'INC_1_1';&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;14. RMAN&amp;gt; ALTER DATABASE OPEN;&lt;br /&gt;&lt;br /&gt;15. SQL&amp;gt; INSERT INTO T1 VALUES(0);&lt;br /&gt;SQL&amp;gt; /&lt;br /&gt;SQL&amp;gt; COMMIT;&lt;br /&gt;&lt;br /&gt;16. Delete controlfile.&lt;br /&gt;$ mv oradata/XE/controlfile cf.bak&lt;br /&gt;&lt;br /&gt;17. RMAN&amp;gt; SHUTDOWN ABORT&lt;br /&gt;&lt;br /&gt;18. RMAN&amp;gt; STARTUP&lt;br /&gt;Database will not open.It will go upto only NOMOUNT state.&lt;br /&gt;&lt;br /&gt;19. RMAN&amp;gt; SET CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/usr/lib/oracle/XE/backup/cf_%F';&lt;br /&gt;&lt;br /&gt;20. RMAN&amp;gt; RESTORE CONTROLFILE FROM AUTOBACKUP;&lt;br /&gt;&lt;br /&gt;21. RMAN&amp;gt; ALTER DATABASE MOUNT;&lt;br /&gt;&lt;br /&gt;22. RMAN&amp;gt; RESTORE DATABASE;,&lt;br /&gt;It will restore the database from the last incremental level 0 database.&lt;br /&gt;&lt;br /&gt;23. RMAN&amp;gt; RECOVER DATABASE;&lt;br /&gt;Here  NOREDO option is not necessary as it is assumed that redo logs has not  been switched and complete recovery is possible. Check the same by  looking at the contents of v$log and comparing with the  checkpoint_change# that have noted in step 5. If all the changes since  that value exist in the redo logs then NOREDO option is not needed. Else  it is required.&lt;br /&gt;&lt;br /&gt;Here first of all, cumulative incremental level 1  backup would restore as there is no need for the backup having tag  'INC_1' as cumulative incremental level 1 backup take backup of all the  changes since the last level 0 backup. Thus our first incremental level 1  backup is not applied. Then it applies backup having tag 'INC_1_1'  which we take after cumulative incremental level backup. After that it  will apply all the changes recorded in the online redologs.&lt;br /&gt;Thus ,  only two incremental level backups needed to apply here. But in the  first scenario all the incremental backups had been applied. Thus we can  say that &lt;span style="font-weight: bold;"&gt;using cumulative incremental  backup in your incremental strategy provides faster recovery as number  of incremental backups to be applied is less.  &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;24. RMAN&amp;gt; ALTER DATBASE OPEN RESETLOGS;&lt;br /&gt;&lt;br /&gt;25. Take whole database backup after opening database in resetlogs mode. It is a good practice to perform th same.&lt;br /&gt;&lt;br /&gt;26. Now check your table. It must have all the changes that we made, keeping all the scenario same.&lt;/span&gt;&lt;/div&gt; &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-4663101014695557525?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/4663101014695557525/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2011/07/differential-backup-and-cumulative.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/4663101014695557525'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/4663101014695557525'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2011/07/differential-backup-and-cumulative.html' title='Differential backup and Cumulative backup'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-7777565350332669247</id><published>2010-12-17T00:52:00.000-08:00</published><updated>2010-12-17T00:56:51.808-08:00</updated><title type='text'>Oracle Clusterware Components</title><content type='html'>&lt;p style="font-family: georgia;"&gt;&lt;span style="font-size:85%;"&gt;Oracle Clusterware is the software, which enables the nodes to  communicate with each other, and forms the cluster and makes the nodes  as single logical server. Oracle Clusterware is run by Cluster Ready  Services (CRS) using two key components. They are &lt;a href="http://en.wikipedia.org/w/index.php?title=Oracle_Cluster_Registry&amp;amp;action=edit&amp;amp;redlink=1" class="new" title="Oracle Cluster Registry (page does not exist)"&gt;Oracle Cluster Registry&lt;/a&gt;&lt;a href="http://en.wikipedia.org/w/index.php?title=Voting_disk&amp;amp;action=edit&amp;amp;redlink=1" class="new" title="Voting disk (page does not exist)"&gt;voting disk&lt;/a&gt;,  which acts a tiebreaker during communication failures. Consistent  heartbeat information from all the nodes is sent to voting disk when the  cluster is running. CRS service has four components namely OPROCd, CRS  Daemon (crsd), Oracle Cluster Synchronization Service Daemon (OCSSD) and  Event Volume Manager Daemon (evmd) and each handles a variety of  functions. Failure or death of the CRS daemon can cause the &lt;a href="http://en.wikipedia.org/w/index.php?title=Node_failure&amp;amp;action=edit&amp;amp;redlink=1" class="new" title="Node failure (page does not exist)"&gt;node failure&lt;/a&gt;  and it automatically reboots the nodes to avoid the data corruption  because of the possible communication failure between the nodes. The CRS  daemon runs as the &lt;a href="http://en.wikipedia.org/wiki/Super_user" title="Super user" class="mw-redirect"&gt;super user&lt;/a&gt;&lt;a href="http://en.wikipedia.org/wiki/UNIX" title="UNIX" class="mw-redirect"&gt;UNIX&lt;/a&gt; platforms and runs as a service in the windows platforms.&lt;/span&gt; (OCR), which records and maintains the cluster and node membership information. The other component is  ‘root’ in the &lt;/p&gt; &lt;p style="font-family: georgia;"&gt;&lt;span style="font-size:85%;"&gt;The following functionalities are covered by Oracle Cluster Ready Services&lt;/span&gt;&lt;/p&gt; &lt;ul style="font-family: georgia;"&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;CRS is installed and run from a different oracle home known as &lt;a href="http://en.wikipedia.org/w/index.php?title=ORA_CRS_HOME&amp;amp;action=edit&amp;amp;redlink=1" class="new" title="ORA CRS HOME (page does not exist)"&gt;ORA CRS HOME&lt;/a&gt;, which is independent from &lt;a href="http://en.wikipedia.org/w/index.php?title=ORACLE_HOME&amp;amp;action=edit&amp;amp;redlink=1" class="new" title="ORACLE HOME (page does not exist)"&gt;ORACLE HOME&lt;/a&gt;.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family: georgia;"&gt;CRSD --&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul style="font-family: georgia;"&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;CRSd manages the resources like starting and stopping the services  and failing-over the application resources. It spawns separate processes  to manage application resources.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;CRS daemon has two modes of running. During startup and after a shutdown. During planned clusterware start it is started as &lt;a href="http://en.wikipedia.org/w/index.php?title=%E2%80%98reboot%E2%80%99&amp;amp;action=edit&amp;amp;redlink=1" class="new" title="‘reboot’ (page does not exist)"&gt;‘reboot’&lt;/a&gt; mode. It is started as &lt;a href="http://en.wikipedia.org/w/index.php?title=%E2%80%98restart%E2%80%99&amp;amp;action=edit&amp;amp;redlink=1" class="new" title="‘restart’ (page does not exist)"&gt;‘restart’&lt;/a&gt; mode after unplanned shutdown.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;In reboot mode it ‘auto’ starts all the resources under its  management. In restart mode it prevails the previous state and brings  back the resources to it previous state before shutdown&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Manages the Oracle Cluster Registry and stores the current known state in the Oracle Cluster Registry&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Runs as ‘root’ on Unix and ‘LocalSystem’ on windows and automatically restarts in case of failure.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;CRS requires the public interface, private interface and the &lt;a href="http://en.wikipedia.org/wiki/Virtual_IP" title="Virtual IP" class="mw-redirect"&gt;Virtual IP&lt;/a&gt;  (VIP) for the operation. All these interfaces should be up and running,  should be able to ping each other before starting CRS Installation.  Without the above network infrastructure CRS cannot be installed.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family: georgia;"&gt;OCSSD ---&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;p style="font-family: georgia;"&gt;&lt;span style="font-size:85%;"&gt;Oracle Cluster Synchronization Services Daemon (&lt;i&gt;ocssd&lt;/i&gt;) is the  component, which provides the synchronization services between the  nodes. OCSSD provides the access to the node membership. It also enables  basic cluster services including cluster group services and cluster  locking. It can also run without integration with vendor clusterware.  Failure of ocssd causes the machine to reboot to avoid split-brain  situation. This is also required in a single instance configuration if &lt;a href="http://en.wikipedia.org/wiki/Automatic_Storage_Management" title="Automatic Storage Management"&gt;Automatic Storage Management&lt;/a&gt; (ASM) is used. Automatic Storage management was a new feature in &lt;a href="http://en.wikipedia.org/w/index.php?title=Oracle_database_10g&amp;amp;action=edit&amp;amp;redlink=1" class="new" title="Oracle database 10g (page does not exist)"&gt;oracle database 10g&lt;/a&gt;. Ocssd runs as ‘oracle’ user. The following functionalities are covered by CSS daemon&lt;/span&gt;&lt;/p&gt; &lt;ul style="font-family: georgia;"&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;CSS provides basic ‘group services’ support. Group Services is a  distributed group membership system that allows the applications to  coordinate activities to achieve a common result.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;’Group services’ use vendor clusterware group services when vendor  clusterware is available. But it is capable of working independently if  there is no vendor clusterware group services available&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;‘Lock services’ is another service from the CSS daemon. Lock  services provide the basic cluster wide serialization locking functions.  It uses FIFO mechanism to manage locking&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Node Services is the third service produced by the CSSD. It uses OCR  to store the data and updates the information during reconfiguration.  It also manages the OCR data, which is static otherwise.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family: georgia;"&gt;EVMD --&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia;"&gt;The third component in OCS is called Event Management Logger. Event  Management logger also runs as daemon process ‘evmd’. The daemon process  ‘evmd’ spawns a permanent child process called ‘evmlogger’ and  generates the events when things happen. EVMD child process ‘evmlogger’  spawns new children processes on demand and scans the callout directory  to invoke callouts. It will restart automatically on failures and death  of the evmd process does not halt the instance. Evmd runs as ‘oracle’  user.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia;"&gt;OPROCD--&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;h2 style="font-family: georgia;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="mw-headline" id="oprocd"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt; &lt;p style="font-family: georgia;"&gt;&lt;span style="font-size:85%;"&gt;Oprocd provides the server fencing solution for the Oracle  Clusterware. It is the process monitor for the oracle clusterware and it  uses the&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;a style="font-weight: bold;" href="http://en.wikipedia.org/w/index.php?title=Hang_check_timer&amp;amp;action=edit&amp;amp;redlink=1" class="new" title="Hang check timer (page does not exist)"&gt;hang check timer&lt;/a&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;or &lt;a href="http://en.wikipedia.org/wiki/Watchdog_timer" title="Watchdog timer"&gt;watchdog&lt;/a&gt; timer (depending on the implementation) for the cluster integrity. Oprocd is locked in the memory and runs as a &lt;a href="http://en.wikipedia.org/wiki/Real-time_computing" title="Real-time computing"&gt;real time&lt;/a&gt; process. This sleeps for a fixed time and runs as ‘root’ user. Failure of the Oprocd process causes the node to restart.&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-7777565350332669247?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/7777565350332669247/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/12/oracle-clusterware-components.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/7777565350332669247'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/7777565350332669247'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/12/oracle-clusterware-components.html' title='Oracle Clusterware Components'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-2660959782720076581</id><published>2010-10-07T01:11:00.000-07:00</published><updated>2010-10-07T01:17:45.235-07:00</updated><title type='text'>Latches</title><content type='html'>&lt;span style="font-family:times new roman;"&gt;What is a latch?&lt;br /&gt;Latches are locking mechanisms used to protect shared memory structures from potential corruption due to concurrent access. In other words,latches ensure exclusive access to the shared data structures in the SGA. Access to SGA structures is seralized, using latches. Latches, unlike locks or enqueues are not used to protect database objects.&lt;br /&gt;Latches are used in almost all operations. For example&lt;br /&gt;1. When a session reads a block from disk, it must modify a free block in the buffer cache and adjust the buffer cache LRU chain.&lt;br /&gt;2. When a session reads a block from the SGA, it will modify the LRU chain.&lt;br /&gt;3. When a new SQL statement is parsed, it will be added to the library cache within the SGA.&lt;br /&gt;4. As modifications are made to blocks, entries are placed in the redo buffer.&lt;br /&gt;5. The database writer periodically writes buffers from the cache to disk (and must update their status from “dirty” to “clean”).&lt;br /&gt;The redo log writer writes entries from the redo buffer to the redo logs. &lt;/span&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:times new roman;"&gt;&lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:times new roman;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;Latch Types &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;There are three types of latches: parent, child, and solitary latches. The parent and solitary latches are fixed in the Oracle kernel code. Child latches are created at instance startup. &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;1. Latch operation &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;2. How are latches acquired?&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;A process may request a latch in the willing-to-wait or no-wait (immediate) mode. If the latch is available on the first request, the process acquires it. Before modifying the protected data structure, the process writes the recovery information in the latch recovery area so that PMON knows what to clean up if the process dies while holding the latch.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;If the latch is not available, the process spins on the CPU for a short while and retries for the latch. This spin and retry activity can be repeated up to the value specified in the intialization parameter _SPIN_COUNT value (default 2000). The values of initialization parameters _MAX_EXPONENTIAL_SLEEP and _MAX_SLEEP_HOLDING_LATCH are used at arriving the spin duration.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;Latches are very light and on most systems, a single machine instruction called “test and set” is used to see if the latch is taken (by looking at a specific memory address) and if not, acquire it (by changing the value in the memory address). &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;---Wakeup mechanisms &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;1. Timeout &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;The operating system signals (wakes up) the process when a set alarm is triggered&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;2. Latch wait posting &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;The next process to free the required latch will wake up the process waiting for the latch. This is initiated by the requesting&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;process before going to sleep by putting itself in a latch wait list &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-2660959782720076581?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/2660959782720076581/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/10/latches.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/2660959782720076581'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/2660959782720076581'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/10/latches.html' title='Latches'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-8628148478190288028</id><published>2010-10-06T01:36:00.000-07:00</published><updated>2010-10-06T01:38:05.748-07:00</updated><title type='text'>Unix for the DBA</title><content type='html'>Unix for the DBA&lt;br /&gt;&lt;br /&gt;How to kill all similar processes with single command (in this case opmn)&lt;br /&gt;&lt;br /&gt;ps -ef | grep opmn |grep -v grep | awk ‘{print $2}’ |xargs -i kill -9 {}&lt;br /&gt;&lt;br /&gt;Locating Files under a particular directory&lt;br /&gt;&lt;br /&gt;find . -print |grep -i test.sql&lt;br /&gt;&lt;br /&gt;Using AWK in UNIX&lt;br /&gt;&lt;br /&gt;To remove a specific column of output from a UNIX command – for example to determine the UNIX process Ids for all Oracle processes on server (second column)&lt;br /&gt;&lt;br /&gt;ps -ef |grep -i oracle |awk '{ print $2 }'&lt;br /&gt;&lt;br /&gt;Changing the standard prompt for Oracle Users &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Edit the .profile for the oracle user&lt;br /&gt;&lt;br /&gt;PS1="`hostname`*$ORACLE_SID:$PWD&gt;"&lt;br /&gt;&lt;br /&gt;Display top 10 CPU consumers using the ps command&lt;br /&gt;&lt;br /&gt;/usr/ucb/ps auxgw | head -11&lt;br /&gt;&lt;br /&gt;Show number of active Oracle dedicated connection users for a particular ORACLE_SID&lt;br /&gt;&lt;br /&gt;ps -ef | grep $ORACLE_SID|grep -v grep|grep -v ora_|wc -l&lt;br /&gt;Display the number of CPU’s in Solaris&lt;br /&gt;&lt;br /&gt;psrinfo -v | grep "Status of processor"|wc -l&lt;br /&gt;Display the number of CPU’s in AIX&lt;br /&gt;&lt;br /&gt;lsdev -C | grep Process|wc -l&lt;br /&gt;&lt;br /&gt;Display RAM Memory size on Solaris&lt;br /&gt;&lt;br /&gt;prtconf |grep -i mem&lt;br /&gt;&lt;br /&gt;Display RAM memory size on AIX&lt;br /&gt;&lt;br /&gt;First determine name of memory device&lt;br /&gt;&lt;br /&gt;lsdev -C |grep mem&lt;br /&gt;&lt;br /&gt;then assuming the name of the memory device is ‘mem0’&lt;br /&gt;&lt;br /&gt;lsattr -El mem0&lt;br /&gt;&lt;br /&gt;Swap space allocation and usage&lt;br /&gt;&lt;br /&gt;Solaris : swap -s or swap -lAix : lsps -a&lt;br /&gt;&lt;br /&gt;Total number of semaphores held by all instances on server&lt;br /&gt;&lt;br /&gt;ipcs -as | awk '{sum += $9} END {print sum}'&lt;br /&gt;&lt;br /&gt;View allocated RAM memory segments&lt;br /&gt;&lt;br /&gt;ipcs -pmb&lt;br /&gt;&lt;br /&gt;Manually deallocate shared memeory segments&lt;br /&gt;&lt;br /&gt;ipcrm -m ''&lt;br /&gt;Show mount points for a disk in AIX&lt;br /&gt;&lt;br /&gt;lspv -l hdisk13&lt;br /&gt;&lt;br /&gt;Display amount of occupied space (in KB) for a file or collection of files in a directory or sub-directory&lt;br /&gt;&lt;br /&gt;du -ks * | sort -n| tail&lt;br /&gt;&lt;br /&gt;Display total file space in a directory&lt;br /&gt;&lt;br /&gt;du -ks .&lt;br /&gt;Cleanup any unwanted trace files more than seven days old&lt;br /&gt;&lt;br /&gt;find . *.trc -mtime +7 -exec rm {} \;&lt;br /&gt;&lt;br /&gt;Locate Oracle files that contain certain strings&lt;br /&gt;&lt;br /&gt;find . -print | xargs grep rollback&lt;br /&gt;&lt;br /&gt;Locate recently created UNIX files (in the past one day)&lt;br /&gt;&lt;br /&gt;find . -mtime -1 -print&lt;br /&gt;&lt;br /&gt;Finding large files on the server (more than 100MB in size)&lt;br /&gt;&lt;br /&gt;find . -size +102400 -print&lt;br /&gt;&lt;br /&gt;Crontab : &lt;br /&gt;&lt;br /&gt;To submit a task every Tuesday (day 2) at 2:45PM&lt;br /&gt;&lt;br /&gt;45 14 2 * * /opt/oracle/scripts/tr_listener.sh &gt; /dev/null 2&gt;&amp;1&lt;br /&gt;&lt;br /&gt;To submit a task to run every 15 minutes on weekdays (days 1-5)&lt;br /&gt;&lt;br /&gt;15,30,45 * 1-5 * * /opt/oracle/scripts/tr_listener.sh &gt; /dev/null 2&gt;&amp;1&lt;br /&gt;&lt;br /&gt;To submit a task to run every hour at 15 minutes past the hour on weekends (days 6 and 0)&lt;br /&gt;&lt;br /&gt;15 * 0,6 * * opt/oracle/scripts/tr_listener.sh &gt; /dev/null 2&gt;&amp;1&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SRVCTL:&lt;br /&gt;srvctl command target [options]&lt;br /&gt;commands: enable|disable|start|stop|relocate|status|add|remove|&lt;br /&gt;modify|getenv|setenv|unsetenv|config&lt;br /&gt;targets: database/db|instance/inst|service/serv|nodeapps|asm|listener&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;srvctl -help or srvctl -v&lt;br /&gt;srvctl -V -- prints version&lt;br /&gt;srvctl version: 10.2.0.0.0 (or) srvctl version: 11.0.0.0.0&lt;br /&gt;srvctl -h -- print usage&lt;br /&gt;srvctl status service –h&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Database:&lt;br /&gt;srvctl add database -d db_name -o ORACLE_HOME [-m domain_name][-p spfile] [-A name|ip/netmask]&lt;br /&gt;[-r {PRIMARY|PHYSICAL_STANDBY|LOGICAL_STANDBY|SNAPSHOT_STANDBY}] &lt;br /&gt;[-s start_options] [-n db_name] [-y {AUTOMATIC|MANUAL}]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;srvctl remove database -d db_name [-f]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;srvctl start database -d db_name [-o start_options] [-c connect_str | -q]&lt;br /&gt;srvctl start database -d db_name [-o open]&lt;br /&gt;srvctl start database -d db_name -o nomount&lt;br /&gt;srvctl start database -d db_name -o mount&lt;br /&gt;srvctl start db -d prod&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;srvctl stop database -d db_name [-o stop_options] [-c connect_str | -q]&lt;br /&gt;srvctl stop database -d db_name [-o normal]&lt;br /&gt;srvctl stop database -d db_name -o transactional&lt;br /&gt;srvctl stop database -d db_name -o immediate&lt;br /&gt;srvctl stop database -d db_name -o abort&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;srvctl status database -d db_name [-f] [-v] [-S level]&lt;br /&gt;srvctl status database -d db_name -v service_name&lt;br /&gt;srvctl status database -d hrms&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;srvctl enable database -d db_name&lt;br /&gt;srvctl disable database -d db_name&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;srvctl config database&lt;br /&gt;srvctl config database -d db_name [-a] [-t]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;srvctl modify database -d db_name [-n db_name] [-o ORACLE_HOME] [-m domain_name] [-p spfile]&lt;br /&gt;[-r {PRIMARY|PHYSICAL_STANDBY|LOGICAL_STANDBY|SNAPSHOT_STANDBY}] [-s start_options] [-y {AUTOMATIC|MANUAL}]&lt;br /&gt;srvctl modify database -d hrms -r physical_standby&lt;br /&gt;srvctl modify db -d RAC -p /u03/oradata/RAC/spfileRAC.ora -- moves parameter file&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;srvctl getenv database -d db_name [-t name_list]&lt;br /&gt;srvctl setenv database -d db_name {-t name=val[,name=val,...]|-T name=val}&lt;br /&gt;srvctl unsetenv database -d db_name [-t name_list]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Instance:&lt;br /&gt;srvctl add instance –d db_name –i inst_name -n node_name&lt;br /&gt;srvctl remove instance –d db_name –i inst_name [-f]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;srvctl start instance -d db_name -i inst_names [-o start_options] [-c connect_str | -q]&lt;br /&gt;srvctl start instance –d db_name –i inst_names [-o open]&lt;br /&gt;srvctl start instance –d db_name –i inst_names -o nomount&lt;br /&gt;srvctl start instance –d db_name –i inst_names -o mount&lt;br /&gt;srvctl start instance –d prod -i prod3&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;srvctl stop instance -d db_name -i inst_names [-o stop_options] [-c connect_str | -q]&lt;br /&gt;srvctl stop instance –d db_name –i inst_names [-o normal]&lt;br /&gt;srvctl stop instance –d db_name –i inst_names -o transactional&lt;br /&gt;srvctl stop instance –d db_name –i inst_names -o immediate&lt;br /&gt;srvctl stop instance –d db_name –i inst_names -o abort&lt;br /&gt;srvctl stop inst –d prod -i prod6&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;srvctl status instance –d db_name –i inst_names [-f] [-v] [-S level]&lt;br /&gt;srvctl status inst –d racdb -i racdb2&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;srvctl enable instance –d db_name –i inst_names&lt;br /&gt;srvctl disable instance –d db_name –i inst_names&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;srvctl modify instance -d db_name -i inst_name {-s asm_inst_name|-r} -- set a dependency of instance to ASM&lt;br /&gt;srvctl modify instance -d db_name -i inst_name -n node_name -- move the instance&lt;br /&gt;srvctl modify instance -d db_name -i inst_name -r -- remove the instance&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;srvctl getenv instance –d db_name –i inst_name [-t name_list]&lt;br /&gt;srvctl setenv instance –d db_name [–i inst_name] {-t "name=val[,name=val,...]" | -T "name=val"}&lt;br /&gt;srvctl unsetenv instance –d db_name [–i inst_name] [-t name_list]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Service:&lt;br /&gt;srvctl add service -d db_name -s service_name -r pref_insts [-a avail_insts] [-P TAF_policy]&lt;br /&gt;srvctl add service -d db_name -s service_name -u {-r "new_pref_inst" | -a "new_avail_inst"}&lt;br /&gt;srvctl add service -d RAC -s PRD -r RAC01,RAC02 -a RAC03,RAC04&lt;br /&gt;srvctl add serv -d CRM -s CRM -r CRM1 -a CRM3 -P basic&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;srvctl remove service -d db_name -s service_name [-i inst_name] [-f]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;srvctl start service -d db_name [-s service_names [-i inst_name]] [-o start_options]&lt;br /&gt;srvctl start service -d db_name -s service_names [-o open]&lt;br /&gt;srvctl start service -d db_name -s service_names -o nomount&lt;br /&gt;srvctl start service -d db_name -s service_names -o mount&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;srvctl stop service -d db_name [-s service_names [-i inst_name]] [-f]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;srvctl status service -d db_name [-s service_names] [-f] [-v] [-S level]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;srvctl enable service -d db_name -s service_names [–i inst_name]&lt;br /&gt;srvctl disable service -d db_name -s service_names [–i inst_name]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;srvctl config service -d db_name [-s service_name] [-a] [-S level]&lt;br /&gt;srvctl config service -d db_name -a -- -a shows TAF configuration&lt;br /&gt;srvctl config service -d WEBTST -s webtest PREF:WEBTST1 AVAIL:WEBTST2&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;srvctl modify service -d db_name -s service_name -i old_inst_name -t new_inst_name [-f]&lt;br /&gt;srvctl modify service -d db_name -s service_name -i avail_inst_name -r [-f]&lt;br /&gt;srvctl modify service -d db_name -s service_name -n -i preferred_list [-a available_list] [-f]&lt;br /&gt;srvctl modify service -d db_name -s service_name -i old_inst_name -a avail_inst -P TAF_policy&lt;br /&gt;srvctl modify serv -d PROD -s SDW -n -i I1,I2,I3,I4 -a I5,I6&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;srvctl relocate service -d db_name -s service_name –i old_inst_name -t target_inst [-f]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;srvctl getenv service -d db_name -s service_name -t name_list&lt;br /&gt;srvctl setenv service -d db_name [-s service_name] {-t "name=val[,name=val,...]" | -T "name=val"}&lt;br /&gt;srvctl unsetenv service -d db_name -s service_name -t name_list&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Nodeapps:&lt;br /&gt;#srvctl add nodeapps -n node_name -o ORACLE_HOME -A name|ip/netmask[/if1[|if2|...]]&lt;br /&gt;#srvctl add nodeapps -n lnx02 -o $ORACLE_HOME -A 192.168.0.151/255.255.0.0/eth0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#srvctl remove nodeapps -n node_names [-f]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#srvctl start nodeapps -n node_name -- Starts GSD, VIP, listener &amp; ONS&lt;br /&gt;#srvctl stop nodeapps -n node_name [-r] -- Stops GSD, VIP, listener &amp; ONS&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#srvctl status nodeapps -n node_name&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#srvctl config nodeapps -n node_name [-a] [-g] [-o] [-s] [-l]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#srvctl modify nodeapps -n node_name [-A new_vip_address]&lt;br /&gt;#srvctl modify nodeapps -n lnx06 -A 10.50.99.43/255.255.252.0/eth0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#srvctl getenv nodeapps -n node_name [-t name_list]&lt;br /&gt;#srvctl setenv nodeapps -n node_name {-t "name=val[,name=val,...]"|-T "name=val"}&lt;br /&gt;#srvctl unsetenv nodeapps -n node_name [-t name_list]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ASM:&lt;br /&gt;srvctl add asm -n node_name -i asminstance -o ORACLE_HOME [-p spfile]&lt;br /&gt;srvctl remove asm -n node_name [-i asminstance] [-f]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;srvctl start asm -n node_name [-i asminstance] [-o start_options] [-c connect_str | -q]&lt;br /&gt;srvctl start asm -n node_name -i asminstance [-o open]&lt;br /&gt;srvctl start asm -n node_name -i asminstance -o nomount&lt;br /&gt;srvctl start asm -n node_name -i asminstance -o mount&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;srvctl stop asm -n node_name [-i asminstance] [-o stop_options] [-c connect_str | -q]&lt;br /&gt;srvctl stop asm -n node_name -i asminstance [-o normal]&lt;br /&gt;srvctl stop asm -n node_name -i asminstance -o transactional&lt;br /&gt;srvctl stop asm -n node_name -i asminstance -o immediate&lt;br /&gt;srvctl stop asm -n node_name -i asminstance -o abort&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;srvctl status asm -n node_name&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;srvctl enable asm -n node_name [-i asminstance]&lt;br /&gt;srvctl disable asm -n node_name [-i asminstance]&lt;br /&gt;srvctl config asm -n node_name&lt;br /&gt;srvctl modify asm -n node_name -i asminstance [-o ORACLE_HOME] [-p spfile]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Listener:&lt;br /&gt;srvctl add listener -n node_name -o ORACLE_HOME [-l listener_name]&lt;br /&gt;-- 11g command&lt;br /&gt;srvctl remove listener -n node_name [-l listener_name] -- 11g command&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;srvctl start listener -n node_name [-l listener_names]&lt;br /&gt;srvctl stop listener -n node_name [-l listener_names]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;srvctl config listener -n node_name&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-8628148478190288028?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/8628148478190288028/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/10/unix-for-dba.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/8628148478190288028'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/8628148478190288028'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/10/unix-for-dba.html' title='Unix for the DBA'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-7134108412533378127</id><published>2010-10-06T01:30:00.000-07:00</published><updated>2010-10-06T01:33:26.887-07:00</updated><title type='text'>Oracle Clusterware processes for 10g on Unix and Linux</title><content type='html'>What are Oracle Clusterware processes for 10g on Unix and Linux&lt;br /&gt;&lt;br /&gt;Cluster Synchronization Services (ocssd) — Manages cluster node membership and runs as the oracle user; failure of this process results in cluster restart.&lt;br /&gt;&lt;br /&gt;Cluster Ready Services (crsd) — The crs process manages cluster resources (which could be a database, an instance, a service, a Listener, a virtual IP (VIP) address, an application process, and so on) based on the resource's configuration information that is stored in the OCR. This includes start, stop, monitor and failover operations. This process runs as the root user&lt;br /&gt;&lt;br /&gt;Event manager daemon (evmd) —A background process that publishes events that crs creates.&lt;br /&gt;&lt;br /&gt;Process Monitor Daemon (OPROCD) —This process monitor the cluster and provide I/O fencing. OPROCD performs its check, stops running, and if the wake up is beyond the expected time, then OPROCD resets the processor and reboots the node. An OPROCD failure results in Oracle Clusterware restarting the node. OPROCD uses the hangcheck timer on Linux platforms.&lt;br /&gt;&lt;br /&gt;RACG (racgmain, racgimon) —Extends clusterware to support Oracle-specific requirements and complex resources. Runs server callout scripts when FAN events occur.&lt;br /&gt;&lt;br /&gt;What are Oracle database background processes specific to RAC&lt;br /&gt;&lt;br /&gt;•LMS—Global Cache Service Process&lt;br /&gt;&lt;br /&gt;•LMD—Global Enqueue Service Daemon&lt;br /&gt;&lt;br /&gt;•LMON—Global Enqueue Service Monitor&lt;br /&gt;&lt;br /&gt;•LCK0—Instance Enqueue Process&lt;br /&gt;&lt;br /&gt;To ensure that each Oracle RAC database instance obtains the block that it needs to satisfy a query or transaction, Oracle RAC instances use two processes, the Global Cache Service (GCS) and the Global Enqueue Service (GES). The GCS and GES maintain records of the statuses of each data file and each cached block using a Global Resource Directory (GRD). The GRD contents are distributed across all of the active instances.&lt;br /&gt;&lt;br /&gt;What are Oracle Clusterware Components&lt;br /&gt;&lt;br /&gt;Voting Disk — Oracle RAC uses the voting disk to manage cluster membership by way of a health check and arbitrates cluster ownership among the instances in case of network failures. The voting disk must reside on shared disk.&lt;br /&gt;&lt;br /&gt;Oracle Cluster Registry (OCR) — Maintains cluster configuration information as well as configuration information about any cluster database within the cluster. The OCR must reside on shared disk that is accessible by all of the nodes in your cluster&lt;br /&gt;&lt;br /&gt;How do you troubleshoot node reboot &lt;br /&gt;&lt;br /&gt;Please check metalink ...&lt;br /&gt;&lt;br /&gt;Note 265769.1 Troubleshooting CRS Reboots&lt;br /&gt;Note.559365.1 Using Diagwait as a diagnostic to get more information for diagnosing Oracle Clusterware Node evictions.&lt;br /&gt;&lt;br /&gt;How do you backup the OCR&lt;br /&gt;&lt;br /&gt;There is an automatic backup mechanism for OCR. The default location is : $ORA_CRS_HOME\cdata\"clustername"\&lt;br /&gt;&lt;br /&gt;To display backups :&lt;br /&gt;#ocrconfig -showbackup&lt;br /&gt;To restore a backup :&lt;br /&gt;#ocrconfig -restore&lt;br /&gt;&lt;br /&gt;With Oracle RAC 10g Release 2 or later, you can also use the export command:&lt;br /&gt;#ocrconfig -export -s online, and use -import option to restore the contents back.&lt;br /&gt;With Oracle RAC 11g Release 1, you can do a manaual backup of the OCR with the command:&lt;br /&gt;# ocrconfig -manualbackup&lt;br /&gt;&lt;br /&gt;How do you backup voting disk&lt;br /&gt;&lt;br /&gt;#dd if=voting_disk_name of=backup_file_name&lt;br /&gt;&lt;br /&gt;How do I identify the voting disk location &lt;br /&gt;&lt;br /&gt;#crsctl query css votedisk&lt;br /&gt;&lt;br /&gt;How do I identify the OCR file location &lt;br /&gt;&lt;br /&gt;check /var/opt/oracle/ocr.loc or /etc/ocr.loc ( depends upon platform)&lt;br /&gt;or&lt;br /&gt;#ocrcheck&lt;br /&gt;&lt;br /&gt;Is ssh required for normal Oracle RAC operation ?&lt;br /&gt;&lt;br /&gt;"ssh" are not required for normal Oracle RAC operation. However "ssh" should be enabled for Oracle RAC and patchset installation.&lt;br /&gt;&lt;br /&gt;What is SCAN?&lt;br /&gt;&lt;br /&gt;Single Client Access Name (SCAN) is s a new Oracle Real Application Clusters (RAC) 11g Release 2 feature that provides a single name for clients to access an Oracle Database running in a cluster. The benefit is clients using SCAN do not need to change if you add or remove nodes in the cluster.&lt;br /&gt;&lt;br /&gt;Click here for more details from Oracle&lt;br /&gt;&lt;br /&gt;What is the purpose of Private Interconnect ?&lt;br /&gt;&lt;br /&gt;Clusterware uses the private interconnect for cluster synchronization (network heartbeat) and daemon communication between the the clustered nodes. This communication is based on the TCP protocol.&lt;br /&gt;RAC uses the interconnect for cache fusion (UDP) and inter-process communication (TCP). Cache Fusion is the remote memory mapping of Oracle buffers, shared between the caches of participating nodes in the cluster.&lt;br /&gt;&lt;br /&gt;Why do we have a Virtual IP (VIP) in Oracle RAC?&lt;br /&gt;&lt;br /&gt;Without using VIPs or FAN, clients connected to a node that died will often wait for a TCP timeout period (which can be up to 10 min) before getting an error. As a result, you don't really have a good HA solution without using VIPs.&lt;br /&gt;When a node fails, the VIP associated with it is automatically failed over to some other node and new node re-arps the world indicating a new MAC address for the IP. Subsequent packets sent to the VIP go to the new node, which will send error RST packets back to the clients. This results in the clients getting errors immediately.&lt;br /&gt;&lt;br /&gt;What do you do if you see GC CR BLOCK LOST in top 5 Timed Events in AWR Report? &lt;br /&gt;&lt;br /&gt;This is most likely due to a fault in interconnect network.&lt;br /&gt;Check netstat -s&lt;br /&gt;if you see "fragments dropped" or "packet reassemblies failed" , Work with your system administrator find the fault with network.&lt;br /&gt;&lt;br /&gt;How many nodes are supported in a RAC Database?&lt;br /&gt;&lt;br /&gt;10g Release 2, support 100 nodes in a cluster using Oracle Clusterware, and 100 instances in a RAC database.&lt;br /&gt;&lt;br /&gt;Srvctl cannot start instance, I get the following error PRKP-1001 CRS-0215, however sqlplus can start it on both nodes? How do you identify the problem?&lt;br /&gt;&lt;br /&gt;Set the environmental variable SRVM_TRACE to true.. And start the instance with srvctl. Now you will get detailed error stack.&lt;br /&gt;&lt;br /&gt;what is the purpose of the ONS daemon?&lt;br /&gt;&lt;br /&gt;The Oracle Notification Service (ONS) daemon is an daemon started by the CRS clusterware as part of the nodeapps. There is one ons daemon started per clustered node.&lt;br /&gt;The Oracle Notification Service daemon receive a subset of published clusterware events via the local evmd and racgimon clusterware daemons and forward those events to application subscribers and to the local listeners.&lt;br /&gt;&lt;br /&gt;This in order to facilitate:&lt;br /&gt;&lt;br /&gt;a. the FAN or Fast Application Notification feature or allowing applications to respond to database state changes.&lt;br /&gt;b. the 10gR2 Load Balancing Advisory, the feature that permit load balancing accross different rac nodes dependent of the load on the different nodes. The rdbms MMON is creating an advisory for distribution of work every 30seconds and forward it via racgimon and ONS to listeners and applications.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-7134108412533378127?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/7134108412533378127/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/10/oracle-clusterware-processes-for-10g-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/7134108412533378127'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/7134108412533378127'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/10/oracle-clusterware-processes-for-10g-on.html' title='Oracle Clusterware processes for 10g on Unix and Linux'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-5626042169302479747</id><published>2010-10-05T03:14:00.000-07:00</published><updated>2010-10-05T03:16:41.604-07:00</updated><title type='text'>ASM REBALANCING</title><content type='html'>Dynamic Storage Configuration&lt;br /&gt;&lt;br /&gt;ASM enables you to change the storage configuration without having to take the database offline. It automatically rebalances—redistributes file data evenly across all the disks of the disk group—after you add disks to or drop disks from a disk group. &lt;br /&gt;&lt;br /&gt;Should a disk failure occur, ASM automatically rebalances to restore full redundancy for files that had extents on the failed disk. When you replace the failed disk with a new disk, ASM rebalances the disk group to spread data evenly across all disks, including the replacement disk.&lt;br /&gt;&lt;br /&gt;Tuning Rebalance Operations&lt;br /&gt;&lt;br /&gt;The V$ASM_OPERATION view provides information that can be used for adjusting ASM_POWER_LIMIT and the resulting power of rebalance operations. The V$ASM_OPERATION view also gives an estimate in the EST_MINUTES column of the amount of time remaining for the rebalance operation to complete. You can see the effect of changing the rebalance power by observing the change in the time estimate.&lt;br /&gt;&lt;br /&gt;Effects of Adding and Dropping Disks from a Disk Group&lt;br /&gt;&lt;br /&gt;ASM automatically rebalances whenever disks are added or dropped. For a normal drop operation (without the FORCE option), a disk is not released from a disk group until data is moved off of the disk through rebalancing. Likewise, a newly added disk cannot support its share of the I/O workload until rebalancing completes. It is more efficient to add or drop multiple disks at the same time so that they are rebalanced as a single operation. This avoids unnecessary movement of data.&lt;br /&gt;&lt;br /&gt;For a drop operation, when rebalance is complete, ASM takes the disk offline momentarily, and then drops it, setting disk header status to FORMER.&lt;br /&gt;&lt;br /&gt;You can add or drop disks without shutting down the database. However, a performance impact on I/O activity may result.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-5626042169302479747?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/5626042169302479747/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/10/asm-rebalancing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/5626042169302479747'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/5626042169302479747'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/10/asm-rebalancing.html' title='ASM REBALANCING'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-3697851468552804644</id><published>2010-10-05T01:54:00.000-07:00</published><updated>2010-10-05T01:55:00.342-07:00</updated><title type='text'>Testing the Fail over in Real Application Clusters Oracle10gR2 using service</title><content type='html'>Testing the Fail over in Real Application Clusters Oracle10gR2 using service:&lt;br /&gt;&lt;br /&gt;How to test the Fail-over, if the Client is connected to a RAC database and one of the nodes goes down?&lt;br /&gt;1. Client connected to Database from a SQL Plus session from a remote Workstation.&lt;br /&gt;*********************************************&lt;br /&gt;SQL&gt; show user&lt;br /&gt;USER is "SCOTT"&lt;br /&gt;SQL&gt; select INSTANCE_NAME, INSTANCE_NUMBER from v$INSTANCE;&lt;br /&gt;INSTANCE_NAME INSTANCE_NUMBER&lt;br /&gt;---------------- ---------------&lt;br /&gt;devdb1 1&lt;br /&gt;*********************************************&lt;br /&gt;Checking the User /Client status from a DB Server&lt;br /&gt;SQL&gt; select USERNAME, INST_ID, MACHINE, TERMINAL, STATUS&lt;br /&gt;2 from gv$session where USERNAME = 'SCOTT';&lt;br /&gt;USERNAME INST_ID MACHINE TERMINAL STATUS&lt;br /&gt;--------- ---------- ------------------------------ -------------- --------&lt;br /&gt;SCOTT 1 WORKGROUP\PSDBA03-02 PSDBA03-02 INACTIVE&lt;br /&gt;****************************************&lt;br /&gt;3. On the DB Server, force /Kill the Instance devdb1.&lt;br /&gt;4. The status of the DBInstance devdb1 is down.&lt;br /&gt;Name Type Target State Host&lt;br /&gt;------------------------------------------------------------&lt;br /&gt;ora....SDEV.cs application ONLINE ONLINE rac2&lt;br /&gt;ora....db1.srv application ONLINE OFFLINE&lt;br /&gt;ora....db2.srv application ONLINE ONLINE rac2&lt;br /&gt;ora.devdb.db application ONLINE ONLINE rac2&lt;br /&gt;ora....b1.inst application OFFLINE OFFLINE&lt;br /&gt;ora....b2.inst application ONLINE ONLINE rac2&lt;br /&gt;ora....SM1.asm application ONLINE ONLINE rac1&lt;br /&gt;ora....C1.lsnr application ONLINE ONLINE rac1&lt;br /&gt;ora.rac1.gsd application ONLINE ONLINE rac1&lt;br /&gt;ora.rac1.ons application ONLINE ONLINE rac1&lt;br /&gt;ora.rac1.vip application ONLINE ONLINE rac1&lt;br /&gt;ora....SM2.asm application ONLINE ONLINE rac2&lt;br /&gt;ora....C2.lsnr application ONLINE ONLINE rac2&lt;br /&gt;ora.rac2.gsd application ONLINE ONLINE rac2&lt;br /&gt;ora.rac2.ons application ONLINE ONLINE rac2&lt;br /&gt;ora.rac2.vip application ONLINE ONLINE rac2&lt;br /&gt;****************************&lt;br /&gt;5. You can see difference with Normal Service, the SQL plus connection throws a error, but with Client-Side Load balancing and TAF the user connection still exists. For User the fail-over is transparent and can go ahead with his session without the need to reconnect.&lt;br /&gt;SQL&gt; select INSTANCE_NAME from v$instance;&lt;br /&gt;INSTANCE_NAME&lt;br /&gt;----------------&lt;br /&gt;devdb2&lt;br /&gt;SQL&gt; show user&lt;br /&gt;USER is "SCOTT"&lt;br /&gt;This is a simple test for fail-over, with a SQL Plus connections from a remote server.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-3697851468552804644?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/3697851468552804644/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/10/testing-fail-over-in-real-application.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/3697851468552804644'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/3697851468552804644'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/10/testing-fail-over-in-real-application.html' title='Testing the Fail over in Real Application Clusters Oracle10gR2 using service'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-2050621956039978265</id><published>2010-10-04T00:38:00.002-07:00</published><updated>2010-10-04T00:39:23.855-07:00</updated><title type='text'>RAC Switchover / Switchback</title><content type='html'>RAC Switchover / Switchback for 2 Node Primary with 2 Node Standby. Got from oracle forums.&lt;br /&gt;DB Name DB Unique Name Host Name Instance Name&lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;live live linux1 live1&lt;br /&gt;live live linux2 live2&lt;br /&gt;live livestdby linux3 livestdby1&lt;br /&gt;live livestdby linux4 livestdby2&lt;br /&gt;&lt;br /&gt;Verify that each database is properly configured for the role it is about to assume and the standby database is in mounted state. &lt;br /&gt;(Verify all Dataguard parameters on each node for Primary &amp; Standby)&lt;br /&gt;&lt;br /&gt;Like,&lt;br /&gt;Log_archive_dest_1&lt;br /&gt;Log_archive_dest_2&lt;br /&gt;Log_archive_dest_state_1&lt;br /&gt;Log_archive_dest_state_2&lt;br /&gt;Fal_client&lt;br /&gt;Fal_server&lt;br /&gt;Local_listener&lt;br /&gt;Remote_listener&lt;br /&gt;Standby_archive_Dest&lt;br /&gt;Standby_archive_management&lt;br /&gt;service_names&lt;br /&gt;db_unique_name&lt;br /&gt;instance_name&lt;br /&gt;db_file_name_convert&lt;br /&gt;log_file_name_convert&lt;br /&gt;&lt;br /&gt;Verify that both Primary RAC &amp; Dataguard RAC are functioning properly and both are in Sync&lt;br /&gt;On Primary, &lt;br /&gt;Select thread#,max(sequence#) from v$archived_log group by thread#;&lt;br /&gt;On Standby,&lt;br /&gt;Select thread#,max(sequence#) from v$log_history group by thread#;&lt;br /&gt;&lt;br /&gt;Before performing a switchover from a RAC primary shut down all but one primary instance (they can be restarted after the switchover has completed). &lt;br /&gt;./srvctl stop instance –d live –i live1&lt;br /&gt;Before performing a switchover or a failover to a RAC standby shut down all but one standby instance (they can be restarted after the role transition has completed). &lt;br /&gt;./srvctl stop instance –d live –i livestdby1&lt;br /&gt;&lt;br /&gt;On the primary database initiate the switchover: &lt;br /&gt;alter database commit to switchover to physical standby with session shutdown;&lt;br /&gt;Shutdown former Primary database &amp; Startup in Mount State.&lt;br /&gt;Shut immediate;&lt;br /&gt;Startup mount;&lt;br /&gt;select name,db_unique_name, log_mode,open_mode,controlfile_type,switchover_status,database_role from v$database;&lt;br /&gt;&lt;br /&gt;Make log_Archive_Dest_state_2 to DEFER&lt;br /&gt;alter system set log_archive_dest_state_2='DEFER' sid='*';&lt;br /&gt;&lt;br /&gt;On the (old) standby database, &lt;br /&gt;select name,log_mode,open_mode,controlfile_type,switchover_status,database_role from v$database;&lt;br /&gt;&lt;br /&gt;On the (old) standby database switch to new primary role: &lt;br /&gt;alter database commit to switchover to primary; &lt;br /&gt;shut immediate;&lt;br /&gt;startup;&lt;br /&gt;&lt;br /&gt;On new Primary database,&lt;br /&gt;select name,log_mode,open_mode,controlfile_type,switchover_status,database_role from v$database;&lt;br /&gt;Make log_Archive_Dest_state_2 to ENABLE&lt;br /&gt;alter system set log_archive_dest_state_2='ENABLE' sid='*';&lt;br /&gt;Add tempfiles in New Primary database.&lt;br /&gt;Do some archivelog switches on new primary database &amp; verify that archives are getting transferred to Standby database.&lt;br /&gt;&lt;br /&gt;On new primary, &lt;br /&gt;select error from v$archive_Dest_status;&lt;br /&gt;select max(sequence#) from v$archived_log;&lt;br /&gt;&lt;br /&gt;On new Standby, Start Redo Apply&lt;br /&gt;&lt;br /&gt;alter database recover managed standby database using current logfile disconnect;&lt;br /&gt;&lt;br /&gt;Select max(sequence#) from v$log_history; (should be matching with Primary)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now Start RAC databases services (both Primary – in open &amp; Standby – in mount)&lt;br /&gt;On new Primary Server.&lt;br /&gt;./srvctl start instance –d live –i livestdby2&lt;br /&gt;Verify using ./crs_stat –t&lt;br /&gt;Check that database is opened in R/W mode.&lt;br /&gt;On new Standby Server. &lt;br /&gt;./srvctl start instance –d live –i live2 –o mount&lt;br /&gt;&lt;br /&gt;Now add TAF services on new Primary (former Standby) Server.&lt;br /&gt;By Command Prompt,&lt;br /&gt;./srvctl add service -d live -s srvc_livestdby -r livestdby1,livestdby2 -P BASIC&lt;br /&gt;OR&lt;br /&gt;By GUI,&lt;br /&gt;dbca -&gt; Oracle Read Application Cluster database -&gt; Service Management -&gt; select database -&gt; add services, details (Preferred / Available), TAF Policy (Basic / Preconnect) - &gt; Finish&lt;br /&gt;&lt;br /&gt;Start the services,&lt;br /&gt;./srvctl start service -d live&lt;br /&gt;&lt;br /&gt;Verify the same,&lt;br /&gt;./crs_stat -t&lt;br /&gt;&lt;br /&gt;Perform TAF testing, to make sure Load Balancing&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-2050621956039978265?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/2050621956039978265/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/10/rac-switchover-switchback_8616.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/2050621956039978265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/2050621956039978265'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/10/rac-switchover-switchback_8616.html' title='RAC Switchover / Switchback'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-1073397245978438721</id><published>2010-10-04T00:32:00.000-07:00</published><updated>2010-10-04T00:33:42.371-07:00</updated><title type='text'>OCR is automatically backed</title><content type='html'>OCR is automatically backed up physically:&lt;br /&gt;Every four hours: CRS keeps the last three copies.&lt;br /&gt;At the end of every day: CRS keeps the last two copies.&lt;br /&gt;At the end of every week: CRS keeps the last two copies&lt;br /&gt;&lt;br /&gt;[oracle@rac2 ~]$ ocrconfig -showbackup&lt;br /&gt;&lt;br /&gt;rac2     2010/10/04 10:29:12     /u01/app/oracle/product/crs/cdata/crs&lt;br /&gt;&lt;br /&gt;rac2     2010/10/04 06:29:11     /u01/app/oracle/product/crs/cdata/crs&lt;br /&gt;&lt;br /&gt;rac2     2010/10/04 02:29:11     /u01/app/oracle/product/crs/cdata/crs&lt;br /&gt;&lt;br /&gt;rac2     2010/10/03 02:29:07     /u01/app/oracle/product/crs/cdata/crs&lt;br /&gt;&lt;br /&gt;dbrac1     2010/09/17 04:17:06     /u01/app/oracle/product/crs/cdata/crs&lt;br /&gt;[oracle@rac2 ~]$ cd /u01/app/oracle/product/crs/cdata/crs&lt;br /&gt;[oracle@rac2 crs]$ ls -ltr&lt;br /&gt;total 27916&lt;br /&gt;-rw-r--r--  1 root root 4079616 Jun 13 02:16 week.ocr&lt;br /&gt;-rw-r--r--  1 root root 4079616 Sep 29 00:58 week_.ocr&lt;br /&gt;-rw-r--r--  1 root root 4079616 Oct  3 02:29 day.ocr&lt;br /&gt;-rw-r--r--  1 root root 4079616 Oct  4 02:29 day_.ocr&lt;br /&gt;-rw-r--r--  1 root root 4079616 Oct  4 02:29 backup02.ocr&lt;br /&gt;-rw-r--r--  1 root root 4079616 Oct  4 06:29 backup01.ocr&lt;br /&gt;-rw-r--r--  1 root root 4079616 Oct  4 10:29 backup00.ocr&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-1073397245978438721?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/1073397245978438721/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/10/ocr-is-automatically-backed.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/1073397245978438721'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/1073397245978438721'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/10/ocr-is-automatically-backed.html' title='OCR is automatically backed'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-8544845837626282064</id><published>2010-09-29T00:06:00.000-07:00</published><updated>2010-09-29T00:07:23.423-07:00</updated><title type='text'>Checkpoint Tuning</title><content type='html'>Determining the time to recover from an instance failure is a necessary component for reaching required service levelsagreements. For example, if service levels dictate that when a node fails, instance recovery time can be no more than 3 minutes, FAST_START_MTTR_TARGET should be set to 180 &lt;br /&gt;&lt;br /&gt;Fast-start checkpointing refers to the periodic writes by the database writer (DBWn) processes for the purpose of writing changed data blocks from the Oracle buffer cache to disk and advancing the thread-checkpoint. Setting the database parameter FAST_START_MTTR_TARGET to a value greater than zero enables the fast-start checkpointing feature. &lt;br /&gt;&lt;br /&gt;Fast-start checkpointing should always be enabled for the following reasons: &lt;br /&gt;&lt;br /&gt;It reduces the time required for cache recovery, and makes instance recovery time-bounded and predictable. This is accomplished by limiting the number of dirty buffers (data blocks which have changes in memory that still need to be written to disk) and the number of redo records (changes in the database) generated between the most recent redo record and the last checkpoint.&lt;br /&gt;  &lt;br /&gt;Fast-Start checkpointing eliminates bulk writes and corresponding I/O spikes that occure traditionally with interval- based checkpoints, providing a smoother, more consistent I/O pattern that is more predictable and easier to manage. &lt;br /&gt;If the system is not already near or at its maximum I/O capacity, fast-start checkpointing will have a negligible impact on performance. Although fast-start checkpointing results in increased write activity, there is little reduction in database throughout, provided the system has sufficient I/O capacity. &lt;br /&gt;&lt;br /&gt;Check-Pointing &lt;br /&gt;&lt;br /&gt;Check-pointing is an important Oracle activity which records the highest system change number (SCN,) so that all data blocks less than or equal to the SCN are known to be written out to the data files. If there is a failure and then subsequent cache recovery, only the redo records containing changes at SCN(s) higher than the checkpoint need to be applied during recovery. &lt;br /&gt;&lt;br /&gt;As we are aware, instance and crash recovery occur in two steps - cache recovery followed by transaction recovery. During the cache recovery phase, also known as the rolling forward stage, Oracle applies all committed and uncommitted changes in the redo log files to the affected data blocks. The work required for cache recovery processing is proportional to the rate of change to the database and the time between checkpoints. &lt;br /&gt;&lt;br /&gt;Mean time to recover (MTTR) &lt;br /&gt;&lt;br /&gt;Fast-start recovery can greatly reduce the mean time to recover (MTTR), with minimal effects on online application performance. Oracle continuously estimates the recovery time and automatically adjusts the check-pointing rate to meet the target recovery time. &lt;br /&gt;&lt;br /&gt;With 10g, the Oracle database can now self-tune check-pointing to achieve good recovery times with low impact on normal throughput. You no longer have to set any checkpoint-related parameters. &lt;br /&gt;&lt;br /&gt;This method reduces the time required for cache recovery and makes the recovery bounded and predictable by limiting the number of dirty buffers and the number of redo records generated between the most recent redo record and the last checkpoint. Administrators specify a target (bounded) time to complete the cache recovery phase of recovery with the FAST_START_MTTR_TARGET initialization parameter, and Oracle automatically varies the incremental checkpoint writes to meet that target. &lt;br /&gt;&lt;br /&gt;The TARGET_MTTR field of V$INSTANCE_RECOVERY contains the MTTR target in effect. The ESTIMATED_MTTR field of V$INSTANCE_RECOVERY contains the estimated MTTR should a crash happen right away. &lt;br /&gt;&lt;br /&gt;Enable MTTR advisory &lt;br /&gt;&lt;br /&gt;Enabling MTTR Advisory Enabling MTTR Advisory involves setting two parameters: &lt;br /&gt;&lt;br /&gt;STATISTICS_LEVEL = TYPICAL&lt;br /&gt;FAST_START_MTTR_TARGET &gt; 0 &lt;br /&gt;&lt;br /&gt;Estimate the value for FAST_START_MTTR_TARGET as follows: &lt;br /&gt;&lt;br /&gt;SELECT TARGET_MTTR,&lt;br /&gt;       ESTIMATED_MTTR,&lt;br /&gt;       CKPT_BLOCK_WRITES&lt;br /&gt;  FROM V$INSTANCE_RECOVERY; &lt;br /&gt;&lt;br /&gt;TARGET_MTTR ESTIMATED_MTTR CKPT_BLOCK_WRITES&lt;br /&gt;----------- -------------- -----------------&lt;br /&gt;        214             12            269880 &lt;br /&gt;&lt;br /&gt;FAST_START_MTTR_TARGET = 214; &lt;br /&gt;&lt;br /&gt;Whenever you set FAST_START_MTTR_TARGET to a nonzero value, then set the following parameters to 0. &lt;br /&gt;&lt;br /&gt;LOG_CHECKPOINT_TIMEOUT = 0&lt;br /&gt;LOG_CHECKPOINT_INTERVAL = 0&lt;br /&gt;FAST_START_IO_TARGET = 0 &lt;br /&gt;&lt;br /&gt;Disable MTTR advisory &lt;br /&gt;&lt;br /&gt;FAST_START_MTTR_TARGET = 0&lt;br /&gt;LOG_CHECKPOINT_INTERVAL = 200000&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-8544845837626282064?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/8544845837626282064/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/09/checkpoint-tuning.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/8544845837626282064'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/8544845837626282064'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/09/checkpoint-tuning.html' title='Checkpoint Tuning'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-9038715560893834275</id><published>2010-09-28T23:57:00.002-07:00</published><updated>2010-09-28T23:58:00.303-07:00</updated><title type='text'>Duplicate Oracle Database with RMAN</title><content type='html'>Overview&lt;br /&gt;A powerful feature of RMAN is the ability to duplicate (clone), a database from a backup. It is possible to create a duplicate database on:&lt;br /&gt;&lt;br /&gt;A remote server with the same file structure &lt;br /&gt;A remote server with a different file structure &lt;br /&gt;The local server with a different file structure &lt;br /&gt;A duplicate database is distinct from a standby database, although both types of databases are created with the DUPLICATE command. A standby database is a copy of the primary database that you can update continually or periodically by using archived logs from the primary database. If the primary database is damaged or destroyed, then you can perform failover to the standby database and effectively transform it into the new primary database. A duplicate database, on the other hand, cannot be used in this way: it is not intended for failover scenarios and does not support the various standby recovery and failover options. &lt;br /&gt;&lt;br /&gt;To prepare for database duplication, you must first create an auxiliary instance. For the duplication to work, you must connect RMAN to both the target (primary) database and an auxiliary instance started in NOMOUNT mode.&lt;br /&gt;&lt;br /&gt;So long as RMAN is able to connect to the primary and duplicate instances, the RMAN client can run on any machine. However, all backups, copies of datafiles, and archived logs used for creating and recovering the duplicate database must be accessible by the server session on the duplicate host.&lt;br /&gt;&lt;br /&gt;As part of the duplicating operation, RMAN manages the following:&lt;br /&gt;&lt;br /&gt;Restores the target datafiles to the duplicate database and performs incomplete recovery by using all available backups and archived logs.&lt;br /&gt;  &lt;br /&gt;Shuts down and starts the auxiliary database.&lt;br /&gt;  &lt;br /&gt;Opens the duplicate database with the RESETLOGS option after incomplete recovery to create the online redo logs.&lt;br /&gt;  &lt;br /&gt;Generates a new, unique DBID for the duplicate database. &lt;br /&gt; &lt;br /&gt;Preparing the Duplicate (Auxiliary) Instance for Duplication&lt;br /&gt;Create an Oracle Password File&lt;br /&gt;&lt;br /&gt;First we must create a password file for the duplicate instance.&lt;br /&gt;&lt;br /&gt;export ORACLE_SID=APP2&lt;br /&gt;orapwd file=orapwAPP2 password=manager entries=5 force=y&lt;br /&gt;&lt;br /&gt;Ensure Oracle Net Connectivity to both Instances&lt;br /&gt;&lt;br /&gt;Next add the appropriate entries into the TNSNAMES.ORA and LISTENER.ORA files in the $TNS_ADMIN directory.&lt;br /&gt;&lt;br /&gt;LISTENER.ORA&lt;br /&gt;&lt;br /&gt;APP1 = Target Database, APP2 = Auxiliary Database&lt;br /&gt;&lt;br /&gt;LISTENER =&lt;br /&gt;  (DESCRIPTION_LIST =&lt;br /&gt;    (DESCRIPTION =&lt;br /&gt;      (ADDRESS = (PROTOCOL = TCP)(HOST = gentic)(PORT = 1521))&lt;br /&gt;    )&lt;br /&gt;  )&lt;br /&gt;&lt;br /&gt;SID_LIST_LISTENER =&lt;br /&gt;  (SID_LIST =&lt;br /&gt;    (SID_DESC =&lt;br /&gt;      (GLOBAL_DBNAME = APP1.WORLD)&lt;br /&gt;      (ORACLE_HOME = /opt/oracle/product/10.2.0)&lt;br /&gt;      (SID_NAME = APP1)&lt;br /&gt;    )&lt;br /&gt;    (SID_DESC =&lt;br /&gt;      (GLOBAL_DBNAME = APP2.WORLD)&lt;br /&gt;      (ORACLE_HOME = /opt/oracle/product/10.2.0)&lt;br /&gt;      (SID_NAME = APP2)&lt;br /&gt;    )&lt;br /&gt;  )&lt;br /&gt;&lt;br /&gt;TNSNAMES.ORA&lt;br /&gt;&lt;br /&gt;APP1 = Target Database, APP2 = Auxiliary Database&lt;br /&gt;&lt;br /&gt;APP1.WORLD =&lt;br /&gt;  (DESCRIPTION =&lt;br /&gt;    (ADDRESS_LIST =&lt;br /&gt;      (ADDRESS = (PROTOCOL = TCP)(HOST = gentic)(PORT = 1521))&lt;br /&gt;    )&lt;br /&gt;    (CONNECT_DATA =&lt;br /&gt;      (SERVICE_NAME = APP1.WORLD)&lt;br /&gt;    )&lt;br /&gt;  )&lt;br /&gt;&lt;br /&gt;APP2.WORLD =&lt;br /&gt;  (DESCRIPTION =&lt;br /&gt;    (ADDRESS_LIST =&lt;br /&gt;      (ADDRESS = (PROTOCOL = TCP)(HOST = gentic)(PORT = 1521))&lt;br /&gt;    )&lt;br /&gt;    (CONNECT_DATA =&lt;br /&gt;      (SERVICE_NAME = APP2.WORLD)&lt;br /&gt;    )&lt;br /&gt;  )&lt;br /&gt;&lt;br /&gt;SQLNET.ORA&lt;br /&gt;&lt;br /&gt;NAMES.DIRECTORY_PATH= (TNSNAMES)&lt;br /&gt;NAMES.DEFAULT_DOMAIN = WORLD&lt;br /&gt;NAME.DEFAULT_ZONE = WORLD&lt;br /&gt;USE_DEDICATED_SERVER = ON&lt;br /&gt;&lt;br /&gt;Now restart the Listener&lt;br /&gt;&lt;br /&gt;lsnrctl stop&lt;br /&gt;lsnrctl start&lt;br /&gt;&lt;br /&gt;Create an Initialization Parameter File for the Auxiliary Instance&lt;br /&gt;&lt;br /&gt;Create an INIT.ORA parameter file for the auxiliary instance, you can copy that from the target instance and then modify the parameters.&lt;br /&gt;&lt;br /&gt;### Duplicate Database&lt;br /&gt;### -----------------------------------------------&lt;br /&gt;# This is only used when you duplicate the database&lt;br /&gt;# on the same host to avoid name conflicts&lt;br /&gt;&lt;br /&gt;DB_FILE_NAME_CONVERT              = (/u01/oracle/db/APP1/,/u01/oracle/db/APP2/)&lt;br /&gt;LOG_FILE_NAME_CONVERT             = (/u01/oracle/db/APP1/,/u01/oracle/db/APP2/,&lt;br /&gt;                                     /opt/oracle/db/APP1/,/opt/oracle/db/APP2/)&lt;br /&gt;&lt;br /&gt;### Global database name is db_name.db_domain&lt;br /&gt;### -----------------------------------------&lt;br /&gt;&lt;br /&gt;db_name                           = APP2&lt;br /&gt;db_unique_name                    = APP2_GENTIC&lt;br /&gt;db_domain                         = WORLD&lt;br /&gt;service_names                     = APP2&lt;br /&gt;instance_name                     = APP2&lt;br /&gt;&lt;br /&gt;### Basic Configuration Parameters&lt;br /&gt;### ------------------------------&lt;br /&gt;&lt;br /&gt;compatible                        = 10.2.0.4&lt;br /&gt;db_block_size                     = 8192&lt;br /&gt;db_file_multiblock_read_count     = 32&lt;br /&gt;db_files                          = 512&lt;br /&gt;control_files                     = /u01/oracle/db/APP2/con/APP2_con01.con,&lt;br /&gt;                                    /opt/oracle/db/APP2/con/APP2_con02.con&lt;br /&gt;&lt;br /&gt;### Database Buffer Cache, I/O&lt;br /&gt;### --------------------------&lt;br /&gt;# The Parameter SGA_TARGET enables Automatic Shared Memory Management&lt;br /&gt;&lt;br /&gt;sga_target                        = 500M&lt;br /&gt;sga_max_size                      = 600M&lt;br /&gt;&lt;br /&gt;### REDO Logging without Data Guard&lt;br /&gt;### -------------------------------&lt;br /&gt;&lt;br /&gt;log_archive_format                = APP2_%s_%t_%r.arc&lt;br /&gt;log_archive_max_processes         = 2&lt;br /&gt;log_archive_dest                  = /u01/oracle/db/APP2/arc&lt;br /&gt;&lt;br /&gt;### System Managed Undo&lt;br /&gt;### -------------------&lt;br /&gt;&lt;br /&gt;undo_management                   = auto&lt;br /&gt;undo_retention                    = 10800&lt;br /&gt;undo_tablespace                   = undo&lt;br /&gt;&lt;br /&gt;### Traces, Dumps and Passwordfile&lt;br /&gt;### ------------------------------&lt;br /&gt;&lt;br /&gt;audit_file_dest                   = /u01/oracle/db/APP2/adm/admp&lt;br /&gt;user_dump_dest                    = /u01/oracle/db/APP2/adm/udmp&lt;br /&gt;background_dump_dest              = /u01/oracle/db/APP2/adm/bdmp&lt;br /&gt;core_dump_dest                    = /u01/oracle/db/APP2/adm/cdmp&lt;br /&gt;utl_file_dir                      = /u01/oracle/db/APP2/adm/utld&lt;br /&gt;remote_login_passwordfile         = exclusive&lt;br /&gt;&lt;br /&gt;Create a full Database Backup&lt;br /&gt;&lt;br /&gt;Make sure that a full backup of the target is accessible on the duplicate host. You can use the following BASH script to backup the target database.&lt;br /&gt;&lt;br /&gt;rman nocatalog target / &lt;&lt;-EOF&lt;br /&gt;   configure retention policy to recovery window of 3 days;&lt;br /&gt;   configure backup optimization on;&lt;br /&gt;   configure controlfile autobackup on;&lt;br /&gt;   configure default device type to disk;&lt;br /&gt;   configure device type disk parallelism 1 backup type to compressed backupset;&lt;br /&gt;   configure datafile backup copies for device type disk to 1;&lt;br /&gt;   configure maxsetsize to unlimited;&lt;br /&gt;   configure snapshot controlfile name to '/u01/backup/snapshot_controlfile';&lt;br /&gt;   show all;&lt;br /&gt;&lt;br /&gt;   run {&lt;br /&gt;     allocate channel ch1 type Disk maxpiecesize = 1900M;&lt;br /&gt;     backup full database noexclude&lt;br /&gt;     include current controlfile&lt;br /&gt;     format '/u01/backup/datafile_%s_%p.bak'&lt;br /&gt;     tag 'datafile_daily';&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   run {&lt;br /&gt;     allocate channel ch1 type Disk maxpiecesize = 1900M;&lt;br /&gt;     backup archivelog all&lt;br /&gt;     delete all input&lt;br /&gt;     format '/u01/backup/archivelog_%s_%p.bak'&lt;br /&gt;     tag 'archivelog_daily';&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   run {&lt;br /&gt;      allocate channel ch1 type Disk maxpiecesize = 1900M;&lt;br /&gt;      backup format '/u01/backup/controlfile_%s.bak' current controlfile;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   crosscheck backup;&lt;br /&gt;   list backup of database;&lt;br /&gt;   report unrecoverable;&lt;br /&gt;   report schema;&lt;br /&gt;   report need backup;&lt;br /&gt;   report obsolete;&lt;br /&gt;   delete noprompt expired backup of database;&lt;br /&gt;   delete noprompt expired backup of controlfile;&lt;br /&gt;   delete noprompt expired backup of archivelog all;&lt;br /&gt;   delete noprompt obsolete recovery window of 3 days;&lt;br /&gt;   quit&lt;br /&gt;EOF&lt;br /&gt;&lt;br /&gt;Creating a Duplicate Database on the Local Host&lt;br /&gt;Before beginning RMAN duplication, use SQL*Plus to connect to the auxiliary instance and start it in NOMOUNT mode. If you do not have a server-side initialization parameter file for the auxiliary instance in the default location, then you must specify the client-side initialization parameter file with the PFILE parameter on the DUPLICATE command.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Get original Filenames from TARGET&lt;br /&gt;&lt;br /&gt;To rename the database files you can use the SET NEWNAME command. Therefore, get the original filenames from the target and modify these names in the DUPLICATE command.&lt;br /&gt;&lt;br /&gt;ORACLE_SID=APP1&lt;br /&gt;export ORACLE_SID&lt;br /&gt;&lt;br /&gt;set feed off&lt;br /&gt;set pagesize 10000&lt;br /&gt;column name format a40 heading "Datafile"&lt;br /&gt;column file# format 99 heading "File-ID"&lt;br /&gt;&lt;br /&gt;select  name, file# from v$dbfile;&lt;br /&gt;&lt;br /&gt;column member format a40 heading "Logfile"&lt;br /&gt;column group# format 99 heading "Group-Nr"&lt;br /&gt;&lt;br /&gt;select  member, group# from v$logfile;&lt;br /&gt;&lt;br /&gt;Datafile                                  File-ID&lt;br /&gt;----------------------------------------  -------&lt;br /&gt;/u01/oracle/db/APP1/sys/APP1_sys1.dbf           1&lt;br /&gt;/u01/oracle/db/APP1/sys/APP1_undo1.dbf          2&lt;br /&gt;/u01/oracle/db/APP1/sys/APP1_sysaux1.dbf        3&lt;br /&gt;/u01/oracle/db/APP1/usr/APP1_users1.dbf         4&lt;br /&gt;&lt;br /&gt;Logfile                                  Group-Nr&lt;br /&gt;---------------------------------------- --------&lt;br /&gt;/u01/oracle/db/APP1/rdo/APP1_log1A.rdo          1&lt;br /&gt;/opt/oracle/db/APP1/rdo/APP1_log1B.rdo          1&lt;br /&gt;/u01/oracle/db/APP1/rdo/APP1_log2A.rdo          2&lt;br /&gt;/opt/oracle/db/APP1/rdo/APP1_log2B.rdo          2&lt;br /&gt;/u01/oracle/db/APP1/rdo/APP1_log3A.rdo          3&lt;br /&gt;/opt/oracle/db/APP1/rdo/APP1_log3B.rdo          3&lt;br /&gt;/u01/oracle/db/APP1/rdo/APP1_log4A.rdo          4&lt;br /&gt;/opt/oracle/db/APP1/rdo/APP1_log4B.rdo          4&lt;br /&gt;/u01/oracle/db/APP1/rdo/APP1_log5A.rdo          5&lt;br /&gt;/opt/oracle/db/APP1/rdo/APP1_log5B.rdo          5&lt;br /&gt;/u01/oracle/db/APP1/rdo/APP1_log6A.rdo          6&lt;br /&gt;/opt/oracle/db/APP1/rdo/APP1_log6B.rdo          6&lt;br /&gt;/u01/oracle/db/APP1/rdo/APP1_log7A.rdo          7&lt;br /&gt;/opt/oracle/db/APP1/rdo/APP1_log7B.rdo          7&lt;br /&gt;/u01/oracle/db/APP1/rdo/APP1_log8A.rdo          8&lt;br /&gt;/opt/oracle/db/APP1/rdo/APP1_log8B.rdo          8&lt;br /&gt;/u01/oracle/db/APP1/rdo/APP1_log9A.rdo          9&lt;br /&gt;/opt/oracle/db/APP1/rdo/APP1_log9B.rdo          9&lt;br /&gt;/u01/oracle/db/APP1/rdo/APP1_log10A.rdo        10&lt;br /&gt;/opt/oracle/db/APP1/rdo/APP1_log10B.rdo        10&lt;br /&gt;&lt;br /&gt;Create Directories for the duplicate Database&lt;br /&gt;&lt;br /&gt;mkdir -p /u01/oracle/db/APP2&lt;br /&gt;mkdir -p /opt/oracle/db/APP2&lt;br /&gt;cd /opt/oracle/db/APP2&lt;br /&gt;mkdir con rdo&lt;br /&gt;cd /u01/oracle/db/APP2&lt;br /&gt;mkdir adm arc con rdo sys tmp usr bck&lt;br /&gt;cd adm&lt;br /&gt;mkdir admp bdmp cdmp udmp utld&lt;br /&gt;&lt;br /&gt;Create Symbolic Links to Password and INIT.ORA File&lt;br /&gt;&lt;br /&gt;Oracle must be able to locate the Password and INIT.ORA File.&lt;br /&gt;&lt;br /&gt;cd $ORACLE_HOME/dbs&lt;br /&gt;ln -s /home/oracle/config/10.2.0/orapwAPP2 orapwAPP2&lt;br /&gt;ln -s /home/oracle/config/10.2.0/initAPP2.ora initAPP2.ora&lt;br /&gt;&lt;br /&gt;Duplicate the Database&lt;br /&gt;&lt;br /&gt;Now you are ready to duplicate the database APP1 to APP2.&lt;br /&gt;&lt;br /&gt;ORACLE_SID=APP2&lt;br /&gt;export ORACLE_SID&lt;br /&gt;&lt;br /&gt;sqlplus sys/manager as sysdba&lt;br /&gt;startup force nomount pfile='/home/oracle/config/10.2.0/initAPP2.ora';&lt;br /&gt;exit;&lt;br /&gt;&lt;br /&gt;rman TARGET sys/manager@APP1 AUXILIARY sys/manager@APP2&lt;br /&gt;&lt;br /&gt;Recovery Manager: Release 10.2.0.4.0 - Production on Tue Oct 28 12:00:13 2008&lt;br /&gt;Copyright (c) 1982, 2007, Oracle. All rights reserved.&lt;br /&gt;connected to target database: APP1 (DBID=3191823649)&lt;br /&gt;connected to auxiliary database: APP2 (not mounted)&lt;br /&gt;&lt;br /&gt;RUN&lt;br /&gt;{&lt;br /&gt;  SET NEWNAME FOR DATAFILE 1 TO '/u01/oracle/db/APP2/sys/APP2_sys1.dbf';&lt;br /&gt;  SET NEWNAME FOR DATAFILE 2 TO '/u01/oracle/db/APP2/sys/APP2_undo1.dbf';&lt;br /&gt;  SET NEWNAME FOR DATAFILE 3 TO '/u01/oracle/db/APP2/sys/APP2_sysaux1.dbf';&lt;br /&gt;  SET NEWNAME FOR DATAFILE 4 TO '/u01/oracle/db/APP2/usr/APP2_users1.dbf';&lt;br /&gt;  DUPLICATE TARGET DATABASE TO APP2&lt;br /&gt;  PFILE = /home/oracle/config/10.2.0/initAPP2.ora&lt;br /&gt;  NOFILENAMECHECK&lt;br /&gt;  LOGFILE GROUP 1 ('/u01/oracle/db/APP2/rdo/APP2_log1A.rdo',&lt;br /&gt;                   '/opt/oracle/db/APP2/rdo/APP2_log1B.rdo') SIZE 10M REUSE,&lt;br /&gt;          GROUP 2 ('/u01/oracle/db/APP2/rdo/APP2_log2A.rdo',&lt;br /&gt;                   '/opt/oracle/db/APP2/rdo/APP2_log2B.rdo') SIZE 10M REUSE,&lt;br /&gt;          GROUP 3 ('/u01/oracle/db/APP2/rdo/APP2_log3A.rdo',&lt;br /&gt;                   '/opt/oracle/db/APP2/rdo/APP2_log3B.rdo') SIZE 10M REUSE,&lt;br /&gt;          GROUP 4 ('/u01/oracle/db/APP2/rdo/APP2_log4A.rdo',&lt;br /&gt;                   '/opt/oracle/db/APP2/rdo/APP2_log4B.rdo') SIZE 10M REUSE,&lt;br /&gt;          GROUP 5 ('/u01/oracle/db/APP2/rdo/APP2_log5A.rdo',&lt;br /&gt;                   '/opt/oracle/db/APP2/rdo/APP2_log5B.rdo') SIZE 10M REUSE,&lt;br /&gt;          GROUP 6 ('/u01/oracle/db/APP2/rdo/APP2_log6A.rdo',&lt;br /&gt;                   '/opt/oracle/db/APP2/rdo/APP2_log6B.rdo') SIZE 10M REUSE,&lt;br /&gt;          GROUP 7 ('/u01/oracle/db/APP2/rdo/APP2_log7A.rdo',&lt;br /&gt;                   '/opt/oracle/db/APP2/rdo/APP2_log7B.rdo') SIZE 10M REUSE,&lt;br /&gt;          GROUP 8 ('/u01/oracle/db/APP2/rdo/APP2_log8A.rdo',&lt;br /&gt;                   '/opt/oracle/db/APP2/rdo/APP2_log8B.rdo') SIZE 10M REUSE,&lt;br /&gt;          GROUP 9 ('/u01/oracle/db/APP2/rdo/APP2_log9A.rdo',&lt;br /&gt;                   '/opt/oracle/db/APP2/rdo/APP2_log9B.rdo') SIZE 10M REUSE,&lt;br /&gt;          GROUP 10 ('/u01/oracle/db/APP2/rdo/APP2_log10A.rdo',&lt;br /&gt;                    '/opt/oracle/db/APP2/rdo/APP2_log10B.rdo') SIZE 10M REUSE;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;The whole, long output is not shown here, but check, that RMAN was able to open the duplicate database with the RESETLOGS option.&lt;br /&gt;&lt;br /&gt;.....&lt;br /&gt;.....&lt;br /&gt;contents of Memory Script:&lt;br /&gt;{&lt;br /&gt;Alter clone database open resetlogs;&lt;br /&gt;}&lt;br /&gt;executing Memory Script&lt;br /&gt;&lt;br /&gt;database opened&lt;br /&gt;Finished Duplicate Db at 28-OCT-08&lt;br /&gt;&lt;br /&gt;As the final step, eliminate or uncomment the DB_FILE_NAME_CONVERT and LOG_FILE_NAME_CONVERT in the INIT.ORA file and restart the database.&lt;br /&gt;&lt;br /&gt;initAPP2.ora&lt;br /&gt;&lt;br /&gt;### Duplicate Database&lt;br /&gt;### -----------------------------------------------&lt;br /&gt;# This is only used when you duplicate the database&lt;br /&gt;# on the same host to avoid name conflicts&lt;br /&gt;# DB_FILE_NAME_CONVERT =  (/u01/oracle/db/APP1/,/u01/oracle/db/APP2/)&lt;br /&gt;# LOG_FILE_NAME_CONVERT = (/u01/oracle/db/APP1/,/u01/oracle/db/APP2/,&lt;br /&gt;                           /opt/oracle/db/APP1/,/opt/oracle/db/APP2/)&lt;br /&gt;&lt;br /&gt;sqlplus / as sysdba&lt;br /&gt;shutdown immediate;&lt;br /&gt;startup;&lt;br /&gt;&lt;br /&gt;Total System Global Area 629145600 bytes&lt;br /&gt;Fixed Size 1269064 bytes&lt;br /&gt;Variable Size 251658936 bytes&lt;br /&gt;Database Buffers 373293056 bytes&lt;br /&gt;Redo Buffers 2924544 bytes&lt;br /&gt;Database mounted.&lt;br /&gt;Database opened.&lt;br /&gt;&lt;br /&gt;Creating a Duplicate Database to Remote Host&lt;br /&gt;This scenario is exactly the same as described for the local host. Copy the RMAN Backup files to the remote host on the same directory as on the localhost.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;cd /u01/backup&lt;br /&gt;scp gentic:/u01/backup/* .&lt;br /&gt;&lt;br /&gt;The other steps are the same as described under «Creating a Duplicate Database on the Local Host».&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-9038715560893834275?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/9038715560893834275/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/09/duplicate-oracle-database-with-rman_28.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/9038715560893834275'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/9038715560893834275'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/09/duplicate-oracle-database-with-rman_28.html' title='Duplicate Oracle Database with RMAN'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-5754219470561624185</id><published>2010-09-28T23:57:00.001-07:00</published><updated>2010-09-28T23:57:59.848-07:00</updated><title type='text'>Duplicate Oracle Database with RMAN</title><content type='html'>Overview&lt;br /&gt;A powerful feature of RMAN is the ability to duplicate (clone), a database from a backup. It is possible to create a duplicate database on:&lt;br /&gt;&lt;br /&gt;A remote server with the same file structure &lt;br /&gt;A remote server with a different file structure &lt;br /&gt;The local server with a different file structure &lt;br /&gt;A duplicate database is distinct from a standby database, although both types of databases are created with the DUPLICATE command. A standby database is a copy of the primary database that you can update continually or periodically by using archived logs from the primary database. If the primary database is damaged or destroyed, then you can perform failover to the standby database and effectively transform it into the new primary database. A duplicate database, on the other hand, cannot be used in this way: it is not intended for failover scenarios and does not support the various standby recovery and failover options. &lt;br /&gt;&lt;br /&gt;To prepare for database duplication, you must first create an auxiliary instance. For the duplication to work, you must connect RMAN to both the target (primary) database and an auxiliary instance started in NOMOUNT mode.&lt;br /&gt;&lt;br /&gt;So long as RMAN is able to connect to the primary and duplicate instances, the RMAN client can run on any machine. However, all backups, copies of datafiles, and archived logs used for creating and recovering the duplicate database must be accessible by the server session on the duplicate host.&lt;br /&gt;&lt;br /&gt;As part of the duplicating operation, RMAN manages the following:&lt;br /&gt;&lt;br /&gt;Restores the target datafiles to the duplicate database and performs incomplete recovery by using all available backups and archived logs.&lt;br /&gt;  &lt;br /&gt;Shuts down and starts the auxiliary database.&lt;br /&gt;  &lt;br /&gt;Opens the duplicate database with the RESETLOGS option after incomplete recovery to create the online redo logs.&lt;br /&gt;  &lt;br /&gt;Generates a new, unique DBID for the duplicate database. &lt;br /&gt; &lt;br /&gt;Preparing the Duplicate (Auxiliary) Instance for Duplication&lt;br /&gt;Create an Oracle Password File&lt;br /&gt;&lt;br /&gt;First we must create a password file for the duplicate instance.&lt;br /&gt;&lt;br /&gt;export ORACLE_SID=APP2&lt;br /&gt;orapwd file=orapwAPP2 password=manager entries=5 force=y&lt;br /&gt;&lt;br /&gt;Ensure Oracle Net Connectivity to both Instances&lt;br /&gt;&lt;br /&gt;Next add the appropriate entries into the TNSNAMES.ORA and LISTENER.ORA files in the $TNS_ADMIN directory.&lt;br /&gt;&lt;br /&gt;LISTENER.ORA&lt;br /&gt;&lt;br /&gt;APP1 = Target Database, APP2 = Auxiliary Database&lt;br /&gt;&lt;br /&gt;LISTENER =&lt;br /&gt;  (DESCRIPTION_LIST =&lt;br /&gt;    (DESCRIPTION =&lt;br /&gt;      (ADDRESS = (PROTOCOL = TCP)(HOST = gentic)(PORT = 1521))&lt;br /&gt;    )&lt;br /&gt;  )&lt;br /&gt;&lt;br /&gt;SID_LIST_LISTENER =&lt;br /&gt;  (SID_LIST =&lt;br /&gt;    (SID_DESC =&lt;br /&gt;      (GLOBAL_DBNAME = APP1.WORLD)&lt;br /&gt;      (ORACLE_HOME = /opt/oracle/product/10.2.0)&lt;br /&gt;      (SID_NAME = APP1)&lt;br /&gt;    )&lt;br /&gt;    (SID_DESC =&lt;br /&gt;      (GLOBAL_DBNAME = APP2.WORLD)&lt;br /&gt;      (ORACLE_HOME = /opt/oracle/product/10.2.0)&lt;br /&gt;      (SID_NAME = APP2)&lt;br /&gt;    )&lt;br /&gt;  )&lt;br /&gt;&lt;br /&gt;TNSNAMES.ORA&lt;br /&gt;&lt;br /&gt;APP1 = Target Database, APP2 = Auxiliary Database&lt;br /&gt;&lt;br /&gt;APP1.WORLD =&lt;br /&gt;  (DESCRIPTION =&lt;br /&gt;    (ADDRESS_LIST =&lt;br /&gt;      (ADDRESS = (PROTOCOL = TCP)(HOST = gentic)(PORT = 1521))&lt;br /&gt;    )&lt;br /&gt;    (CONNECT_DATA =&lt;br /&gt;      (SERVICE_NAME = APP1.WORLD)&lt;br /&gt;    )&lt;br /&gt;  )&lt;br /&gt;&lt;br /&gt;APP2.WORLD =&lt;br /&gt;  (DESCRIPTION =&lt;br /&gt;    (ADDRESS_LIST =&lt;br /&gt;      (ADDRESS = (PROTOCOL = TCP)(HOST = gentic)(PORT = 1521))&lt;br /&gt;    )&lt;br /&gt;    (CONNECT_DATA =&lt;br /&gt;      (SERVICE_NAME = APP2.WORLD)&lt;br /&gt;    )&lt;br /&gt;  )&lt;br /&gt;&lt;br /&gt;SQLNET.ORA&lt;br /&gt;&lt;br /&gt;NAMES.DIRECTORY_PATH= (TNSNAMES)&lt;br /&gt;NAMES.DEFAULT_DOMAIN = WORLD&lt;br /&gt;NAME.DEFAULT_ZONE = WORLD&lt;br /&gt;USE_DEDICATED_SERVER = ON&lt;br /&gt;&lt;br /&gt;Now restart the Listener&lt;br /&gt;&lt;br /&gt;lsnrctl stop&lt;br /&gt;lsnrctl start&lt;br /&gt;&lt;br /&gt;Create an Initialization Parameter File for the Auxiliary Instance&lt;br /&gt;&lt;br /&gt;Create an INIT.ORA parameter file for the auxiliary instance, you can copy that from the target instance and then modify the parameters.&lt;br /&gt;&lt;br /&gt;### Duplicate Database&lt;br /&gt;### -----------------------------------------------&lt;br /&gt;# This is only used when you duplicate the database&lt;br /&gt;# on the same host to avoid name conflicts&lt;br /&gt;&lt;br /&gt;DB_FILE_NAME_CONVERT              = (/u01/oracle/db/APP1/,/u01/oracle/db/APP2/)&lt;br /&gt;LOG_FILE_NAME_CONVERT             = (/u01/oracle/db/APP1/,/u01/oracle/db/APP2/,&lt;br /&gt;                                     /opt/oracle/db/APP1/,/opt/oracle/db/APP2/)&lt;br /&gt;&lt;br /&gt;### Global database name is db_name.db_domain&lt;br /&gt;### -----------------------------------------&lt;br /&gt;&lt;br /&gt;db_name                           = APP2&lt;br /&gt;db_unique_name                    = APP2_GENTIC&lt;br /&gt;db_domain                         = WORLD&lt;br /&gt;service_names                     = APP2&lt;br /&gt;instance_name                     = APP2&lt;br /&gt;&lt;br /&gt;### Basic Configuration Parameters&lt;br /&gt;### ------------------------------&lt;br /&gt;&lt;br /&gt;compatible                        = 10.2.0.4&lt;br /&gt;db_block_size                     = 8192&lt;br /&gt;db_file_multiblock_read_count     = 32&lt;br /&gt;db_files                          = 512&lt;br /&gt;control_files                     = /u01/oracle/db/APP2/con/APP2_con01.con,&lt;br /&gt;                                    /opt/oracle/db/APP2/con/APP2_con02.con&lt;br /&gt;&lt;br /&gt;### Database Buffer Cache, I/O&lt;br /&gt;### --------------------------&lt;br /&gt;# The Parameter SGA_TARGET enables Automatic Shared Memory Management&lt;br /&gt;&lt;br /&gt;sga_target                        = 500M&lt;br /&gt;sga_max_size                      = 600M&lt;br /&gt;&lt;br /&gt;### REDO Logging without Data Guard&lt;br /&gt;### -------------------------------&lt;br /&gt;&lt;br /&gt;log_archive_format                = APP2_%s_%t_%r.arc&lt;br /&gt;log_archive_max_processes         = 2&lt;br /&gt;log_archive_dest                  = /u01/oracle/db/APP2/arc&lt;br /&gt;&lt;br /&gt;### System Managed Undo&lt;br /&gt;### -------------------&lt;br /&gt;&lt;br /&gt;undo_management                   = auto&lt;br /&gt;undo_retention                    = 10800&lt;br /&gt;undo_tablespace                   = undo&lt;br /&gt;&lt;br /&gt;### Traces, Dumps and Passwordfile&lt;br /&gt;### ------------------------------&lt;br /&gt;&lt;br /&gt;audit_file_dest                   = /u01/oracle/db/APP2/adm/admp&lt;br /&gt;user_dump_dest                    = /u01/oracle/db/APP2/adm/udmp&lt;br /&gt;background_dump_dest              = /u01/oracle/db/APP2/adm/bdmp&lt;br /&gt;core_dump_dest                    = /u01/oracle/db/APP2/adm/cdmp&lt;br /&gt;utl_file_dir                      = /u01/oracle/db/APP2/adm/utld&lt;br /&gt;remote_login_passwordfile         = exclusive&lt;br /&gt;&lt;br /&gt;Create a full Database Backup&lt;br /&gt;&lt;br /&gt;Make sure that a full backup of the target is accessible on the duplicate host. You can use the following BASH script to backup the target database.&lt;br /&gt;&lt;br /&gt;rman nocatalog target / &lt;&lt;-EOF&lt;br /&gt;   configure retention policy to recovery window of 3 days;&lt;br /&gt;   configure backup optimization on;&lt;br /&gt;   configure controlfile autobackup on;&lt;br /&gt;   configure default device type to disk;&lt;br /&gt;   configure device type disk parallelism 1 backup type to compressed backupset;&lt;br /&gt;   configure datafile backup copies for device type disk to 1;&lt;br /&gt;   configure maxsetsize to unlimited;&lt;br /&gt;   configure snapshot controlfile name to '/u01/backup/snapshot_controlfile';&lt;br /&gt;   show all;&lt;br /&gt;&lt;br /&gt;   run {&lt;br /&gt;     allocate channel ch1 type Disk maxpiecesize = 1900M;&lt;br /&gt;     backup full database noexclude&lt;br /&gt;     include current controlfile&lt;br /&gt;     format '/u01/backup/datafile_%s_%p.bak'&lt;br /&gt;     tag 'datafile_daily';&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   run {&lt;br /&gt;     allocate channel ch1 type Disk maxpiecesize = 1900M;&lt;br /&gt;     backup archivelog all&lt;br /&gt;     delete all input&lt;br /&gt;     format '/u01/backup/archivelog_%s_%p.bak'&lt;br /&gt;     tag 'archivelog_daily';&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   run {&lt;br /&gt;      allocate channel ch1 type Disk maxpiecesize = 1900M;&lt;br /&gt;      backup format '/u01/backup/controlfile_%s.bak' current controlfile;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   crosscheck backup;&lt;br /&gt;   list backup of database;&lt;br /&gt;   report unrecoverable;&lt;br /&gt;   report schema;&lt;br /&gt;   report need backup;&lt;br /&gt;   report obsolete;&lt;br /&gt;   delete noprompt expired backup of database;&lt;br /&gt;   delete noprompt expired backup of controlfile;&lt;br /&gt;   delete noprompt expired backup of archivelog all;&lt;br /&gt;   delete noprompt obsolete recovery window of 3 days;&lt;br /&gt;   quit&lt;br /&gt;EOF&lt;br /&gt;&lt;br /&gt;Creating a Duplicate Database on the Local Host&lt;br /&gt;Before beginning RMAN duplication, use SQL*Plus to connect to the auxiliary instance and start it in NOMOUNT mode. If you do not have a server-side initialization parameter file for the auxiliary instance in the default location, then you must specify the client-side initialization parameter file with the PFILE parameter on the DUPLICATE command.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Get original Filenames from TARGET&lt;br /&gt;&lt;br /&gt;To rename the database files you can use the SET NEWNAME command. Therefore, get the original filenames from the target and modify these names in the DUPLICATE command.&lt;br /&gt;&lt;br /&gt;ORACLE_SID=APP1&lt;br /&gt;export ORACLE_SID&lt;br /&gt;&lt;br /&gt;set feed off&lt;br /&gt;set pagesize 10000&lt;br /&gt;column name format a40 heading "Datafile"&lt;br /&gt;column file# format 99 heading "File-ID"&lt;br /&gt;&lt;br /&gt;select  name, file# from v$dbfile;&lt;br /&gt;&lt;br /&gt;column member format a40 heading "Logfile"&lt;br /&gt;column group# format 99 heading "Group-Nr"&lt;br /&gt;&lt;br /&gt;select  member, group# from v$logfile;&lt;br /&gt;&lt;br /&gt;Datafile                                  File-ID&lt;br /&gt;----------------------------------------  -------&lt;br /&gt;/u01/oracle/db/APP1/sys/APP1_sys1.dbf           1&lt;br /&gt;/u01/oracle/db/APP1/sys/APP1_undo1.dbf          2&lt;br /&gt;/u01/oracle/db/APP1/sys/APP1_sysaux1.dbf        3&lt;br /&gt;/u01/oracle/db/APP1/usr/APP1_users1.dbf         4&lt;br /&gt;&lt;br /&gt;Logfile                                  Group-Nr&lt;br /&gt;---------------------------------------- --------&lt;br /&gt;/u01/oracle/db/APP1/rdo/APP1_log1A.rdo          1&lt;br /&gt;/opt/oracle/db/APP1/rdo/APP1_log1B.rdo          1&lt;br /&gt;/u01/oracle/db/APP1/rdo/APP1_log2A.rdo          2&lt;br /&gt;/opt/oracle/db/APP1/rdo/APP1_log2B.rdo          2&lt;br /&gt;/u01/oracle/db/APP1/rdo/APP1_log3A.rdo          3&lt;br /&gt;/opt/oracle/db/APP1/rdo/APP1_log3B.rdo          3&lt;br /&gt;/u01/oracle/db/APP1/rdo/APP1_log4A.rdo          4&lt;br /&gt;/opt/oracle/db/APP1/rdo/APP1_log4B.rdo          4&lt;br /&gt;/u01/oracle/db/APP1/rdo/APP1_log5A.rdo          5&lt;br /&gt;/opt/oracle/db/APP1/rdo/APP1_log5B.rdo          5&lt;br /&gt;/u01/oracle/db/APP1/rdo/APP1_log6A.rdo          6&lt;br /&gt;/opt/oracle/db/APP1/rdo/APP1_log6B.rdo          6&lt;br /&gt;/u01/oracle/db/APP1/rdo/APP1_log7A.rdo          7&lt;br /&gt;/opt/oracle/db/APP1/rdo/APP1_log7B.rdo          7&lt;br /&gt;/u01/oracle/db/APP1/rdo/APP1_log8A.rdo          8&lt;br /&gt;/opt/oracle/db/APP1/rdo/APP1_log8B.rdo          8&lt;br /&gt;/u01/oracle/db/APP1/rdo/APP1_log9A.rdo          9&lt;br /&gt;/opt/oracle/db/APP1/rdo/APP1_log9B.rdo          9&lt;br /&gt;/u01/oracle/db/APP1/rdo/APP1_log10A.rdo        10&lt;br /&gt;/opt/oracle/db/APP1/rdo/APP1_log10B.rdo        10&lt;br /&gt;&lt;br /&gt;Create Directories for the duplicate Database&lt;br /&gt;&lt;br /&gt;mkdir -p /u01/oracle/db/APP2&lt;br /&gt;mkdir -p /opt/oracle/db/APP2&lt;br /&gt;cd /opt/oracle/db/APP2&lt;br /&gt;mkdir con rdo&lt;br /&gt;cd /u01/oracle/db/APP2&lt;br /&gt;mkdir adm arc con rdo sys tmp usr bck&lt;br /&gt;cd adm&lt;br /&gt;mkdir admp bdmp cdmp udmp utld&lt;br /&gt;&lt;br /&gt;Create Symbolic Links to Password and INIT.ORA File&lt;br /&gt;&lt;br /&gt;Oracle must be able to locate the Password and INIT.ORA File.&lt;br /&gt;&lt;br /&gt;cd $ORACLE_HOME/dbs&lt;br /&gt;ln -s /home/oracle/config/10.2.0/orapwAPP2 orapwAPP2&lt;br /&gt;ln -s /home/oracle/config/10.2.0/initAPP2.ora initAPP2.ora&lt;br /&gt;&lt;br /&gt;Duplicate the Database&lt;br /&gt;&lt;br /&gt;Now you are ready to duplicate the database APP1 to APP2.&lt;br /&gt;&lt;br /&gt;ORACLE_SID=APP2&lt;br /&gt;export ORACLE_SID&lt;br /&gt;&lt;br /&gt;sqlplus sys/manager as sysdba&lt;br /&gt;startup force nomount pfile='/home/oracle/config/10.2.0/initAPP2.ora';&lt;br /&gt;exit;&lt;br /&gt;&lt;br /&gt;rman TARGET sys/manager@APP1 AUXILIARY sys/manager@APP2&lt;br /&gt;&lt;br /&gt;Recovery Manager: Release 10.2.0.4.0 - Production on Tue Oct 28 12:00:13 2008&lt;br /&gt;Copyright (c) 1982, 2007, Oracle. All rights reserved.&lt;br /&gt;connected to target database: APP1 (DBID=3191823649)&lt;br /&gt;connected to auxiliary database: APP2 (not mounted)&lt;br /&gt;&lt;br /&gt;RUN&lt;br /&gt;{&lt;br /&gt;  SET NEWNAME FOR DATAFILE 1 TO '/u01/oracle/db/APP2/sys/APP2_sys1.dbf';&lt;br /&gt;  SET NEWNAME FOR DATAFILE 2 TO '/u01/oracle/db/APP2/sys/APP2_undo1.dbf';&lt;br /&gt;  SET NEWNAME FOR DATAFILE 3 TO '/u01/oracle/db/APP2/sys/APP2_sysaux1.dbf';&lt;br /&gt;  SET NEWNAME FOR DATAFILE 4 TO '/u01/oracle/db/APP2/usr/APP2_users1.dbf';&lt;br /&gt;  DUPLICATE TARGET DATABASE TO APP2&lt;br /&gt;  PFILE = /home/oracle/config/10.2.0/initAPP2.ora&lt;br /&gt;  NOFILENAMECHECK&lt;br /&gt;  LOGFILE GROUP 1 ('/u01/oracle/db/APP2/rdo/APP2_log1A.rdo',&lt;br /&gt;                   '/opt/oracle/db/APP2/rdo/APP2_log1B.rdo') SIZE 10M REUSE,&lt;br /&gt;          GROUP 2 ('/u01/oracle/db/APP2/rdo/APP2_log2A.rdo',&lt;br /&gt;                   '/opt/oracle/db/APP2/rdo/APP2_log2B.rdo') SIZE 10M REUSE,&lt;br /&gt;          GROUP 3 ('/u01/oracle/db/APP2/rdo/APP2_log3A.rdo',&lt;br /&gt;                   '/opt/oracle/db/APP2/rdo/APP2_log3B.rdo') SIZE 10M REUSE,&lt;br /&gt;          GROUP 4 ('/u01/oracle/db/APP2/rdo/APP2_log4A.rdo',&lt;br /&gt;                   '/opt/oracle/db/APP2/rdo/APP2_log4B.rdo') SIZE 10M REUSE,&lt;br /&gt;          GROUP 5 ('/u01/oracle/db/APP2/rdo/APP2_log5A.rdo',&lt;br /&gt;                   '/opt/oracle/db/APP2/rdo/APP2_log5B.rdo') SIZE 10M REUSE,&lt;br /&gt;          GROUP 6 ('/u01/oracle/db/APP2/rdo/APP2_log6A.rdo',&lt;br /&gt;                   '/opt/oracle/db/APP2/rdo/APP2_log6B.rdo') SIZE 10M REUSE,&lt;br /&gt;          GROUP 7 ('/u01/oracle/db/APP2/rdo/APP2_log7A.rdo',&lt;br /&gt;                   '/opt/oracle/db/APP2/rdo/APP2_log7B.rdo') SIZE 10M REUSE,&lt;br /&gt;          GROUP 8 ('/u01/oracle/db/APP2/rdo/APP2_log8A.rdo',&lt;br /&gt;                   '/opt/oracle/db/APP2/rdo/APP2_log8B.rdo') SIZE 10M REUSE,&lt;br /&gt;          GROUP 9 ('/u01/oracle/db/APP2/rdo/APP2_log9A.rdo',&lt;br /&gt;                   '/opt/oracle/db/APP2/rdo/APP2_log9B.rdo') SIZE 10M REUSE,&lt;br /&gt;          GROUP 10 ('/u01/oracle/db/APP2/rdo/APP2_log10A.rdo',&lt;br /&gt;                    '/opt/oracle/db/APP2/rdo/APP2_log10B.rdo') SIZE 10M REUSE;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;The whole, long output is not shown here, but check, that RMAN was able to open the duplicate database with the RESETLOGS option.&lt;br /&gt;&lt;br /&gt;.....&lt;br /&gt;.....&lt;br /&gt;contents of Memory Script:&lt;br /&gt;{&lt;br /&gt;Alter clone database open resetlogs;&lt;br /&gt;}&lt;br /&gt;executing Memory Script&lt;br /&gt;&lt;br /&gt;database opened&lt;br /&gt;Finished Duplicate Db at 28-OCT-08&lt;br /&gt;&lt;br /&gt;As the final step, eliminate or uncomment the DB_FILE_NAME_CONVERT and LOG_FILE_NAME_CONVERT in the INIT.ORA file and restart the database.&lt;br /&gt;&lt;br /&gt;initAPP2.ora&lt;br /&gt;&lt;br /&gt;### Duplicate Database&lt;br /&gt;### -----------------------------------------------&lt;br /&gt;# This is only used when you duplicate the database&lt;br /&gt;# on the same host to avoid name conflicts&lt;br /&gt;# DB_FILE_NAME_CONVERT =  (/u01/oracle/db/APP1/,/u01/oracle/db/APP2/)&lt;br /&gt;# LOG_FILE_NAME_CONVERT = (/u01/oracle/db/APP1/,/u01/oracle/db/APP2/,&lt;br /&gt;                           /opt/oracle/db/APP1/,/opt/oracle/db/APP2/)&lt;br /&gt;&lt;br /&gt;sqlplus / as sysdba&lt;br /&gt;shutdown immediate;&lt;br /&gt;startup;&lt;br /&gt;&lt;br /&gt;Total System Global Area 629145600 bytes&lt;br /&gt;Fixed Size 1269064 bytes&lt;br /&gt;Variable Size 251658936 bytes&lt;br /&gt;Database Buffers 373293056 bytes&lt;br /&gt;Redo Buffers 2924544 bytes&lt;br /&gt;Database mounted.&lt;br /&gt;Database opened.&lt;br /&gt;&lt;br /&gt;Creating a Duplicate Database to Remote Host&lt;br /&gt;This scenario is exactly the same as described for the local host. Copy the RMAN Backup files to the remote host on the same directory as on the localhost.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;cd /u01/backup&lt;br /&gt;scp gentic:/u01/backup/* .&lt;br /&gt;&lt;br /&gt;The other steps are the same as described under «Creating a Duplicate Database on the Local Host».&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-5754219470561624185?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/5754219470561624185/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/09/duplicate-oracle-database-with-rman.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/5754219470561624185'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/5754219470561624185'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/09/duplicate-oracle-database-with-rman.html' title='Duplicate Oracle Database with RMAN'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-4974254615492742337</id><published>2010-09-27T05:55:00.000-07:00</published><updated>2010-09-27T06:03:38.287-07:00</updated><title type='text'>Memory Architecture of an Oracle instance</title><content type='html'>Oracle Database can set limits on how much virtual memory the database uses for the SGA. It can start instances with minimal memory and allow the instance to use more memory by expanding the memory allocated for SGA components, up to a maximum determined by the SGA_MAX_SIZE initialization parameter.&lt;br /&gt;&lt;br /&gt;SGA_MAX_SIZE is not dynamic. You can NOT change the value.&lt;br /&gt;&lt;br /&gt;However, as compared to previous versions of Oracle, in 10g SGA_MAX_SIZE does not define the size of memory allocated, but rather the MAXIMUM size that CAN be allocated.&lt;br /&gt;&lt;br /&gt;The SGA_TARGET Initialization Parameter&lt;br /&gt;&lt;br /&gt;The SGA_TARGET initialization parameter reflects the total size of the SGA and includes memory for the following components:&lt;br /&gt;&lt;br /&gt;    *  Fixed SGA and other internal allocations needed by the Oracle Database instance&lt;br /&gt;    *  The log buffer&lt;br /&gt;    *  The shared pool&lt;br /&gt;    *  The Java pool&lt;br /&gt;    *  The buffer cache&lt;br /&gt;    *&lt;br /&gt;&lt;br /&gt;      The keep and recycle buffer caches (if specified)&lt;br /&gt;    *&lt;br /&gt;&lt;br /&gt;      Nonstandard block size buffer caches (if specified)&lt;br /&gt;    *&lt;br /&gt;&lt;br /&gt;      The Streams pool&lt;br /&gt;&lt;br /&gt;It is significant that SGA_TARGET includes the entire memory for the SGA, in contrast to earlier releases in which memory for the internal and fixed SGA was added to the sum of the configured SGA memory parameters. Thus, SGA_TARGET gives you precise control over the size of the shared memory region allocated by the database. If SGA_TARGET is set to a value greater than SGA_MAX_SIZE at startup, then the latter is bumped up to accommodate SGA_TARGET.&lt;br /&gt;&lt;br /&gt;Automatically Managed SGA Components&lt;br /&gt;&lt;br /&gt;When you set a value for SGA_TARGET, Oracle Database 10g automatically sizes the most commonly configured components, including:&lt;br /&gt;&lt;br /&gt;    *&lt;br /&gt;&lt;br /&gt;      The shared pool (for SQL and PL/SQL execution)&lt;br /&gt;    *&lt;br /&gt;&lt;br /&gt;      The Java pool (for Java execution state)&lt;br /&gt;    *&lt;br /&gt;&lt;br /&gt;      The large pool (for large allocations such as RMAN backup buffers)&lt;br /&gt;    *&lt;br /&gt;&lt;br /&gt;      The buffer cache&lt;br /&gt;    *&lt;br /&gt;&lt;br /&gt;      The Streams pool&lt;br /&gt;&lt;br /&gt;You need not set the size of any of these components explicitly. By default the parameters for these components will appear to have values of zero. Whenever a component needs memory, it can request that it be transferred from another component by way of the internal automatic tuning mechanism. This transfer of memory occurs transparently, without user intervention.&lt;br /&gt;&lt;br /&gt;The performance of each of these automatically sized components is monitored by the Oracle Database instance. The instance uses internal views and statistics to determine how to distribute memory optimally among the components. As the workload changes, memory is redistributed to ensure optimal performance. To calculate the optimal distribution of memory, the database uses an algorithm that takes into consideration both long-term and short-term trends.&lt;br /&gt;&lt;br /&gt;Manually Managed SGA Components&lt;br /&gt;&lt;br /&gt;There are a few SGA components whose sizes are not automatically adjusted. The administrator needs to specify the sizes of these components explicitly, if needed by the application. Such components are:&lt;br /&gt;&lt;br /&gt;    *&lt;br /&gt;&lt;br /&gt;      Keep/Recycle buffer caches (controlled by DB_KEEP_CACHE_SIZE and DB_RECYCLE_CACHE_SIZE)&lt;br /&gt;    *&lt;br /&gt;&lt;br /&gt;      Additional buffer caches for non-standard block sizes (controlled by DB_nK_CACHE_SIZE, n = {2, 4, 8, 16, 32})&lt;br /&gt;&lt;br /&gt;The sizes of these components is determined by the administrator-defined value of their corresponding parameters. These values can, of course, be changed any time either using Enterprise Manager or from the command line with an ALTER SYSTEM statement.&lt;br /&gt;&lt;br /&gt;The memory consumed by manually sized components reduces the amount of memory available for automatic adjustment. For example, in the following configuration:&lt;br /&gt;&lt;br /&gt;SGA_TARGET = 256M&lt;br /&gt;DB_8K_CACHE_SIZE = 32M&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The instance has only 224 MB (256 - 32) remaining to be distributed among the automatically sized components.&lt;br /&gt;&lt;br /&gt;Automatic Shared Memory Management&lt;br /&gt;&lt;br /&gt;In previous database releases, a database administrator (DBA) was required to manually specify different SGA component sizes by setting a number of initialization parameters, including the SHARED_POOL_SIZE, DB_CACHE_SIZE, JAVA_POOL_SIZE, and LARGE_POOL_SIZE parameters. Oracle Database 10g includes the Automatic Shared Memory Management feature which simplifies the SGA memory management significantly. In Oracle Database 10g, a DBA can simply specify the total amount of SGA memory available to an instance using the SGA_TARGET initialization parameter and the Oracle Database will automatically distribute this memory among various subcomponents to ensure most effective memory utilization.&lt;br /&gt;&lt;br /&gt;When automatic SGA memory management is enabled, the sizes of the different SGA components are flexible and can adapt to the needs of a workload without requiring any additional configuration. The database automatically distributes the available memory among the various components as required, allowing the system to maximize the use of all available SGA memory.&lt;br /&gt;&lt;br /&gt;Consider a manual configuration in which 1 GB of memory is available for the SGA and distributed to the following initialization parameters:&lt;br /&gt;&lt;br /&gt;SHARED_POOL_SIZE=128M&lt;br /&gt;DB_CACHE_SIZE=896M&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If an application attempts to allocate more than 128 MB of memory from the shared pool, an error is raised that indicates that the available shared pool has been exhausted. There could be free memory in the buffer cache, but this memory is not accessible to the shared pool. You would have to manually resize the buffer cache and the shared pool to work around this problem.&lt;br /&gt;&lt;br /&gt;With automatic SGA management, you can simply set the SGA_TARGET initialization parameter to 1G. If an application needs more shared pool memory, it can obtain that memory by acquiring it from the free memory in the buffer cache.&lt;br /&gt;&lt;br /&gt;Setting a single parameter greatly simplifies the administration task. You specify only the amount of SGA memory that an instance has available and forget about the sizes of individual components. No out of memory errors are generated unless the system has actually run out of memory.&lt;br /&gt;&lt;br /&gt;Automatic SGA management can enhance workload performance without requiring any additional resources or manual tuning effort. With manual configuration of the SGA, it is possible that compiled SQL statements frequently age out of the shared pool because of its inadequate size. This can increase the frequency of hard parses, leading to reduced performance. When automatic SGA management is enabled, the internal tuning algorithm monitors the performance of the workload, increasing the shared pool if it determines the increase will reduce the number of parses required.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-4974254615492742337?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/4974254615492742337/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/09/memory-architecture-of-oracle-instance.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/4974254615492742337'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/4974254615492742337'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/09/memory-architecture-of-oracle-instance.html' title='Memory Architecture of an Oracle instance'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-264990482147973848</id><published>2010-09-27T05:39:00.000-07:00</published><updated>2010-09-27T05:45:55.186-07:00</updated><title type='text'>Moving, copying or cloning a database from one server to another with different directory structures can be easily accomplished with RMAN</title><content type='html'>Moving, copying or cloning a database from one server to another with different directory structures can be easily accomplished with RMAN. Imagine that you have a database on one node and you want to copy it to another node without shuting down your database and move your datafiles to a different directory structure… This will be demonstrated here by using RMAN.&lt;br /&gt;&lt;br /&gt;ASSUMPTIONS&lt;br /&gt;&lt;br /&gt;Source Database&lt;br /&gt;&lt;br /&gt;    * 10.2.0.4 database online (sid neo) at server1 (app)&lt;br /&gt;    * archivelog mode is enabled&lt;br /&gt;    * db datafiles are in the directory /opt/oracle/oradata/neo2&lt;br /&gt;    * database will be backed up online with RMAN to /u01/backup&lt;br /&gt;&lt;br /&gt;Destiny Database&lt;br /&gt;&lt;br /&gt;    * 10.2.0.4 Oracle Home installed without any database running at server2 (mynode2.com)&lt;br /&gt;    * db datafiles must be created / moved to different directory: /opt/oracle/oradata/neo&lt;br /&gt;    * only the manual backup created at server1 will be moved to server2&lt;br /&gt;&lt;br /&gt;AT SERVER1&lt;br /&gt;Moving, copying or cloning a database from one server to another with different directory structures can be easily accomplished with RMAN. Imagine that you have a database on one node and you want to copy it to another node without shuting down your database and move your datafiles to a different directory structure… This will be demonstrated here by using RMAN.&lt;br /&gt;&lt;br /&gt;ASSUMPTIONS&lt;br /&gt;&lt;br /&gt;Source Database&lt;br /&gt;&lt;br /&gt;    * 10.2.0.4 database online (sid neo) at server1 (app)&lt;br /&gt;    * archivelog mode is enabled&lt;br /&gt;    * db datafiles are in the directory /opt/oracle/oradata/neo2&lt;br /&gt;    * database will be backed up online with RMAN to /u01/backup&lt;br /&gt;&lt;br /&gt;Logon as oracle user software owner at server1 and set your environment variables. Then open RMAN and backup the source database we want to copy /move / clone.&lt;br /&gt;&lt;br /&gt;[oracle@neoface oracle]$ export ORACLE_HOME=/opt/oracle/product/10.2.0/db_1&lt;br /&gt;[oracle@neoface oracle]$ export ORACLE_SID=neo&lt;br /&gt;[oracle@neoface oracle]$ export PATH=$ORACLE_HOME/bin:$PATH&lt;br /&gt;[oracle@neoface oracle]$ rman target /&lt;br /&gt;RMAN&gt; backup database plus archivelog;&lt;br /&gt;&lt;br /&gt;cf_NEO_c-1689570411-20090106-00 (control file backup)&lt;br /&gt;back_NEO_675389594_736_1&lt;br /&gt;back_NEO_675389780_737_1&lt;br /&gt;back_NEO_675390018_738_1&lt;br /&gt;back_NEO_675390293_739_1&lt;br /&gt;&lt;br /&gt;Copy those 5 backup files to server2&lt;br /&gt;&lt;br /&gt;[oracle@neoface oracle]$ scp /u01/backup/back_NEO* root@mynode2.com:/u01/backup/&lt;br /&gt;&lt;br /&gt;Create an initialization file (pfile) from the current spfile. Then copy it to the server2.&lt;br /&gt;&lt;br /&gt;[oracle@neoface oracle]$ sqlplus “/ as sysdba”&lt;br /&gt;SQL&gt; create pfile from spfile;&lt;br /&gt;SQL&gt; exit;&lt;br /&gt;[oracle@neoface oracle]$ scp /opt/oracle/product/10.2.0/db_1/dbs/initneo.ora oracle@mynode2.com:/opt/oracle/product/10.2.0/db_1/dbs/initneo.ora/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;AT SERVER2&lt;br /&gt;&lt;br /&gt;Logon at server2 to do the following steps:&lt;br /&gt;&lt;br /&gt;    * create the OS directories to hold the datafiles and the admin log files and pfile:&lt;br /&gt;    * edit the pfile to modify the instance name in parameters like bdump, udump, etc&lt;br /&gt;    * change the onwership of pfile to belong to oracle user&lt;br /&gt;    * connect to RMAN and startup the database  in nomount mode&lt;br /&gt;    * restore the control file from the backup&lt;br /&gt;    * mount the database&lt;br /&gt;    * validate catalog by crosschecking and cataloging the 4 backups pieces we copied&lt;br /&gt;    * rename the datafiles and redolog files and restoring the database&lt;br /&gt;&lt;br /&gt;Switch to oracle user and create datafiles directories :&lt;br /&gt;&lt;br /&gt;[root@mynode2 root] su – oracle&lt;br /&gt;[oracle@mynode2 oracle]$ mkdir /opt/oracle/admin/neo -p&lt;br /&gt;[oracle@mynode2 oracle]$ cd /opt/oracle/admin/neo&lt;br /&gt;[oracle@mynode2 oracle]$ mkdir cdump udump bdump pfile&lt;br /&gt;&lt;br /&gt;[oracle@mynode2 oracle]$ mkdir /opt/oracle/oradata/neo -p&lt;br /&gt;&lt;br /&gt;Edit your pfile accordingly your new directory structure:&lt;br /&gt;&lt;br /&gt;[oracle@mynode2 oracle]$ vi /opt/oracle/product/10.2.0/db_1/dbs/initneo.ora&lt;br /&gt;&lt;br /&gt;Set environment variables and start working on RMAN:&lt;br /&gt;&lt;br /&gt;[oracle@mynode2 oracle]$ export ORACLE_HOME=/opt/oracle/product/10.2.0/db_1&lt;br /&gt;[oracle@mynode2 oracle]$ export ORACLE_SID=neo&lt;br /&gt;[oracle@mynode2 oracle]$ export PATH=$ORACLE_HOME/bin:$PATH&lt;br /&gt;[oracle@mynode2 oracle]$ rman target /&lt;br /&gt;RMAN&gt; startup nomount&lt;br /&gt;RMAN&gt; restore controlfile from ‘/u01/backup/cf_NEO_c-1689570411-20090106-00′;&lt;br /&gt;RMAN&gt; alter database mount ;&lt;br /&gt;RMAN&gt; exit&lt;br /&gt;&lt;br /&gt;Now that the database is mounted, we’ll check the correct database SCN from the current log that we’ll use later to recover the database. Take note of your current SCN.&lt;br /&gt;&lt;br /&gt;[oracle@mynode2 oracle]$ sqlplus “/ as sysdba”&lt;br /&gt;SQL&gt; select group#, first_change#, status, archived from v$log;&lt;br /&gt;&lt;br /&gt;    GROUP# FIRST_CHANGE# STATUS           ARC&lt;br /&gt;---------- ------------- ---------------- ---&lt;br /&gt;     1     336565140     ACTIVE           YES&lt;br /&gt;     2     336415067     CURRENT          NO&lt;br /&gt;     3     336523814     INACTIVE         YES&lt;br /&gt;&lt;br /&gt;SQL&gt; exit;&lt;br /&gt;&lt;br /&gt;[oracle@mynode2 oracle]$ rman target /&lt;br /&gt;&lt;br /&gt;As we only copied to this server the backup we created at the beggining and we did not copy all the backups we had on server1 we must crosscheck the catalog against the OS files. Run the following commands at RMAN prompt :&lt;br /&gt;&lt;br /&gt;RMAN&gt; CROSSCHECK backup;&lt;br /&gt;RMAN&gt; CROSSCHECK copy;&lt;br /&gt;RMAN&gt; CROSSCHECK backup of database;&lt;br /&gt;RMAN&gt; CROSSCHECK backup of controlfile;&lt;br /&gt;RMAN&gt; CROSSCHECK archivelog all;&lt;br /&gt;&lt;br /&gt;Now let’s catalog the 4 backup pieces that we copy to this server2:&lt;br /&gt;&lt;br /&gt;RMAN&gt; CATALOG backuppiece ‘/u01/backup/back_NEO_675389594_736_1′;&lt;br /&gt;RMAN&gt; CATALOG backuppiece ‘/u01/backup/back_NEO_675389780_737_1′;&lt;br /&gt;RMAN&gt; CATALOG backuppiece ‘/u01/backup/back_NEO_675390018_738_1′;&lt;br /&gt;RMAN&gt; CATALOG backuppiece ‘/u01/backup/back_NEO_675390293_739_1′;&lt;br /&gt;&lt;br /&gt;Next, as we changed the directory of our datafiles we must rename the redologs:&lt;br /&gt;RMAN&gt; ALTER DATABASE  rename file ‘/opt/oracle/oradata/neo2/redo01.log’ to ‘/opt/oracle/oradata/neo/redo01.log’;&lt;br /&gt;RMAN&gt; ALTER DATABASE rename file ‘/opt/oracle/oradata/neo2/redo02.log’ to ‘/opt/oracle/oradata/neo/redo02.log’;&lt;br /&gt;RMAN&gt; ALTER DATABASE rename file ‘/opt/oracle/oradata/neo2/redo03.log’ to ‘/opt/oracle/oradata/neo/redo03.log’;&lt;br /&gt;&lt;br /&gt;If you use BLOCK CHANGE TRACKING to allow fast incremental backups,  and if you want to move the datafiles to different directory you must disable this feature and enabling it by specifying the new dir:&lt;br /&gt;&lt;br /&gt;RMAN&gt; ALTER DATABASE disable block change tracking;&lt;br /&gt;RMAN&gt; ALTER DATABASE enable block change tracking using file ‘/opt/oracle/oradata/neo/block_change_tracking.f’;&lt;br /&gt;&lt;br /&gt;This will avoid errors like ORA-19751 and ORA-19750&lt;br /&gt;&lt;br /&gt;Now let’s run the script that will restore our database, renaming the datafiles and recovering until the archivelog with SCN 336415067, the current one.&lt;br /&gt;&lt;br /&gt;RMAN&gt; run {&lt;br /&gt;set newname for datafile 1 to “/opt/oracle/oradata/neo/system01.dbf”;&lt;br /&gt;set newname for datafile 2 to “/opt/oracle/oradata/neo/undotbs01.dbf”;&lt;br /&gt;set newname for datafile 3 to “/opt/oracle/oradata/neo/sysaux01.dbf”;&lt;br /&gt;set newname for datafile 4 to “/opt/oracle/oradata/neo/data01.dbf”;&lt;br /&gt;set newname for datafile 5 to “/opt/oracle/oradata/neo/index01.dbf”;&lt;br /&gt;set newname for datafile 6 to “/opt/oracle/oradata/neo/users01.dbf”;&lt;br /&gt;set newname for datafile 7 to “/opt/oracle/oradata/neo/streams.dbf”;&lt;br /&gt;set newname for datafile 8 to “/opt/oracle/oradata/neo/data01brig.dbf”;&lt;br /&gt;set newname for datafile 9 to “/opt/oracle/oradata/neo/index02.dbf”;&lt;br /&gt;restore database;&lt;br /&gt;switch datafile all;&lt;br /&gt;recover database until scn 336415067;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;RMAN&gt; ALTER DATABASE open resetlogs;&lt;br /&gt;&lt;br /&gt;I didn’t manage to avoid errors like ORA-01110 and  ORA-01180 at RMAN without using the  “until” clause in the “recover database” sentence instead, like most people use it, as the first instruction after the run command.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;----------------------------------------------------------------------------------&lt;br /&gt;Renaming the database in the process &lt;br /&gt;&lt;br /&gt;Pfile&lt;br /&gt;&lt;br /&gt;Changing the dbname and path,&lt;br /&gt;sqlplus / as sysdba&lt;br /&gt;create pfile from spfile;&lt;br /&gt;exit&lt;br /&gt;&lt;br /&gt;cd $ORACLE_HOME/dbs&lt;br /&gt;  rm -f spfiledbname3.ora&lt;br /&gt;vi initdbname3.ora&lt;br /&gt;then,&lt;br /&gt;&lt;br /&gt;remove the first lines&lt;br /&gt;:%s/dbname/dbname3/g&lt;br /&gt;&lt;br /&gt;Database&lt;br /&gt;&lt;br /&gt;Look for datafile IDs,&lt;br /&gt;&lt;br /&gt;list backup of database;&lt;br /&gt;&lt;br /&gt;add the rman statements to relocate the datafiles,&lt;br /&gt;run {&lt;br /&gt;set newname for datafile 1 to '/u02/oradata/dbname3/system01.dbf';&lt;br /&gt;set newname for datafile 2 to '/u02/oradata/dbname3/undotbs01.dbf';&lt;br /&gt;set newname for datafile 3 to '/u02/oradata/dbname3/sysaux01.dbf';&lt;br /&gt;set newname for datafile 4 to '/u02/oradata/dbname3/users01.dbf';&lt;br /&gt;set newname for datafile 5 to '/u02/oradata/dbname3/tsname.dbf';&lt;br /&gt;restore database;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-264990482147973848?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/264990482147973848/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/09/moving-copying-or-cloning-database-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/264990482147973848'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/264990482147973848'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/09/moving-copying-or-cloning-database-from.html' title='Moving, copying or cloning a database from one server to another with different directory structures can be easily accomplished with RMAN'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-6019224375467702210</id><published>2010-09-27T05:34:00.000-07:00</published><updated>2010-09-27T05:35:24.725-07:00</updated><title type='text'>Brief explanation of how assorted Oracle files can be renamed or moved to a new location</title><content type='html'>To move or rename a controlfile do the following:&lt;br /&gt;&lt;br /&gt;    * Alter the control_files parameter using the ALTER SYSTEM comamnd.&lt;br /&gt;    * Shutdown the database.&lt;br /&gt;    * Rename the physical file on the OS.&lt;br /&gt;    * Start the database.&lt;br /&gt;&lt;br /&gt;To move or rename a logfile do the following:&lt;br /&gt;&lt;br /&gt;    * Shutdown the database.&lt;br /&gt;    * Rename the physical file on the OS.&lt;br /&gt;    * Start the database in mount mode.&lt;br /&gt;    * Issue the ALTER DATABASE RENAME FILE command to rename the file within the Oracle dictionary.&lt;br /&gt;    * Open the database.&lt;br /&gt;&lt;br /&gt;To move or rename a datafile do the following:&lt;br /&gt;&lt;br /&gt;    * Shutdown the database.&lt;br /&gt;    * Rename the physical file on the OS.&lt;br /&gt;    * Start the database in mount mode.&lt;br /&gt;    * Issue the ALTER DATABASE RENAME FILE command to rename the file within the Oracle dictionary.&lt;br /&gt;    * Open the database.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-6019224375467702210?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/6019224375467702210/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/09/brief-explanation-of-how-assorted.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/6019224375467702210'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/6019224375467702210'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/09/brief-explanation-of-how-assorted.html' title='Brief explanation of how assorted Oracle files can be renamed or moved to a new location'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-1147158557688800374</id><published>2010-09-27T03:52:00.000-07:00</published><updated>2010-09-27T03:54:04.962-07:00</updated><title type='text'>ORA-01555: snapshot too old during export EXP-00000: Export terminated unsuccessfully</title><content type='html'>Seems the other sessions are updating the database during your export.&lt;br /&gt;So use CONSISTENT=N ( which is default).&lt;br /&gt;Dont specify CONSISTENT=Y.&lt;br /&gt;Else&lt;br /&gt;Increase your RBS(in 8i) and look into undo Management in 9i.&lt;br /&gt;There is a long running transaction that needs more undo space than the available one. &lt;br /&gt;&lt;br /&gt;sql &gt;show parameter undo&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;NAME                                 TYPE        VALUE&lt;br /&gt;------------------------------------ ----------- ------------------------------&lt;br /&gt;undo_management                      string      AUTO&lt;br /&gt;undo_retention                       integer     0&lt;br /&gt;undo_suppress_errors                 boolean     FALSE&lt;br /&gt;undo_tablespace                      string      UNDOTBS1&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If the UNDO_RETENTION initialization parameter is not specified, the default value is 900 seconds.( I must have tweaked mine. Ingore it).&lt;br /&gt;&lt;br /&gt;to reset this would be the command.&lt;br /&gt;ALTER SYSTEM SET UNDO_RETENTION = 30000;&lt;br /&gt;&lt;br /&gt;quoting docs&lt;br /&gt;&lt;br /&gt;Committed undo information normally is lost when its undo space is overwritten by a newer transaction. But for consistent read purposes, long running queries might require old undo information for undoing changes and producing older images of data blocks. The initialization parameter, UNDO_RETENTION, provides a means of explicitly specifying the amount of undo information to retain. With a proper setting, long running queries can complete without risk of receiving the "snapshot too old" error.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-1147158557688800374?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/1147158557688800374/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/09/ora-01555-snapshot-too-old-during.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/1147158557688800374'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/1147158557688800374'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/09/ora-01555-snapshot-too-old-during.html' title='ORA-01555: snapshot too old during export EXP-00000: Export terminated unsuccessfully'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-8677651923343040942</id><published>2010-09-27T03:44:00.000-07:00</published><updated>2010-09-27T03:47:56.083-07:00</updated><title type='text'>Cost Based Optimizer (CBO) and Database Statistics</title><content type='html'>Cost Based Optimizer (CBO) and Database Statistics&lt;br /&gt;&lt;br /&gt;Whenever a valid SQL statement is processed Oracle has to decide how to retrieve the necessary data. This decision can be made using one of two methods:&lt;br /&gt; &lt;br /&gt;•Rule Based Optimizer (RBO) - This method is used if the server has no internal statistics relating to the objects referenced by the statement. This method is no longer favoured by Oracle and will be desupported in future releases. &lt;br /&gt;&lt;br /&gt;•Cost Based Optimizer (CBO) - This method is used if internal statistics are present. The CBO checks several possible execution plans and selects the one with the lowest cost, where cost relates to system resources. &lt;br /&gt;&lt;br /&gt;If new objects are created, or the amount of data in the database changes the statistics will no longer represent the real state of the database so the CBO decision process may be seriously impaired. The mechanisms and issues relating to maintenance of internal statistics are explained below:&lt;br /&gt;&lt;br /&gt;•Analyze Statement&lt;br /&gt;•DBMS_UTILITY&lt;br /&gt;•DBMS_STATS&lt;br /&gt;•Scheduling Stats&lt;br /&gt;•Transfering Stats&lt;br /&gt;•Issues&lt;br /&gt;Analyze Statement&lt;br /&gt;The ANALYZE statement can be used to gather statistics for a specific table, index or cluster. The statistics can be computed exactly, or estimated based on a specific number of rows, or a percentage of rows:&lt;br /&gt;&lt;br /&gt;ANALYZE TABLE employees COMPUTE STATISTICS;&lt;br /&gt;ANALYZE INDEX employees_pk COMPUTE STATISTICS;&lt;br /&gt;&lt;br /&gt;ANALYZE TABLE employees ESTIMATE STATISTICS SAMPLE 100 ROWS;&lt;br /&gt;ANALYZE TABLE employees ESTIMATE STATISTICS SAMPLE 15 PERCENT;DBMS_UTILITY&lt;br /&gt;The DBMS_UTILITY package can be used to gather statistics for a whole schema or database. Both methods follow the same format as the analyze statement:&lt;br /&gt;&lt;br /&gt;EXEC DBMS_UTILITY.analyze_schema('SCOTT','COMPUTE');&lt;br /&gt;EXEC DBMS_UTILITY.analyze_schema('SCOTT','ESTIMATE', estimate_rows =&gt; 100);&lt;br /&gt;EXEC DBMS_UTILITY.analyze_schema('SCOTT','ESTIMATE', estimate_percent =&gt; 15);&lt;br /&gt;&lt;br /&gt;EXEC DBMS_UTILITY.analyze_database('COMPUTE');&lt;br /&gt;EXEC DBMS_UTILITY.analyze_database('ESTIMATE', estimate_rows =&gt; 100);&lt;br /&gt;EXEC DBMS_UTILITY.analyze_database('ESTIMATE', estimate_percent =&gt; 15);&lt;br /&gt;&lt;br /&gt;DBMS_STATS&lt;br /&gt;&lt;br /&gt;The DBMS_STATS package was introduced in Oracle 8i and is Oracles preferred method of gathering object statistics. Oracle list a number of benefits to using it including parallel execution, long term storage of statistics and transfer of statistics between servers. Once again, it follows a similar format to the other methods:&lt;br /&gt;&lt;br /&gt;EXEC DBMS_STATS.gather_database_stats;&lt;br /&gt;EXEC DBMS_STATS.gather_database_stats(estimate_percent =&gt; 15);&lt;br /&gt;&lt;br /&gt;EXEC DBMS_STATS.gather_schema_stats('SCOTT');&lt;br /&gt;EXEC DBMS_STATS.gather_schema_stats('SCOTT', estimate_percent =&gt; 15);&lt;br /&gt;&lt;br /&gt;EXEC DBMS_STATS.gather_table_stats('SCOTT', 'EMPLOYEES');&lt;br /&gt;EXEC DBMS_STATS.gather_table_stats('SCOTT', 'EMPLOYEES', estimate_percent =&gt; 15);&lt;br /&gt;&lt;br /&gt;EXEC DBMS_STATS.gather_index_stats('SCOTT', 'EMPLOYEES_PK');&lt;br /&gt;EXEC DBMS_STATS.gather_index_stats('SCOTT', 'EMPLOYEES_PK', estimate_percent =&gt; 15);&lt;br /&gt;&lt;br /&gt;This package also gives you the ability to delete statistics:&lt;br /&gt;&lt;br /&gt;EXEC DBMS_STATS.delete_database_stats;&lt;br /&gt;EXEC DBMS_STATS.delete_schema_stats('SCOTT');&lt;br /&gt;EXEC DBMS_STATS.delete_table_stats('SCOTT', 'EMPLOYEES');&lt;br /&gt;EXEC DBMS_STATS.delete_index_stats('SCOTT', 'EMPLOYEES_PK');&lt;br /&gt;&lt;br /&gt;Scheduling Stats&lt;br /&gt;&lt;br /&gt;Scheduling the gathering of statistics using DBMS_Job is the easiest way to make sure they are always up to date:&lt;br /&gt;&lt;br /&gt;SET SERVEROUTPUT ON&lt;br /&gt;DECLARE&lt;br /&gt;  l_job  NUMBER;&lt;br /&gt;BEGIN&lt;br /&gt;  DBMS_JOB.submit(l_job,&lt;br /&gt;                  'BEGIN DBMS_STATS.gather_schema_stats(''SCOTT''); END;',&lt;br /&gt;                  SYSDATE,&lt;br /&gt;                  'SYSDATE + 1');&lt;br /&gt;  COMMIT;&lt;br /&gt;  DBMS_OUTPUT.put_line('Job: ' || l_job);&lt;br /&gt;END;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;The above code sets up a job to gather statistics for SCOTT for the current time every day. You can list the current jobs on the server using the DBA_JOBS and DBA_JOBS_RUNNING views.&lt;br /&gt;&lt;br /&gt;Existing jobs can be removed using:&lt;br /&gt;&lt;br /&gt;EXEC DBMS_JOB.remove(X);&lt;br /&gt;COMMIT;&lt;br /&gt;&lt;br /&gt;Where 'X' is the number of the job to be removed.&lt;br /&gt;&lt;br /&gt;Transfering Stats&lt;br /&gt;&lt;br /&gt;It is possible to transfer statistics between servers allowing consistent execution plans between servers with varying amounts of data. First the statistics must be collected into a statistics table. In the following examples the statistics for the APPSCHEMA user are collected into a new table, STATS_TABLE, which is owned by DBASCHEMA:&lt;br /&gt;&lt;br /&gt;  SQL&gt; EXEC DBMS_STATS.create_stat_table('DBASCHEMA','STATS_TABLE');&lt;br /&gt;  SQL&gt; EXEC DBMS_STATS.export_schema_stats('APPSCHEMA','STATS_TABLE',NULL,'DBASCHEMA');&lt;br /&gt;&lt;br /&gt;This table can then be transfered to another server using your preferred method&lt;br /&gt; (Export/Import, SQLPlus Copy etc.) and the stats imported into the data dictionary as follows:&lt;br /&gt;&lt;br /&gt;  SQL&gt; EXEC DBMS_STATS.import_schema_stats('APPSCHEMA','STATS_TABLE',NULL,'DBASCHEMA');&lt;br /&gt;  SQL&gt; EXEC DBMS_STATS.drop_stat_table('DBASCHEMA','STATS_TABLE');&lt;br /&gt;&lt;br /&gt;Issues&lt;br /&gt;&lt;br /&gt;•Exclude dataload tables from your regular stats gathering, unless you know they will be full at the time that stats are gathered.&lt;br /&gt;•I've found gathering stats for the SYS schema can make the system run slower, not faster.&lt;br /&gt;•Gathering statistics can be very resource intensive for the server so avoid peak workload times or gather stale stats only.&lt;br /&gt;•Even if scheduled, it may be necessary to gather fresh statistics after database maintenance or large data loads.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-8677651923343040942?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/8677651923343040942/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/09/cost-based-optimizer-cbo-and-database.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/8677651923343040942'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/8677651923343040942'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/09/cost-based-optimizer-cbo-and-database.html' title='Cost Based Optimizer (CBO) and Database Statistics'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-8578439682690508813</id><published>2010-09-27T02:42:00.001-07:00</published><updated>2010-09-27T03:08:20.908-07:00</updated><title type='text'>Using EXPLAIN PLAN and TKPROF To Tune Your Applications</title><content type='html'>Consider the following query and execution plan: &lt;br /&gt;SELECT   a.customer_name, COUNT (DISTINCT b.invoice_id) "Open Invoices", &lt;br /&gt;         COUNT (c.invoice_id) "Open Invoice Items"&lt;br /&gt;FROM     customers a, invoices b, invoice_items c&lt;br /&gt;WHERE    b.invoice_status = 'OPEN'&lt;br /&gt;AND      a.customer_id = b.customer_id&lt;br /&gt;AND      c.invoice_id (+) = b.invoice_id&lt;br /&gt;GROUP BY a.customer_name;&lt;br /&gt;&lt;br /&gt;  ID PARENT OPERATION                           OBJECT_NAME&lt;br /&gt;---- ------ ----------------------------------- ------------------------------&lt;br /&gt;   0        SELECT STATEMENT&lt;br /&gt;   1      0  SORT GROUP BY&lt;br /&gt;   2      1   NESTED LOOPS OUTER&lt;br /&gt;   3      2    HASH JOIN&lt;br /&gt;   4      3     TABLE ACCESS BY INDEX ROWID     INVOICES&lt;br /&gt;   5      4      INDEX RANGE SCAN               INVOICES_STATUS&lt;br /&gt;   6      3     TABLE ACCESS FULL               CUSTOMERS&lt;br /&gt;   7      2    INDEX RANGE SCAN                 INVOICE_ITEMS_PK&lt;br /&gt;This execution plan is more complex than the previous two, and here you can start to get a feel for the way in which complex operations get broken down into simpler subordinate operations. To execute this query, the database server will do the following: First Oracle will perform a range scan on the invoices_status index to get the ROWIDs of all rows in the invoices table with the desired status. For each ROWID found, the record from the invoices table will be fetched. &lt;br /&gt;&lt;br /&gt;This set of invoice records will be set aside for a moment while the focus turns to the customers table. Here, Oracle will fetch all customers records with a full table scan. To perform a hash join between the invoices and customers tables, Oracle will build a hash from the customer records and use the invoice records to probe the customer hash. &lt;br /&gt;Next, a nested loops join will be performed between the results of the hash join and the invoice_items_pk index. For each row resulting from the hash join, Oracle will perform a unique scan of the invoice_items_pk index to find index entries for matching invoice items. Note that Oracle gets everything it needs from the index and doesn’t even need to access the invoice_items table at all. Also note that the nested loops operation is an outer join. A sort operation for the purposes of grouping is performed on the results of the nested loops operation in order to complete the SELECT statement. &lt;br /&gt;&lt;br /&gt;It is interesting to note that Oracle choose to use a hash join and a full table scan on the customers table instead of the more traditional nested loops join. In this database there are many invoices and a relatively small number of customers, making a full table scan of the customers table less expensive than repeated index lookups on the customers_pk index. But suppose the customers table was enormous and the relative number of invoices was quite small. In that scenario a nested loops join might be better than a hash join. Examining the execution plan allows you to see which join method Oracle is using. You could then apply optimizer hints to coerce Oracle to use alternate methods and compare the performance. &lt;br /&gt;&lt;br /&gt;You may wonder how I got that whole detailed explanation out of the eight line execution plan listing shown above. Did I read anything into the execution plan? No! It’s all there! Understanding the standard inputs and outputs of each type of operation and coupling this with the indenting is key to reading an execution plan. &lt;br /&gt;&lt;br /&gt;A nested loops join operation always takes two inputs: For every row coming from the first input, the second input is executed once to find matching rows. A hash join operation also takes two inputs: The second input is read completely once and used to build a hash. For each row coming from the first input, one probe is performed against this hash. Sorting operations, meanwhile, take in one input. When the entire input has been read, the rows are sorted and output in the desired order.&lt;br /&gt;&lt;br /&gt;Now let’s look at a query with a more complicated execution plan: &lt;br /&gt;SELECT   customer_name&lt;br /&gt;FROM     customers a&lt;br /&gt;WHERE    EXISTS&lt;br /&gt;         (&lt;br /&gt;         SELECT 1&lt;br /&gt;         FROM   invoices_view b&lt;br /&gt;         WHERE  b.customer_id = a.customer_id&lt;br /&gt;         AND    number_of_lines &gt; 100&lt;br /&gt;         )&lt;br /&gt;ORDER BY customer_name;&lt;br /&gt;&lt;br /&gt;  ID PARENT OPERATION                           OBJECT_NAME&lt;br /&gt;---- ------ ----------------------------------- ------------------------------&lt;br /&gt;   0        SELECT STATEMENT&lt;br /&gt;   1      0  SORT ORDER BY&lt;br /&gt;   2      1   FILTER&lt;br /&gt;   3      2    TABLE ACCESS FULL                CUSTOMERS&lt;br /&gt;   4      2    VIEW                             INVOICES_VIEW&lt;br /&gt;   5      4     FILTER&lt;br /&gt;   6      5      SORT GROUP BY&lt;br /&gt;   7      6       NESTED LOOPS&lt;br /&gt;   8      7        TABLE ACCESS BY INDEX ROWID  INVOICES&lt;br /&gt;   9      8         INDEX RANGE SCAN            INVOICES_CUSTOMER_ID&lt;br /&gt;  10      7        INDEX RANGE SCAN             INVOICE_ITEMS_PK&lt;br /&gt;&lt;br /&gt;This execution plan is somewhat complex because the query includes a subquery that the optimizer could not rewrite as a simple join, and a view whose definition could not be merged into the query. The definition of the invoices_view view is as follows: &lt;br /&gt;&lt;br /&gt;CREATE OR REPLACE VIEW invoices_view&lt;br /&gt;AS&lt;br /&gt;SELECT   a.invoice_id, a.customer_id, a.invoice_date, a.invoice_status,&lt;br /&gt;         a.invoice_number, a.invoice_type, a.total_amount,&lt;br /&gt;         COUNT(*) number_of_lines&lt;br /&gt;FROM     invoices a, invoice_items b&lt;br /&gt;WHERE    b.invoice_id = a.invoice_id&lt;br /&gt;GROUP BY a.invoice_id, a.customer_id, a.invoice_date, a.invoice_status,&lt;br /&gt;         a.invoice_number, a.invoice_type, a.total_amount;&lt;br /&gt;&lt;br /&gt;Here is what this execution plan says: Oracle will execute this query by reading all rows from the customers table with a full table scan. For each customer record, the invoices_view view will be assembled as a filter and the relevant contents of the view will be examined to determine whether the customer should be part of the result set or not. &lt;br /&gt;&lt;br /&gt;Oracle will assemble the view by performing an index range scan on the invoices_customer_id index and fetching the rows from the invoices table containing one specific customer_id. For each invoice record found, the invoice_items_pk index will be range scanned to get a nested loops join of invoices to their invoice_items records. The results of the join are sorted for grouping, and then groups with 100 or fewer invoice_items records are filtered out. &lt;br /&gt;&lt;br /&gt;What is left at the step with ID 4 is a list of invoices for one specific customer that have more than 100 invoice_items records associated. If at least one such invoice exists, then the customer passes the filter at the step with ID 2. Finally, all customer records passing this filter are sorted for correct ordering and the results are complete. &lt;br /&gt;&lt;br /&gt;Note that queries involving simple views will not result in a “view” operation in the execution plan. This is because Oracle can often merge a view definition into the query referencing the view so that the table accesses required to implement the view just become part of the regular execution plan. In this example, the GROUP BY clause embedded in the view foiled Oracle’s ability to merge the view into the query, making a separate “view” operation necessary in order to execute the query. &lt;br /&gt;&lt;br /&gt;Also note that the filter operation can take on a few different forms. In general, a filter operation is where Oracle looks at a set of candidate rows and eliminates some based on certain criteria. This criteria could involve a simple test such as number_of_lines &gt; 100 or it could be an elaborate subquery. &lt;br /&gt;&lt;br /&gt;In this example, the filter at step ID 5 takes only one input. Here Oracle evaluates each row from the input one at a time and either adds the row to the output or discards it as appropriate. Meanwhile, the filter at step ID 2 takes two inputs. When a filter takes two inputs, Oracle reads the rows from the first input one at a time and executes the second input once for each row. Based on the results of the second input, the row from the first input is either added to the output or discarded. &lt;br /&gt;&lt;br /&gt;Oracle is able to perform simple filtering operations while performing a full table scan. Therefore, a separate filter operation will not appear in the execution plan when Oracle performs a full table scan and throws out rows that don’t satisfy a WHERE clause. Filter operations with one input commonly appear in queries with view operations or HAVING clauses, while filter operations with multiple inputs will appear in queries with EXISTS clauses. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;An important note about execution plans and subqueries: When a SQL statement involves subqueries, Oracle tries to merge the subquery into the main statement by using a join. If this is not feasible and the subquery does not have any dependencies or references to the main query, then Oracle will treat the subquery as a completely separate statement from the standpoint of developing an execution plan—almost as if two separate SQL statements were sent to the database server. When you generate an execution plan for a statement that includes a fully autonomous subquery, the execution plan may not include the operations for the subquery. In this situation, you need to generate an execution plan for the subquery separately.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-8578439682690508813?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/8578439682690508813/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/09/using-explain-plan-and-tkprof-to-tune.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/8578439682690508813'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/8578439682690508813'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/09/using-explain-plan-and-tkprof-to-tune.html' title='Using EXPLAIN PLAN and TKPROF To Tune Your Applications'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-881474915640481138</id><published>2010-09-27T02:08:00.000-07:00</published><updated>2010-09-27T02:13:04.405-07:00</updated><title type='text'>Use EXPLAIN PLAN and TKPROF To Tune Your Applications</title><content type='html'>tkprof &lt;trace file&gt; &lt;output file&gt; [explain=&lt;username/password&gt;] [sys=n] \&lt;br /&gt;       [insert=&lt;filename&gt;] [record=&lt;filename&gt;] [sort=&lt;keyword&gt;]&lt;br /&gt;&lt;br /&gt;If you invoke TKPROF with no arguments at all, you will get a help screen listing all of the options. This is especially helpful because TKPROF offers many sort capabilities, but you select the desired sort by specifying a cryptic keyword. The help screen identifies all of the sort keywords. &lt;br /&gt;&lt;br /&gt;In its simplest form, you run TKPROF specifying the name of a SQL trace file and an output filename. TKPROF will read the trace file and generate a report file with the output filename you specified. TKPROF will not connect to the database, and the report will not include execution plans for the SQL statements. SQL statements that were executed by the SYS user recursively (to dynamically allocate an extent in a dictionary-managed tablespace, for example) will be included in the report, and the statements will appear in the report approximately in the order in which they were executed in the database session that was traced. &lt;br /&gt;&lt;br /&gt;If you include the explain keyword, TKPROF will connect to the database and execute an EXPLAIN PLAN statement for each SQL statement found in the trace file. The execution plan results will be included in the report file. As we will see later, TKPROF merges valuable information from the trace file into the execution plan display, making this just about the most valuable way to display an execution plan. Note that the username you specify when running TKPROF should be the same as the username connected in the database session that was traced. You do not need to have a plan table in order to use the explain keyword—TKPROF will create and drop its own plan table if needed. &lt;br /&gt;&lt;br /&gt;If you specify sys=n, TKPROF will exclude from the report SQL statements initiated by Oracle as the SYS user. This will make your report look tidier because it will only contain statements actually issued by your application. The theory is that Oracle internal SQL has already been fully optimized by the kernel developers at Oracle Corporation, so you should not have to deal with it. However, using sys=n will exclude potentially valuable information from the TKPROF report. Suppose the SGA is not properly sized on the instance and Oracle is spending a lot of time resolving dictionary cache misses. This would manifest itself in lots of time spent on recursive SQL statements initiated by the SYS user. Using sys=n would exclude this information from the report. &lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 10.2.0.4.0 - Production on Mon Sep 27 14:33:22 2010&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Connected to:&lt;br /&gt;Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production&lt;br /&gt;With the Partitioning, OLAP, Data Mining and Real Application Testing options&lt;br /&gt;&lt;br /&gt;SQL&gt; archive log list&lt;br /&gt;Database log mode              Archive Mode&lt;br /&gt;Automatic archival             Enabled&lt;br /&gt;Archive destination            /arch&lt;br /&gt;Oldest online log sequence     160&lt;br /&gt;Next log sequence to archive   162&lt;br /&gt;Current log sequence           162&lt;br /&gt;SQL&gt; conn scott/tiger&lt;br /&gt;Connected.&lt;br /&gt;SQL&gt; select * from tab;&lt;br /&gt;&lt;br /&gt;TNAME                          TABTYPE  CLUSTERID&lt;br /&gt;------------------------------ ------- ----------&lt;br /&gt;DEPT                           TABLE&lt;br /&gt;EMP                            TABLE&lt;br /&gt;BONUS                          TABLE&lt;br /&gt;SALGRADE                       TABLE&lt;br /&gt;IREPS_REVOKED_CERTS_MASTER     TABLE&lt;br /&gt;&lt;br /&gt;SQL&gt; ALTER SESSION /* Module glpost.c */ SET sql_trace = TRUE;&lt;br /&gt;&lt;br /&gt;Session altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from DEPT;&lt;br /&gt;&lt;br /&gt;    DEPTNO DNAME          LOC&lt;br /&gt;---------- -------------- -------------&lt;br /&gt;        10 ACCOUNTING     NEW YORK&lt;br /&gt;        20 RESEARCH       DALLAS&lt;br /&gt;        30 SALES          CHICAGO&lt;br /&gt;        40 OPERATIONS     BOSTON&lt;br /&gt;&lt;br /&gt;SQL&gt; exit&lt;br /&gt;Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production&lt;br /&gt;With the Partitioning, OLAP, Data Mining and Real Application Testing options&lt;br /&gt;[oracle@crisreplication ~]$ cd /u01/app/oracle/&lt;br /&gt;admin/                       oradata/                     oraInventory_24nov09.tar.gz  product/&lt;br /&gt;flash_recovery_area/         oraInventory/                oraInventory.tar.gz          utlfile/&lt;br /&gt;[oracle@crisreplication ~]$ cd /u01/app/oracle/admin/trialrep/udump/&lt;br /&gt;[oracle@crisreplication udump]$ ls -ltr&lt;br /&gt;[oracle@crisreplication udump]$ tkprof trialrep_ora_15837.trc trialrep_ora_15837.html&lt;br /&gt;&lt;br /&gt;TKPROF: Release 10.2.0.4.0 - Production on Mon Sep 27 14:35:23 2010&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2007, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;[oracle@crisreplication udump]$ tkprof trialrep_ora_15837.trc trialrep_ora_15837.html explain=scott/tiger sys=n&lt;br /&gt;&lt;br /&gt;TKPROF: Release 10.2.0.4.0 - Production on Mon Sep 27 14:35:47 2010&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2007, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;[oracle@crisreplication udump]$&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;TKPROF: Release 10.2.0.4.0 - Production on Mon Sep 27 14:35:47 2010&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2007, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;Trace file: trialrep_ora_15837.trc&lt;br /&gt;Sort options: default&lt;br /&gt;&lt;br /&gt;********************************************************************************&lt;br /&gt;count    = number of times OCI procedure was executed&lt;br /&gt;cpu      = cpu time in seconds executing &lt;br /&gt;elapsed  = elapsed time in seconds executing&lt;br /&gt;disk     = number of physical reads of buffers from disk&lt;br /&gt;query    = number of buffers gotten for consistent read&lt;br /&gt;current  = number of buffers gotten in current mode (usually for update)&lt;br /&gt;rows     = number of rows processed by the fetch or execute call&lt;br /&gt;********************************************************************************&lt;br /&gt;&lt;br /&gt;select * &lt;br /&gt;from&lt;br /&gt; DEPT&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;call     count       cpu    elapsed       disk      query    current        rows&lt;br /&gt;------- ------  -------- ---------- ---------- ---------- ----------  ----------&lt;br /&gt;Parse        1      0.01       0.06          0          0          0           0&lt;br /&gt;Execute      1      0.00       0.00          0          0          0           0&lt;br /&gt;Fetch        2      0.00       0.06          6          8          0           4&lt;br /&gt;------- ------  -------- ---------- ---------- ---------- ----------  ----------&lt;br /&gt;total        4      0.01       0.13          6          8          0           4&lt;br /&gt;&lt;br /&gt;Misses in library cache during parse: 1&lt;br /&gt;Optimizer mode: ALL_ROWS&lt;br /&gt;Parsing user id: 57  (SCOTT)&lt;br /&gt;&lt;br /&gt;Rows     Row Source Operation&lt;br /&gt;-------  ---------------------------------------------------&lt;br /&gt;      4  TABLE ACCESS FULL DEPT (cr=8 pr=6 pw=0 time=67168 us)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Rows     Execution Plan&lt;br /&gt;-------  ---------------------------------------------------&lt;br /&gt;      0  SELECT STATEMENT   MODE: ALL_ROWS&lt;br /&gt;      4   TABLE ACCESS   MODE: ANALYZED (FULL) OF 'DEPT' (TABLE)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;********************************************************************************&lt;br /&gt;&lt;br /&gt;OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS&lt;br /&gt;&lt;br /&gt;call     count       cpu    elapsed       disk      query    current        rows&lt;br /&gt;------- ------  -------- ---------- ---------- ---------- ----------  ----------&lt;br /&gt;Parse        1      0.01       0.06          0          0          0           0&lt;br /&gt;Execute      1      0.00       0.00          0          0          0           0&lt;br /&gt;Fetch        2      0.00       0.06          6          8          0           4&lt;br /&gt;------- ------  -------- ---------- ---------- ---------- ----------  ----------&lt;br /&gt;total        4      0.01       0.13          6          8          0           4&lt;br /&gt;&lt;br /&gt;Misses in library cache during parse: 1&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS&lt;br /&gt;&lt;br /&gt;call     count       cpu    elapsed       disk      query    current        rows&lt;br /&gt;------- ------  -------- ---------- ---------- ---------- ----------  ----------&lt;br /&gt;Parse       15      0.01       0.13          0          0          0           0&lt;br /&gt;Execute     69      0.06       0.14          0          0          0           0&lt;br /&gt;Fetch       80      0.01       0.06          0        216          0         471&lt;br /&gt;------- ------  -------- ---------- ---------- ---------- ----------  ----------&lt;br /&gt;total      164      0.09       0.34          0        216          0         471&lt;br /&gt;&lt;br /&gt;Misses in library cache during parse: 14&lt;br /&gt;Misses in library cache during execute: 14&lt;br /&gt;&lt;br /&gt;    1  user  SQL statements in session.&lt;br /&gt;   69  internal SQL statements in session.&lt;br /&gt;   70  SQL statements in session.&lt;br /&gt;    1  statement EXPLAINed in this session.&lt;br /&gt;********************************************************************************&lt;br /&gt;Trace file: trialrep_ora_15837.trc&lt;br /&gt;Trace file compatibility: 10.01.00&lt;br /&gt;Sort options: default&lt;br /&gt;&lt;br /&gt;       1  session in tracefile.&lt;br /&gt;       1  user  SQL statements in trace file.&lt;br /&gt;      69  internal SQL statements in trace file.&lt;br /&gt;      70  SQL statements in trace file.&lt;br /&gt;      15  unique SQL statements in trace file.&lt;br /&gt;       1  SQL statements EXPLAINed using schema:&lt;br /&gt;           SCOTT.prof$plan_table&lt;br /&gt;             Default table was used.&lt;br /&gt;             Table was created.&lt;br /&gt;             Table was dropped.&lt;br /&gt;     648  lines in trace file.&lt;br /&gt;       0  elapsed seconds in trace file.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-881474915640481138?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/881474915640481138/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/09/use-explain-plan-and-tkprof-to-tune.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/881474915640481138'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/881474915640481138'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/09/use-explain-plan-and-tkprof-to-tune.html' title='Use EXPLAIN PLAN and TKPROF To Tune Your Applications'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-4316336303962803137</id><published>2010-09-27T00:43:00.000-07:00</published><updated>2010-09-27T00:45:47.386-07:00</updated><title type='text'>HOW TO REMOVE CRS AUTO START AND RESTART FOR A RAC INSTANCE</title><content type='html'>HOW TO REMOVE CRS AUTO START AND RESTART FOR A RAC INSTANCE&lt;br /&gt;-----------------------------------------------------------&lt;br /&gt;&lt;br /&gt;OVERVIEW&lt;br /&gt;Oracle Clusterware (CRS) is a new feature of Oracle Database 10g Real &lt;br /&gt;Application Clusters that further differentiates RAC for high availability and &lt;br /&gt;scalability. CRS provides automated management and sophisticated monitoring of&lt;br /&gt;RAC instances and is designed to enhance the overall user experience of cluster&lt;br /&gt;database management. &lt;br /&gt;&lt;br /&gt;By default, CRS is configured to auto-start database instances as a part of node&lt;br /&gt;boot and provide lights-out instance failure detection followed by an &lt;br /&gt;auto-restart of the failed instance. However, on some special occasions, &lt;br /&gt;it might be highly desirable to limit the level of protection CRS provides &lt;br /&gt;for a RAC database. Namely, this implies preventing instances from auto-starting&lt;br /&gt;on boot and not auto-restarting failed instances.  The latter, however, may be&lt;br /&gt;relaxed to allow a single attempt to restart a failed instance. This way, CRS &lt;br /&gt;will attempt to restore availability of the instance, but avoid thrashing if a &lt;br /&gt;problem that caused the instance to fail also keeps preventing it from &lt;br /&gt;successfully recovering on restart. Either way, the choice to customize this is &lt;br /&gt;left to the DBA.&lt;br /&gt;&lt;br /&gt;Oracle Database 10g Real Application Clusters release 10.1.0.4 and above make &lt;br /&gt;it possible to accomplish the above stated change in CRS behavior. This document&lt;br /&gt;lists the steps necessary to limit the level of CRS protection over a RAC &lt;br /&gt;database.&lt;br /&gt;&lt;br /&gt;HIGH LEVEL APPROACH&lt;br /&gt;In a nutshell, the procedure amounts to the following two parts&lt;br /&gt;  1. Identifying a set of CRS resources that affect the behavior &lt;br /&gt;  2. Modifying a few profile attributes to contain special values for the &lt;br /&gt;resources identified in the first step&lt;br /&gt;&lt;br /&gt;The following sections will cover both phases in detail.&lt;br /&gt;IDENTIFYING RELEVANT RESOURCES&lt;br /&gt;&lt;br /&gt;The automated management of a RAC database is accomplished by modeling various &lt;br /&gt;RAC applications/features as CRS resources. A CRS resource is defined by a &lt;br /&gt;profile, which contains a list of attributes that tell CRS how manage the &lt;br /&gt;resource.  CRS resources created to manage a RAC database can be identified as &lt;br /&gt;belonging to a well-known type. There is a finite and relatively small number &lt;br /&gt;of types. The type may be easily identified given the name of a resource: each &lt;br /&gt;name ends with a &lt;resource_type&gt;. For instance, ora.linux.db is of type db, &lt;br /&gt;which happens to mean database. To display the names of the resources managed &lt;br /&gt;by the CRS, use the crs_stat command from a clustered node.  The output of the &lt;br /&gt;command is a set of names and states of resources registered on the cluster to &lt;br /&gt;which the node belongs.&lt;br /&gt;&lt;br /&gt;Figure 1. Example Listing resource names using crs_stat&lt;br /&gt;$ crs_stat&lt;br /&gt;NAME=ora.linux.ar.us.oracle.com.cs&lt;br /&gt;TYPE=application&lt;br /&gt;TARGET=OFFLINE&lt;br /&gt;STATE=OFFLINE&lt;br /&gt;&lt;br /&gt;NAME=ora.linux.ar.us.oracle.com.linux.srv&lt;br /&gt;TYPE=application&lt;br /&gt;TARGET=OFFLINE&lt;br /&gt;STATE=OFFLINE&lt;br /&gt;&lt;br /&gt;Additional output is available but has been truncated for clarity's sake&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The relevant resources are the resources that belong to the following 4 types: &lt;br /&gt;&lt;br /&gt;  db - Denotes resources that represent a database&lt;br /&gt;  srv -Denotes resources that represent a service member.&lt;br /&gt;  cs - Denotes resources that represent a service.&lt;br /&gt;  inst - Denotes resources that represent a database instance&lt;br /&gt;&lt;br /&gt;The CRS profiles for these resources must be modified for the new CRS behavior &lt;br /&gt;to take effect for all RAC databases installed on the cluster. If, however, &lt;br /&gt;the affect of the change is to be limited to a subset of installed databases, &lt;br /&gt;the list of resources needs to be filtered further. (The rest of this section &lt;br /&gt;should be skipped if the new CRS behavior. is to be in effect for all databases &lt;br /&gt;installed on the cluster.)&lt;br /&gt;Please note that since more than one database may be installed on a cluster, &lt;br /&gt;to modify the level of protection for a particular database, one must identify &lt;br /&gt;the resources that represent entities of this database. This may be easily &lt;br /&gt;accomplished since the names of the resources belonging to the above- stated &lt;br /&gt;types always start with ora.&lt;database name&gt;.  For instance, ora.linux.db &lt;br /&gt;means that the resource belongs to the database named linux.  Only resources of &lt;br /&gt;the above-enumerated types that belong to the selected databases will need to &lt;br /&gt;have their profiles modified. &lt;br /&gt;MODIFYING RESOURCE PROFILES&lt;br /&gt;Please note that Oracle strongly discourages any modifications made to CRS &lt;br /&gt;profiles for any resources starting with &lt;ora&gt;. Never make any modifications to &lt;br /&gt;CRS profiles for &lt;ora&gt; resources but the ones explicitly described below in &lt;br /&gt;this document. &lt;br /&gt;&lt;br /&gt;To modify a profile attribute for a resource, the following steps must be &lt;br /&gt;followed:&lt;br /&gt;  1.Generate the resource profile file by issuing the following command: &lt;br /&gt;    crs_stat -p resource_name &gt; $CRS_HOME/crs/public/resource_name.cap&lt;br /&gt;&lt;br /&gt;  2.Update desired attributes by editing the file created in step 1.&lt;br /&gt;&lt;br /&gt;  3.Commit the updates made as a part of the previous step by issuing the &lt;br /&gt;  following command&lt;br /&gt;    crs_register -u resource_name&lt;br /&gt;&lt;br /&gt;  4.  Verify the updates have been committed by issuing the following command &lt;br /&gt;    crs_stat -p resource_name&lt;br /&gt;&lt;br /&gt;For each of the resources identified as a part of the preceding section, the &lt;br /&gt;following modifications must be made:&lt;br /&gt;  1.Resources of type inst must have the following attributes modified&lt;br /&gt;    AUTO_START must be set to 2&lt;br /&gt;    RESTART_ATTEMPTS must be set to 0 or 1. The former value will prevent &lt;br /&gt;  CRS from attempting to restart a failed instance at all while the latter&lt;br /&gt;  will grant it a single attempt; if this only attempt is unsuccessful, &lt;br /&gt;  CRS will leave the instance as is.&lt;br /&gt;  2.Resources of type db, srv,  cs must have the following attributes modified&lt;br /&gt;  AUTO_START must be set to 2&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-4316336303962803137?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/4316336303962803137/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/09/how-to-remove-crs-auto-start-and.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/4316336303962803137'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/4316336303962803137'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/09/how-to-remove-crs-auto-start-and.html' title='HOW TO REMOVE CRS AUTO START AND RESTART FOR A RAC INSTANCE'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-5005628236565164877</id><published>2010-09-27T00:29:00.000-07:00</published><updated>2010-09-27T00:33:36.505-07:00</updated><title type='text'>RMAN Terminology</title><content type='html'>Explanation of RMAN Terminology&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;RMAN TARGET DATABASE – An RMAN Target Database is the primary database that will be backed up for RAC Grid creation. In RMAN’s terminology, the term target database identifies the database that is undergoing a backup, restore or recovery operation by the RMAN Recovery Manager.&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;RMAN AUXILIARY DATABASE – An Auxiliary Database is a RAC Grid that will be created as a result of the duplication of the target database. In RMAN’s terminology, Auxiliary instance identifies an instance which RMAN connects in order to execute the duplicate command.&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;RMAN CHANNEL – An RMAN Channel is a communication pipeline between a RMAN executable and a target or auxiliary database. An RMAN channel consists of a server session on the target or auxiliary database and a data stream from the database to the backup device or vice-versa. RMAN console sends commands to the database using this channel, and the server session running on the database executes the command on behalf of the RMAN Recovery Manager.&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;RMAN AUTOMATIC CHANNEL ALLOCATION – RMAN Channels can be configured to use a set of default attributes for each operation when a channel is not allocated manually. By default, RMAN configures a channel of device type, DISK, to be used for automatic channel allocation.&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;RMAN MANUAL CHANNEL ALLOCATION - As the name suggests, a channel can be configured manually for special needs such as increasing the degree of parallelism. Channels can be allocated manually by using the ALLOCATE CHANNEL command in the RUN block of RMAN statement. &lt;br /&gt;&lt;br /&gt;Connecting to an Auxiliary Database&lt;br /&gt;To use the DUPLICATE command or to perform RMAN TSPITR, you need to connect to an auxiliary instance. In these examples, assume that these variables have the following meanings.&lt;br /&gt;&lt;br /&gt;Variable Meaning &lt;br /&gt;SYS  User with SYSDBA privileges&lt;br /&gt; &lt;br /&gt;oracle The password for connecting as SYSDBA specified in the target database's orapwd file&lt;br /&gt; &lt;br /&gt;trgt  The net service name for the target database&lt;br /&gt; &lt;br /&gt;rman  Owner of the recovery catalog having RECOVERY_CATALOG_OWNER privilege&lt;br /&gt; &lt;br /&gt;cat  The password for user RMAN specified in the recovery catalog's orapwd file&lt;br /&gt; &lt;br /&gt;catdb   The net service name for the recovery catalog database&lt;br /&gt; &lt;br /&gt;aux  The password for connecting as SYSDBA specified in the auxiliary database's orapwd file&lt;br /&gt; &lt;br /&gt;auxdb  The net service name for the auxiliary database&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;If the auxiliary database uses password files for authentication, then you can connect using a password for either local or remote access. If you are connecting remotely through a net service name, then authentication through a password file is mandatory.&lt;br /&gt;&lt;br /&gt;Connecting to an Auxiliary Database from the Command Line&lt;br /&gt;To connect to an auxiliary instance from the operating system command line, enter the following:&lt;br /&gt;&lt;br /&gt;% rman AUXILIARY SYS/aux@auxdb&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To connect to the target, auxiliary, and recovery catalog databases, issue the following (all on one line):&lt;br /&gt;&lt;br /&gt;% rman TARGET SYS/oracle@trgt CATALOG rman/cat@catdb AUXILIARY SYS/aux@auxdb&lt;br /&gt;&lt;br /&gt;Connecting to an Auxiliary Database from the RMAN Prompt&lt;br /&gt;Alternatively, you can start RMAN and connect to the auxiliary database from the RMAN prompt:&lt;br /&gt;&lt;br /&gt;% rman&lt;br /&gt;RMAN&gt; CONNECT AUXILIARY SYS/aux@auxdb&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To connect to the target, auxiliary, and recovery catalog databases, issue:&lt;br /&gt;&lt;br /&gt;% rman&lt;br /&gt;RMAN&gt; CONNECT TARGET SYS/oracle@trgt&lt;br /&gt;RMAN&gt; CONNECT CATALOG rman/cat@catdb&lt;br /&gt;RMAN&gt; CONNECT AUXILIARY SYS/aux@auxdb&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-5005628236565164877?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/5005628236565164877/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/09/rman-terminology.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/5005628236565164877'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/5005628236565164877'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/09/rman-terminology.html' title='RMAN Terminology'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-3751216833588609759</id><published>2010-09-23T01:31:00.000-07:00</published><updated>2010-09-23T01:33:16.673-07:00</updated><title type='text'>Parsing SQL Statements in Oracle</title><content type='html'>Parsing SQL Statements in Oracle &lt;br /&gt;&lt;br /&gt;One of the first steps Oracle takes in processing a SQL statement is to parse it. During the parsing phase, Oracle will break down the submitted SQL statement into its component parts, determine what type of statement it is (Query, DML, or DDL), and perform a series of checks on it. Two important concepts for the DBA to understand is (1) what are the steps involved in the parse phase and (2) what is the difference between a hard parse and a soft parse.&lt;br /&gt;&lt;br /&gt;The Syntax Check &amp; Semantic Analysis &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The first two function of the parse phase Syntax Check and Semantic Analysis happen for each and every SQL statement within the database. &lt;br /&gt;Syntax Check&lt;br /&gt;Oracle checks that the SQL statement is valid. Does it make sense given the SQL grammar documented in the SQL Reference Manual? Does it follow all of the rules for SQL? &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Semantic Analysis&lt;br /&gt;This function of the parse phase, takes the Syntax Check one step further by checking if the statement is valid in light of the objects in the database. Do the tables and columns referenced in the SQL statement actually exist in the database? Does the user executing the statement have access to the objects and are the proper privileges in place? Are there ambiguities in the statement? For example, consider a statement that references two tables emp1 and emp2 and both tables have a column name. The following statement "select name from emp1, emp where..." is ambiguous; the query doesn't know which table to get name from. &lt;br /&gt;&lt;br /&gt;Although Oracle considers the first two functions of the parse phase (checking the validity of the SQL statement and then checking the semantics to ensure that the statement can be properly executed), the difference is sometimes hard to see from the users perspective. When Oracle reports an error to the user during the parse phase, it doesn't just come out and say "Error within the Syntax Function" or "Error within the Semantics Function". &lt;br /&gt;&lt;br /&gt;For example, the following SQL statement fails with a syntax error: &lt;br /&gt;&lt;br /&gt;  SQL&gt; select from where 4;&lt;br /&gt;  select from where 4&lt;br /&gt;         *&lt;br /&gt;  ERROR at line 1:&lt;br /&gt;  ORA-00936: missing expression&lt;br /&gt;Here is an example of a SQL statement that fails with a semantic error: &lt;br /&gt;&lt;br /&gt;  SQL&gt; select * from table_doesnt_exist;&lt;br /&gt;  select * from table_doesnt_exist&lt;br /&gt;                *&lt;br /&gt;  ERROR at line 1:&lt;br /&gt;  ORA-00942: table or view does not exist&lt;br /&gt;&lt;br /&gt;Hard Parse vs. Soft Parse &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;We now consider the next and one of the most important functions of Oracle's parse phase. The Oracle database now needs to check in the Shared Pool to determine if the current SQL statement being parsed has already been processed by any other sessions. &lt;br /&gt;If the current statement has already been processed, the parse operation can skip the next two functions in the process: Optimization and Row Source Generation. If the parse phase does, in fact, skip these two functions, it is called a soft parse. A soft parse will save a considerable amount of CPU cycles when running your query. On the other hand, if the current SQL statement has never been parsed by another session, the parse phase must execute ALL of the parsing steps. This type of parse is called a hard parse. It is especially important that developers write and design queries that take advantage of soft parses so that parsing phase can skip the optimization and row source generation functions, which are very CPU intensive and a point of contention (serialization). If a high percentage of your queries are being hard-parsed, your system will function slowly, and in some cases, not at all. &lt;br /&gt;&lt;br /&gt;Oracle uses a piece of memory called the Shared Pool to enable sharing of SQL statements. The Shared Pool is a piece of memory in the System Global Area (SGA) and is maintained by the Oracle database. After Oracle completes the first two functions of the parse phase (Syntax and Semantic Checks), it looks in the Shared Pool to see if that same exact query has already been processed by another session. Since Oracle has already performed the semantic check, it has already determined: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Exactly what table(s) are involved&lt;br /&gt;&lt;br /&gt;That the user has access privileges to the tables. &lt;br /&gt;Oracle will now look at all of the queries in the Shared Pool that have already been parsed, optimized, and generated to see if the hard-parse portion of the current SQL statement has already been done. &lt;br /&gt;&lt;br /&gt;Why not Check the Shared Pool First? &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now that you understand the steps involved in parsing SQL statements, it's time to take it one step further. Oracle will always keep an unparsed representation of the SQL code in the Shared Pool, and that the database will perform a hashing algorithm to quickly located the SQL code. OK, so why doesn't Oracle make this step (checking the Shared Pool for a matching statement) the first step in its parsing phase, before making any other checks. &lt;br /&gt;Even when soft parsing, Oracle needs to parse the statement before it goes looking in the Shared Pool. One of the big reason's for this sequence is the Semantic Check. Consider the following query: &lt;br /&gt;&lt;br /&gt;select * from emp;&lt;br /&gt;Assume that this query was first submitted by user "SCOTT" and that the "emp" table in the FROM clause is a table owned by SCOTT. You then submit the same exact query (as a user other than SCOTT) to Oracle. The database has no idea what "emp" is a reference to. Is it a synonym to another table? Is it a view in your schema that references another table? For this reason, Oracle needs to perform a Semantic Check on the SQL statement to ensure that the code you are submitting is going to reference the same exact objects you are requesting in your query. &lt;br /&gt;&lt;br /&gt;Then remember that Oracle needs to syntactically parse the query before it can semantically parse it. The hash is good only for finding query strings that are the same; it doesn't help the database figure out if the referenced statements are the same statement as in you execution context.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-3751216833588609759?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/3751216833588609759/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/09/parsing-sql-statements-in-oracle.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/3751216833588609759'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/3751216833588609759'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/09/parsing-sql-statements-in-oracle.html' title='Parsing SQL Statements in Oracle'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-8183014997680963991</id><published>2010-09-16T04:01:00.001-07:00</published><updated>2010-09-16T04:02:05.553-07:00</updated><title type='text'>Master node at Oracle Clusterware level</title><content type='html'>[oracle@dbrac1 dump]$ cat $ORA_CRS_HOME/log/`hostname`/cssd/ocssd* |grep master&lt;br /&gt;&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 1&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 2&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 1&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 1&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 1&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 1&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 1&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 1&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 1&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 1&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 1&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 1&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 1&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 2&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 2&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 2&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 2&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 1&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 1&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 1&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 1&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 1&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 1&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 1&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 1&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 1&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 2&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 1&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 1&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 1&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 1&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 1&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 1&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 1&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 1&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 1&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 1&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 1&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-8183014997680963991?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/8183014997680963991/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/09/master-node-at-oracle-clusterware-level.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/8183014997680963991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/8183014997680963991'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/09/master-node-at-oracle-clusterware-level.html' title='Master node at Oracle Clusterware level'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-7559770716288240567</id><published>2010-09-06T01:37:00.000-07:00</published><updated>2010-09-06T01:44:50.334-07:00</updated><title type='text'>HOW TO APPLY ORACLE PATCH (OPATCH)</title><content type='html'>HOW TO APPLY ORACLE PATCH (OPATCH)&lt;br /&gt;====================================================&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To apply Opatch conditions are db and listener both must be down as opatch will update your current ORACLE_HOME with patches.&lt;br /&gt;in single instance its not possible.&lt;br /&gt;but for RAC instance its possible.&lt;br /&gt;as in RAC there will be two seperate oracle home and two seperate instances running once instance on each oracle_home&lt;br /&gt;&lt;br /&gt;use this command:&lt;br /&gt;&lt;br /&gt;opatch napply -skip_subset -skip_duplicate -local -oh $ORACLE_HOME&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;when using -local parameter and -oh $ORACLE_HOME this means this patch session will only apply patch to current sourced ORACLE_HOME.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;steps before applying patch:&lt;br /&gt;----------------------------&lt;br /&gt;&lt;br /&gt;1) check the database status.&lt;br /&gt;wch_db.sql&lt;br /&gt;-----------&lt;br /&gt;select name,&lt;br /&gt;open_mode,&lt;br /&gt;database_name,&lt;br /&gt;created,&lt;br /&gt;log_mode,&lt;br /&gt;platform_name&lt;br /&gt;from v$database;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2) Check the object's invalid.&lt;br /&gt;&lt;br /&gt;user_inv.sql&lt;br /&gt;============&lt;br /&gt;SELECT owner,&lt;br /&gt;COUNT(*)&lt;br /&gt;FROM dba_objects&lt;br /&gt;WHERE status = 'INVALID'&lt;br /&gt;GROUP BY owner;&lt;br /&gt;&lt;br /&gt;count_inv.sql&lt;br /&gt;-------------&lt;br /&gt;select count(*)&lt;br /&gt;from dba_objects&lt;br /&gt;WHERE status ='INVALID';&lt;br /&gt;&lt;br /&gt;3) Take backup of invalid's&lt;br /&gt;&lt;br /&gt;create table bk_inv_ as select * from dba_objects&lt;br /&gt;where status='INVALID';&lt;br /&gt;&lt;br /&gt;4) check opatch version using &lt;br /&gt;opatch -v&lt;br /&gt;if opatch version is not compatible check the readme file and&lt;br /&gt;download the latest version and uncompress&lt;br /&gt;in $ORACLE_HOME.&lt;br /&gt;&lt;br /&gt;5) check oraInst.loc file pointing to your current $ORACLE_HOME or not.&lt;br /&gt;cat /etc/oraInst.loc&lt;br /&gt;&lt;br /&gt;inventory_loc=/u01/app/oracle/10.2.0/GlobalOraInv&lt;br /&gt;inst_group=dba&lt;br /&gt;&lt;br /&gt;if your server have more then one $ORACLE_HOME then comment the other $ORACLE_HOME and&lt;br /&gt;uncomment the current $ORACLE_HOME&lt;br /&gt;&lt;br /&gt;inventory must point to the current $ORACLE_HOME which is getting patched.&lt;br /&gt;&lt;br /&gt;6) check free space on $ORACLE_HOME &lt;br /&gt;df -h $ORACLE_HOME&lt;br /&gt;&lt;br /&gt;7) chek the utilities like &lt;br /&gt;which ld&lt;br /&gt;which ar&lt;br /&gt;which make&lt;br /&gt;etc as per readme file.&lt;br /&gt;&lt;br /&gt;8) unzip the patch &lt;br /&gt;unzip -d /loc_2_unzip p.zip&lt;br /&gt;&lt;br /&gt;9) Go the patch directory&lt;br /&gt;cd /loc_2_unzip/patch_number&lt;br /&gt;&lt;br /&gt;10) Bring down the listner.&lt;br /&gt;cd $ORACLE_HOME/bin&lt;br /&gt;lsnrctl stop &lt;br /&gt;&lt;br /&gt;11) Bring down the database&lt;br /&gt;Shutdown immediate.&lt;br /&gt;&lt;br /&gt;12) export opatch &lt;br /&gt;export PATH=$PATH:$HOME:$ORACLE_HOME/OPatch:/bin&lt;br /&gt;&lt;br /&gt;13) Start the patch&lt;br /&gt;&lt;br /&gt;skip_duplicate&lt;br /&gt; Skips patches to be applied that are duplicates of other patches installed in the Oracle home. Two patches are duplicates if they fix the same set of bugs.&lt;br /&gt; &lt;br /&gt;skip_subset&lt;br /&gt; Skips patches to be applied that are subsets of other patches installed in the Oracle home. One patch is a subset of another patch if the former fixes a subset of bugs fixed by the latter.&lt;br /&gt;&lt;br /&gt;opatch napply -skip_subset -skip_duplicate&lt;br /&gt;&lt;br /&gt;for RAC database then database can be up&lt;br /&gt;as it may be having more then one instance&lt;br /&gt;so you can bring down one instance and listener and apply the patch and open it&lt;br /&gt;and then do the same on another node.&lt;br /&gt;like this db will be up and no user will face issue in outage also.&lt;br /&gt;&lt;br /&gt;to apply opatch in RAC instance (We can use -skip_subset -skip_duplicate with Opatch napply only? And is it right that if we are installing patch for the first time on a oracle software we will generally use opatch apply. consider I have applied october cpu patch and I am applying November patch. so while applting Oct patch I shall just use opatch apply and while applying Nov patch i shall use opatch napply -skip_subset -skip_duplicate)&lt;br /&gt;///////////*************************************************888&lt;br /&gt;The readme stats whether you should use opatch apply or opatch napply.&lt;br /&gt;&lt;br /&gt;I am not sure whether november CPU patch is a bundle of multiple patch or single patch. If it is bundle of multiple patch then you should be using opatch napply irrespective of whether you applied any patch on your software previously. apply and naply does not depends on previous patches that are appled on your database. It just depend onl current opatch session. If you need to install just one patch currently use opatch apply. And if you want to install multiple patch in a single session use opatch napply.&lt;br /&gt;&lt;br /&gt;And regarding -skip_subset and -skip_duplicate you are correct it shoudl be used only with opatch napply.&lt;br /&gt;&lt;br /&gt;For more info use below command&lt;br /&gt;opatch apply -help&lt;br /&gt;opatch napply -help&lt;br /&gt;&lt;br /&gt;**********************************************************///////////&lt;br /&gt;&lt;br /&gt;opatch napply -skip_subset -skip_duplicate -local -oh $ORACLE_HOME&lt;br /&gt;&lt;br /&gt;when using -local parameter and&lt;br /&gt;-oh $ORACLE_HOME this means this patch session will only apply patch to current ORACLE_HOME only.&lt;br /&gt;&lt;br /&gt;--------------------------------------------------------&lt;br /&gt;. All-Node Patch&lt;br /&gt;&lt;br /&gt;. Shutdown all Oracle instances on all nodes&lt;br /&gt;. Apply the patch to all nodes&lt;br /&gt;. Bring all nodes up&lt;br /&gt;&lt;br /&gt;. Minimum downtime&lt;br /&gt;&lt;br /&gt;. Shutdown the Oracle instance on node 1&lt;br /&gt;. Apply the patch to the Oracle instance on node 1&lt;br /&gt;. Shutdown the Oracle instance on node 2&lt;br /&gt;. Apply the patch to the Oracle instance on node 2&lt;br /&gt;. Shutdown the Oracle instance on node 3&lt;br /&gt;. At this point, instances on nodes 1 and 2 can be brought up&lt;br /&gt;. Apply the patch to the Oracle instance on node 3&lt;br /&gt;. Startup the Oracle instance on node 3&lt;br /&gt;&lt;br /&gt;. (no downtime) &lt;br /&gt;&lt;br /&gt;. Shutdown the Oracle instance on node 1&lt;br /&gt;. Apply the patch to the Oracle instance on node 1&lt;br /&gt;. Start the Oracle instance on node 1&lt;br /&gt;. Shutdown the Oracle instance on node 2&lt;br /&gt;. Apply the patch to the Oracle instance on node 2&lt;br /&gt;. Start the Oracle instance on node 2&lt;br /&gt;. Shutdown the Oracle instance on node 3&lt;br /&gt;. Apply the patch to the Oracle instance on node 3&lt;br /&gt;. Start the Oracle instance on node 3&lt;br /&gt;-------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;14) Once patch installation is completed need to do post patching steps.&lt;br /&gt;&lt;br /&gt;a) starup the instance&lt;br /&gt;startup&lt;br /&gt;b) Loading modified sqlfiles into the database.&lt;br /&gt;@$ORACLE_HOME/rdbms/admin/catbundle.sql cpu apply&lt;br /&gt;&lt;br /&gt;to check the logs generated&lt;br /&gt;catbundle_CPU__APPLY_.log&lt;br /&gt;catbundle_CPU__GENERATE_.log&lt;br /&gt;&lt;br /&gt;c) Recompiling Views in the Database&lt;br /&gt;shutdown immediate&lt;br /&gt;startup upgrade&lt;br /&gt;@$ORACLE_HOME/cpu/view_recompile/view_recompile_jan2008cpu.sql&lt;br /&gt;shutdown immediate&lt;br /&gt;startup&lt;br /&gt;&lt;br /&gt;If it is a RAC instance.&lt;br /&gt;shutdown&lt;br /&gt;startup nomount&lt;br /&gt;alter database set cluster database=false scope=spfile;&lt;br /&gt;shutdown&lt;br /&gt;startup upgrade&lt;br /&gt;@?/cpu/view_recompile/view_recompile_jan2008cpu.sql&lt;br /&gt;shutdown&lt;br /&gt;startup&lt;br /&gt;alter database set cluster database=true scope=spfile;&lt;br /&gt;&lt;br /&gt;restart the database.&lt;br /&gt;cd $CRS_HOME/bin&lt;br /&gt;srvctl start database -d &lt;br /&gt;15) If any invalid objects were reported, run the utlrp.sql script as follows&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;user_inv.sql&lt;br /&gt;============&lt;br /&gt;SELECT owner,&lt;br /&gt;COUNT(*)&lt;br /&gt;FROM dba_objects&lt;br /&gt;WHERE status = 'INVALID'&lt;br /&gt;GROUP BY owner;&lt;br /&gt;&lt;br /&gt;count_inv.sql&lt;br /&gt;-------------&lt;br /&gt;select count(*)&lt;br /&gt;from dba_objects&lt;br /&gt;WHERE status ='INVALID';&lt;br /&gt;&lt;br /&gt;if any new invalids seen then again take backup of invalid objects and compile it.&lt;br /&gt;&lt;br /&gt;create table bk_inv_ as select * from dba_objects&lt;br /&gt;where status='INVALID';&lt;br /&gt;&lt;br /&gt;@?/rdbms/admin/utlrp.sql --- to compile the invalid objects.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;16) Confirm that patch has been applied successfully or not at db level also.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;post_patch.sql&lt;br /&gt;--------------&lt;br /&gt;col action_time for a40&lt;br /&gt;col action for a15&lt;br /&gt;col namespace for a15&lt;br /&gt;col version for a15&lt;br /&gt;col comments for a40&lt;br /&gt;set pages 1000&lt;br /&gt;set lines 170&lt;br /&gt;select * from registry$history ;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-7559770716288240567?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/7559770716288240567/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/09/how-to-apply-oracle-patch-opatch.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/7559770716288240567'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/7559770716288240567'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/09/how-to-apply-oracle-patch-opatch.html' title='HOW TO APPLY ORACLE PATCH (OPATCH)'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-2823587267429465730</id><published>2010-08-17T23:04:00.000-07:00</published><updated>2010-08-17T23:05:29.080-07:00</updated><title type='text'></title><content type='html'>Transparent application failover&lt;br /&gt;&lt;br /&gt;Is a client-side feature that allows for clients to reconnect to surviving databases in the event of a failure of a database instance. Notifications are used by the server to trigger TAF callbacks on the client-side. Your options could be: Basic, in which the application connects to a backup node only after the primary connection fails. This approach has low overhead, but the end user experiences a delay while the new connection is created, or Pre-Connect, where the application simultaneously connects to both a primary and a backup node. This offers faster failover, because a pre-spawned connection is ready to use. But the extra connection adds everyday overhead by duplicating connections.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-2823587267429465730?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/2823587267429465730/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/08/transparent-application-failover-is.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/2823587267429465730'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/2823587267429465730'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/08/transparent-application-failover-is.html' title=''/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-7325316820288887332</id><published>2010-08-11T03:09:00.001-07:00</published><updated>2010-08-11T03:09:29.157-07:00</updated><title type='text'>Log switching history</title><content type='html'>Log switching history&lt;br /&gt;   &lt;br /&gt; select to_char(first_time,'YYYY-MON-DD') day,&lt;br /&gt;to_char(sum(decode(to_char(first_time,'HH24'),'00',1,0)),'99') "00",&lt;br /&gt;to_char(sum(decode(to_char(first_time,'HH24'),'01',1,0)),'99') "01",&lt;br /&gt;to_char(sum(decode(to_char(first_time,'HH24'),'02',1,0)),'99') "02",&lt;br /&gt;to_char(sum(decode(to_char(first_time,'HH24'),'03',1,0)),'99') "03",&lt;br /&gt;to_char(sum(decode(to_char(first_time,'HH24'),'04',1,0)),'99') "04",&lt;br /&gt;to_char(sum(decode(to_char(first_time,'HH24'),'05',1,0)),'99') "05",&lt;br /&gt;to_char(sum(decode(to_char(first_time,'HH24'),'06',1,0)),'99') "06",&lt;br /&gt;to_char(sum(decode(to_char(first_time,'HH24'),'07',1,0)),'99') "07",&lt;br /&gt;to_char(sum(decode(to_char(first_time,'HH24'),'08',1,0)),'99') "08",&lt;br /&gt;to_char(sum(decode(to_char(first_time,'HH24'),'09',1,0)),'99') "09",&lt;br /&gt;to_char(sum(decode(to_char(first_time,'HH24'),'10',1,0)),'99') "10",&lt;br /&gt;to_char(sum(decode(to_char(first_time,'HH24'),'11',1,0)),'99') "11",&lt;br /&gt;to_char(sum(decode(to_char(first_time,'HH24'),'12',1,0)),'99') "12",&lt;br /&gt;to_char(sum(decode(to_char(first_time,'HH24'),'13',1,0)),'99') "13",&lt;br /&gt;to_char(sum(decode(to_char(first_time,'HH24'),'14',1,0)),'99') "14",&lt;br /&gt;to_char(sum(decode(to_char(first_time,'HH24'),'15',1,0)),'99') "15",&lt;br /&gt;to_char(sum(decode(to_char(first_time,'HH24'),'16',1,0)),'99') "16",&lt;br /&gt;to_char(sum(decode(to_char(first_time,'HH24'),'17',1,0)),'99') "17",&lt;br /&gt;to_char(sum(decode(to_char(first_time,'HH24'),'18',1,0)),'99') "18",&lt;br /&gt;to_char(sum(decode(to_char(first_time,'HH24'),'19',1,0)),'99') "19",&lt;br /&gt;to_char(sum(decode(to_char(first_time,'HH24'),'20',1,0)),'99') "20",&lt;br /&gt;to_char(sum(decode(to_char(first_time,'HH24'),'21',1,0)),'99') "21",&lt;br /&gt;to_char(sum(decode(to_char(first_time,'HH24'),'22',1,0)),'99') "22",&lt;br /&gt;to_char(sum(decode(to_char(first_time,'HH24'),'23',1,0)),'99') "23"&lt;br /&gt;from v$log_history group by to_char(first_time,'YYYY-MON-DD');&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-7325316820288887332?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/7325316820288887332/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/08/log-switching-history.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/7325316820288887332'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/7325316820288887332'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/08/log-switching-history.html' title='Log switching history'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-7643745665295106930</id><published>2010-08-11T02:19:00.000-07:00</published><updated>2010-08-11T02:20:02.931-07:00</updated><title type='text'>Track redo generation by day</title><content type='html'>select trunc(completion_time) rundate&lt;br /&gt;,count(*) logswitch&lt;br /&gt;,round((sum(blocks*block_size)/1024/1024)) “REDO PER DAY (MB)”&lt;br /&gt;from v$archived_log&lt;br /&gt;group by trunc(completion_time)&lt;br /&gt;order by 1&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-7643745665295106930?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/7643745665295106930/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/08/track-redo-generation-by-day.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/7643745665295106930'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/7643745665295106930'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/08/track-redo-generation-by-day.html' title='Track redo generation by day'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-6370405377015569080</id><published>2010-08-11T02:01:00.000-07:00</published><updated>2010-08-11T02:03:26.690-07:00</updated><title type='text'>Recover from loss of  single current online redo log file</title><content type='html'>Recover from loss of  single current online redo log file &lt;br /&gt;&lt;br /&gt;RMAN&gt; list backupset summary;&lt;br /&gt;&lt;br /&gt;List of Backups&lt;br /&gt;===============&lt;br /&gt;Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag&lt;br /&gt;------- -- -- - ----------- --------------- ------- ------- ---------- ---&lt;br /&gt;6       B  0  A DISK        11-AUG-10       1       1       NO         EB64LEVEL0&lt;br /&gt;7       B  0  A DISK        11-AUG-10       1       1       NO         EB64LEVEL0&lt;br /&gt;8       B  0  A DISK        11-AUG-10       1       1       NO         EB64LEVEL0&lt;br /&gt;9       B  0  A DISK        11-AUG-10       1       1       NO         EB64LEVEL0&lt;br /&gt;10      B  A  A DISK        11-AUG-10       1       1       NO         TAG20100811T141822&lt;br /&gt;11      B  A  A DISK        11-AUG-10       1       1       NO         TAG20100811T141822&lt;br /&gt;RMAN&gt; exit&lt;br /&gt;&lt;br /&gt;Recovery Manager complete.&lt;br /&gt;[oracle@crisreplication ~]$ sqlplus "/ as sysdba"&lt;br /&gt;SQL*Plus: Release 10.2.0.4.0 - Production on Wed Aug 11 14:19:01 2010&lt;br /&gt;Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.&lt;br /&gt;&lt;br /&gt;Connected to:&lt;br /&gt;Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production&lt;br /&gt;With the Partitioning, OLAP, Data Mining and Real Application Testing options&lt;br /&gt;SQL&gt; select member from v$Logfile;&lt;br /&gt;&lt;br /&gt;MEMBER&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;/u01/app/oracle/oradata/trialrep/redo02.log&lt;br /&gt;/u01/app/oracle/oradata/trialrep/redo01.log&lt;br /&gt;/u01/app/oracle/oradata/trialrep/redo03.log&lt;br /&gt;SQL&gt; SQL&gt;&lt;br /&gt;SQL&gt;&lt;br /&gt;SQL&gt; select group#, sequence#, bytes/1024/1024 as "Size (MB)", members, status from v$log;&lt;br /&gt;    GROUP#  SEQUENCE#  Size (MB)    MEMBERS STATUS&lt;br /&gt;---------- ---------- ---------- ---------- ----------------&lt;br /&gt;        1         15         50          1 ACTIVE&lt;br /&gt;        2         14         50          1 INACTIVE&lt;br /&gt;        3         16         50          1 CURRENT&lt;br /&gt;SQL&gt;  select group#, member from v$logfile order by 1;&lt;br /&gt;    GROUP#&lt;br /&gt;----------&lt;br /&gt;MEMBER&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;        1&lt;br /&gt;/u01/app/oracle/oradata/trialrep/redo01.log&lt;br /&gt;        2&lt;br /&gt;/u01/app/oracle/oradata/trialrep/redo02.log&lt;br /&gt;        3&lt;br /&gt;/u01/app/oracle/oradata/trialrep/redo03.log&lt;br /&gt;&lt;br /&gt;SQL&gt;  select group#, sequence#, bytes/1024/1024 as "Size (MB)", members, status from v$log;&lt;br /&gt;    GROUP#  SEQUENCE#  Size (MB)    MEMBERS STATUS&lt;br /&gt;---------- ---------- ---------- ---------- ----------------&lt;br /&gt;        1         15         50          1 ACTIVE&lt;br /&gt;        2         14         50          1 INACTIVE&lt;br /&gt;        3         16         50          1 CURRENT&lt;br /&gt;SQL&gt;  select group#, sequence#, bytes/1024/1024 as "Size (MB)", members, status from v$log;&lt;br /&gt;    GROUP#  SEQUENCE#  Size (MB)    MEMBERS STATUS&lt;br /&gt;---------- ---------- ---------- ---------- ----------------&lt;br /&gt;        1         15         50          1 ACTIVE&lt;br /&gt;        2         14         50          1 INACTIVE&lt;br /&gt;        3         16         50          1 CURRENT&lt;br /&gt;SQL&gt; exit&lt;br /&gt;Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production&lt;br /&gt;With the Partitioning, OLAP, Data Mining and Real Application Testing options&lt;br /&gt;[oracle@crisreplication ~]$ sqlplus "/ as sysdba"&lt;br /&gt;SQL*Plus: Release 10.2.0.4.0 - Production on Wed Aug 11 14:21:18 2010&lt;br /&gt;Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.&lt;br /&gt;&lt;br /&gt;Connected to:&lt;br /&gt;Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production&lt;br /&gt;With the Partitioning, OLAP, Data Mining and Real Application Testing options&lt;br /&gt;SQL&gt;  select group#, sequence#, bytes/1024/1024 as "Size (MB)", members, status from v$log;&lt;br /&gt;    GROUP#  SEQUENCE#  Size (MB)    MEMBERS STATUS&lt;br /&gt;---------- ---------- ---------- ---------- ----------------&lt;br /&gt;        1         15         50          1 ACTIVE&lt;br /&gt;        2         14         50          1 INACTIVE&lt;br /&gt;        3         16         50          1 CURRENT&lt;br /&gt;SQL&gt; archive log list&lt;br /&gt;Database log mode              Archive Mode&lt;br /&gt;Automatic archival             Enabled&lt;br /&gt;Archive destination            /arch&lt;br /&gt;Oldest online log sequence     14&lt;br /&gt;Next log sequence to archive   16&lt;br /&gt;Current log sequence           16&lt;br /&gt;SQL&gt; shut immediate&lt;br /&gt;Database closed.&lt;br /&gt;Database dismounted.&lt;br /&gt;ORACLE instance shut down.&lt;br /&gt;SQL&gt; startup&lt;br /&gt;ORACLE instance started.&lt;br /&gt;Total System Global Area 1207959552 bytes&lt;br /&gt;Fixed Size                  1267164 bytes&lt;br /&gt;Variable Size             318769700 bytes&lt;br /&gt;Database Buffers          872415232 bytes&lt;br /&gt;Redo Buffers               15507456 bytes&lt;br /&gt;Database mounted.&lt;br /&gt;ORA-00313: open failed for members of log group 3 of thread 1&lt;br /&gt;ORA-00312: online log 3 thread 1: '/u01/app/oracle/oradata/trialrep/redo03.log'&lt;br /&gt;&lt;br /&gt;SQL&gt;   select group#, sequence#, bytes/1024/1024 as "Size (MB)", members, status from v$log;&lt;br /&gt;    GROUP#  SEQUENCE#  Size (MB)    MEMBERS STATUS&lt;br /&gt;---------- ---------- ---------- ---------- ----------------&lt;br /&gt;        1         15         50          1 INACTIVE&lt;br /&gt;        3         16         50          1 CURRENT&lt;br /&gt;        2         14         50          1 INACTIVE&lt;br /&gt;SQL&gt; exit&lt;br /&gt;Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production&lt;br /&gt;With the Partitioning, OLAP, Data Mining and Real Application Testing options&lt;br /&gt;&lt;br /&gt;[oracle@crisreplication ~]$ rman target /&lt;br /&gt;Recovery Manager: Release 10.2.0.4.0 - Production on Wed Aug 11 14:24:14 2010&lt;br /&gt;Copyright (c) 1982, 2007, Oracle.  All rights reserved.&lt;br /&gt;connected to target database: TRIALREP (DBID=1985177645, not open)&lt;br /&gt;&lt;br /&gt;RMAN&gt; run {&lt;br /&gt;2&gt; set until sequence 16;&lt;br /&gt;3&gt; restore database;&lt;br /&gt;4&gt; recover database;&lt;br /&gt;5&gt; alter database open resetlogs;&lt;br /&gt;6&gt; }&lt;br /&gt;&lt;br /&gt;executing command: SET until clause&lt;br /&gt;using target database control file instead of recovery catalog&lt;br /&gt;Starting restore at 11-AUG-10&lt;br /&gt;&lt;br /&gt;allocated channel: ORA_DISK_1&lt;br /&gt;channel ORA_DISK_1: sid=153 devtype=DISK&lt;br /&gt;channel ORA_DISK_1: starting datafile backupset restore&lt;br /&gt;channel ORA_DISK_1: specifying datafile(s) to restore from backup set&lt;br /&gt;restoring datafile 00002 to /u01/app/oracle/oradata/trialrep/undotbs01.dbf&lt;br /&gt;restoring datafile 00003 to /u01/app/oracle/oradata/trialrep/sysaux01.dbf&lt;br /&gt;restoring datafile 00004 to /u01/app/oracle/oradata/trialrep/users01.dbf&lt;br /&gt;channel ORA_DISK_1: reading from backup piece /home/oracle/rman/rman0bll30b1_1_1&lt;br /&gt;channel ORA_DISK_1: restored backup piece 1&lt;br /&gt;piece handle=/home/oracle/rman/rman0bll30b1_1_1 tag=EB64LEVEL0&lt;br /&gt;channel ORA_DISK_1: restore complete, elapsed time: 00:00:36&lt;br /&gt;channel ORA_DISK_1: starting datafile backupset restore&lt;br /&gt;channel ORA_DISK_1: specifying datafile(s) to restore from backup set&lt;br /&gt;restoring datafile 00001 to /u01/app/oracle/oradata/trialrep/system01.dbf&lt;br /&gt;restoring datafile 00005 to /u01/app/oracle/oradata/trialrep/example01.dbf&lt;br /&gt;restoring datafile 00006 to /u01/app/oracle/oradata/trialrep/bv1to1.dbf&lt;br /&gt;channel ORA_DISK_1: reading from backup piece /home/oracle/rman/rman0all30b1_1_1&lt;br /&gt;channel ORA_DISK_1: restored backup piece 1&lt;br /&gt;piece handle=/home/oracle/rman/rman0all30b1_1_1 tag=EB64LEVEL0&lt;br /&gt;channel ORA_DISK_1: restore complete, elapsed time: 00:00:46&lt;br /&gt;&lt;br /&gt;Finished restore at 11-AUG-10&lt;br /&gt;&lt;br /&gt;Starting recover at 11-AUG-10&lt;br /&gt;using channel ORA_DISK_1&lt;br /&gt;starting media recovery&lt;br /&gt;archive log thread 1 sequence 15 is already on disk as file /arch/1_15_726755127.dbf&lt;br /&gt;archive log filename=/arch/1_15_726755127.dbf thread=1 sequence=15&lt;br /&gt;media recovery complete, elapsed time: 00:00:04&lt;br /&gt;&lt;br /&gt;Finished recover at 11-AUG-10&lt;br /&gt;&lt;br /&gt;database opened&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-6370405377015569080?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/6370405377015569080/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/08/recover-from-loss-of-single-current.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/6370405377015569080'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/6370405377015569080'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/08/recover-from-loss-of-single-current.html' title='Recover from loss of  single current online redo log file'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-954045546987130074</id><published>2010-08-10T06:45:00.000-07:00</published><updated>2010-08-10T06:49:58.465-07:00</updated><title type='text'>Backup script for Linux using tar and find</title><content type='html'>script.sh&lt;br /&gt;#!/bin/bash&lt;br /&gt;#&lt;br /&gt;# creates backups of essential files&lt;br /&gt;#&lt;br /&gt;DATA="/home /root /usr/local/httpd"&lt;br /&gt;CONFIG="/etc /var/lib /var/named"&lt;br /&gt;LIST="/tmp/backlist_$$.txt"&lt;br /&gt;#&lt;br /&gt;#mount /mnt/backup&lt;br /&gt;set $(date)&lt;br /&gt;#&lt;br /&gt;if test "$1" = "Tue" ; then&lt;br /&gt;# weekly a full backup of all data and config. settings:&lt;br /&gt;#&lt;br /&gt;tar cfz "/mnt/backup/data/data_full_$6-$2-$3.tgz" $DATA&lt;br /&gt;rm -f /mnt/backup/data/data_diff*&lt;br /&gt;#&lt;br /&gt;tar cfz "/mnt/backup/config/config_full_$6-$2-$3.tgz" $CONFIG &lt;br /&gt;rm -f /mnt/backup/config/config_diff*&lt;br /&gt;else&lt;br /&gt;# incremental backup:&lt;br /&gt;#&lt;br /&gt;find $DATA -depth -type f \( -ctime -1 -o -mtime -1 \) -print &gt; $LIST&lt;br /&gt;tar cfzT "/mnt/backup/data/data_diff_$6-$2-$3.tgz" "$LIST"&lt;br /&gt;rm -f "$LIST"&lt;br /&gt;#&lt;br /&gt;find $CONFIG -depth -type f \( -ctime -1 -o -mtime -1 \) -print &gt; $LIST&lt;br /&gt;tar cfzT "/mnt/backup/config/config_diff_$6-$2-$3.tgz" "$LIST"&lt;br /&gt;rm -f "$LIST"&lt;br /&gt;fi&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-954045546987130074?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/954045546987130074/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/08/backup-script-for-linux-using-tar-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/954045546987130074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/954045546987130074'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/08/backup-script-for-linux-using-tar-and.html' title='Backup script for Linux using tar and find'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-8544151712606256729</id><published>2010-07-08T00:39:00.000-07:00</published><updated>2010-07-08T01:21:53.884-07:00</updated><title type='text'>Reading Text Files using Oracle PL/SQL and UTL_FILE</title><content type='html'>&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;&lt;span class="Apple-style-span"  style="color:#330033;"&gt; &lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;&lt;span class="Apple-style-span"  style="color:#330033;"&gt;Set ----alter system set utl_file_dir='/foo/bar/dir1','/foo/baz/dir2','/tmp' scope=spfile&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;&lt;span class="Apple-style-span"  style="color:#330033;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;The first step we need to perform is nothing but letting the Oracle database know on which directory we are working (reading or writing files only from that directory). This can be achieved using the following command:&lt;/span&gt;&lt;/span&gt; &lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;&lt;span class="Apple-style-span"  style="color:#330033;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#330033;"&gt;CREATE DIRECTORY sampledata AS 'c:sampledata';&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#330033;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#330033;"&gt;The above command creates a new directory entry into the Oracle database with a logical name to the directory, "SAMPLEDATA" (pointing to the path "c:sampledata"). To execute the above command, you need to have certain privileges. I suggest you log in using "SYSTEM" user (or contact your database administrator on this issue). If you wanted to list all the directories registered, you can use the following command:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#330033;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#330033;"&gt;SELECT * FROM ALL_DIRECTORIES;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#330033;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#330033;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#330033;"&gt;The second step we need to perform is providing necessary permissions to the user to work with that directory. This can be achieved with something like the following:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#330033;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#330033;"&gt;GRANT read, write ON DIRECTORY sampledata TO PUBLIC;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#330033;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#330033;"&gt;The above step makes sure that the directory "sampledata" (or "c:sampledata") is accessible to every user (PUBLIC). It is not at all a good idea to provide grants to the PUBLIC. I suggest you provide the grants only to the required users (who really need them).&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#330033;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#330033;"&gt;The third step we need to perform is simply creating a new text file within the folder "c:sampledata". I hope you can do it yourself.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#330033;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#330033;"&gt;The last and final step is trying to read the file using PL/SQL. Open your SQL*PLUS environment and copy the following code:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#330033;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#330033;"&gt;declare&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#330033;"&gt;f utl_file.file_type;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#330033;"&gt;s varchar2(200);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#330033;"&gt;begin&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#330033;"&gt;f := utl_file.fopen('SAMPLEDATA','sample1.txt','R');&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#330033;"&gt;utl_file.get_line(f,s);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#330033;"&gt;utl_file.fclose(f);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#330033;"&gt;dbms_output.put_line(s);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#330033;"&gt;end;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#330033;"&gt;/&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#330033;"&gt;Created by Suyash application dba HCL-----&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#330033;"&gt;&lt;div&gt;Implemented this code.&lt;/div&gt;&lt;div&gt;*************************************************************&lt;/div&gt;&lt;div&gt;DECLARE &lt;/div&gt;&lt;div&gt;TYPE IDCurTyp IS REF CURSOR; &lt;/div&gt;&lt;div&gt;fo UTL_FILE.FILE_TYPE; &lt;/div&gt;&lt;div&gt;varRow VARCHAR2(4000); &lt;/div&gt;&lt;div&gt;cur_output IDCurTyp; &lt;/div&gt;&lt;div&gt;BEGIN &lt;/div&gt;&lt;div&gt;fo := UTL_FILE.FOPEN('C:\BACKUP','TEST.csv', 'W', 2000); &lt;/div&gt;&lt;div&gt;OPEN cur_output FOR &lt;/div&gt;&lt;div&gt;'SELECT ''"''  OID  ''",''  DOC_PATH ''"'' FROM IREPS_PURGED_DOC_DETAILS'; &lt;/div&gt;&lt;div&gt;LOOP &lt;/div&gt;&lt;div&gt;FETCH cur_output INTO varRow; &lt;/div&gt;&lt;div&gt;EXIT WHEN cur_output%NOTFOUND; &lt;/div&gt;&lt;div&gt;UTL_FILE.putf( fo, '%s\n', varRow ); &lt;/div&gt;&lt;div&gt;END LOOP; &lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;CLOSE cur_output; &lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;UTL_FILE.FCLOSE( fo ); &lt;/div&gt;&lt;div&gt;END; &lt;/div&gt;&lt;div&gt;****************************************************&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-8544151712606256729?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/8544151712606256729/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/07/reading-text-files-using-oracle-plsql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/8544151712606256729'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/8544151712606256729'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/07/reading-text-files-using-oracle-plsql.html' title='Reading Text Files using Oracle PL/SQL and UTL_FILE'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-1624180878361670740</id><published>2010-06-22T22:46:00.000-07:00</published><updated>2010-06-22T22:47:34.151-07:00</updated><title type='text'>Split-brain condition</title><content type='html'>&lt;span class="Apple-style-span" style="border-collapse: collapse; "&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;For a two-node cluster, split-brain occurs when nodes in a cluster cannot talk to each other (the internode links fail) and each node assumes it is the only surviving member of the cluster. If the nodes in the cluster have uncoordinated access to the shared storage area, they would end up overwriting each other's data, causing data corruption because each node assumes ownership of shared data. To prevent data corruption, one node must be asked to leave the cluster or should be forced out immediately.&lt;br /&gt;In case of Split Brain in 2 Node cluster due to Private N/W failure between two nodes. The Node which has lowest Node number will continue to run while Node with high node number in Cluster will be evicted from cluster. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-1624180878361670740?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/1624180878361670740/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/06/split-brain-condition.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/1624180878361670740'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/1624180878361670740'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/06/split-brain-condition.html' title='Split-brain condition'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-4024116092883350050</id><published>2010-05-05T00:26:00.000-07:00</published><updated>2010-05-05T00:27:36.059-07:00</updated><title type='text'>Move the OCR and Move the Voting disk</title><content type='html'>&lt;a name="0.1_Move_the_OCR"&gt;&lt;/a&gt;&lt;span style="font-family:arial;font-size:85%;color:#000066;"&gt;Move the OCR &lt;/span&gt;&lt;a name="0.1_table6B"&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;color:#000066;"&gt;#&lt;br /&gt;# The new raw storage devices for OCR should be owned by the&lt;br /&gt;# root user, must be in the oinstall group, and must have&lt;br /&gt;# permissions set to 640. Provide at least 280MB of disk&lt;br /&gt;# space for each OCR file and verify the raw storage devices&lt;br /&gt;# can be seen from all nodes in the cluster.&lt;br /&gt;#&lt;br /&gt;[root@racnode1 ~]# ls -l /dev/raw/raw[12]&lt;br /&gt;crw-r----- 1 root oinstall 162, 1 Oct  8 21:55 /dev/raw/raw1&lt;br /&gt;crw-r----- 1 root oinstall 162, 2 Oct  8 21:55 /dev/raw/raw2&lt;br /&gt;[root@racnode2 ~]# ls -l /dev/raw/raw[12]&lt;br /&gt;crw-r----- 1 root oinstall 162, 1 Oct  8 21:54 /dev/raw/raw1&lt;br /&gt;crw-r----- 1 root oinstall 162, 2 Oct  8 21:54 /dev/raw/raw2&lt;br /&gt;#&lt;br /&gt;# Use the dd command to zero out the devices and make sure&lt;br /&gt;# no data is written to the raw devices.&lt;br /&gt;#&lt;br /&gt;[root@racnode1 ~]# dd if=/dev/zero of=/dev/raw/raw1&lt;br /&gt;[root@racnode1 ~]# dd if=/dev/zero of=/dev/raw/raw2&lt;br /&gt;#&lt;br /&gt;# Verify CRS is running on node 1.&lt;br /&gt;#&lt;br /&gt;[root@racnode1 ~]# crsctl check crs&lt;br /&gt;CSS appears healthy&lt;br /&gt;CRS appears healthy&lt;br /&gt;EVM appears healthy&lt;br /&gt;#&lt;br /&gt;# Verify CRS is running on node 2.&lt;br /&gt;#&lt;br /&gt;[root@racnode2 ~]# crsctl check crs&lt;br /&gt;CSS appears healthy&lt;br /&gt;CRS appears healthy&lt;br /&gt;EVM appears healthy&lt;br /&gt;#&lt;br /&gt;# Query the current location and number of OCR files on&lt;br /&gt;# the OCFS2 file system.&lt;br /&gt;#&lt;br /&gt;[root@racnode1 ~]# ocrcheck&lt;br /&gt;Status of Oracle Cluster Registry is as follows :&lt;br /&gt;         Version                  :          2&lt;br /&gt;         Total space (kbytes)     :     262120&lt;br /&gt;         Used space (kbytes)      :       4676&lt;br /&gt;         Available space (kbytes) :     257444&lt;br /&gt;         ID                       : 1513888898&lt;br /&gt;         Device/File Name         : /u02/oradata/racdb/OCRFile         &lt;-- OCR (primary)&lt;br /&gt;                                    Device/File integrity check succeeded&lt;br /&gt;         Device/File Name         : /u02/oradata/racdb/OCRFile_mirror  &lt;-- OCR (mirror)&lt;br /&gt;                                    Device/File integrity check succeeded&lt;br /&gt;         Cluster registry integrity check succeeded&lt;br /&gt;#&lt;br /&gt;# Move OCR and OCR mirror to new storage location.&lt;br /&gt;#&lt;br /&gt;[root@racnode1 ~]# ocrconfig -replace ocr /dev/raw/raw1&lt;br /&gt;[root@racnode1 ~]# ocrconfig -replace ocrmirror /dev/raw/raw2&lt;br /&gt;#&lt;br /&gt;# Verify OCR relocation from node 1.&lt;br /&gt;#&lt;br /&gt;[root@racnode1 ~]# ocrcheck&lt;br /&gt;Status of Oracle Cluster Registry is as follows :&lt;br /&gt;         Version                  :          2&lt;br /&gt;         Total space (kbytes)     :     262120&lt;br /&gt;         Used space (kbytes)      :       4676&lt;br /&gt;         Available space (kbytes) :     257444&lt;br /&gt;         ID                       : 1513888898&lt;br /&gt;         Device/File Name         : /dev/raw/raw1&lt;br /&gt;                                    Device/File integrity check succeeded&lt;br /&gt;         Device/File Name         : /dev/raw/raw2&lt;br /&gt;                                    Device/File integrity check succeeded&lt;br /&gt;         Cluster registry integrity check succeeded&lt;br /&gt;#&lt;br /&gt;# Verify OCR relocation from node 2.&lt;br /&gt;#&lt;br /&gt;[root@racnode2 ~]# ocrcheck&lt;br /&gt;Status of Oracle Cluster Registry is as follows :&lt;br /&gt;         Version                  :          2&lt;br /&gt;         Total space (kbytes)     :     262120&lt;br /&gt;         Used space (kbytes)      :       4676&lt;br /&gt;         Available space (kbytes) :     257444&lt;br /&gt;         ID                       : 1513888898&lt;br /&gt;         Device/File Name         : /dev/raw/raw1&lt;br /&gt;                                    Device/File integrity check succeeded&lt;br /&gt;         Device/File Name         : /dev/raw/raw2&lt;br /&gt;                                    Device/File integrity check succeeded&lt;br /&gt;         Cluster registry integrity check succeeded&lt;br /&gt;#&lt;br /&gt;# Remove all deleted OCR files from the OCFS2 file system.&lt;br /&gt;#&lt;br /&gt;[root@racnode1 ~]# rm /u02/oradata/racdb/OCRFile&lt;br /&gt;[root@racnode1 ~]# rm /u02/oradata/racdb/OCRFile_mirror&lt;br /&gt;&lt;/span&gt;&lt;a name="0.1_Move_the_Voting_Disk"&gt;&lt;/a&gt;&lt;span style="font-family:arial;font-size:85%;color:#000066;"&gt;Move the Voting Disk &lt;/span&gt;&lt;a name="0.1_table6C"&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;color:#000066;"&gt;#&lt;br /&gt;# The new raw storage devices for the voting disks should be&lt;br /&gt;# owned by the oracle user, must be in the oinstall group,&lt;br /&gt;# and and must have permissions set to 644. Provide at least&lt;br /&gt;# 20MB of disk space for each voting disk and verify the raw&lt;br /&gt;# storage devices can be seen from all nodes in the cluster.&lt;br /&gt;#&lt;br /&gt;[root@racnode1 ~]# ls -l /dev/raw/raw[345]&lt;br /&gt;crw-r--r-- 1 oracle oinstall 162, 3 Oct  8 22:44 /dev/raw/raw3&lt;br /&gt;crw-r--r-- 1 oracle oinstall 162, 4 Oct  8 22:45 /dev/raw/raw4&lt;br /&gt;crw-r--r-- 1 oracle oinstall 162, 5 Oct  9 00:22 /dev/raw/raw5&lt;br /&gt;[root@racnode2 ~]# ls -l /dev/raw/raw[345]&lt;br /&gt;crw-r--r-- 1 oracle oinstall 162, 3 Oct  8 22:53 /dev/raw/raw3&lt;br /&gt;crw-r--r-- 1 oracle oinstall 162, 4 Oct  8 22:54 /dev/raw/raw4&lt;br /&gt;crw-r--r-- 1 oracle oinstall 162, 5 Oct  9 00:23 /dev/raw/raw5&lt;br /&gt;#&lt;br /&gt;# Use the dd command to zero out the devices and make sure&lt;br /&gt;# no data is written to the raw devices.&lt;br /&gt;#&lt;br /&gt;[root@racnode1 ~]# dd if=/dev/zero of=/dev/raw/raw3&lt;br /&gt;[root@racnode1 ~]# dd if=/dev/zero of=/dev/raw/raw4&lt;br /&gt;[root@racnode1 ~]# dd if=/dev/zero of=/dev/raw/raw5&lt;br /&gt;#&lt;br /&gt;# Query the current location and number of voting disks on&lt;br /&gt;# the OCFS2 file system. There needs to be at least two&lt;br /&gt;# voting disks configured before attempting to perform the&lt;br /&gt;# move.&lt;br /&gt;#&lt;br /&gt;[root@racnode1 ~]# crsctl query css votedisk&lt;br /&gt;0.     0    /u02/oradata/racdb/CSSFile&lt;br /&gt;1.     0    /u02/oradata/racdb/CSSFile_mirror1&lt;br /&gt;2.     0    /u02/oradata/racdb/CSSFile_mirror2&lt;br /&gt;located 3 votedisk(s).&lt;br /&gt;#&lt;br /&gt;# Stop all application processes.&lt;br /&gt;#&lt;br /&gt;[root@racnode1 ~]# srvctl stop database -d racdb&lt;br /&gt;[root@racnode1 ~]# srvctl stop asm -n racnode1&lt;br /&gt;[root@racnode1 ~]# srvctl stop asm -n racnode2&lt;br /&gt;[root@racnode1 ~]# srvctl stop nodeapps -n racnode1&lt;br /&gt;[root@racnode1 ~]# srvctl stop nodeapps -n racnode2&lt;br /&gt;#&lt;br /&gt;# Verify all application processes are OFFLINE.&lt;br /&gt;#&lt;br /&gt;[root@racnode1 ~]# crs_stat -t&lt;br /&gt;Name           Type           Target    State     Host&lt;br /&gt;------------------------------------------------------------&lt;br /&gt;ora.racdb.db   application    OFFLINE   OFFLINE&lt;br /&gt;ora....b1.inst application    OFFLINE   OFFLINE&lt;br /&gt;ora....b2.inst application    OFFLINE   OFFLINE&lt;br /&gt;ora....srvc.cs application    OFFLINE   OFFLINE&lt;br /&gt;ora....db1.srv application    OFFLINE   OFFLINE&lt;br /&gt;ora....db2.srv application    OFFLINE   OFFLINE&lt;br /&gt;ora....SM1.asm application    OFFLINE   OFFLINE&lt;br /&gt;ora....E1.lsnr application    OFFLINE   OFFLINE&lt;br /&gt;ora....de1.gsd application    OFFLINE   OFFLINE&lt;br /&gt;ora....de1.ons application    OFFLINE   OFFLINE&lt;br /&gt;ora....de1.vip application    OFFLINE   OFFLINE&lt;br /&gt;ora....SM2.asm application    OFFLINE   OFFLINE&lt;br /&gt;ora....E2.lsnr application    OFFLINE   OFFLINE&lt;br /&gt;ora....de2.gsd application    OFFLINE   OFFLINE&lt;br /&gt;ora....de2.ons application    OFFLINE   OFFLINE&lt;br /&gt;ora....de2.vip application    OFFLINE   OFFLINE&lt;br /&gt;#&lt;br /&gt;# Shut down CRS on node 1 and verify the CRS stack is not up.&lt;br /&gt;#&lt;br /&gt;[root@racnode1 ~]# crsctl stop crs&lt;br /&gt;Stopping resources. This could take several minutes.&lt;br /&gt;Successfully stopped CRS resources.&lt;br /&gt;Stopping CSSD.&lt;br /&gt;Shutting down CSS daemon.&lt;br /&gt;Shutdown request successfully issued.&lt;br /&gt;[root@racnode1 ~]# ps -ef  grep d.bin  grep -v grep&lt;br /&gt;#&lt;br /&gt;# Shut down CRS on node 2 and verify the CRS stack is not up.&lt;br /&gt;#&lt;br /&gt;[root@racnode2 ~]# crsctl stop crs&lt;br /&gt;Stopping resources. This could take several minutes.&lt;br /&gt;Successfully stopped CRS resources.&lt;br /&gt;Stopping CSSD.&lt;br /&gt;Shutting down CSS daemon.&lt;br /&gt;Shutdown request successfully issued.&lt;br /&gt;[root@racnode2 ~]# ps -ef  grep d.bin  grep -v grep&lt;br /&gt;#&lt;br /&gt;# Move all three voting disks to new storage location.&lt;br /&gt;#&lt;br /&gt;[root@racnode1 ~]# crsctl delete css votedisk /u02/oradata/racdb/CSSFile -force&lt;br /&gt;successful deletion of votedisk /u02/oradata/racdb/CSSFile.&lt;br /&gt;[root@racnode1 ~]# crsctl add css votedisk /dev/raw/raw3 -force&lt;br /&gt;Now formatting voting disk: /dev/raw/raw3&lt;br /&gt;successful addition of votedisk /dev/raw/raw3.&lt;br /&gt;[root@racnode1 ~]# crsctl delete css votedisk /u02/oradata/racdb/CSSFile_mirror1 -force&lt;br /&gt;successful deletion of votedisk /u02/oradata/racdb/CSSFile_mirror1.&lt;br /&gt;[root@racnode1 ~]# crsctl add css votedisk /dev/raw/raw4 -force&lt;br /&gt;Now formatting voting disk: /dev/raw/raw4&lt;br /&gt;successful addition of votedisk /dev/raw/raw4.&lt;br /&gt;[root@racnode1 ~]# crsctl delete css votedisk /u02/oradata/racdb/CSSFile_mirror2 -force&lt;br /&gt;successful deletion of votedisk /u02/oradata/racdb/CSSFile_mirror2.&lt;br /&gt;[root@racnode1 ~]# crsctl add css votedisk /dev/raw/raw5 -force&lt;br /&gt;Now formatting voting disk: /dev/raw/raw5&lt;br /&gt;successful addition of votedisk /dev/raw/raw5.&lt;br /&gt;#&lt;br /&gt;# Verify voting disk(s) relocation from node 1.&lt;br /&gt;#&lt;br /&gt;[root@racnode1 ~]# crsctl query css votedisk&lt;br /&gt;0.     0    /dev/raw/raw3&lt;br /&gt;1.     0    /dev/raw/raw4&lt;br /&gt;2.     0    /dev/raw/raw5&lt;br /&gt;located 3 votedisk(s).&lt;br /&gt;#&lt;br /&gt;# Verify voting disk(s) relocation from node 2.&lt;br /&gt;#&lt;br /&gt;[root@racnode2 ~]# crsctl query css votedisk&lt;br /&gt;0.     0    /dev/raw/raw3&lt;br /&gt;1.     0    /dev/raw/raw4&lt;br /&gt;2.     0    /dev/raw/raw5&lt;br /&gt;located 3 votedisk(s).&lt;br /&gt;#&lt;br /&gt;# Remove all deleted voting disk files from the OCFS2 file system.&lt;br /&gt;#&lt;br /&gt;[root@racnode1 ~]# rm /u02/oradata/racdb/CSSFile&lt;br /&gt;[root@racnode1 ~]# rm /u02/oradata/racdb/CSSFile_mirror1&lt;br /&gt;[root@racnode1 ~]# rm /u02/oradata/racdb/CSSFile_mirror2&lt;br /&gt;#&lt;br /&gt;# With all voting disks now located on raw storage devices,&lt;br /&gt;# restart CRS on all Oracle RAC nodes.&lt;br /&gt;#&lt;br /&gt;[root@racnode1 ~]# crsctl start crs&lt;br /&gt;[root@racnode2 ~]# crsctl start crs&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-4024116092883350050?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/4024116092883350050/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/05/move-ocr-and-move-voting-disk.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/4024116092883350050'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/4024116092883350050'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/05/move-ocr-and-move-voting-disk.html' title='Move the OCR and Move the Voting disk'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-4340091409286925875</id><published>2010-05-05T00:22:00.000-07:00</published><updated>2010-05-05T00:25:48.175-07:00</updated><title type='text'>Recover the Voting Disk</title><content type='html'>&lt;span style="font-size:85%;"&gt;The recommended way to recover from a lost or corrupt voting disk is to restore it from a previous good backup that was taken with the dd command.&lt;br /&gt;There are actually very few steps required to restore the voting disks:&lt;br /&gt;Shutdown CRS on all nodes in the cluster.&lt;br /&gt;List the current location of the voting disks.&lt;br /&gt;Restore each of the voting disks using the dd command from a previous good backup of the voting disks that was taken using the same dd command.&lt;br /&gt;Re-start CRS on all nodes in the cluster.&lt;br /&gt;For example: &lt;/span&gt;&lt;a name="0.1_table5E"&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;[root@racnode1 ~]# crsctl stop crs&lt;br /&gt;[root@racnode2 ~]# crsctl stop crs&lt;br /&gt;[root@racnode1 ~]# crsctl query css votedisk&lt;br /&gt;[root@racnode1 ~]# # Do this for all voting disks...&lt;br /&gt;[root@racnode1 ~]# dd if=&lt;backup_voting_disk&gt; of=&lt;voting_disk_name&gt; bs=4k&lt;br /&gt;[root@racnode1 ~]# crsctl start crs&lt;br /&gt;[root@racnode2 ~]# crsctl start crs&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-4340091409286925875?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/4340091409286925875/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/05/recover-voting-disk.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/4340091409286925875'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/4340091409286925875'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/05/recover-voting-disk.html' title='Recover the Voting Disk'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-3286327931505893610</id><published>2010-05-05T00:02:00.000-07:00</published><updated>2010-05-05T00:16:52.890-07:00</updated><title type='text'>How to add two new voting disks to the current cluster</title><content type='html'>&lt;span style="font-size:85%;"&gt;The following example demonstrates how to add two new voting disks to the current cluster. The new voting disks will reside on the same OCFS2 file system in the same directory as the current voting disk. Please note that I am doing this for the sake brevity. Multiplexed voting disks should always be placed on a separate device than the current voting disk to guard against a single point of failure.&lt;br /&gt;Stop all application processes, shut down CRS on all nodes, and Oracle10g R2 users should use the -force flag to the crsctl command when adding the new voting disk(s). For example: &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;color:#330000;"&gt;# Query current voting disk configuration.&lt;br /&gt;#&lt;br /&gt;[root@racnode1 ~]# crsctl query css votedisk&lt;br /&gt;0.     0    /u02/oradata/racdb/CSSFile&lt;br /&gt;located 1 votedisk(s).&lt;br /&gt;#&lt;br /&gt;# Stop all application processes.&lt;br /&gt;#&lt;br /&gt;[root@racnode1 ~]# srvctl stop database -d racdb&lt;br /&gt;[root@racnode1 ~]# srvctl stop asm -n racnode1&lt;br /&gt;[root@racnode1 ~]# srvctl stop asm -n racnode2&lt;br /&gt;[root@racnode1 ~]# srvctl stop nodeapps -n racnode1&lt;br /&gt;[root@racnode1 ~]# srvctl stop nodeapps -n racnode2&lt;br /&gt;#&lt;br /&gt;# Verify all application processes are OFFLINE.&lt;br /&gt;#&lt;br /&gt;[root@racnode1 ~]# crs_stat -t&lt;br /&gt;Name           Type           Target    State     Host&lt;br /&gt;------------------------------------------------------------&lt;br /&gt;ora.racdb.db   application    OFFLINE   OFFLINE&lt;br /&gt;ora....b1.inst application    OFFLINE   OFFLINE&lt;br /&gt;ora....b2.inst application    OFFLINE   OFFLINE&lt;br /&gt;ora....srvc.cs application    OFFLINE   OFFLINE&lt;br /&gt;ora....db1.srv application    OFFLINE   OFFLINE&lt;br /&gt;ora....db2.srv application    OFFLINE   OFFLINE&lt;br /&gt;ora....SM1.asm application    OFFLINE   OFFLINE&lt;br /&gt;ora....E1.lsnr application    OFFLINE   OFFLINE&lt;br /&gt;ora....de1.gsd application    OFFLINE   OFFLINE&lt;br /&gt;ora....de1.ons application    OFFLINE   OFFLINE&lt;br /&gt;ora....de1.vip application    OFFLINE   OFFLINE&lt;br /&gt;ora....SM2.asm application    OFFLINE   OFFLINE&lt;br /&gt;ora....E2.lsnr application    OFFLINE   OFFLINE&lt;br /&gt;ora....de2.gsd application    OFFLINE   OFFLINE&lt;br /&gt;ora....de2.ons application    OFFLINE   OFFLINE&lt;br /&gt;ora....de2.vip application    OFFLINE   OFFLINE&lt;br /&gt;#&lt;br /&gt;# Shut down CRS on node 1 and verify the CRS stack is not up.&lt;br /&gt;#&lt;br /&gt;[root@racnode1 ~]# crsctl stop crs&lt;br /&gt;Stopping resources. This could take several minutes.&lt;br /&gt;Successfully stopped CRS resources.&lt;br /&gt;Stopping CSSD.&lt;br /&gt;Shutting down CSS daemon.&lt;br /&gt;Shutdown request successfully issued.&lt;br /&gt;[root@racnode1 ~]# ps -ef  grep d.bin  grep -v grep&lt;br /&gt;#&lt;br /&gt;# Shut down CRS on node 2 and verify the CRS stack is not up.&lt;br /&gt;#&lt;br /&gt;[root@racnode2 ~]# crsctl stop crs&lt;br /&gt;Stopping resources. This could take several minutes.&lt;br /&gt;Successfully stopped CRS resources.&lt;br /&gt;Stopping CSSD.&lt;br /&gt;Shutting down CSS daemon.&lt;br /&gt;Shutdown request successfully issued.&lt;br /&gt;[root@racnode2 ~]# ps -ef  grep d.bin  grep -v grep&lt;br /&gt;#&lt;br /&gt;# Take a backup of the current voting disk.&lt;br /&gt;#&lt;br /&gt;[oracle@racnode1 ~]$ dd if=/u02/oradata/racdb/CSSFile of=/home/oracle/VotingDiskBackup.dmp bs=4k&lt;br /&gt;2500+0 records in&lt;br /&gt;2500+0 records out&lt;br /&gt;10240000 bytes (10 MB) copied, 0.272872 seconds, 37.5 MB/s&lt;br /&gt;#&lt;br /&gt;# Add two new voting disks.&lt;br /&gt;#&lt;br /&gt;[root@racnode1 ~]# crsctl add css votedisk /u02/oradata/racdb/CSSFile_mirror1 -force&lt;br /&gt;Now formatting voting disk: /u02/oradata/racdb/CSSFile_mirror1&lt;br /&gt;successful addition of votedisk /u02/oradata/racdb/CSSFile_mirror1.&lt;br /&gt;[root@racnode1 ~]# crsctl add css votedisk /u02/oradata/racdb/CSSFile_mirror2 -force&lt;br /&gt;Now formatting voting disk: /u02/oradata/racdb/CSSFile_mirror2&lt;br /&gt;successful addition of votedisk /u02/oradata/racdb/CSSFile_mirror2.&lt;br /&gt;#&lt;br /&gt;# Set the appropriate permissions on the new voting disks.&lt;br /&gt;#&lt;br /&gt;[root@racnode1 ~]# chown oracle /u02/oradata/racdb/CSSFile_mirror1&lt;br /&gt;[root@racnode1 ~]# chgrp oinstall /u02/oradata/racdb/CSSFile_mirror1&lt;br /&gt;[root@racnode1 ~]# chmod 644 /u02/oradata/racdb/CSSFile_mirror1&lt;br /&gt;[root@racnode1 ~]# chown oracle /u02/oradata/racdb/CSSFile_mirror2&lt;br /&gt;[root@racnode1 ~]# chgrp oinstall /u02/oradata/racdb/CSSFile_mirror2&lt;br /&gt;[root@racnode1 ~]# chmod 644 /u02/oradata/racdb/CSSFile_mirror2   &lt;br /&gt;If the new voting disks will be created on raw devices&lt;br /&gt;#&lt;br /&gt;# Clear out the contents from the new raw devices.&lt;br /&gt;#&lt;br /&gt;[root@racnode1 ~]# dd if=/dev/zero of=/dev/raw/raw3&lt;br /&gt;[root@racnode1 ~]# dd if=/dev/zero of=/dev/raw/raw4&lt;br /&gt;#&lt;br /&gt;# Add two new voting disks.&lt;br /&gt;#&lt;br /&gt;[root@racnode1 ~]# crsctl add css votedisk /dev/raw/raw3 -force&lt;br /&gt;Now formatting voting disk: /dev/raw/raw3&lt;br /&gt;successful addition of votedisk /dev/raw/raw3.&lt;br /&gt;[root@racnode1 ~]# crsctl add css votedisk /dev/raw/raw4 -force&lt;br /&gt;Now formatting voting disk: /dev/raw/raw4&lt;br /&gt;successful addition of votedisk /dev/raw/raw4.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;color:#330000;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;color:#330000;"&gt;----&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;color:#330000;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;color:#003300;"&gt;# Verify new voting disk access from node 1.&lt;br /&gt;#&lt;br /&gt;[root@racnode1 ~]# crsctl query css votedisk&lt;br /&gt;0.     0    /u02/oradata/racdb/CSSFile&lt;br /&gt;1.     0    /u02/oradata/racdb/CSSFile_mirror1&lt;br /&gt;2.     0    /u02/oradata/racdb/CSSFile_mirror2&lt;br /&gt;located 3 votedisk(s).&lt;br /&gt;#&lt;br /&gt;# Verify new voting disk access from node 2.&lt;br /&gt;#&lt;br /&gt;[root@racnode2 ~]# crsctl query css votedisk&lt;br /&gt;0.     0    /u02/oradata/racdb/CSSFile&lt;br /&gt;1.     0    /u02/oradata/racdb/CSSFile_mirror1&lt;br /&gt;2.     0    /u02/oradata/racdb/CSSFile_mirror2&lt;br /&gt;located 3 votedisk(s).&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;color:#003300;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;After verifying the new voting disk(s) can be seen from all nodes in the cluster, restart CRS and the application processes.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#660000;"&gt;Remove a Voting Disk&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Oracle Clusterware must be shut down on all nodes in the cluster before adding or removing voting disks. Just as we were required to add the -force flag when adding a voting disk, the same holds true for Oracle10g R2 users attempting to remove a voting disk: &lt;/span&gt;&lt;a name="0.1_table54"&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#660000;"&gt;[root@racnode1 ~]# crsctl delete css votedisk /u02/oradata/racdb/CSSFile_mirror1&lt;/span&gt;&lt;br /&gt;Cluster is not in a ready state for online disk removal&lt;br /&gt;&lt;span style="color:#660000;"&gt;[root@racnode1 ~]# crsctl delete css votedisk /u02/oradata/racdb/CSSFile_mirror2&lt;/span&gt;&lt;br /&gt;Cluster is not in a ready state for online disk removal&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-3286327931505893610?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/3286327931505893610/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/05/how-to-add-two-new-voting-disks-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/3286327931505893610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/3286327931505893610'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/05/how-to-add-two-new-voting-disks-to.html' title='How to add two new voting disks to the current cluster'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-705895392952402834</id><published>2010-05-04T22:51:00.000-07:00</published><updated>2010-05-04T23:00:16.209-07:00</updated><title type='text'>Recover OCR from Valid OCR Mirror</title><content type='html'>&lt;span style="font-size:85%;"&gt;The restore process will use the good OCR copy (whether its the primary OCR or the OCR mirror) to restore the missing/corrupt copy. Remember that if there is at least one copy of the OCR available, you can use that valid copy to restore the contents of the other copy of the OCR. The best part about this type of recovery is that it doesn't require any downtime! Oracle Clusterware and the applications can remain online during the recovery process.&lt;br /&gt;For the purpose of this example, let's corrupt the primary OCR file: &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;color:#660000;"&gt;[root@racnode1 ~]# dd if=/dev/zero of=/u02/oradata/racdb/OCRFile bs=4k count=100&lt;br /&gt;100+0 records in&lt;br /&gt;100+0 records out&lt;br /&gt;409600 bytes (410 kB) copied, 0.00756842 seconds, 54.1 MB/s&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;color:#660000;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Running ocrcheck picks up the now corrupted primary OCR file:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;color:#660000;"&gt;[root@racnode1 ~]# ocrcheck&lt;br /&gt;Status of Oracle Cluster Registry is as follows :&lt;br /&gt;         Version                  :          2&lt;br /&gt;         Total space (kbytes)     :     262120&lt;br /&gt;         Used space (kbytes)      :       4668&lt;br /&gt;         Available space (kbytes) :     257452&lt;br /&gt;         ID                       :   1331197&lt;br /&gt;         Device/File Name         : /u02/oradata/racdb/OCRFile  &lt;-- Corrupt OCR&lt;br /&gt;                                    Device/File needs to be synchronized with the other device&lt;br /&gt;         Device/File Name         : /u02/oradata/racdb/OCRFile_mirror&lt;br /&gt;                                    Device/File integrity check succeeded&lt;br /&gt;         Cluster registry integrity check succeeded&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Note that after loosing the one OCR copy (in this case, the primary OCR file), Oracle Clusterware and the applications remain online:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;color:#660000;"&gt;While the applications and CRS remain online, perform the following steps to recover the primary OCR using the contents of the OCR mirror.&lt;br /&gt;When using a clustered file system, remove the corrupt OCR file and re-initialize it:&lt;br /&gt;[root@racnode1 ~]# rm /u02/oradata/racdb/OCRFile&lt;br /&gt;[root@racnode1 ~]# cp /dev/null /u02/oradata/racdb/OCRFile&lt;br /&gt;[root@racnode1 ~]# chown root /u02/oradata/racdb/OCRFile&lt;br /&gt;[root@racnode1 ~]# chgrp oinstall /u02/oradata/racdb/OCRFile&lt;br /&gt;[root@racnode1 ~]# chmod 640 /u02/oradata/racdb/OCRFile&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;NOTE: If the target OCR is located on a raw device, verify the permissions are applied correctly for an OCR file (owned by root:oinstall with 0640 permissions), that the device is being shared by all nodes in the cluster, and finally use the dd command from only one node in the cluster to zero out the device and make sure no data is written to the raw device.&lt;br /&gt;[root@racnode1 ~]# ls -l /dev/raw/raw1&lt;br /&gt;crw-r----- 1 root oinstall 162, 1 Oct  6 11:05 /dev/raw/raw1&lt;br /&gt;[root@racnode2 ~]# ls -l /dev/raw/raw1&lt;br /&gt;crw-r----- 1 root oinstall 162, 1 Oct  6 11:04 /dev/raw/raw1&lt;br /&gt;[root@racnode1 ~]# dd if=/dev/zero of=/dev/raw/raw1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Restore the primary OCR using the contents of the OCR mirror. Note that this operation is the same process used when &lt;/span&gt;&lt;a href="http://www.idevelopment.info/data/Oracle/DBA_tips/Oracle10gRAC/CLUSTER_65.shtml#Add+an+OCR+File" target="_blank"&gt;&lt;span style="font-size:85%;"&gt;adding a new OCR location&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;:&lt;br /&gt;&lt;span style="color:#660000;"&gt;[root@racnode1 ~]# ocrconfig -replace ocr /u02/oradata/racdb/OCRFile&lt;/span&gt;&lt;/span&gt;&lt;a name="0.1_table41"&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;NOTE: If the target OCR is located on a raw device, substitute the path name above with that of the shared device name: (i.e. /dev/raw/raw1)&lt;br /&gt;Verify the restore was successful by viewing the Clusterware alert log file.&lt;br /&gt;&lt;span style="color:#660000;"&gt;[root@racnode1 ~]# tail $ORA_CRS_HOME/log/racnode1/alertracnode1.log&lt;/span&gt;&lt;br /&gt;...&lt;br /&gt;2009-10-06 17:46:51.118&lt;br /&gt;&lt;span style="color:#660000;"&gt;[crsd(11054)]CRS-1007:The OCR/OCR mirror location was replaced by /u02/oradata/racdb/OCRFile.&lt;/span&gt;&lt;br /&gt;Verify the OCR configuration by running the ocrcheck command:&lt;br /&gt;[root@racnode1 ~]# ocrcheck&lt;br /&gt;Status of Oracle Cluster Registry is as follows :&lt;br /&gt;         Version                  :          2&lt;br /&gt;         Total space (kbytes)     :     262120&lt;br /&gt;         Used space (kbytes)      :       4668&lt;br /&gt;         Available space (kbytes) :     257452&lt;br /&gt;         ID                       :    1331197&lt;br /&gt;         Device/File Name         : /u02/oradata/racdb/OCRFile&lt;br /&gt;                                    Device/File integrity check succeeded  &lt;-- Primary OCR Restored&lt;br /&gt;         Device/File Name         : /u02/oradata/racdb/OCRFile_mirror&lt;br /&gt;                                    Device/File integrity check succeeded&lt;br /&gt;         Cluster registry integrity check succeeded&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;As the oracle user account with user equivalence enabled on all the nodes, run the cluvfy command to validate the OCR configuration:&lt;br /&gt;[oracle@racnode1 ~]$ ssh racnode1 "hostname; date"&lt;br /&gt;racnode1&lt;br /&gt;Tue Oct  6 17:52:52 EDT 2009&lt;br /&gt;[oracle@racnode1 ~]$ ssh racnode2 "hostname; date"&lt;br /&gt;racnode2&lt;br /&gt;Tue Oct  6 17:51:50 EDT 2009&lt;br /&gt;[oracle@racnode1 ~]$ cluvfy comp ocr -n all&lt;br /&gt;Verifying OCR integrity&lt;br /&gt;Checking OCR integrity...&lt;br /&gt;Checking the absence of a non-clustered configuration...&lt;br /&gt;All nodes free of non-clustered, local-only configurations.&lt;br /&gt;Uniqueness check for OCR device passed.&lt;br /&gt;Checking the version of OCR...&lt;br /&gt;OCR of correct Version "2" exists.&lt;br /&gt;Checking data integrity of OCR...&lt;br /&gt;Data integrity check for OCR passed.&lt;br /&gt;OCR integrity check passed.&lt;br /&gt;Verification of OCR integrity was successful.&lt;/span&gt;&lt;br /&gt;&lt;a name="0.1_Recover_OCR_from_Automatically_Generated"&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#666600;"&gt;Recover OCR from Automatically Generated Physical Backup  -&lt;/span&gt;&lt;br /&gt;This section demonstrates how to recover the Oracle Cluster Registry from a lost or corrupt OCR file. This example assumes that both the primary OCR and the OCR mirror are lost from an accidental delete by a user and that the latest &lt;/span&gt;&lt;a href="http://www.idevelopment.info/data/Oracle/DBA_tips/Oracle10gRAC/CLUSTER_65.shtml#OCR+Backup:+Automatic+OCR+Backups" target="_blank"&gt;&lt;span style="font-size:85%;"&gt;automatic OCR backup copy&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt; on the master node is accessible.&lt;br /&gt;At this time, the second node in the cluster (racnode2) is the &lt;/span&gt;&lt;a href="http://www.idevelopment.info/data/Oracle/DBA_tips/Oracle10gRAC/CLUSTER_65.shtml#The+Master+Node" target="_blank"&gt;&lt;span style="font-size:85%;"&gt;master node&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt; and currently available. We will be restoring the OCR using the latest OCR backup copy from racnode2 which is located at /u01/app/crs/cdata/crs/backup00.ocr.&lt;br /&gt;Let's now corrupt the OCR by removing both the primary OCR and the OCR mirror: &lt;/span&gt;&lt;a name="0.1_table42"&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;[root@racnode1 ~]# rm /u02/oradata/racdb/OCRFile&lt;br /&gt;[root@racnode1 ~]# rm /u02/oradata/racdb/OCRFile_mirror&lt;br /&gt;Running ocrcheck fails to provide any useful information given that both OCR files are lost &lt;/span&gt;&lt;a name="0.1_table43"&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;[root@racnode1 ~]# ocrcheck&lt;br /&gt;PROT-602: Failed to retrieve data from the cluster registry&lt;br /&gt;Note that after loosing both OCR files, Oracle Clusterware and the applications remain online. Before restoring the OCR, the applications and CRS will need to be shutdown as described in the steps below.&lt;br /&gt;Perform the following steps to recover the OCR from the latest automatically generated physical backup:&lt;br /&gt;With CRS still online, identify the &lt;/span&gt;&lt;a href="http://www.idevelopment.info/data/Oracle/DBA_tips/Oracle10gRAC/CLUSTER_65.shtml#The+Master+Node" target="_blank"&gt;&lt;span style="font-size:85%;"&gt;master node&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt; (which in this example is racnode2) and all OCR backups using the ocrconfig -showbackup command:&lt;br /&gt;[root@racnode1 ~]# ocrconfig -showbackup&lt;br /&gt;racnode2     2009/10/07 12:05:18     /u01/app/crs/cdata/crs&lt;br /&gt;racnode2     2009/10/07 08:05:17     /u01/app/crs/cdata/crs&lt;br /&gt;racnode2     2009/10/07 04:05:17     /u01/app/crs/cdata/crs&lt;br /&gt;racnode2     2009/10/07 00:05:16     /u01/app/crs/cdata/crs&lt;br /&gt;racnode1     2009/09/24 08:49:19     /u01/app/crs/cdata/crs&lt;br /&gt;Note that ocrconfig -showbackup may result in a segmentation fault or simply not show any results if CRS is shutdown.&lt;br /&gt;&lt;/span&gt;&lt;a name="0.1_S2:_Identify_Configured_OCR_Files"&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;For documentation purposes, identify the number and location of all configured OCR files that will be recovered in this example.&lt;br /&gt;[root@racnode2 ~]# cat /etc/oracle/ocr.loc&lt;br /&gt;#Device/file /u02/oradata/racdb/OCRFile getting replaced by device /u02/oradata/racdb/OCRFile&lt;br /&gt;ocrconfig_loc=/u02/oradata/racdb/OCRFile&lt;br /&gt;ocrmirrorconfig_loc=/u02/oradata/racdb/OCRFile_mirror&lt;br /&gt;Although all OCR files have been lost or corrupted, the Oracle Clusterware daemons as well as the clustered database remain running. In this scenario, Oracle Clusterware and all managed resources need to be shut down in order to recover the OCR. Attempting to stop CRS using crsctl stop crs will fail given it cannot write to the now lost/corrupt OCR file:&lt;br /&gt;[root@racnode1 ~]# crsctl stop crs&lt;br /&gt;OCR initialization failed accessing OCR device: PROC-26: Error while accessing the physical storage Operating System error [No such file or directory] [2]&lt;br /&gt;With the environment in this unstable state, shutdown all database instances from all nodes in the cluster and then reboot each node:&lt;br /&gt;[oracle@racnode1 ~]$ sqlplus / as sysdba&lt;br /&gt;SQL&gt; shutdown immediate&lt;br /&gt;[root@racnode1 ~]# reboot&lt;br /&gt;------------------------------------------------&lt;br /&gt;[oracle@racnode2 ~]$ sqlplus / as sysdba&lt;br /&gt;SQL&gt; shutdown immediate&lt;br /&gt;[root@racnode2 ~]# reboot&lt;br /&gt;When the Oracle RAC nodes come back up, note that Oracle Clusterware will fail to start as a result of the lost/corrupt OCR file:&lt;br /&gt;[root@racnode1 ~]# crs_stat -t&lt;br /&gt;CRS-0184: Cannot communicate with the CRS daemon.&lt;br /&gt;[root@racnode2 ~]# crs_stat -t&lt;br /&gt;CRS-0184: Cannot communicate with the CRS daemon.&lt;br /&gt;When using a clustered file system, re-initialize both the primary OCR and the OCR mirror target locations identified earlier in the &lt;/span&gt;&lt;a href="http://www.idevelopment.info/data/Oracle/DBA_tips/Oracle10gRAC/CLUSTER_65.shtml#S2:+Identify+Configured+OCR+Files" target="_blank"&gt;&lt;span style="font-size:85%;"&gt;/etc/oracle/ocr.loc&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt; file:&lt;br /&gt;[root@racnode1 ~]# rm -f /u02/oradata/racdb/OCRFile&lt;br /&gt;[root@racnode1 ~]# cp /dev/null /u02/oradata/racdb/OCRFile&lt;br /&gt;[root@racnode1 ~]# chown root /u02/oradata/racdb/OCRFile&lt;br /&gt;[root@racnode1 ~]# chgrp oinstall /u02/oradata/racdb/OCRFile&lt;br /&gt;[root@racnode1 ~]# chmod 640 /u02/oradata/racdb/OCRFile&lt;br /&gt;[root@racnode1 ~]# rm -f /u02/oradata/racdb/OCRFile_mirror&lt;br /&gt;[root@racnode1 ~]# cp /dev/null /u02/oradata/racdb/OCRFile_mirror&lt;br /&gt;[root@racnode1 ~]# chown root /u02/oradata/racdb/OCRFile_mirror&lt;br /&gt;[root@racnode1 ~]# chgrp oinstall /u02/oradata/racdb/OCRFile_mirror&lt;br /&gt;[root@racnode1 ~]# chmod 640 /u02/oradata/racdb/OCRFile_mirror&lt;/span&gt;&lt;a name="0.1_table44"&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;NOTE: If the target OCR is located on a raw device(s), verify the permissions are applied correctly for an OCR file (owned by root:oinstall with 0640 permissions), that the device is being shared by all nodes in the cluster, and finally use the dd command from only one node in the cluster to zero out the device(s) and make sure no data is written to the raw device(s).&lt;br /&gt;[root@racnode1 ~]# ls -l /dev/raw/raw[12]&lt;br /&gt;crw-r----- 1 root oinstall 162, 1 Oct  7 15:00 /dev/raw/raw1&lt;br /&gt;crw-r----- 1 root oinstall 162, 2 Oct  7 15:00 /dev/raw/raw2&lt;br /&gt;[root@racnode2 ~]# ls -l /dev/raw/raw[12]&lt;br /&gt;crw-r----- 1 root oinstall 162, 1 Oct  7 14:59 /dev/raw/raw1&lt;br /&gt;crw-r----- 1 root oinstall 162, 2 Oct  7 14:59 /dev/raw/raw2&lt;br /&gt;[root@racnode1 ~]# dd if=/dev/zero of=/dev/raw/raw1 &lt;-- OCR (primary)&lt;br /&gt;[root@racnode1 ~]# dd if=/dev/zero of=/dev/raw/raw2 &lt;-- OCR (mirror)&lt;br /&gt;Before restoring the OCR, dump the contents of the physical backup you intend to recover from the &lt;/span&gt;&lt;a href="http://www.idevelopment.info/data/Oracle/DBA_tips/Oracle10gRAC/CLUSTER_65.shtml#The+Master+Node" target="_blank"&gt;&lt;span style="font-size:85%;"&gt;master node&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt; (racnode2) to validate its availability as well as the accuracy of its contents:&lt;br /&gt;[root@racnode2 ~]# ocrdump -backupfile /u01/app/crs/cdata/crs/backup00.ocr&lt;br /&gt;[root@racnode2 ~]# less OCRDUMPFILE&lt;br /&gt;With CRS down, perform the restore operation from the &lt;/span&gt;&lt;a href="http://www.idevelopment.info/data/Oracle/DBA_tips/Oracle10gRAC/CLUSTER_65.shtml#The+Master+Node" target="_blank"&gt;&lt;span style="font-size:85%;"&gt;master node&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt; (racnode2) by applying the latest automatically generated physical backup:&lt;br /&gt;[root@racnode2 ~]# ocrconfig -restore /u01/app/crs/cdata/crs/backup00.ocr&lt;br /&gt;Restart Oracle Clusterware on all of the nodes in the cluster by rebooting each node or by running the crsctl start crs command:&lt;br /&gt;[root@racnode1 ~]# crsctl start crs&lt;br /&gt;Attempting to start CRS stack&lt;br /&gt;The CRS stack will be started shortly&lt;br /&gt;[root@racnode2 ~]# crsctl start crs&lt;br /&gt;Attempting to start CRS stack&lt;br /&gt;The CRS stack will be started shortly&lt;br /&gt;Verify the OCR configuration by running the ocrcheck command:&lt;br /&gt;[root@racnode1 ~]# ocrcheck&lt;br /&gt;Status of Oracle Cluster Registry is as follows :&lt;br /&gt;         Version                  :          2&lt;br /&gt;         Total space (kbytes)     :     262120&lt;br /&gt;         Used space (kbytes)      :       4668&lt;br /&gt;         Available space (kbytes) :     257452&lt;br /&gt;         ID                       :    1331197&lt;br /&gt;         Device/File Name         : /u02/oradata/racdb/OCRFile&lt;br /&gt;                                    Device/File integrity check succeeded &lt;-- Primary OCR Restored&lt;br /&gt;         Device/File Name         : /u02/oradata/racdb/OCRFile_mirror&lt;br /&gt;                                    Device/File integrity check succeeded &lt;-- Mirror OCR Restored&lt;br /&gt;         Cluster registry integrity check succeeded&lt;br /&gt;As the oracle user account with user equivalence enabled on all the nodes, run the cluvfy command to validate the OCR configuration:&lt;br /&gt;[oracle@racnode1 ~]$ ssh racnode1 "hostname; date"&lt;br /&gt;racnode1&lt;br /&gt;Wed Oct  7 16:29:49 EDT 2009&lt;br /&gt;[oracle@racnode1 ~]$ ssh racnode2 "hostname; date"&lt;br /&gt;racnode2&lt;br /&gt;Wed Oct  7 16:29:06 EDT 2009&lt;br /&gt;[oracle@racnode1 ~]$ cluvfy comp ocr -n all&lt;br /&gt;Verifying OCR integrity&lt;br /&gt;Checking OCR integrity...&lt;br /&gt;Checking the absence of a non-clustered configuration...&lt;br /&gt;All nodes free of non-clustered, local-only configurations.&lt;br /&gt;Uniqueness check for OCR device passed.&lt;br /&gt;Checking the version of OCR...&lt;br /&gt;OCR of correct Version "2" exists.&lt;br /&gt;Checking data integrity of OCR...&lt;br /&gt;Data integrity check for OCR passed.&lt;br /&gt;OCR integrity check passed.&lt;br /&gt;Verification of OCR integrity was successful.&lt;br /&gt;Finally, verify the applications are running:&lt;br /&gt;[root@racnode1 ~]# crs_stat -t&lt;br /&gt;Name           Type           Target    State     Host&lt;br /&gt;------------------------------------------------------------&lt;br /&gt;ora.racdb.db   application    ONLINE    ONLINE    racnode1&lt;br /&gt;ora....b1.inst application    ONLINE    ONLINE    racnode1&lt;br /&gt;ora....b2.inst application    ONLINE    ONLINE    racnode2&lt;br /&gt;ora....srvc.cs application    ONLINE    ONLINE    racnode2&lt;br /&gt;ora....db1.srv application    ONLINE    ONLINE    racnode1&lt;br /&gt;ora....db2.srv application    ONLINE    ONLINE    racnode2&lt;br /&gt;ora....SM1.asm application    ONLINE    ONLINE    racnode1&lt;br /&gt;ora....E1.lsnr application    ONLINE    ONLINE    racnode1&lt;br /&gt;ora....de1.gsd application    ONLINE    ONLINE    racnode1&lt;br /&gt;ora....de1.ons application    ONLINE    ONLINE    racnode1&lt;br /&gt;ora....de1.vip application    ONLINE    ONLINE    racnode1&lt;br /&gt;ora....SM2.asm application    ONLINE    ONLINE    racnode2&lt;br /&gt;ora....E2.lsnr application    ONLINE    ONLINE    racnode2&lt;br /&gt;ora....de2.gsd application    ONLINE    ONLINE    racnode2&lt;br /&gt;ora....de2.ons application    ONLINE    ONLINE    racnode2&lt;br /&gt;ora....de2.vip application    ONLINE    ONLINE    racnode2&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-705895392952402834?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/705895392952402834/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/05/recover-ocr-from-valid-ocr-mirror.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/705895392952402834'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/705895392952402834'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/05/recover-ocr-from-valid-ocr-mirror.html' title='Recover OCR from Valid OCR Mirror'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-1806180422012502260</id><published>2010-05-04T22:44:00.000-07:00</published><updated>2010-05-04T22:50:03.811-07:00</updated><title type='text'>The Master Node determination in oracle RAC</title><content type='html'>&lt;p&gt;&lt;span style="font-size:85%;"&gt;The CRSD process only creates automatic OCR physical backups on one node in the cluster, which is the OCR master node. It does not create automatic backup copies on the other nodes; only from the OCR master node. If the master node fails, the OCR backups will be created from the new master node. You can determine which node in the cluster is the master node by examining the $ORA_CRS_HOME/log/&lt;node_name&gt;/cssd/ocssd.log file on any node in the cluster. In this log file, check for reconfiguration information (reconfiguration successful) after which you will see which node is the master and how many nodes are active in the cluster:&lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;color:#660000;"&gt;Node 1 - (racnode1)&lt;br /&gt;[    CSSD]CLSS-3000: reconfiguration successful, incarnation 1 with 2 nodes&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 1&lt;br /&gt;Node 2 - (racnode2)&lt;br /&gt;[    CSSD]CLSS-3000: reconfiguration successful, incarnation 1 with 2 nodes&lt;br /&gt;[    CSSD]CLSS-3001: local node number 2, master node number 1&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;Another quick approach is to use either of the following methods:&lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;color:#660000;"&gt;Node 1 - (racnode1)&lt;br /&gt;# grep -i "master node" $ORA_CRS_HOME/log/racnode?/cssd/ocssd.log  tail -1&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 1&lt;br /&gt;Node 2 - (racnode2)&lt;br /&gt;# grep -i "master node" $ORA_CRS_HOME/log/racnode?/cssd/ocssd.log  tail -1&lt;br /&gt;[    CSSD]CLSS-3001: local node number 2, master node number 1  &lt;br /&gt;# If not found in the ocssd.log, then look through all&lt;br /&gt;# of the ocssd archives:&lt;br /&gt;Node 1 - (racnode1)&lt;br /&gt;# for x in 'ls -tr $ORA_CRS_HOME/log/racnode?/cssd/ocssd.*'&lt;br /&gt;do grep -i "master node" $x; done  tail -1&lt;br /&gt;[    CSSD]CLSS-3001: local node number 1, master node number 1&lt;br /&gt;Node 2 - (racnode2)&lt;br /&gt;# for x in 'ls -tr $ORA_CRS_HOME/log/racnode?/cssd/ocssd.*'&lt;br /&gt;do grep -i "master node" $x; done  tail -1&lt;br /&gt;[    CSSD]CLSS-3001: local node number 2, master node number 1  &lt;br /&gt;# The master node information is confirmed by the&lt;br /&gt;# ocrconfig -showbackup command:&lt;br /&gt;# ocrconfig -showbackup&lt;br /&gt;racnode1     2009/09/29 13:05:22     /u01/app/crs/cdata/crs&lt;br /&gt;racnode1     2009/09/29 09:05:22     /u01/app/crs/cdata/crs&lt;br /&gt;racnode1     2009/09/29 05:05:22     /u01/app/crs/cdata/crs&lt;br /&gt;racnode1     2009/09/28 05:05:21     /u01/app/crs/cdata/crs&lt;br /&gt;racnode1     2009/09/22 05:05:13     /u01/app/crs/cdata/crs&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;You can use any backup software to copy the automatically generated physical backup files to a stable backup location: &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;color:#660000;"&gt;[root@racnode1 ~]# cp -p -v -f -R /u01/app/crs/cdata /u02/crs_backup/ocrbackup/RACNODE1&lt;br /&gt;'/u01/app/crs/cdata/crs/day_.ocr' -&gt; '/u02/crs_backup/ocrbackup/RACNODE1/cdata/crs/day_.ocr'&lt;br /&gt;'/u01/app/crs/cdata/crs/backup02.ocr' -&gt; '/u02/crs_backup/ocrbackup/RACNODE1/cdata/crs/backup02.ocr'&lt;br /&gt;'/u01/app/crs/cdata/crs/backup01.ocr' -&gt; '/u02/crs_backup/ocrbackup/RACNODE1/cdata/crs/backup01.ocr'&lt;br /&gt;'/u01/app/crs/cdata/crs/week_.ocr' -&gt; '/u02/crs_backup/ocrbackup/RACNODE1/cdata/crs/week_.ocr'&lt;br /&gt;'/u01/app/crs/cdata/crs/day.ocr' -&gt; '/u02/crs_backup/ocrbackup/RACNODE1/cdata/crs/day.ocr'&lt;br /&gt;'/u01/app/crs/cdata/crs/backup00.ocr' -&gt; '/u02/crs_backup/ocrbackup/RACNODE1/cdata/crs/backup00.ocr'&lt;br /&gt;'/u01/app/crs/cdata/crs/week.ocr' -&gt; '/u02/crs_backup/ocrbackup/RACNODE1/cdata/crs/week.ocr'&lt;br /&gt;[root@racnode2 ~]# cp -p -v -f -R /u01/app/crs/cdata /u02/crs_backup/ocrbackup/RACNODE2&lt;br /&gt;'/u01/app/crs/cdata/crs/day_.ocr' -&gt; '/u02/crs_backup/ocrbackup/RACNODE2/cdata/crs/day_.ocr'&lt;br /&gt;'/u01/app/crs/cdata/crs/backup02.ocr' -&gt; '/u02/crs_backup/ocrbackup/RACNODE2/cdata/crs/backup02.ocr'&lt;br /&gt;'/u01/app/crs/cdata/crs/backup01.ocr' -&gt; '/u02/crs_backup/ocrbackup/RACNODE2/cdata/crs/backup01.ocr'&lt;br /&gt;'/u01/app/crs/cdata/crs/week_.ocr' -&gt; '/u02/crs_backup/ocrbackup/RACNODE2/cdata/crs/week_.ocr'&lt;br /&gt;'/u01/app/crs/cdata/crs/day.ocr' -&gt; '/u02/crs_backup/ocrbackup/RACNODE2/cdata/crs/day.ocr'&lt;br /&gt;'/u01/app/crs/cdata/crs/backup00.ocr' -&gt; '/u02/crs_backup/ocrbackup/RACNODE2/cdata/crs/backup00.ocr'&lt;br /&gt;'/u01/app/crs/cdata/crs/week.ocr' -&gt; '/u02/crs_backup/ocrbackup/RACNODE2/cdata/crs/week.ocr'&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;Manual OCR Exports :&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;Performing a manual export of the OCR should be done before and after making significant configuration changes to the cluster, such as adding or deleting nodes from your environment, modifying Oracle Clusterware resources, or creating a database. This type of backup is often referred to as a logical backup. &lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;color:#660000;"&gt;ocrconfig -export &lt;backup_file_name&gt;&lt;br /&gt;For example: &lt;/span&gt;&lt;a name="0.1_table36"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="0.1_OCR_Backup:_Manual_OCR_Logical_Backup"&gt;&lt;/a&gt;&lt;span style="font-size:85%;color:#660000;"&gt;[root@racnode1 ~]# ocrconfig -export /u02/crs_backup/ocrbackup/RACNODE1/exports/OCRFileBackup.dmp&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;To restore the OCR from an export/logical backup, use the ocrconfig –import command-&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;To restore the OCR from an export/logical backup, use the ocrconfig –import command. Note that the CRS stack needs to be shutdown on all nodes in the cluster prior to running the restore operation. In addition, the total space required for the restored OCR location (typically 280MB) has to be pre-allocated. This is especially important when the OCR is located on a clustered file system like OCFS2.&lt;br /&gt;&lt;span style="color:#660000;"&gt;ocrconfig –import &lt;export_file_name&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;You cannot restore the OCR from a logical backup using the -restore option. The only method to restore the OCR from a logical export is to use the -import option.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-1806180422012502260?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/1806180422012502260/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/05/master-node-determination-in-oracle-rac.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/1806180422012502260'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/1806180422012502260'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/05/master-node-determination-in-oracle-rac.html' title='The Master Node determination in oracle RAC'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-585564306126443586</id><published>2010-05-04T02:55:00.000-07:00</published><updated>2010-05-04T02:58:25.248-07:00</updated><title type='text'>clustering_factor</title><content type='html'>&lt;span style="font-size:85%;"&gt;The &lt;span style="color:#660000;"&gt;clustering_factor&lt;/span&gt; measures how synchronized an index is with the data in a table.  A table with a high clustering factor is out-of-sequence with the rows and large index range scans will consume lots of I/O.  Conversely, an index with a low clustering_factor is closely aligned with the table and related rows reside together of each data block, making indexes very desirable for optimal access.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5288221630246612894-585564306126443586?l=rohitsinhago.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rohitsinhago.blogspot.com/feeds/585564306126443586/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rohitsinhago.blogspot.com/2010/05/clusteringfactor.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/585564306126443586'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5288221630246612894/posts/default/585564306126443586'/><link rel='alternate' type='text/html' href='http://rohitsinhago.blogspot.com/2010/05/clusteringfactor.html' title='clustering_factor'/><author><name>ROHIT SINHA</name><uri>http://www.blogger.com/profile/05036955460075316651</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='32' src='http://2.bp.blogspot.com/_d4Ea1_28n9g/S1Hv1zmjs5I/AAAAAAAAAVk/FiYNbpI_yL4/S220/n1080084244_69.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5288221630246612894.post-6213250285411622401</id><published>2010-05-04T02:34:00.000-07:00</published><updated>2010-05-04T02:37:41.096-07:00</updated><title type='text'>patch deploy Process on Test enviorment</title><content type='html'>[oracle@rac1 bdump]$ cd /u01/app/oracle/product/10.2.0/crs_1/OPatch&lt;br /&gt;[oracle@rac1 OPatch]$ ./opatch lsinventory -detail -oh /u01/app/oracle/product/10.2.0/crs_1/&lt;br /&gt;Invoking OPatch 10.2.0.4.8&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Oracle Interim Patch Installer version 10.2.0.4.8&lt;br /&gt;Copyright (c) 2009, Oracle Corporation.  All rights reserved.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Oracle Home       : /u01/app/oracle/product/10.2.0/crs_1&lt;br /&gt;Central Inventory : /u01/app/oracle/oraInventory&lt;br /&gt;   from           : /etc/oraInst.loc&lt;br /&gt;OPatch version    : 10.2.0.4.8&lt;br /&gt;OUI version       : 10.2.0.4.0&lt;br /&gt;OUI location      : /u01/app/oracle/product/10.2.0/crs_1//oui&lt;br /&gt;Log file location : /u01/app/oracle/product/10.2.0/crs_1/cfgtoollogs/opatch/opatch2009-11-27_18-53-59PM.log&lt;br /&gt;&lt;br /&gt;Patch history file: /u01/app/oracle/product/10.2.0/crs_1/cfgtoollogs/opatch/opatch_history.txt&lt;br /&gt;&lt;br /&gt;Lsinventory Output file location : /u01/app/oracle/product/10.2.0/crs_1/cfgtoollogs/opatch/lsinv/lsinventory2009-11-27_18-53-59PM.txt&lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;Installed Top-level Products (2):&lt;br /&gt;&lt;br /&gt;Oracle Clusterware                                                   10.2.0.1.0&lt;br /&gt;Oracle Database 10g Release 2 Patch Set 3                            10.2.0.4.0&lt;br /&gt;There are 2 products installed in this Oracle Home.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;[oracle@rac1 crsd]$ cd /u01/app/oracle/product/10.2.0/crs_1/OPatch&lt;br /&gt;[oracle@rac1 OPatch]$  ./opatch lsinventory -detail -oh /u01/app/oracle/product/10.2.0/db_1/&lt;br /&gt;&lt;br /&gt;Invoking OPatch 10.2.0.4.8&lt;br /&gt;&lt;br /&gt;Oracle Interim Patch Installer version 10.2.0.4.8&lt;br /&gt;Copyright (c) 2009, Oracle Corporation.  All rights reserved.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Oracle Home       : /u01/app/oracle/product/10.2.0/db_1&lt;br /&gt;Central Inventory : /u01/app/oracle/oraInventory&lt;br /&gt;   from           : /etc/oraInst.loc&lt;br /&gt;OPatch version    : 10.2.0.4.8&lt;br /&gt;OUI version       : 10.2.0.4.0&lt;br /&gt;OUI location      : /u01/app/oracle/product/10.2.0/db_1//oui&lt;br /&gt;Log file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2009-11-27_18-54-40PM.log&lt;br /&gt;&lt;br /&gt;Patch history file: /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt&lt;br /&gt;&lt;br /&gt;Lsinventory Output file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2009-11-27_18-54-40PM.txt&lt;br /&gt;&lt;br /&gt;root@rac1 ~]# cd /home/oracle/8705958/&lt;br /&gt;[root@rac1 8705958]# ls&lt;br /&gt;custom  etc  files  README.txt&lt;br /&gt;[root@rac1 8705958]# custom/scripts/prerootpatch.sh -crshome /u01/app/oracle/product/10.2.0/crs_1/ -crsuser oracle&lt;br /&gt;Checking to see if Oracle CRS stack is down...&lt;br /&gt;Oracle CRS stack is down now.&lt;br /&gt;&lt;br /&gt;[root@rac1 8705958]# !su&lt;br /&gt;su - oracle&lt;br /&gt;[oracle@rac1 ~]$ cd 8705958/&lt;br /&gt;[oracle@rac1 8705958]$ custom/scripts/prepatch.sh -crshome /u01/app/oracle/product/10.2.0/crs_1/[oracle@rac1 8705958]$ custom/scripts/prepatch.sh -crshome /u01/app/oracle/product/10.2.0/crs_1/&lt;br /&gt;custom/scripts/prepatch.sh completed successfully.&lt;br /&gt;[oracle@rac1 8705958]$&lt;br /&gt;&lt;br /&gt;[oracle@rac1 8705958]$ ls&lt;br /&gt;custom  etc  files  README.txt&lt;br /&gt;[oracle@rac1 8705958]$ custom/server/8705958/custom/scripts/prepatch.sh -dbhome /u01/app/oracle/product/10.2.0/db_1/&lt;br /&gt;Unable to determine value for ORACLE_BASE. Ignoring...&lt;br /&gt;custom/server/8705958/custom/scripts/prepatch.sh completed successfully.&lt;br /&gt;&lt;br /&gt;[oracle@rac1 8705958]$ pwd&lt;br /&gt;/home/oracle/8705958&lt;br /&gt;&lt;br /&gt;[oracle@rac1 8705958]$ /u01/app/oracle/product/10.2.0/crs_1/OPatch/opatch napply -local -oh /u01/app/oracle/product/10.2.0/crs_1/ -id 8705958&lt;br /&gt;Invoking OPatch 10.2.0.4.8&lt;br /&gt;&lt;br /&gt;Oracle Interim Patch Installer version 10.2.0.4.8&lt;br /&gt;Copyright (c) 2009, Oracle Corporation.  All rights reserved.&lt;br /&gt;&lt;br /&gt;UTIL session&lt;br /&gt;&lt;br /&gt;Oracle Home       : /u01/app/oracle/product/10.2.0/crs_1&lt;br /&gt;Central Inventory : /u01/app/oracle/oraInventory&lt;br /&gt;   from           : /etc/oraInst.loc&lt;br /&gt;OPatch version    : 10.2.0.4.8&lt;br /&gt;OUI version       : 10.2.0.4.0&lt;br /&gt;OUI location      : /u01/app/oracle/product/10.2.0/crs_1//oui&lt;br /&gt;Log file location : /u01/app/oracle/product/10.2.0/crs_1/cfgtoollogs/opatch/opatch2009-11-27_19-07-24PM.log&lt;br /&gt;&lt;br /&gt;Patch history file: /u01/app/oracle/product/10.2.0/crs_1/cfgtoollogs/opatch/opatch_history.txt&lt;br /&gt;&lt;br /&gt;Invoking utility "napply"&lt;br /&gt;hecking conflict among patches...&lt;br /&gt;Checking if Oracle Home has components required by patches...&lt;br /&gt;Checking conflicts against Oracle Home...&lt;br /&gt;OPatch continues with these patches:   8705958&lt;br /&gt;&lt;br /&gt;Do you want to proceed? [yn]&lt;br /&gt;y&lt;br /&gt;User Responded with: Y&lt;br /&gt;&lt;br /&gt;Running prerequisite checks...&lt;br /&gt;User Responded with: Y&lt;br /&gt;&lt;br /&gt;Running prerequisite checks...&lt;br /&gt;Provide your email address to be informed of security issues, install and&lt;br /&gt;initiate Oracle Configuration Manager. Easier for you if you use your My&lt;br /&gt;Oracle Support Email address/User Name.&lt;br /&gt;Visit http://www.oracle.com/support/policies.html for details.&lt;br /&gt;Email address/User Name:&lt;br /&gt;&lt;br /&gt;You have not provided an email address for notification of security issues.&lt;br /&gt;Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]:  Y&lt;br /&gt;You selected -local option, hence OPatch will patch the local system only.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.&lt;br /&gt;You selected -local option, hence OPatch will patch the local system only.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.&lt;br /&gt;(Oracle Home = '/u01/app/oracle/product/10.2.0/crs_1')&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Is the local system ready for patching? [yn]&lt;br /&gt;User Responded with: Y&lt;br /&gt;Backing up files affected by the patch 'NApply' for restore. This might take a while...&lt;br /&gt;Execution of 'sh /home/oracle/8705958/custom/scripts/pre -apply 8705958 ':&lt;br /&gt;&lt;br /&gt;/bin/chmod: changing permissions of `/home/oracle/8705958/custom/scripts/prepatchverify.sh': Operation not permitted&lt;br /&gt;Pre-patch script verification complete.&lt;br /&gt;Verification exit code 0&lt;br /&gt;Execution of 'sh /home/oracle/8705958/custom/scripts/pre -apply 8705958 ':&lt;br /&gt;&lt;br /&gt;/bin/chmod: changing permissions of `/home/oracle/8705958/custom/scripts/prepatchverify.sh': Operation not permitted&lt;br /&gt;Pre-patch script verification complete.&lt;br /&gt;Verification exit code 0&lt;br /&gt;&lt;br /&gt;Return Code = 0&lt;br /&gt;&lt;br /&gt;Applying patch 8705958...&lt;br /&gt;&lt;br /&gt;ApplySession applying interim patch '8705958' to OH '/u01/app/oracle/product/10.2.0/crs_1'&lt;br /&gt;Backing up files affected by the patch '8705958' for rollback. This might take a while...&lt;br /&gt;&lt;br /&gt;Patching component oracle.crs, 10.2.0.4.0...&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/bin/cemutlo"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/bin/cemutlo.bin"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/bin/cemutls"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/bin/cemutls.bin"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/bin/clscfg"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/bin/clscfg.bin"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/bin/clsfmt"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/bin/clsfmt.bin"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/bin/clsid"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/bin/clsid.bin"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/bin/cluutil"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/bin/cluvfy"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/bin/crs_getperm"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/bin/crs_getperm.bin"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/bin/crs_profile"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/bin/crs_profile.bin"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/bin/crs_register"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/bin/crs_register.bin"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/bin/crs_relocate"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/bin/crs_relocate.bin"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/bin/crs_setperm"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/bin/crs_setperm.bin"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/bin/crs_start"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/bin/crs_start.bin"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/bin/crs_stat"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/bin/crs_stat.bin"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/bin/crs_stop"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/bin/crs_stop.bin"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/bin/crs_unregister"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/bin/crs_unregister.bin"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/bin/crsctl"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/bin/crsctl.bin"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/bin/crsd"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/bin/crsd.bin"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/css/admin/init.cssd"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/css/mesg/clssar.msb"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/css/mesg/clsscs.msb"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/css/mesg/clssd.msb"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/css/mesg/clssdk.msb"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/css/mesg/clsse.msb"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/css/mesg/clssel.msb"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/css/mesg/clssf.msb"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/css/mesg/clsshu.msb"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/css/mesg/clssi.msb"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/css/mesg/clssiw.msb"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/css/mesg/clssja.msb"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/css/mesg/clssko.msb"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/css/mesg/clssn.msb"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/css/mesg/clssnl.msb"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/css/mesg/clsspl.msb"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/css/mesg/clsspt.msb"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/css/mesg/clssptb.msb"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/css/mesg/clssro.msb"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/css/mesg/clssru.msb"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/css/mesg/clsss.msb"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/css/mesg/clsssf.msb"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/css/mesg/clsssk.msb"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/css/mesg/clssth.msb"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/css/mesg/clsstr.msb"&lt;br /&gt;Copying file to "/u01/app/oracle/product/10.2.0/crs_1/css/mesg/clssus.msb"&lt;br /&gt;Copying file to "/u01/app/oracle/product/1
