<?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-6987474324062764228</id><updated>2012-01-04T09:32:07.987-08:00</updated><title type='text'>EXPLORING ORACLE</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://arulselvaraj.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://arulselvaraj.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Arul</name><uri>http://www.blogger.com/profile/07889868459610579865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp3.blogger.com/__dynQ-Lq5NM/SCeNVa75UAI/AAAAAAAAACE/qyNxLdSLtzo/S220/90970001.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>31</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6987474324062764228.post-5356169213978873479</id><published>2011-05-09T18:22:00.000-07:00</published><updated>2011-05-09T18:25:46.440-07:00</updated><title type='text'>ORA-27546: Oracle compiled against IPC interface version 3.2 found version 3.3</title><content type='html'>&lt;strong&gt;Background:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Customer upgraded 10204 CRS and ASM to 11202 Grid Infrastructure.&lt;br /&gt;Customer upgraded his 10204 Databases to 11202 Database.&lt;br /&gt;Customer verified all the jobs and application to be working fine.&lt;br /&gt;Customer uninstalled OLD 10204 CRS, ASM &amp; Database home.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Symptoms:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Their nightly export job failed with following error.&lt;br /&gt;&lt;br /&gt;UDE-27546: operation generated ORACLE error 27546&lt;br /&gt;ORA-27546: Oracle compiled against IPC interface version 3.2 found version 3.3&lt;br /&gt;&lt;br /&gt;Further investigation revealed that even normal connections to 11202 database was failing with following error.&lt;br /&gt;&lt;br /&gt;ORA-27546: Oracle compiled against IPC interface version 3.2 found version 3.3&lt;br /&gt;&lt;br /&gt;Cause:&lt;br /&gt;Further research revealed that the error was caused due to library mismatch their RAC Nodes for libskgxp10.so in $ORACLE_HOME/lib.&lt;br /&gt;&lt;br /&gt;Apparently, this library was found to have different timestamp and size between node 1 and rest of the nodes in cluster which is caused by Bug: 5474623 - DEINSTALL OF ONE ORACLE HOME AFFECTS ANOTHER ORACLE HOME.&lt;br /&gt;&lt;br /&gt;As per the bug, OUI picks up the environment ORACLE_HOME variable and cleans up the library file libskgxp10.so from that particular ORACLE_HOME irrespective of which ORACLE_HOME you are uninstalling.&lt;br /&gt; &lt;br /&gt;Customer uninstalled 10204 CRS, ASM and DB home while ORACLE_HOME environment variable was set to 11202 Database home.&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br /&gt;Copy the good copy of libskgxp10.so from any other node (11202 ORACLE_HOME/lib) in the cluster to the problematic node (11202 ORACLE_HOME/lib) from where uninstall was started.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6987474324062764228-5356169213978873479?l=arulselvaraj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arulselvaraj.blogspot.com/feeds/5356169213978873479/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6987474324062764228&amp;postID=5356169213978873479' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/5356169213978873479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/5356169213978873479'/><link rel='alternate' type='text/html' href='http://arulselvaraj.blogspot.com/2011/05/background-customer-upgraded-10204-crs.html' title='ORA-27546: Oracle compiled against IPC interface version 3.2 found version 3.3'/><author><name>Arul</name><uri>http://www.blogger.com/profile/07889868459610579865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp3.blogger.com/__dynQ-Lq5NM/SCeNVa75UAI/AAAAAAAAACE/qyNxLdSLtzo/S220/90970001.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6987474324062764228.post-8136046562566417602</id><published>2011-02-09T15:15:00.000-08:00</published><updated>2011-02-09T15:57:57.555-08:00</updated><title type='text'>/etc/oratab &amp; # line added by Agent</title><content type='html'>We upgraded our Oracle technology stack from 10204 to 11202. We are running Oracle Grid infrastructure 11202 on 4 node RAC, which has many 11202 database running it.&lt;br /&gt;&lt;br /&gt;We use /etc/oratab extensively on all our scripts. For example: backup scripts, application scripts which needs to connect to database etc..&lt;br /&gt;&lt;br /&gt;In a RAC environment /etc/oratab only contains the DB_UNIQUE_NAME for cluster database instead of ORACLE_SID And most of our scripts use ORACLE_SID instead of DB_UNIQUE_NAME. As result of this we modifed /etc/oratab to point to ORACLE_SID rather than DB_UNIQUE_NAME. Thiw worked well in 10g. &lt;br /&gt;&lt;br /&gt;Since we upgraded to Oracle 11202, we started having new entry in our /etc/oratab with DB_UNIQUE_NAME like below.&lt;br /&gt;&lt;br /&gt;TEST:/app/oracle/db/11.2/db_1:N               # line added by Agent&lt;br /&gt;PROD:/app/oracle/db/11.2/db_1:N                # line added by Agent&lt;br /&gt;DR:/app/oracle/db/11.2/db_1:N                # line added by Agent&lt;br /&gt;&lt;br /&gt;This cause most of our scripts to fail and as result I modified the /etc/oratab manually and removed those entries and surprisingly in couple of days those entries will come back and our script will fail all over again.&lt;br /&gt;&lt;br /&gt;I looked up in google and metalink and found couple of bugs which said that its an expected behaviour but no one explained why this is happening or who updates the /etc/oratab at regular intervals.&lt;br /&gt;&lt;br /&gt;Further research revealed that ORACLE agent updates the /etc/oratab everytime you restart the database.&lt;br /&gt;&lt;br /&gt;Logfile /app/oracle/grid/11.2/grid_1/log/node01/agent/crsd/oraagent_oracle has the following entries to confirm that.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;oraagent_oracle.l01:2011-02-10 08:35:52.745: [ora.test.db][1346505024] {1:35347:18516} [start] sUpdateOratab oratab is /etc/oratab&lt;br /&gt;oraagent_oracle.l01:2011-02-10 08:35:52.760: [ora.test.db][1346505024] {1:35347:18516} [start] ConfigFile::updateInPlace file /etc/oratab is updated&lt;br /&gt;oraagent_oracle.l01:2011-02-10 08:37:06.316: [ora.test.db][3187673408] {1:35347:18560} [start] sUpdateOratab oratab is /etc/oratab&lt;br /&gt;oraagent_oracle.l01:2011-02-10 08:37:06.329: [ora.test.db][3187673408] {1:35347:18560} [start] ConfigFile::updateInPlace file /etc/oratab is updated&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Based on that,  we can say that, &lt;br /&gt;&lt;br /&gt;The oratab file entry is also updated automatically by the oraagent - New process introduced in 11g (not to be confused with Oracle EM agent) when a database started or shutdown.&lt;br /&gt;&lt;br /&gt;Oracle creates an entry for each Oracle RAC database in the oratab configuration file Database name or DB_UNIQUE_NAME and not the ORACLE_SID. The oratab file is created by the root.sh script during installation, and it is updated by the Database Configuration Assistant when creating or deleting a database.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6987474324062764228-8136046562566417602?l=arulselvaraj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arulselvaraj.blogspot.com/feeds/8136046562566417602/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6987474324062764228&amp;postID=8136046562566417602' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/8136046562566417602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/8136046562566417602'/><link rel='alternate' type='text/html' href='http://arulselvaraj.blogspot.com/2011/02/etcoratab-line-added-by-agent.html' title='/etc/oratab &amp; # line added by Agent'/><author><name>Arul</name><uri>http://www.blogger.com/profile/07889868459610579865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp3.blogger.com/__dynQ-Lq5NM/SCeNVa75UAI/AAAAAAAAACE/qyNxLdSLtzo/S220/90970001.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6987474324062764228.post-8429663304028967288</id><published>2011-02-07T20:39:00.000-08:00</published><updated>2011-02-09T15:14:54.744-08:00</updated><title type='text'>ORA-15186: ASMLIB error function = [asm_open], error = [1], mesg = [Operation not permitted]</title><content type='html'>Recently, I was involved in OS rolling upgrade for 3-node RAC running on 10204 with ASMLIB. I had performed quite a few OS rolling upgrades in past so I had my checklist or documentation handy on steps to re-configure ASMLIB.&lt;br /&gt;&lt;br /&gt;The upgrade worked fine on node 1 and ASM re-configuration worked fine. However on node 2, after patching OS and re-configuring ASMLIB, asm disk group failed mount with folowing error.&lt;br /&gt;&lt;br /&gt;ORA-15186: ASMLIB error function = [asm_open], error = [1], mesg = [Operation not permitted]&lt;br /&gt;&lt;br /&gt;Based on my previous experience, I was positive that this error is related multipathing. Most probably the root cause is ORACLE_SCANORDER parameter in /etc/sysconfig/oracleasm file.&lt;br /&gt;&lt;br /&gt;I verified the value and it was set correctly as below.&lt;br /&gt;&lt;br /&gt;# ORACLEASM_SCANORDER: Matching patterns to order disk scanning&lt;br /&gt;ORACLEASM_SCANORDER="dm"&lt;br /&gt;&lt;br /&gt;My asm commands, querydisk, listdisk, scandisk were working fine.&lt;br /&gt;&lt;br /&gt;However, ASM diskgroup failed to mount with above errors.&lt;br /&gt;&lt;br /&gt;To further investigate, I checked /dev/oracleasm/disks and /proc/partitions&lt;br /&gt;&lt;br /&gt;ls -l /dev/oracleasm/disks&lt;br /&gt;total 0&lt;br /&gt;brw-rw---- 1 oracle dba 65,  176 Feb  6 17:04 TESTORA2_ASM1&lt;br /&gt;brw-rw---- 1 oracle dba 65,  192 Feb  6 17:04 TESTORA2_ASM2&lt;br /&gt;brw-rw---- 1 oracle dba 65,  208 Feb  6 17:04 TESTORA2_ASM3&lt;br /&gt;brw-rw---- 1 oracle dba 65,  224 Feb  6 17:04 TESTORA2_ASM4&lt;br /&gt;&lt;br /&gt;cat /proc/partitions&lt;br /&gt;....&lt;br /&gt;....&lt;br /&gt;....&lt;br /&gt;65   176  209715200 sdab&lt;br /&gt;65   192  209715200 sdac&lt;br /&gt;65   208  209715200 sdad&lt;br /&gt;65   224  209715200 sdae&lt;br /&gt;....&lt;br /&gt;....&lt;br /&gt;....&lt;br /&gt;253     9  209715200 dm-9&lt;br /&gt;253    10  209715200 dm-10&lt;br /&gt;253    11  209715200 dm-11&lt;br /&gt;253    12  209715200 dm-12&lt;br /&gt;....&lt;br /&gt;....&lt;br /&gt;....&lt;br /&gt;&lt;br /&gt;If you compare above to output you can see that my ls -l /dev/oracleasm/disks output (major, minor) matches to cat /proc/paritions outpu (major, minor) sd* disks and not dm-* disks. Even though my ORACLEASM_SCANORDER="dm" set correctly, ASM is not looking at the multipath disks but a single disks.&lt;br /&gt;&lt;br /&gt;I tried restarting ASM service couple of times and it didn't help. I tried changing the ORACLEASM_SCANORDER="sd" as well and still no luck. Based on this, I thought for some reason ASMLIB was not reading the /etc/sysconfig/oracleasm file at all.&lt;br /&gt;&lt;br /&gt;I decided to raise the SR with Oracle support and luckily I got a call from very knowlegeble senior support analyst and he confirmed that using the strace on /etc/init.d/oracleasm start command.&lt;br /&gt;&lt;br /&gt;In strace it was visible that instead of reading the /etc/sysconfig/oracleasm file it was reading the file called oracleasm-_dev_oracleasm.&lt;br /&gt;&lt;br /&gt;We ran ls command on other sever to compare with this server.&lt;br /&gt;&lt;br /&gt;On working server&lt;br /&gt;------------------&lt;br /&gt;&lt;br /&gt;ls -l /etc/sysconfig/oracleasm*&lt;br /&gt;&lt;br /&gt;lrwxrwxrwx 1 root root  24 Feb  6 16:57 oracleasm -&gt; oracleasm-_dev_oracleasm&lt;br /&gt;-rw-r--r-- 1 root root 776 Feb  6 17:00 oracleasm-_dev_oracleasm&lt;br /&gt;-rw-r--r-- 1 root root 863 May 12  2010 oracleasm.rpmsave&lt;br /&gt;&lt;br /&gt;On a Problematic Server&lt;br /&gt;------------------------&lt;br /&gt;&lt;br /&gt;ls -l oracleasm*&lt;br /&gt;-rw-r--r--  1 root root  24 Feb  6 16:57 oracleasm &lt;br /&gt;-rw-r--r-- 1 root root 776 Feb  6 17:00 oracleasm-_dev_oracleasm&lt;br /&gt;-rw-r--r-- 1 root root 863 May 12  2010 oracleasm.rpmsave&lt;br /&gt;&lt;br /&gt;You can see that a on a problematic server, oracleasm is a text file instead of symbolic link. Further investigation revealed that while cleanup of OLD ASMLIB,  file oracleasm-_dev_oracleasm was left out and due to this new installtion failed to create the symbolic link.&lt;br /&gt;&lt;br /&gt;I recreated the symbolic link manually and changed the ORACLEASM_SCANORDER="dm" and restarted the ASM service and all started working properly.&lt;br /&gt;&lt;br /&gt;Hope this helps...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6987474324062764228-8429663304028967288?l=arulselvaraj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arulselvaraj.blogspot.com/feeds/8429663304028967288/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6987474324062764228&amp;postID=8429663304028967288' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/8429663304028967288'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/8429663304028967288'/><link rel='alternate' type='text/html' href='http://arulselvaraj.blogspot.com/2011/02/ora-15186-asmlib-error-function-asmopen.html' title='ORA-15186: ASMLIB error function = [asm_open], error = [1], mesg = [Operation not permitted]'/><author><name>Arul</name><uri>http://www.blogger.com/profile/07889868459610579865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp3.blogger.com/__dynQ-Lq5NM/SCeNVa75UAI/AAAAAAAAACE/qyNxLdSLtzo/S220/90970001.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6987474324062764228.post-2751023404770266953</id><published>2011-01-17T21:28:00.000-08:00</published><updated>2011-01-24T02:21:43.801-08:00</updated><title type='text'>DBMS_REDEFINITION.COPY_TABLE_DEPENDENTS Failed with ORA-01408: such column list already indexed</title><content type='html'>Recently I was engaged in exercise to partition a table in a database. I was using a DBMS_REDEFINITION package to partition the online. &lt;br /&gt;&lt;br /&gt;As per documentation, &lt;br /&gt;&lt;br /&gt;There may be times when you want to override the actions of DBMS_REDEFINITION.COPY_TABLE_DEPENDENTS( ). For example, an index must be moved to a different tablespace. This can be achieved by making the relevant changes on the interim table, and then using DBMS_REDEFINITION.REGISTER_DEPENDENT_OBJECT() to register the new version of the object. Then when DBMS_REDEFINITION.COPY_TABLE_DEPENDENTS( ) is executed, it will ignore that object, in this case the index, which has already been defined.&lt;br /&gt;&lt;br /&gt;However, during my test, I realized that this is not entirely true. It complained about my index which was supporting my primary key constraint.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Let's see that in following example:&lt;br /&gt;&lt;br /&gt;Creating Source Table&lt;br /&gt;---------------------&lt;br /&gt;SQL&gt;  create table t1  as  select * from all_users;&lt;br /&gt;Table created.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter table t1 add constraint t1_pk primary key(user_id);&lt;br /&gt;Table altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; select index_name from user_indexes;&lt;br /&gt;INDEX_NAME&lt;br /&gt;-----------------------------&lt;br /&gt;T1_PK&lt;br /&gt;&lt;br /&gt;Creating Interim Partitioned Table&lt;br /&gt;----------------------------------&lt;br /&gt;SQL&gt; create table t2 partition by hash(user_id) partitions 8 as select * from t1 where 1=2;&lt;br /&gt;Table created.&lt;br /&gt;&lt;br /&gt;Moving the tablespace of INDEX on interim Table&lt;br /&gt;-----------------------------------------------&lt;br /&gt;SQL&gt; create index t2_Pk on t2 (user_id) tablespace system;&lt;br /&gt;Index created.&lt;br /&gt;&lt;br /&gt;Start online re-definition&lt;br /&gt;---------------------------&lt;br /&gt;SQL&gt; exec dbms_redefinition.can_redef_table( user, 'T1' );&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;SQL&gt;  exec dbms_redefinition.start_redef_table( user, 'T1', 'T2' );&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;SQL&gt; EXEC DBMS_REDEFINITION.REGISTER_DEPENDENT_OBJECT('TEST', 'T1', 'T2',  DBMS_REDEFINITION.CONS_INDEX, 'TEST', 'T1_PK', 'T2_PK');&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;SQL&gt; SET SERVEROUTPUT ON;&lt;br /&gt;VARIABLE NERRORS NUMBER;&lt;br /&gt;BEGIN&lt;br /&gt;DBMS_REDEFINITION.COPY_TABLE_DEPENDENTS ( 'TEST', 'T1', 'T2', 1, TRUE, TRUE, TRUE , FALSE, NUM_ERRORS =&gt; :NERRORS );&lt;br /&gt;END;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;BEGIN&lt;br /&gt;*&lt;br /&gt;ERROR at line 1:&lt;br /&gt;ORA-01408: such column list already indexed&lt;br /&gt;ORA-06512: at "SYS.DBMS_REDEFINITION", line 984&lt;br /&gt;ORA-06512: at "SYS.DBMS_REDEFINITION", line 1727&lt;br /&gt;ORA-06512: at line 2&lt;br /&gt;&lt;br /&gt;Following query confirms that&lt;br /&gt;------------------------------ &lt;br /&gt;SQL&gt;  select * From dba_redefinition_errors;&lt;br /&gt;OBJECT_TYP OBJECT_OWNER                   OBJECT_NAME&lt;br /&gt;---------- ------------------------------ ------------------------------&lt;br /&gt;BASE_TABLE_OWNER               BASE_TABLE_NAME&lt;br /&gt;------------------------------ ------------------------------&lt;br /&gt;DDL_TXT&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;CONSTRAINT TEST                           T1_PK&lt;br /&gt;TEST                           T1&lt;br /&gt;ALTER TABLE "TEST"."T2" ADD CONSTRAINT "TMP$$_T1_PK0" PRIMARY KEY ("USER_ID")&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;Removing the Index&lt;br /&gt;------------------&lt;br /&gt;SQL&gt; BEGIN&lt;br /&gt;DBMS_REDEFINITION.unregister_dependent_object ( 'TEST', 'T1', 'T2', DBMS_REDEFINITION.CONS_INDEX, 'TEST', 'T1_PK', 'T2_PK');&lt;br /&gt;END;&lt;br /&gt;/&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;SQL&gt; DROP INDEX T2_PK;&lt;br /&gt;Index dropped.&lt;br /&gt;&lt;br /&gt;No re-try the copy constraints&lt;br /&gt;------------------------------&lt;br /&gt;SQL&gt; SET SERVEROUTPUT ON;&lt;br /&gt;VARIABLE NERRORS NUMBER;&lt;br /&gt;BEGIN&lt;br /&gt;DBMS_REDEFINITION.COPY_TABLE_DEPENDENTS ( 'TEST', 'T1', 'T2', 1, TRUE, TRUE, TRUE , FALSE, NUM_ERRORS =&gt; :NERRORS );&lt;br /&gt;END;&lt;br /&gt;/&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;SQL&gt; exec dbms_redefinition.finish_redef_table( user, 'T1', 'T2' );&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;Hope this helps...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6987474324062764228-2751023404770266953?l=arulselvaraj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arulselvaraj.blogspot.com/feeds/2751023404770266953/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6987474324062764228&amp;postID=2751023404770266953' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/2751023404770266953'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/2751023404770266953'/><link rel='alternate' type='text/html' href='http://arulselvaraj.blogspot.com/2011/01/dbmsredefinitioncopytabledependents.html' title='DBMS_REDEFINITION.COPY_TABLE_DEPENDENTS Failed with ORA-01408: such column list already indexed'/><author><name>Arul</name><uri>http://www.blogger.com/profile/07889868459610579865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp3.blogger.com/__dynQ-Lq5NM/SCeNVa75UAI/AAAAAAAAACE/qyNxLdSLtzo/S220/90970001.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6987474324062764228.post-4359209806019735841</id><published>2011-01-13T17:14:00.000-08:00</published><updated>2011-01-13T18:39:08.954-08:00</updated><title type='text'>Drop tablespace waiting on 'reliable message'</title><content type='html'>Lats week, I droped a tablespace from production database.&lt;br /&gt;&lt;br /&gt;SQL&gt; select count(*) from dba_segments where tablespace_name='TEST';&lt;br /&gt;COUNT(*)&lt;br /&gt;----------&lt;br /&gt;0&lt;br /&gt;SQL&gt; drop tablespace TEST including contents and datafiles;&lt;br /&gt;&lt;br /&gt;Its just hung there for more than 2 hours.&lt;br /&gt;&lt;br /&gt;I looked at the alert log...&lt;br /&gt;&lt;br /&gt;Wed Jan 12 11:10:39 2011&lt;br /&gt;drop tablespace test including contents and datafiles&lt;br /&gt;Wed Jan 12 11:11:52 2011&lt;br /&gt;Deleted Oracle managed file +DGROUP1/PROD/datafile/test.339.666449433&lt;br /&gt;Wed Jan 12 11:12:12 2011&lt;br /&gt;Deleted Oracle managed file +DGROUP1/PROD/datafile/test.1104.672507107&lt;br /&gt;Wed Jan 12 11:12:29 2011&lt;br /&gt;Deleted Oracle managed file +DGROUP1/PROD/datafile/test.1838.684692483&lt;br /&gt;Wed Jan 12 11:12:45 2011&lt;br /&gt;Deleted Oracle managed file +DGROUP1/PROD/datafile/test.1955.691083671&lt;br /&gt;Wed Jan 12 11:39:48 2011&lt;br /&gt;Thread 1 advanced to log sequence 94797 (LGWR switch)&lt;br /&gt;Current log# 7 seq# 94797 mem# 0: +DGROUP2/PROD/redo07a.dbf&lt;br /&gt;Wed Jan 12 11:39:50 2011&lt;br /&gt;LNS: Standby redo logfile selected for thread 1 sequence 94797 for destination LOG_ARCHIVE_DEST_2&lt;br /&gt;Wed Jan 12 11:42:35 2011&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Looks like all the files have been dropped physically from ASM.&lt;br /&gt;&lt;br /&gt;Checked the database...&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from v$tablespace where name='TEST';&lt;br /&gt;&lt;br /&gt;no rows selected&lt;br /&gt;&lt;br /&gt;SQL&gt; select file_name from dba_data_files where tablespace_name='TEST';&lt;br /&gt;&lt;br /&gt;no rows selected&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In spite of all this, my initial sqlplus session with drop tablespace was still hung...&lt;br /&gt;&lt;br /&gt;Looking V$session_wait it was waiting for 'reliable message' for last 2 hours.&lt;br /&gt;&lt;br /&gt;SQL&gt; select event, p1, p2, state from v$session_wait where sid=836;&lt;br /&gt;EVENT     P1  P2      STATE&lt;br /&gt;---------------------------------------------------------------- ----------&lt;br /&gt;reliable message 6852580008 6968627176 WAITING&lt;br /&gt;SQL&gt; /&lt;br /&gt;reliable message 6852580008 6968627176 WAITING&lt;br /&gt;SQL&gt; /&lt;br /&gt;reliable message 6852580008 6968627176 WAITING&lt;br /&gt;SQL&gt; /&lt;br /&gt;reliable message 6852580008 6968627176 WAITING&lt;br /&gt;&lt;br /&gt;I gogled a bit, couldn't find anything. Metalink search got me few hits though...&lt;br /&gt;&lt;br /&gt;Bug 6148054 RAC hang waiting for "reliable message"&lt;br /&gt;Bug 4635062  drop tablespace session waiting for reliable message&lt;br /&gt;&lt;br /&gt;Though, this confirmed that I was hitting either of the oracle bug, none of them had a solution on what to do for exisitng hung session. One off the bug did had a suggestion to kill the session from other session using alter system command. However, there wasn't enough information on if that resolved the issue or not.&lt;br /&gt;&lt;br /&gt;AS I had no other option, I killed my drop tablespace session from other session using alter system command and drop tablespace worked.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6987474324062764228-4359209806019735841?l=arulselvaraj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arulselvaraj.blogspot.com/feeds/4359209806019735841/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6987474324062764228&amp;postID=4359209806019735841' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/4359209806019735841'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/4359209806019735841'/><link rel='alternate' type='text/html' href='http://arulselvaraj.blogspot.com/2011/01/drop-tablespace-waiting-on-reliable.html' title='Drop tablespace waiting on &apos;reliable message&apos;'/><author><name>Arul</name><uri>http://www.blogger.com/profile/07889868459610579865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp3.blogger.com/__dynQ-Lq5NM/SCeNVa75UAI/AAAAAAAAACE/qyNxLdSLtzo/S220/90970001.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6987474324062764228.post-145975567175948735</id><published>2011-01-13T16:03:00.000-08:00</published><updated>2011-01-13T17:13:33.632-08:00</updated><title type='text'>Watch out when using RMAN custom backup piece naming convention via FORMAT</title><content type='html'>Yesterday, I was asked to investigate the backup restore issue of production database for one off my client. Customer was taking incremental level 0 backups on Sunday and cumulative incremental level 1 backups on Monday-Saturday. Customer had successful backup for all one month, no errors in the backup log files,  RMAN Catalog list valid backups available for last one month. &lt;br /&gt;&lt;br /&gt;Customer was trying to restore and recover a backup as of Monday morning. In spite successful incremental level 0 backup on Sunday night, restore as of Monday morning was failing. It was complaining about backup being not found for certain files in backup set of Sunday and it was trying to read the backup piece of previous Sunday and for some files 4 to 6 weeks old backup piece. &lt;br /&gt;Customer had no clue on why RMAN was able to restore few files from last night (Sunday) incremental level 0 backup however, trying to read a backup piece 3 to 4 weeks old for other files.&lt;br /&gt;&lt;br /&gt;Customer was using the following script to perform the backup.&lt;br /&gt;&lt;br /&gt;run&lt;br /&gt;    {&lt;br /&gt;allocate channel tdp1 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/opt/tivoli/tsm/client/oracle/bin64/tdpo.opt)'; &lt;br /&gt;&lt;br /&gt;allocate channel tdp2 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/opt/tivoli/tsm/client/oracle/bin64/tdpo.opt)'; &lt;br /&gt;&lt;br /&gt;BACKUP INCREMENTAL LEVEL 0 DATABASE FORMAT='DB_LVL0_%d_%T%t_%p_%c' PLUS ARCHIVELOG NOT BACKED UP 2 TIMES FORMAT='LG_%d_%T%t_%p_%c';&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;Then I looked at the backup log files…&lt;br /&gt;&lt;br /&gt;Starting backup at 10-JAN-2011 05:18:50&lt;br /&gt;channel tdp1: starting incremental level 0 datafile backupset&lt;br /&gt;channel tdp1: specifying datafile(s) in backupset&lt;br /&gt;input datafile fno=00006 name=+DGROUP1/prod/datafile/PROD_data.1138.704640745&lt;br /&gt;input datafile fno=00007 name=+DGROUP1/prod/datafile/PROD_index.1147.704640829&lt;br /&gt;input datafile fno=00014 name=+DGROUP1/prod/datafile/PROD_data.2100.725724753&lt;br /&gt;input datafile fno=00002 name=+DGROUP1/prod/datafile/undotbs1.1067.704635111&lt;br /&gt;input datafile fno=00010 name=+DGROUP1/prod/datafile/PROD_data.1111.719594721&lt;br /&gt;input datafile fno=00013 name=+DGROUP1/prod/datafile/PROD_data.1278.721149489&lt;br /&gt;input datafile fno=00005 name=+DGROUP1/prod/datafile/users.1210.704635119&lt;br /&gt;input datafile fno=00016 name=+DGROUP1/prod/datafile/PROD_index.1435.726672149&lt;br /&gt;channel tdp1: starting piece 1 at 10-JAN-2011 05:18:51&lt;br /&gt;channel tdp2: starting incremental level 0 datafile backupset&lt;br /&gt;channel tdp2: specifying datafile(s) in backupset&lt;br /&gt;input datafile fno=00004 name=+DGROUP1/prod/datafile/undotbs2.2251.704635119&lt;br /&gt;input datafile fno=00015 name=+DGROUP1/prod/datafile/PROD_data.1080.725725677&lt;br /&gt;input datafile fno=00017 name=+DGROUP1/prod/datafile/PROD_index.1090.734796557&lt;br /&gt;input datafile fno=00012 name=+DGROUP1/prod/datafile/PROD_data.1951.721149479&lt;br /&gt;input datafile fno=00009 name=+DGROUP1/prod/datafile/PROD_data.395.717544159&lt;br /&gt;input datafile fno=00011 name=+DGROUP1/prod/datafile/PROD_data.1162.719594733&lt;br /&gt;input datafile fno=00003 name=+DGROUP1/prod/datafile/sysaux.1922.704635113&lt;br /&gt;input datafile fno=00001 name=+DGROUP1/prod/datafile/system.1752.704635103&lt;br /&gt;input datafile fno=00008 name=+DGROUP1/prod/datafile/drsys.770.712926249&lt;br /&gt;channel tdp2: starting piece 1 at 10-JAN-2011 05:18:51&lt;br /&gt;channel tdp2: finished piece 1 at 10-JAN-2011 05:49:39&lt;br /&gt;piece handle=DB_LVL0_prod_20110110740035131_1_1 tag=TAG20110110T051851 comment=API Version 2.0,MMS Version 5.5.1.0&lt;br /&gt;channel tdp2: backup set complete, elapsed time: 00:30:48&lt;br /&gt;channel tdp1: finished piece 1 at 10-JAN-2011 05:56:45&lt;br /&gt;piece handle=DB_LVL0_prod_20110110740035131_1_1 tag=TAG20110110T051851 comment=API Version 2.0,MMS Version 5.5.1.0&lt;br /&gt;channel tdp1: backup set complete, elapsed time: 00:37:54&lt;br /&gt;Finished backup at 10-JAN-2011 05:56:45&lt;br /&gt;&lt;br /&gt;If you look at the log files very carefully, it allocated 2 channels and distributes the all the datafiles in 2 sets and starts the backups. However, if you look at the backup piece name for both channels, it’s exactly same. As a result, when which ever channel finished lasts it overwrites the backup taken by earlier channel. So if you look at the above output, channel 1 td1 and channel 2 tdp2 started the backup but the channel 2 finished backup first with the name DB_LVL0_PROD_20110110740035131_1_1. Later on when channel 1 finished the backup it reused the same backup piece name DB_LVL0_PROD_20110110740035131_1_1. Due to this all the files backed by channel 2 tdp2 are completely lost.  And the surprisingly, RMAN doesn’t complain at all about this. RMAN Backup log file looks clear with return code 0.&lt;br /&gt;However, when it comes to restore, RMAN can only restore the set of files backup by channel 1 tdp1 which finished last and its has no backup available for files backed by channel 2 tdp2. &lt;br /&gt;&lt;br /&gt;Let’s confirm this by looking at RMAN catalog output. We already saw RMAN backup log it says it backed up all datafiles without any error.&lt;br /&gt;&lt;br /&gt;Let’s run Report Schema to list the datafiles in database.&lt;br /&gt;&lt;br /&gt;RMAN&gt; report schema;&lt;br /&gt;&lt;br /&gt;using target database control file instead of recovery catalog&lt;br /&gt;Report of database schema&lt;br /&gt;&lt;br /&gt;List of Permanent Datafiles&lt;br /&gt;===========================&lt;br /&gt;File Size(MB) Tablespace RB segs Datafile Name&lt;br /&gt;---- -------- -------------------- ------- ------------------------&lt;br /&gt;1 530 SYSTEM *** +DGROUP1/prod/datafile/system.1752.704635103&lt;br /&gt;2 13720 UNDOTBS1 *** +DGROUP1/prod/datafile/undotbs1.1067.704635111&lt;br /&gt;3 970 SYSAUX *** +DGROUP1/prod/datafile/sysaux.1922.704635113&lt;br /&gt;4 23395 UNDOTBS2 *** +DGROUP1/prod/datafile/undotbs2.2251.704635119&lt;br /&gt;5 5 USERS *** +DGROUP1/prod/datafile/users.1210.704635119&lt;br /&gt;6 20480 PROD_DATA *** +DGROUP1/prod/datafile/PROD_data.1138.704640745&lt;br /&gt;7 18960 PROD_INDEX *** +DGROUP1/prod/datafile/PROD_index.1147.704640829&lt;br /&gt;8 20 DRSYS *** +DGROUP1/prod/datafile/drsys.770.712926249&lt;br /&gt;9 8192 PROD_DATA *** +DGROUP1/prod/datafile/PROD_data.395.717544159&lt;br /&gt;10 8192 PROD_DATA *** +DGROUP1/prod/datafile/PROD_data.1111.719594721&lt;br /&gt;11 8192 PROD_DATA *** +DGROUP1/prod/datafile/PROD_data.1162.719594733&lt;br /&gt;12 8196 PROD_DATA *** +DGROUP1/prod/datafile/PROD_data.1951.721149479&lt;br /&gt;13 8192 PROD_DATA *** +DGROUP1/prod/datafile/PROD_data.1278.721149489&lt;br /&gt;14 18692 PROD_DATA *** +DGROUP1/prod/datafile/PROD_data.2100.725724753&lt;br /&gt;15 18992 PROD_DATA *** +DGROUP1/prod/datafile/PROD_data.1080.725725677&lt;br /&gt;16 8192 PROD_INDEX *** +DGROUP1/prod/datafile/PROD_index.1435.726672149&lt;br /&gt;17 16384 PROD_INDEX *** +DGROUP1/prod/datafile/PROD_index.1090.734796557&lt;br /&gt;&lt;br /&gt;List of Temporary Files&lt;br /&gt;=======================&lt;br /&gt;File Size(MB) Tablespace Maxsize(MB) Tempfile Name&lt;br /&gt;---- -------- -------------------- ----------- --------------------&lt;br /&gt;1 15360 TEMP 15360 +DGROUP1/prod/tempfile/temp.309.704635115&lt;br /&gt;2 8192 TEMP 8192 +DGROUP1/prod/tempfile/temp.1141.735345399&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now let’s grab the backup tag from backup log file and list the backup piece and datafiles in that backup tag.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;RMAN&gt; list backup tag TAG20110110T051851;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;List of Backup Sets&lt;br /&gt;===================&lt;br /&gt;&lt;br /&gt;BS Key Type LV Size Device Type Elapsed Time Completion Time&lt;br /&gt;------- ---- -- ---------- ----------- ------------ --------------------&lt;br /&gt;5169802 Incr 0 93.70G SBT_TAPE 00:37:50 10-JAN-2011 05:56:41&lt;br /&gt;BP Key: 5169806 Status: AVAILABLE Compressed: NO Tag: TAG20110110T051851&lt;br /&gt;Handle: DB_LVL0_prod_20110110740035131_1_1 Media:&lt;br /&gt;List of Datafiles in backup set 5169802&lt;br /&gt;File LV Type Ckp SCN Ckp Time Name&lt;br /&gt;---- -- ---- ---------- -------------------- ----&lt;br /&gt;2 0 Incr 7310305942 10-JAN-2011 05:18:51 +DGROUP1/prod/datafile/undotbs1.1067.704635111&lt;br /&gt;5 0 Incr 7310305942 10-JAN-2011 05:18:51 +DGROUP1/prod/datafile/users.1210.704635119&lt;br /&gt;6 0 Incr 7310305942 10-JAN-2011 05:18:51 +DGROUP1/prod/datafile/norkom_data.1138.704640745&lt;br /&gt;7 0 Incr 7310305942 10-JAN-2011 05:18:51 +DGROUP1/prod/datafile/norkom_index.1147.704640829&lt;br /&gt;10 0 Incr 7310305942 10-JAN-2011 05:18:51 +DGROUP1/prod/datafile/norkom_data.1111.719594721&lt;br /&gt;13 0 Incr 7310305942 10-JAN-2011 05:18:51 +DGROUP1/prod/datafile/norkom_data.1278.721149489&lt;br /&gt;14 0 Incr 7310305942 10-JAN-2011 05:18:51 +DGROUP1/prod/datafile/norkom_data.2100.725724753&lt;br /&gt;16 0 Incr 7310305942 10-JAN-2011 05:18:51 +DGROUP1/prod/datafile/norkom_index.1435.726672149&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;RMAN&gt;&lt;br /&gt;&lt;br /&gt;From the above output you can clearly see that there set of datafiles missing in the backup piece. That’s why customer was able to restore set of files from recent backup and for rest of the files RMAN was looking for backup piece which 3 to 4 weeks old.&lt;br /&gt;&lt;br /&gt;So be cautious when you are using customized RMAN backup piece name using format keyword. Make sure you use %u which guarantees unique name for your backup piece.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6987474324062764228-145975567175948735?l=arulselvaraj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arulselvaraj.blogspot.com/feeds/145975567175948735/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6987474324062764228&amp;postID=145975567175948735' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/145975567175948735'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/145975567175948735'/><link rel='alternate' type='text/html' href='http://arulselvaraj.blogspot.com/2011/01/watch-out-when-using-rman-custom-backup.html' title='Watch out when using RMAN custom backup piece naming convention via FORMAT'/><author><name>Arul</name><uri>http://www.blogger.com/profile/07889868459610579865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp3.blogger.com/__dynQ-Lq5NM/SCeNVa75UAI/AAAAAAAAACE/qyNxLdSLtzo/S220/90970001.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6987474324062764228.post-3545719155900619582</id><published>2010-08-17T16:23:00.000-07:00</published><updated>2010-08-17T22:53:04.056-07:00</updated><title type='text'>ORA-31619: invalid dump file for IMPDP</title><content type='html'>We had a EXPDP script to export the application schema on daily basis. &lt;br /&gt;&lt;br /&gt;We were writing data pump files to WINDOWS files system mounted to LINUX system with CIFS option. We used parallel=2 and generated 2 files in parallel.&lt;br /&gt;&lt;br /&gt;EXPDP always worked fine without any issues.&lt;br /&gt;&lt;br /&gt;Last night I had to restore the EXPORT in DEV invironment and the IMPDP failed with following error.&lt;br /&gt;&lt;br /&gt;ORA-39001: invalid argument value&lt;br /&gt;ORA-39000: bad dump file specification&lt;br /&gt;ORA-31619: invalid dump file "/app/edws/fileload/expdp/SYSMAN_201.dmp"&lt;br /&gt;&lt;br /&gt;After breaking my head for a while, I found that if EXPDP has parallel set &gt; 1 and if you write to 2 multiple files on CIFS mounted file system, it corrupts the file.&lt;br /&gt;&lt;br /&gt;Your IMPDP throws above error. I got mixed resulst from Metalink. &lt;br /&gt;Bug #  8313127 says CIFS file system is not supported for data pump.&lt;br /&gt;Note: 444809.1 says its supported but not certified.&lt;br /&gt;&lt;br /&gt;Based on my test, you write to one file, you are still safe. But if you use parallel option, you are files are corrupted and can't be used for IMPORT.&lt;br /&gt;&lt;br /&gt;So for those who are using CIFS mount please be aware of that.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6987474324062764228-3545719155900619582?l=arulselvaraj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arulselvaraj.blogspot.com/feeds/3545719155900619582/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6987474324062764228&amp;postID=3545719155900619582' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/3545719155900619582'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/3545719155900619582'/><link rel='alternate' type='text/html' href='http://arulselvaraj.blogspot.com/2010/08/ora-31619-invalid-dump-file-for-impdp.html' title='ORA-31619: invalid dump file for IMPDP'/><author><name>Arul</name><uri>http://www.blogger.com/profile/07889868459610579865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp3.blogger.com/__dynQ-Lq5NM/SCeNVa75UAI/AAAAAAAAACE/qyNxLdSLtzo/S220/90970001.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6987474324062764228.post-4698545904911582409</id><published>2010-07-28T22:27:00.001-07:00</published><updated>2010-07-29T17:40:41.606-07:00</updated><title type='text'>How to Rollback failed Patchset via Flashback Database</title><content type='html'>&lt;strong&gt;Pre-Patch&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Enable Flashback&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;-- SQL&gt; alter database flashback on;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Create Restore Point&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;-- SQL&gt; create restore point before_patch guarantee flashback database;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Patch 1020n&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Shutdown DB&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;-- SQL&gt; shutdown immediate&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Startup from 10204 HOME&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;-- SQL&gt; startup upgrade&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Run the Upgrade Scripts&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;-- SQL&gt; catupgrd.sql&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Rollback Patch&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;If you are not happy with the patch, it failed or it had some error which you can't fix it and decided to rollback, Please follow below steps.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Start the Database&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;-- SQL&gt; startup force mount&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Flashback Database&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;-- SQL&gt; FLASHBACK DATABASE TO RESTORE POINT BEFORE_PATCH;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Shutdown Database&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;-- SQL&gt; shutdown immediate&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Start the database from OLD 10203 HOME&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;-- SQL&gt; startup mount&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Open the Database&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;-- SQL&gt; alter database open resetlogs;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Turn off Flashback&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;-- SQL&gt; alter database flashback off;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Drop restore point&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;-- SQL&gt; drop restore point BEFORE_PATCH;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;That's all you are ready to go back in business with 10203.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6987474324062764228-4698545904911582409?l=arulselvaraj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arulselvaraj.blogspot.com/feeds/4698545904911582409/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6987474324062764228&amp;postID=4698545904911582409' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/4698545904911582409'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/4698545904911582409'/><link rel='alternate' type='text/html' href='http://arulselvaraj.blogspot.com/2010/07/how-to-rollback-failed-patchset-via.html' title='How to Rollback failed Patchset via Flashback Database'/><author><name>Arul</name><uri>http://www.blogger.com/profile/07889868459610579865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp3.blogger.com/__dynQ-Lq5NM/SCeNVa75UAI/AAAAAAAAACE/qyNxLdSLtzo/S220/90970001.JPG'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6987474324062764228.post-3843987809095006507</id><published>2010-07-28T21:49:00.000-07:00</published><updated>2010-07-28T22:27:03.460-07:00</updated><title type='text'>Failed DB Patch Set - No need to Restore, Use Flashback Instead</title><content type='html'>Since last couple of weeks I have been working on a project to patch more than 50+ databases from 10203 to 10204.&lt;br /&gt;&lt;br /&gt;I never follwed the traditional approach of backing up of ORACLE_HOME and the database as Rollback Strategy. Last night I had to patch a Data warehouse database (3TB in size) and it failed. My Rollback Strategy saved me hour n hours of backup restore and I thought it will be worth sharing with you all.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Patching ORACLE_HOME from 10203 to 10204&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;-- Create new 10201 Home &amp; Patch it to 101024&lt;br /&gt;&lt;br /&gt;-- This will help you to minimize the downtime during the patch as well as if rollback is required you can use the existing home without a need of restore&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Patching Database from 10203 to 10204&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;-- Enable a flashback on database before patching, this avoid the need have a database backup prior to patch&lt;br /&gt;&lt;br /&gt;-- In case of failure, you dont need to go through database restore, use flashback database to rollback the patch. This will drastically redice your rollback time, you will back in business within minutes. My DW database was 3TB in size imagines the time it would have taken to restore vs it took less than 5 minutes to restore.&lt;br /&gt;&lt;br /&gt;P.S.  In my next blog, I have documented the high level steps on how to use flashback to rollback the patch.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6987474324062764228-3843987809095006507?l=arulselvaraj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arulselvaraj.blogspot.com/feeds/3843987809095006507/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6987474324062764228&amp;postID=3843987809095006507' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/3843987809095006507'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/3843987809095006507'/><link rel='alternate' type='text/html' href='http://arulselvaraj.blogspot.com/2010/07/failed-db-patch-set-no-need-to-restore.html' title='Failed DB Patch Set - No need to Restore, Use Flashback Instead'/><author><name>Arul</name><uri>http://www.blogger.com/profile/07889868459610579865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp3.blogger.com/__dynQ-Lq5NM/SCeNVa75UAI/AAAAAAAAACE/qyNxLdSLtzo/S220/90970001.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6987474324062764228.post-5151301651631571129</id><published>2010-07-25T16:09:00.000-07:00</published><updated>2010-07-25T16:40:04.787-07:00</updated><title type='text'>After 10204 patch SRVCTL fails with srvctl: line 187: /bin/java: No such file or directory</title><content type='html'>Last night I patched 10203 2-node RAC database to 102042. There were no issues with patching and all went well. However after patching, my srvctl command on node 2 started failing with&lt;br /&gt;&lt;br /&gt;&lt;strong&gt; "srvctl: line 187: /bin/java: No such file or directory".&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;I checked all the environment variables and other libabry paths and all seemed OK to me. For node 1, everything was working fine and I was able to manage node to resources using the SRVCTL on node 1. It was the node 2 SRVCTL which was causing the trouble.&lt;br /&gt;&lt;br /&gt;To further troubleshoot, I had to enable to tracing for SRVCTL and that revealed that SRVCTL file on node to had following environment variables set to NULL.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Node 1 - $ORACLE_HOME/bin/srvctl&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;# External Directory Variables set by the Installer&lt;br /&gt;JREDIR=/app/oracle/product/10.2/db_3/jdk/jre&lt;br /&gt;JLIBDIR=/app/oracle/product/10.2/db_3/jlib&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Node 2 - $ORACLE_HOME/bin/srvctl&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;# External Directory Variables set by the Installer&lt;br /&gt;JREDIR=&lt;br /&gt;JLIBDIR=&lt;br /&gt;&lt;br /&gt;I had to modify the Node 2 srvctl file similar to node 1 and the issue got resolved. Not sure of teh root cause at this point in time.  However, sharing the fix so that if anyone of you come across this problem it will be a quick fix.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6987474324062764228-5151301651631571129?l=arulselvaraj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arulselvaraj.blogspot.com/feeds/5151301651631571129/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6987474324062764228&amp;postID=5151301651631571129' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/5151301651631571129'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/5151301651631571129'/><link rel='alternate' type='text/html' href='http://arulselvaraj.blogspot.com/2010/07/after-10204-patch-srvctl-fails-with.html' title='After 10204 patch SRVCTL fails with srvctl: line 187: /bin/java: No such file or directory'/><author><name>Arul</name><uri>http://www.blogger.com/profile/07889868459610579865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp3.blogger.com/__dynQ-Lq5NM/SCeNVa75UAI/AAAAAAAAACE/qyNxLdSLtzo/S220/90970001.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6987474324062764228.post-5365342493374514294</id><published>2010-02-23T20:03:00.000-08:00</published><updated>2010-02-23T20:18:54.308-08:00</updated><title type='text'>Calculating Network Bandwidth Required for Data Guard Log shipping</title><content type='html'>&lt;strong&gt;Calculating Network Bandwidth Required for Data Guard Log shipping&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;I am currently working with a customer designing Oracle Data Guard. As part of the design process, one my objective was to calculate the additional network bandwidth required ship the logs from primary site to standby site.&lt;br /&gt;&lt;br /&gt;As usual, I did some googling and found some intresting links and formulas. Based on all that I have written a simple SQL query as below which shows the network bandwidth required in Mbps to ship the logs. It shows total Mbps required to ship the logs for a day, max,min and avg Mbps required to ship the logs for an hour. The formula used in query is quite simple (just the conversion of an hour into seconds and bytes into bits and 30% network overhead).&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;SELECT DT, &lt;br /&gt;SUM(RB*8/3600000000*1.3) TOTAL_Mbps_REQ_FOR_A_DAY, &lt;br /&gt;MIN(RB*8/3600000000*1.3) MIN_Mbps_REQ_FOR_AN_HOUR, &lt;br /&gt;MAX(RB*8/3600000000*1.3) MAX_Mbps_REQ_FOR_AN_HOUR , &lt;br /&gt;AVG(RB*8/3600000000*1.3) AVG_Mbps_REQ_FOR_AN_HOUR &lt;br /&gt;FROM&lt;br /&gt;(&lt;br /&gt;SELECT TRUNC (COMPLETION_TIME) DT,&lt;br /&gt;TO_CHAR (COMPLETION_TIME,'HH24') HH,&lt;br /&gt;SUM(BLOCKS*BLOCK_SIZE) RB&lt;br /&gt;FROM&lt;br /&gt;V$ARCHIVED_LOG&lt;br /&gt;WHERE COMPLETION_TIME &gt; SYSDATE-5&lt;br /&gt;AND DEST_ID=1&lt;br /&gt;GROUP BY TRUNC(COMPLETION_TIME),&lt;br /&gt;TO_CHAR (COMPLETION_TIME, 'HH24')&lt;br /&gt;)&lt;br /&gt;GROUP BY DT;&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Hope this helps you.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6987474324062764228-5365342493374514294?l=arulselvaraj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arulselvaraj.blogspot.com/feeds/5365342493374514294/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6987474324062764228&amp;postID=5365342493374514294' title='31 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/5365342493374514294'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/5365342493374514294'/><link rel='alternate' type='text/html' href='http://arulselvaraj.blogspot.com/2010/02/calculating-network-bandwidth-required.html' title='Calculating Network Bandwidth Required for Data Guard Log shipping'/><author><name>Arul</name><uri>http://www.blogger.com/profile/07889868459610579865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp3.blogger.com/__dynQ-Lq5NM/SCeNVa75UAI/AAAAAAAAACE/qyNxLdSLtzo/S220/90970001.JPG'/></author><thr:total>31</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6987474324062764228.post-5852115786676771957</id><published>2009-07-25T01:03:00.000-07:00</published><updated>2009-07-25T01:04:48.051-07:00</updated><title type='text'>ORA-16069: Archive Log standby database activation identifier mismatch</title><content type='html'>ORA-16069: Archive Log standby database activation identifier mismatch&lt;br /&gt;&lt;br /&gt;Last week, I was testing "Using a Physical Standby Database for Read/Write Testing and Reporting" documented at "http://download.oracle.com/docs/cd/B19306_01/server.102/b14239/scenarios.htm#CIHIABDH".&lt;br /&gt;&lt;br /&gt;I was able to activate standby database perform read-write operations, test my application, flashback the database back to standby mode and start the managed recovery once again.&lt;br /&gt;&lt;br /&gt;However, my primary database started complaining while shipping the logs to standby.&lt;br /&gt;ORA-16401: ARCHIVELOG REJECTED BY RFS&lt;br /&gt;&lt;br /&gt;At the same time I could see the following error message in standby.&lt;br /&gt;ORA-16069: Archive Log standby database activation identifier mismatch&lt;br /&gt;&lt;br /&gt;I was running 10.2.0.2, so when I contacted oracle, they asked me apply the latest 10.2.0.4 patchset. So I will not talk about root case and I will talk on how I fixed ORA-16069 problem.&lt;br /&gt;&lt;br /&gt;On Primary&lt;br /&gt;----------&lt;br /&gt;SQL&gt; alter database create standby controlfile as 'C:\standby.ctl';&lt;br /&gt;&lt;br /&gt;On Standby&lt;br /&gt;-----------&lt;br /&gt;SQL&gt; shutdown immediate&lt;br /&gt;&lt;br /&gt;Replace your standby controlfile with new standby controlfile created in previous controlfile.&lt;br /&gt;&lt;br /&gt;SQL&gt; startup mount&lt;br /&gt;SQL&gt; recover managed standby database disconnect;&lt;br /&gt;&lt;br /&gt;The above steps will fix ORA-16069 and enable log shipping as well as GAP resolution from primary to standby.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6987474324062764228-5852115786676771957?l=arulselvaraj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arulselvaraj.blogspot.com/feeds/5852115786676771957/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6987474324062764228&amp;postID=5852115786676771957' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/5852115786676771957'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/5852115786676771957'/><link rel='alternate' type='text/html' href='http://arulselvaraj.blogspot.com/2009/07/ora-16069-archive-log-standby-database.html' title='ORA-16069: Archive Log standby database activation identifier mismatch'/><author><name>Arul</name><uri>http://www.blogger.com/profile/07889868459610579865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp3.blogger.com/__dynQ-Lq5NM/SCeNVa75UAI/AAAAAAAAACE/qyNxLdSLtzo/S220/90970001.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6987474324062764228.post-8688879734628627798</id><published>2009-07-24T22:45:00.000-07:00</published><updated>2009-07-24T22:48:40.842-07:00</updated><title type='text'>DBUA fails with LRM-00116 &amp; ORA-01078</title><content type='html'>Recently I was upgrading the 10.2.0.2 database to 10.2.0.4 on Windows 2003 server. DBUA failed with  "ORA-01078: failure in processing system parameters" error while doing the pre upgrade checks. I looked up in the C:\Oracle\product\10.2.4\cfgtoollogs\dbua\DBNAME\upgrade0\PreUpgrade.log and found the following.&lt;br /&gt;&lt;br /&gt;LRM-00101: unknown parameter name 'e:\WEBCT64DATA\datafiledb_name'&lt;br /&gt;LRM-00116: syntax error at 'E:\MYDBdb_uni' following '='&lt;br /&gt;ORA-01078: failure in processing system parameters&lt;br /&gt;&lt;br /&gt;It didn't make any sense to me, as I had no parameter with values as 'e:\MYDB\datafiledb_name' as this. However, when I closely looked at this I realised that I had parameter called db_file_name_convert which had value set to 'd:\dbname\datafile\', 'E:\MYDB\datafile\' and it was followed by the parameter db_name.&lt;br /&gt;&lt;br /&gt;Now I knew something is wrong here which oracle DBUA doesn't like. As usual I checked up in metalink and found a note. 397802.1 "DBUA Reports ORA-01078 While Upgrading A Data Guard Database".&lt;br /&gt;&lt;br /&gt;Yes, this note confirms that DBUA doesn't like this parameter value and as solution recommends it to set to null values. The metalink article doesn't talk about why DBUA doesn't like this and as per the note this can happen only with this data guard related parameters and hence issues associated with upgrading data giard database.&lt;br /&gt;&lt;br /&gt;I did some further dig up on this issue and found it to be something else.&lt;br /&gt;&lt;br /&gt;Its seems to me on windows DBUA treats any trailing "\" in pfile/spfile as an escape character and hence and trailing backspace which are part of values for any init params will be ignored and nect parameter name will be appended to the value.&lt;br /&gt;&lt;br /&gt;For e.g.&lt;br /&gt;In my case the param file looks like...&lt;br /&gt;....&lt;br /&gt;....&lt;br /&gt;db_file_name_convert='D:\MYDB\DATAFILE\', 'E:\MYDB\DATAFILE\'&lt;br /&gt;DB_NAME=MYDB&lt;br /&gt;&lt;br /&gt;So as there is a "\" in end it escapes it and reads the file as "db_file_name_convert='D:\MYDB\DATAFILE\', 'E:\MYDB\DATAFILEDB_NAME=MYDB" which is invalid and it doesn't like and complains. So this error has nothing to do with data guard instances. &lt;br /&gt;&lt;br /&gt;This error can be caused by any parameter in init file which has values with "/" at the end no matter you are run data guard or single instance.&lt;br /&gt;&lt;br /&gt;For e.g.&lt;br /&gt;&lt;br /&gt;user_dump_Dest="c:\oracle\admin\udump\"&lt;br /&gt;background_dump_Dest="c:\oracle\admin\bdump\"&lt;br /&gt;core_dump_Dest="c:\oracle\admin\cdump\"&lt;br /&gt;&lt;br /&gt;It seems to be windows specific issue.  So if DBUA fails with LRM-00116 &amp; ORA-01078 on windows please check the init file for values which has a "\" at the end.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6987474324062764228-8688879734628627798?l=arulselvaraj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arulselvaraj.blogspot.com/feeds/8688879734628627798/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6987474324062764228&amp;postID=8688879734628627798' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/8688879734628627798'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/8688879734628627798'/><link rel='alternate' type='text/html' href='http://arulselvaraj.blogspot.com/2009/07/dbua-fails-with-lrm-00116-ora-01078.html' title='DBUA fails with LRM-00116 &amp; ORA-01078'/><author><name>Arul</name><uri>http://www.blogger.com/profile/07889868459610579865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp3.blogger.com/__dynQ-Lq5NM/SCeNVa75UAI/AAAAAAAAACE/qyNxLdSLtzo/S220/90970001.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6987474324062764228.post-3298800644060010617</id><published>2009-06-18T21:24:00.000-07:00</published><updated>2009-06-18T21:57:54.747-07:00</updated><title type='text'>Frequently used commands in Data Guard using Broker</title><content type='html'>&lt;strong&gt;· How to upgrade/downgrade the protection mode?&lt;/strong&gt;&lt;br /&gt;DGMGRL&gt; EDIT CONFIGURATION SET PROTECTION MODE AS MAXAVAILABILITY;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;· How to change the init parameter setting related to data guard?&lt;/strong&gt;&lt;br /&gt;DGMGRL&gt; EDIT DATABASE 'MYDBdr' SET PROPERTY 'StandbyFileManagement'='AUTO';&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;· How to change the redo shipping process or mode?&lt;/strong&gt;&lt;br /&gt;DGMGRL&gt; EDIT DATABASE 'MYDB’ PROPERTY 'LogXptMode'='SYNC';&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;· How to open the standby database in read-only mode?&lt;/strong&gt;&lt;br /&gt;DGMGRL&gt; EDIT DATABASE 'MYDBdr' SET STATE='READ-ONLY';&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;· How to stop the recovery process on standby database?&lt;/strong&gt;&lt;br /&gt;DGMGRL&gt; EDIT DATABASE 'MYDBdr' SET STATE='LOG-APPLY-OFF’;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;· How to put the standby database back in recovery mode? &lt;/strong&gt;&lt;br /&gt;DGMGRL&gt; EDIT DATABASE 'MYDBdr' SET STATE='ONLINE’;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;· How to stop the redo shipping on primary database?&lt;/strong&gt;&lt;br /&gt;DGMGRL&gt; EDIT DATABASE 'MYDB' SET STATE='LOG-TRANSPORT-OFF’;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;· How to start the redo shipping on primary database?&lt;/strong&gt;&lt;br /&gt;DGMGRL&gt; EDIT DATABASE 'MYDB' SET STATE='ONLINE’;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;· How to check the status of broker configuration?&lt;/strong&gt;&lt;br /&gt;DGMGRL&gt; SHOW CONFIGURATION;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6987474324062764228-3298800644060010617?l=arulselvaraj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arulselvaraj.blogspot.com/feeds/3298800644060010617/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6987474324062764228&amp;postID=3298800644060010617' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/3298800644060010617'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/3298800644060010617'/><link rel='alternate' type='text/html' href='http://arulselvaraj.blogspot.com/2009/06/frequently-used-commands-in-data-guard.html' title='Frequently used commands in Data Guard using Broker'/><author><name>Arul</name><uri>http://www.blogger.com/profile/07889868459610579865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp3.blogger.com/__dynQ-Lq5NM/SCeNVa75UAI/AAAAAAAAACE/qyNxLdSLtzo/S220/90970001.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6987474324062764228.post-5730010627202460024</id><published>2009-03-11T15:32:00.000-07:00</published><updated>2009-03-11T15:52:44.004-07:00</updated><title type='text'>Best Practices for Change Data Capture (CDC) Asynchronous Auto Log Archive</title><content type='html'>Currently I am working with a customer to implement CDC and as a part of this engagement, I was looking for resources on best practices / guidelines to consider while implementing CDC. Even though there is much on Google and Oracle documentation, I thought it will be good idea to consolidate them and publish it here.&lt;br /&gt;&lt;br /&gt;Following are the guidelines / best practices to consider while implementing CDC in Asynchronous Auto Log Archive mode. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;1. Supplemental Logging&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;· The asynchronous modes of Change Data Capture work best with appropriate supplemental logging on the source database. Oracle recommends that the source database supplementally log all source table columns that are part of a primary key or function to uniquely identify a row. &lt;br /&gt;· Create an unconditional log group for all source table columns that are captured by any asynchronous change table. This should be done before any change tables are created on a source table. If an unconditional log group is not created for all source table columns to be captured, then when an update DML operation occurs, some unchanged user column values in change tables will be null instead of reflecting the actual source table value.&lt;br /&gt;· If you intend to capture all the column values in a row whenever a column in that row is updated, you can use ALL COLUMN option instead of listing each column one-by-one in the ALTER TABLE statement for supplemental logging. However, do not use this form of the ALTER TABLE statement if all columns are not needed. Logging all columns incurs more overhead than logging selected columns.&lt;br /&gt;· Use force-logging option only if you want to capture the changes out of direct load insert or inserts with nologging.  Use this force logging with caution as it may introduce performance overhead on the source database.&lt;br /&gt;· To minimize performance impact in case you want capture even the changes out of direct load inserts or inserts with nologging, consider moving the source tables which are part of such operation to a dedicated tablespace and turn on force-logging at tablespace level instead of database level.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;2. Defining Tables and Columns&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;· Performance, storage &amp; network overhead of the Change Data Capture configuration is proportional to the amount of table and columns, which are part of the configurations.&lt;br /&gt;· Ensure that you include only required and relevant tables and their columns while creating change tables.&lt;br /&gt;· Capture only selective and relevant control columns on the change tables.&lt;br /&gt;· By default, Change Data Capture process, records both (old &amp; new) values in change table. If old values are not required, ensure to capture only new values (parameter CAPTURE_VALUES=&gt;’NEW’) to minimize the performance overhead.&lt;br /&gt;· Oracle recommends that change tables not be created in system tablespaces. This can be accomplished if the publisher's default tablespace is not the system tablespace or if the publisher specifies a tablespace in the options_string parameter.&lt;br /&gt;· Do not specify any constrains on change table as it adds performance overhead during the time of capture. Perform all your data validations in target database.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;3. Change Source, Change Sets &amp; Subscriptions&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;· Keep the number of change sources per source database to minimum. Ideally create one change source in your staging database for each source database. Bear in mind that a change set cannot span across the change sources.&lt;br /&gt;· Keep the number of change sets within a given change source to minimum.  Bear in mind that a change set is a set of change data that is guaranteed to be transactionally consistent and subscription cannot span across change sets. If your subscriber needs set of changed data, which spans across various tables in one subscription, then you should group those tables in one change set. &lt;br /&gt;· Keep the number of subscription equal or more than number of subscribers. Bear in mind that given subscription cannot be shared by 2 subscribers. If you have a subscriber who is interested in change set but he is interested in few change tables on daily basis and few change tables in weekly basis, then consider creating two subscriptions for the give subscriber. If you have two subscribers interested in same set of change tables, the create two different subscriptions for a given change set instead of duplicating the source tables in two change sets.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;4. Publisher &amp; Subscriber&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;· It’s highly recommended to create a dedicated publisher user on staging database for publication purpose. &lt;br /&gt;· Oracle recommends that when creating the publisher account on a staging database, the DBA specify a default tablespace for the publisher; the publisher should use this tablespace for any change tables he or she creates.&lt;br /&gt;· Generally, one publisher is sufficient enough to manage multiple change sources/ source databases on given staging database. However, if you have centralized staging databases, which caters multiple source databases and you don’t want to share the access to change source for security reasons, then it makes more sense to have dedicated publisher for each source database.&lt;br /&gt;· If you have multiple source databases and centralized staging databases and only one publisher, then make sure you use options_string while creating change tables and specify appropriate tablespace name to group the change tables from various source databases to their respective tablespaces.&lt;br /&gt;· It’s highly recommended that end application don’t share the subscribers. Each application interested in changed data must have their own dedicated subscribers.&lt;br /&gt;· The publisher must grant the SELECT privilege before a subscriber can subscribe to the change table. The publisher must not grant any DML access (use of INSERT, UPDATE, or DELETE statements) to the subscribers on the change tables because a subscriber might inadvertently change the data in the change table, making it inconsistent with its source. Furthermore, the publisher should avoid creating change tables in schemas to which subscribers have DML access.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;5. ARCHIVE_LAG_TARGET&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;With the AutoLog archive option, Change sets are populated as new archived redo log files arrive on the staging database. The degree of latency depends on the frequency of redo log file switches on the source database. The AutoLog archive option has a higher degree of latency than any other option. However, ARCHIVE_LAG_TARGET parameter can be used to efficiently control this latency by forcing log switches at regular interval. A 0 value disables the time-based thread advance feature; otherwise, the value represents the number of seconds. The typical, or recommended value is 1800 (30 minutes). Extremely low values can result in frequent log switches, which could degrade performance; such values can also make the archiver process too busy to archive the continuously generated logs.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;6. Archiving Strategy for Change tables&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;· When finished using change data, a subscriber must call the DBMS_CDC_SUBSCRIBE.PURGE_WINDOW procedure. This indicates to Change Data Capture and the publisher that the change data is no longer needed by this subscriber and allows auto scheduled DBMS_JOB to execute DBMS_CDC_PUBLISH.PURGE procedure to remove data that subscribers are no longer using from the change tables. This ensures that the size of the change tables does not grow without limit. &lt;br /&gt;· If the subscriber fails to call PURGE_WINDOW after using the changed data, then DBMS_CDC_PUBLISH.PURGE procedure cannot delete unneeded rows from the change table. So, it’s important to ensure that subscriber runs the DBMS_CDC_SUBSCRIBE.PURGE_WINDOW procedure whenever finished using change data.&lt;br /&gt;· In addition to DBMS_CDC_SUBSCRIBE.PURGE_WINDOW procedure, it’s highly recommended that the subscriber should call the DBMS_CDC_SUBSCRIBE.DROP_SUBSCRIPTION procedure to drop unneeded subscriptions.&lt;br /&gt;· By default, auto scheduled DBMS_JOB executes DBMS_CDC_PUBLISH.PURGE every 24 hours. It’s recommended that the publisher who created the first change table should adjust this interval using the DBMS_JOB.CHANGE procedure based on the frequency of subscription (calls to extend_window procedure).  The values for the JOB parameter for this procedure can be found by querying the USER_JOBS view for the job number that corresponds to the WHAT column containing the string 'SYS.DBMS_CDC_PUBLISH.PURGE ();'.&lt;br /&gt;· It is possible that a subscriber could fail to call PURGE_WINDOW, with the result being that unneeded rows would not be deleted by the purge job. It’s highly recommended that the publisher should monitor the DBA_SUBSCRIPTIONS view at regular intervals to determine if this is happening. The publisher can use the DBMS_CDC_PUBLISH.DROP_SUBSCRIPTION procedure to drop active subscriptions where subscriber has failed to call PURGE_WINDOW.&lt;br /&gt;· Publisher should consider performing purge operations at a finer granularity than the automatic purge operation performed by Change Data Capture as and when required. For e.g. after massive data load change capture, as a clean-up process etc. There are three purge operations available to the publisher:&lt;br /&gt;§ – DBMS_CDC_PUBLISH.PURGE: Purges all change tables on the staging database. This is the same PURGE operation as is performed automatically by Change Data Capture.&lt;br /&gt;§ – DBMS_CDC_PUBLISH.PURGE_CHANGE_SET: Purges all the change tables in a named change set.&lt;br /&gt;§ – DBMS_CDC_PUBLISH.PURGE_CHANGE_TABLE: Purges a named changed table.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6987474324062764228-5730010627202460024?l=arulselvaraj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arulselvaraj.blogspot.com/feeds/5730010627202460024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6987474324062764228&amp;postID=5730010627202460024' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/5730010627202460024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/5730010627202460024'/><link rel='alternate' type='text/html' href='http://arulselvaraj.blogspot.com/2009/03/best-practices-for-change-data-capture.html' title='Best Practices for Change Data Capture (CDC) Asynchronous Auto Log Archive'/><author><name>Arul</name><uri>http://www.blogger.com/profile/07889868459610579865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp3.blogger.com/__dynQ-Lq5NM/SCeNVa75UAI/AAAAAAAAACE/qyNxLdSLtzo/S220/90970001.JPG'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6987474324062764228.post-6451685366004876062</id><published>2008-01-29T01:31:00.001-08:00</published><updated>2008-01-29T01:33:35.475-08:00</updated><title type='text'>Recovering 3 TB standby when the archive log is deleted/corrupted before applying</title><content type='html'>Yesterday, I had a challenging issue with one of my customer and its worth sharing.&lt;br /&gt;&lt;br /&gt;They had 3 TB data warehouse system with physical standby in place. Its a critical banking reporting database and standby is mostly used in the evening to run the critical reports. They had a corruption in one of the archive log which was shipped to standby for applying. The same archive log on primary database was deleted without backup as the backups were taken on standby. Standby database was stuck for recovery requesting that particular archive log.&lt;br /&gt;&lt;br /&gt;No other option but to take a fresh backup from primary and re-create the standby. But 3TB primary DB, 9 hours of backup time and around 14 hours of restore time. Not acceptable to customer.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Simple solution...&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1. Check the SCN on standby&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt;select current_scn from v$database;&lt;br /&gt;CURRENT_SCN&lt;br /&gt;-----------&lt;br /&gt;47987632&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. Take incremental SCN backup on Primary&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;RMAN&gt; BACKUP INCREMENTAL FROM SCN 47987632 DATABASE;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. Recover the database&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt;recover managed standby database cancel;&lt;br /&gt;RMAN&gt; RECOVER DATABASE NOREDO;&lt;br /&gt;SQL&gt; recover managed standby database nodelay disconnect;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Backup took 12 minutes and the size was 1.2 GB thats all. Recovery took 16 minutes.&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6987474324062764228-6451685366004876062?l=arulselvaraj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arulselvaraj.blogspot.com/feeds/6451685366004876062/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6987474324062764228&amp;postID=6451685366004876062' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/6451685366004876062'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/6451685366004876062'/><link rel='alternate' type='text/html' href='http://arulselvaraj.blogspot.com/2008/01/recovering-3-tb-standby-when-archive.html' title='Recovering 3 TB standby when the archive log is deleted/corrupted before applying'/><author><name>Arul</name><uri>http://www.blogger.com/profile/07889868459610579865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp3.blogger.com/__dynQ-Lq5NM/SCeNVa75UAI/AAAAAAAAACE/qyNxLdSLtzo/S220/90970001.JPG'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6987474324062764228.post-4410792965229438569</id><published>2008-01-20T17:33:00.000-08:00</published><updated>2008-01-20T18:52:23.089-08:00</updated><title type='text'>Exploiting 11g ASM features against 10g database</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Exploiting 11g ASM features against 10g database&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;We all know that new Oracle 11g release has much more to offer. Its going to take some time for every one to adopt 11g in production. Lot of testing to be done. Management has to be convinced about its stability based on success stories of others customers. But somewhere, someone has to start. &lt;br /&gt;&lt;br /&gt;For those who are using ASM as their storage can upgrade their ASM instance alone to 11g immediately and start exploiting 11g ASM features against their 10g database.&lt;br /&gt;&lt;br /&gt;Following are the simple steps to follow and you are all set to go with ASM 11g features for your 1og database.&lt;br /&gt;&lt;br /&gt;1.&lt;span style="font-weight:bold;"&gt; Install Oracle 11g RDBMS software for your new ASM 11g HOME.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;2. Shutdown your 10g database &amp; ASM instance&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;3. Reconfigure Oracle Cluster Synchronization Services to run from new 11g home&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; Set PATH and other environment variables(ORACLE_HOME, ORACLE_SID) to new ORACLE 11g executables.&lt;br /&gt; &lt;br /&gt; Login as root and run following command.&lt;br /&gt; &lt;br /&gt; [root@arul oracle]# &lt;span style="font-weight:bold;"&gt;localconfig reset&lt;/span&gt;&lt;br /&gt; Successfully accumulated necessary OCR keys.&lt;br /&gt; Creating OCR keys for user 'root', privgrp 'root'..&lt;br /&gt; Operation successful.&lt;br /&gt; Configuration for local CSS has been initialized&lt;br /&gt; Stale CSS daemon is running... killing it now&lt;br /&gt; Cleaning up Network socket directories&lt;br /&gt; Setting up Network socket directories&lt;br /&gt; Adding to inittab&lt;br /&gt; Startup will be queued to init within 30 seconds.&lt;br /&gt; Checking the status of new Oracle init process...&lt;br /&gt; Expecting the CRS daemons to be up within 600 seconds.&lt;br /&gt; Cluster Synchronization Services is active on these nodes.&lt;br /&gt;         arul&lt;br /&gt; Cluster Synchronization Services is active on all the nodes.&lt;br /&gt; Oracle CSS service is installed and running under init(1M)&lt;br /&gt; [root@arul oracle]#&lt;br /&gt;&lt;br /&gt;4. &lt;span style="font-weight:bold;"&gt;Copy password file &amp; S/Pfile to new 11g ORACLE_HOME/dbs folder&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span style="font-style:italic;"&gt;$ cp spfile+ASM.ora /u02/app/oracle/product/11g/db_1/dbs&lt;br /&gt; $ cp orapw+ASM /u02/app/oracle/product/11g/db_1/dbs&lt;br /&gt;&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;5. &lt;span style="font-weight:bold;"&gt;Remove the obsolete initialization parameters&lt;/span&gt;&lt;br /&gt; Parameters like background/user/core dump dest are obsolete in 11g, so remove those parameters.&lt;br /&gt; Change the remote login passwordfile to exclusive.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;6. Login as sysdba and start the ASM instance from 11g home and grant sysasm privilege.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;$ sqlplus / as sysdba&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 11.1.0.6.0 - Production on Mon Jan 21 09:11:50 2008&lt;br /&gt;Copyright (c) 1982, 2007, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;Connected to an idle instance.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;SQL&gt; startup&lt;/span&gt;&lt;br /&gt;ASM instance started&lt;br /&gt;&lt;br /&gt;Total System Global Area  284565504 bytes&lt;br /&gt;Fixed Size                  1299428 bytes&lt;br /&gt;Variable Size             258100252 bytes&lt;br /&gt;ASM Cache                  25165824 bytes&lt;br /&gt;ASM diskgroups mounted&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;SQL&gt; grant sysasm to sys;&lt;/span&gt;&lt;br /&gt;Grant succeeded.&lt;br /&gt;SQL&gt; exit&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;7. Start 10g RDBMS instance.&lt;/span&gt;&lt;br /&gt; set PATH and other environment variables(ORACLE_HOME, ORACLE_SID) to ORACLE 10g RDBMS instance.&lt;br /&gt; &lt;br /&gt; $ sqlplus / as sysdba&lt;br /&gt; &lt;br /&gt; SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jan 21 09:13:46 2008&lt;br /&gt; &lt;br /&gt; Copyright (c) 1982, 2005, Oracle.  All rights reserved.&lt;br /&gt; &lt;br /&gt; Connected to an idle instance.&lt;br /&gt; &lt;br /&gt; SQL&gt; startup&lt;br /&gt; ORACLE instance started.&lt;br /&gt; &lt;br /&gt; Total System Global Area  184549376 bytes&lt;br /&gt; Fixed Size                  1218412 bytes&lt;br /&gt; Variable Size              71305364 bytes&lt;br /&gt; Database Buffers          109051904 bytes&lt;br /&gt; Redo Buffers                2973696 bytes&lt;br /&gt; Database mounted.&lt;br /&gt; Database opened.&lt;br /&gt; SQL&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;8. All set to go.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; Now you can use 11g ASM features for your 10g RDBMS instance.&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; ASMCMD has the few very handy new commands: &lt;span style="font-weight:bold;"&gt;cp, lsdsk, pwd...&lt;/span&gt; &lt;br /&gt; &lt;br /&gt;  &lt;span style="font-weight:bold;"&gt;Few examples..&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; ASMCMD [+data/mars] &gt; &lt;span style="font-weight:bold;"&gt;cp spfilemars.ora +data/mars/test/spfilemars.ora&lt;/span&gt;&lt;br /&gt; source +data/mars/spfilemars.ora&lt;br /&gt; target +data/mars/test/spfilemars.ora&lt;br /&gt; copying file(s)...&lt;br /&gt; file, +DATA/mars/test/spfilemars.ora, copy committed.&lt;br /&gt; &lt;br /&gt; ASMCMD [+data/mars] &gt; cd test&lt;br /&gt; ASMCMD [+data/mars/test] &gt; ls&lt;br /&gt; spfilemars.ora&lt;br /&gt;  &lt;br /&gt; &lt;span style="font-weight:bold;"&gt;$ asmcmd -v&lt;br /&gt; asmcmd version 11.1.0.6.0&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;         &lt;span style="font-weight:bold;"&gt;ASMCMD [+data/mars/test] &gt; pwd&lt;br /&gt; +data/mars/test&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span style="font-weight:bold;"&gt;ASMCMD [+data/mars/test] &gt; lsdsk &lt;/span&gt;&lt;br /&gt; Path&lt;br /&gt; /dev/raw/raw1&lt;br /&gt; /dev/raw/raw2&lt;br /&gt;&lt;br /&gt; &lt;span style="font-weight:bold;"&gt;ASMCMD [+data/mars/test] &gt; lsct&lt;/span&gt;&lt;br /&gt; DB_Name  Status     Software_Version  Compatible_version  Instance_Name  Disk_Group&lt;br /&gt; mars     CONNECTED        10.2.0.1.0          10.2.0.1.0  mars           DATA &lt;br /&gt; mars     CONNECTED        10.2.0.1.0          10.2.0.1.0  mars           FRA&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6987474324062764228-4410792965229438569?l=arulselvaraj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arulselvaraj.blogspot.com/feeds/4410792965229438569/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6987474324062764228&amp;postID=4410792965229438569' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/4410792965229438569'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/4410792965229438569'/><link rel='alternate' type='text/html' href='http://arulselvaraj.blogspot.com/2008/01/exploiting-11g-asm-features-against-10g.html' title='Exploiting 11g ASM features against 10g database'/><author><name>Arul</name><uri>http://www.blogger.com/profile/07889868459610579865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp3.blogger.com/__dynQ-Lq5NM/SCeNVa75UAI/AAAAAAAAACE/qyNxLdSLtzo/S220/90970001.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6987474324062764228.post-4803562332830304075</id><published>2007-10-31T04:38:00.000-07:00</published><updated>2007-10-31T04:57:25.714-07:00</updated><title type='text'>Oracle11g Active Data Guard</title><content type='html'>A physical standby database can be open for read-only access while Redo Apply is active if a license for the Oracle Active Data Guard option has been purchased. This capability is known as Real-time Query.&lt;br /&gt;&lt;br /&gt;Let test this feature...&lt;br /&gt;&lt;br /&gt;Oracle DATAGUARD Physical standby configuration steps remains same as 10g. So I have a physical standby database already running.&lt;br /&gt;&lt;br /&gt;Make sure you have standby redo logs configured..&lt;br /&gt;&lt;br /&gt;SQL&gt; select database_role from v$database;&lt;br /&gt;DATABASE_ROLE&lt;br /&gt;----------------&lt;br /&gt;PHYSICAL STANDBY&lt;br /&gt;&lt;br /&gt;SQL&gt; select count(*) from v$standby_log;&lt;br /&gt;  COUNT(*)&lt;br /&gt;----------&lt;br /&gt;         3&lt;br /&gt;&lt;br /&gt;Open the Physical standby database and start the recovery&lt;br /&gt;&lt;br /&gt;SQL&gt; ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; ALTER DATABASE OPEN;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SQL&gt;  ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;Now Lets perfrom some transaction on primary and redo will be shipped to standby and will be applied and we will be able to query them online when the apply is in progress.&lt;br /&gt;&lt;br /&gt;SQL&gt; select database_role from v$database;&lt;br /&gt;DATABASE_ROLE&lt;br /&gt;----------------&lt;br /&gt;PRIMARY&lt;br /&gt;&lt;br /&gt;SQL&gt; select count(*) from test;&lt;br /&gt;  COUNT(*)&lt;br /&gt;----------&lt;br /&gt;     68289&lt;br /&gt;&lt;br /&gt;SQL&gt; truncate table test;&lt;br /&gt;Table truncated.&lt;br /&gt;&lt;br /&gt;SQL&gt; select count(*) from test;&lt;br /&gt;  COUNT(*)&lt;br /&gt;----------&lt;br /&gt;         0&lt;br /&gt;&lt;br /&gt;Now lets check on standby&lt;br /&gt;&lt;br /&gt;SQL&gt; select database_role from v$database;&lt;br /&gt;DATABASE_ROLE&lt;br /&gt;----------------&lt;br /&gt;PHYSICAL STANDBY&lt;br /&gt;&lt;br /&gt;SQL&gt; select count(*) from test;&lt;br /&gt;  COUNT(*)&lt;br /&gt;----------&lt;br /&gt;         0&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6987474324062764228-4803562332830304075?l=arulselvaraj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arulselvaraj.blogspot.com/feeds/4803562332830304075/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6987474324062764228&amp;postID=4803562332830304075' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/4803562332830304075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/4803562332830304075'/><link rel='alternate' type='text/html' href='http://arulselvaraj.blogspot.com/2007/10/oracle11g-active-data-guard.html' title='Oracle11g Active Data Guard'/><author><name>Arul</name><uri>http://www.blogger.com/profile/07889868459610579865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp3.blogger.com/__dynQ-Lq5NM/SCeNVa75UAI/AAAAAAAAACE/qyNxLdSLtzo/S220/90970001.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6987474324062764228.post-4785265643193833008</id><published>2007-10-29T05:44:00.000-07:00</published><updated>2007-10-29T06:07:57.899-07:00</updated><title type='text'>ORA-01274 on Standby DB using ASM</title><content type='html'>ORA-01274 is raised on standby database when Automated standby file management is disabled, so an added file on primary could not automatically be created on the standby. The control file file entry for the file is 'UNNAMEDnnnnn'.&lt;br /&gt;&lt;br /&gt;Wehn you are using a normal file system, Use the ALTER DATABASE CREATE DATAFILE statement to create the file and set STANDBY_FILE_MANAGEMENT to AUTO and restart standby recovery.&lt;br /&gt;&lt;br /&gt;For e.g.&lt;br /&gt;ALTER DATABASE CREATE DATAFILE&lt;br /&gt;'/u01/app/oracle/product/10.1.0/dbs/UNNAMED00007'&lt;br /&gt;AS&lt;br /&gt;'/u02/db1/oradata/test01.dbf';&lt;br /&gt;&lt;br /&gt;But if you are using ASM along with oracle managed files then target datafile name is auto generated. We had ORA-1274 recently on standby using ASM file system and this how it was fixed.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ERROR&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;Media Recovery Log +DATA/genprd_js/arc00457_0631903938.002&lt;br /&gt;File #6 added to control file as 'UNNAMED00006' because&lt;br /&gt;the parameter STANDBY_FILE_MANAGEMENT is set to MANUAL&lt;br /&gt;The file should be manually created to continue.&lt;br /&gt;Errors with log +DATA/genprd_js/arc00457_0631903938.002&lt;br /&gt;MRP0: Background Media Recovery terminated with error 1274&lt;br /&gt;Fri Oct 26 16:36:05 2007&lt;br /&gt;Errors in file d:\oracle\product\10.2.0\admin\genprd_js\bdump\genprd2_mrp0_4320.trc:&lt;br /&gt;ORA-01274: cannot add datafile '+DATA/genprd_fc/datafile/deal_data_large.598.636716925' - file could not be created&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;FIX&lt;/strong&gt;&lt;br /&gt;&lt;em&gt;SQL&gt; alter database create datafile 6 as;&lt;br /&gt;SQL&gt; recover managed standby database disconnect;&lt;/em&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6987474324062764228-4785265643193833008?l=arulselvaraj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arulselvaraj.blogspot.com/feeds/4785265643193833008/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6987474324062764228&amp;postID=4785265643193833008' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/4785265643193833008'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/4785265643193833008'/><link rel='alternate' type='text/html' href='http://arulselvaraj.blogspot.com/2007/10/ora-01274-on-standby-db-using-asm.html' title='ORA-01274 on Standby DB using ASM'/><author><name>Arul</name><uri>http://www.blogger.com/profile/07889868459610579865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp3.blogger.com/__dynQ-Lq5NM/SCeNVa75UAI/AAAAAAAAACE/qyNxLdSLtzo/S220/90970001.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6987474324062764228.post-3706262214545932302</id><published>2007-07-30T05:38:00.000-07:00</published><updated>2007-07-30T05:39:27.472-07:00</updated><title type='text'>How to backup Database &amp; archivelog to two different area with two different format and TAG name</title><content type='html'>&lt;strong&gt;Backup database format '/u01/db_backup/%d_%t_%s_%p' tag 'DB_daily_backup' plus archivelog format '/u02/arch_backup/%d_%U' tag 'Arch_daily_backup' delete input; &lt;br /&gt; &lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6987474324062764228-3706262214545932302?l=arulselvaraj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arulselvaraj.blogspot.com/feeds/3706262214545932302/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6987474324062764228&amp;postID=3706262214545932302' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/3706262214545932302'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/3706262214545932302'/><link rel='alternate' type='text/html' href='http://arulselvaraj.blogspot.com/2007/07/how-to-backup-database-archivelog-to.html' title='How to backup Database &amp; archivelog to two different area with two different format and TAG name'/><author><name>Arul</name><uri>http://www.blogger.com/profile/07889868459610579865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp3.blogger.com/__dynQ-Lq5NM/SCeNVa75UAI/AAAAAAAAACE/qyNxLdSLtzo/S220/90970001.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6987474324062764228.post-6131547298441497319</id><published>2007-07-30T05:32:00.000-07:00</published><updated>2007-08-28T19:19:14.007-07:00</updated><title type='text'>How to backup Archivelogs when stored on local disk in a RAC environment</title><content type='html'>RMAN enables the autolocation feature whenever the allocated channels have different PARMS or CONNECT strings. RMAN automatically discovers which nodes of an Oracle Real Application Clusters configuration can access the files that you want to back up or restore. RMAN autolocates the following files:&lt;br /&gt;&lt;br /&gt;·Backup pieces during backup or restore &lt;br /&gt;&lt;br /&gt;·Archived redo logs during backup &lt;br /&gt;&lt;br /&gt;·Datafile or control file copies during backup or restore &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;So run the script from any node, connect to any node, but make sure you have a channel connecting each instance.  Sample…Script&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;run&lt;br /&gt;{&lt;br /&gt;ALLOCATE CHANNEL CH1 DEVICE TYPE sbt_tape connect '/@node2' PARMS "ENV=(tdpo_optfile=C:\Program Files\tivoli\tsm\AgentOBA\tdpo_LN1O.opt)";&lt;br /&gt;&lt;br /&gt;ALLOCATE CHANNEL CH2 DEVICE TYPE sbt_tape connect '/@node1' PARMS "ENV=(tdpo_optfile=C:\Program Files\tivoli\tsm\AgentOBA\tdpo_LN1O.opt)";&lt;br /&gt;&lt;br /&gt;Backup archivelog all;&lt;br /&gt;}&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6987474324062764228-6131547298441497319?l=arulselvaraj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arulselvaraj.blogspot.com/feeds/6131547298441497319/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6987474324062764228&amp;postID=6131547298441497319' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/6131547298441497319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/6131547298441497319'/><link rel='alternate' type='text/html' href='http://arulselvaraj.blogspot.com/2007/07/how-backup-archivelogs-when-stroed-on.html' title='How to backup Archivelogs when stored on local disk in a RAC environment'/><author><name>Arul</name><uri>http://www.blogger.com/profile/07889868459610579865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp3.blogger.com/__dynQ-Lq5NM/SCeNVa75UAI/AAAAAAAAACE/qyNxLdSLtzo/S220/90970001.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6987474324062764228.post-7380650948509634806</id><published>2007-07-30T05:24:00.000-07:00</published><updated>2007-07-30T17:47:40.079-07:00</updated><title type='text'>Standby Database with a Time Lag</title><content type='html'>By default, when the standby database is performing managed recovery, it automatically applies redo logs when they arrive from the primary database. But in some cases, you might not want the logs to be applied immediately, because you want to create a time lag between the archiving of a redo log at the primary site and the application of the log at the standby site. A time lag can protect against the transfer of corrupted or erroneous data from the primary site to the standby site.&lt;br /&gt;&lt;br /&gt;For example, suppose you run a batch job every night on the primary database. Unfortunately, you accidentally ran the batch job twice and you did not realize the mistake until the batch job completed for the second time. Ideally, you need to roll back the database to the point in time before the batch job began. A primary database that has a standby database with a time lag could help you to recover. You could fail over the standby database with the time lag and use it as the new primary database.&lt;br /&gt;&lt;br /&gt;To create a standby database with a time lag, use the DELAY attribute of the LOG_ARCHIVE_DEST_n initialization parameter in the primary database initialization parameter file. The following is an example of how to add a 4-hour delay to the LOG_ARCHIVE_DEST_n initialization parameter:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;SQL&gt; ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='SERVICE=stdby DELAY=240';&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The DELAY attribute indicates that the archived redo logs at the standby site are not available for recovery until the 4-hour time interval has expired. The time interval (expressed in minutes) starts when the archived redo logs are successfully transmitted to the standby site. &lt;strong&gt;The redo information is still sent to the standby database and written to the disk as normal without any delay.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Swithover Steps when stanby is running in Time lag&lt;/strong&gt;.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Step 1 Current Primary&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;SQL&gt; startup force;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;SQL&gt; alter database commit to switchover to standby with session shutdown;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;SQL&gt; shutdown immediate;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;SQL&gt; startup nomount;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;SQL&gt; alter database mount standby database;&lt;/strong&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Step 2 Current Standby&lt;br /&gt;&lt;br /&gt;SQL&gt; ALTER DATABASE RECOVER MANAGED STANDBY DATABASE NODELAY DISCONNECT FROM SESSION THROUGH LAST SWITCHOVER;&lt;br /&gt;SQL&gt; alter database commit to switchover to primary with session shutdown;&lt;br /&gt;SQL&gt; shutdown immediate;&lt;br /&gt;SQL&gt; startup mount;&lt;br /&gt;SQL&gt; alter database open;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Step 3 Former Primary (Current Standby)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; recover managed standby database disconnect;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6987474324062764228-7380650948509634806?l=arulselvaraj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arulselvaraj.blogspot.com/feeds/7380650948509634806/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6987474324062764228&amp;postID=7380650948509634806' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/7380650948509634806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/7380650948509634806'/><link rel='alternate' type='text/html' href='http://arulselvaraj.blogspot.com/2007/07/standby-database-with-time-lag.html' title='Standby Database with a Time Lag'/><author><name>Arul</name><uri>http://www.blogger.com/profile/07889868459610579865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp3.blogger.com/__dynQ-Lq5NM/SCeNVa75UAI/AAAAAAAAACE/qyNxLdSLtzo/S220/90970001.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6987474324062764228.post-1527616760378564551</id><published>2007-07-20T01:11:00.000-07:00</published><updated>2007-07-20T01:22:25.217-07:00</updated><title type='text'>REQUIRED_MIRROR_FREE_MB &amp; USABLE_FILE_MB</title><content type='html'>&lt;strong&gt;REQUIRED_MIRROR_FREE_MB &amp; USABLE_FILE_MB&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The &lt;strong&gt;V$ASM_DISKGROUP &lt;/strong&gt;view contains columns that help you manage capacity:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;REQUIRED_MIRROR_FREE_MB&lt;/strong&gt; - indicates the amount of space that must be available in the disk group to restore full redundancy after the worst failure that can be tolerated by the disk group.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;USABLE_FILE_MB&lt;/strong&gt; - indicates the amount of free space, adjusted for mirroring, that is available for new files.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;USABLE_FILE_MB&lt;/strong&gt; is computed by subtracting &lt;strong&gt;REQUIRED_MIRROR_FREE_MB &lt;/strong&gt;from total free space in the disk group and then adjusting for mirroring. For example, in a normal redundancy disk group, where by default mirrored files take up disk space equal to twice their size, if 4 GB of actual usable file space remains, &lt;strong&gt;USABLE_FILE_MB&lt;/strong&gt; equals roughly 2 GB. You can then add up to a 2 GB file.&lt;br /&gt;&lt;br /&gt;The following query shows capacity metrics for a normal redundancy disk group that consists of four 1 GB (1024 MB) disks, each in its own failure group:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt;  select name, type, total_mb, free_mb, required_mirror_free_mb, usable_file_mb from v$asm_diskgroup;&lt;br /&gt;&lt;br /&gt;NAME                           TYPE     TOTAL_MB    FREE_MB  REQUIRED_MIRROR_FREE_MB USABLE_FILE_MB&lt;br /&gt;---------------------------------------------------------------------------------------------------&lt;br /&gt;DATA                           NORMAL       4096       3941                     1024           1458&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The REQUIRED_MIRROR_FREE_MB column shows that 1 GB of extra capacity must be available to restore full redundancy after one or more disks fail. Note that the first three numeric columns in the query results are raw numbers. That is, they do not take redundancy into account. Only the last column is adjusted for normal redundancy. &lt;br /&gt;&lt;br /&gt;Notice that:&lt;br /&gt;&lt;br /&gt;-- Created disk group worth 4GB so TOTAL_MB is 4096M&lt;br /&gt;-- Metadata &amp; header takes some place so you are left out with FREE_MB 3941M&lt;br /&gt;-- Oracle has reserved 1024M to support disk failure so  REQUIRED_MIRROR_FREE_MB is 1024M&lt;br /&gt;&lt;br /&gt;So FREE_MB - REQUIRED_MIRROR_FREE_MB = USABLE_FILE_MB&lt;br /&gt;&lt;br /&gt;So 3941 - 1024 = 2917M&lt;br /&gt;&lt;br /&gt;But as we said earlier TOTAL_MB, FREE_MB, REQUIRED_MIRROR_FREE_MB are RAW figures they don't account the mirroring but USABLE_FILE_MB does. This means that out of 2917M due to normal redundancy the actual USABLE_FILE_MB turns out to be 2917/2 = 1458( what you see in output).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now I go and create a database worth 1000M on this disk group so lets see how output will look like.&lt;br /&gt;&lt;br /&gt;NAME                           TYPE     TOTAL_MB    FREE_MB  REQUIRED_MIRROR_FREE_MB USABLE_FILE_MB&lt;br /&gt;---------------------------------------------------------------------------------------------------&lt;br /&gt;DATA                           NORMAL       4096       2051                     1024            513&lt;br /&gt;&lt;br /&gt;So the equation is pretty clear,  So you had 3941M free, you used 1000M for database so your  FREE_MB  (3941M-1000M ) becomes 2051( FREE_MB) now. Oracle has reserved 1024M to support disk failure so  REQUIRED_MIRROR_FREE_MB is 1024M.  So out of 2051(FREE_MB) - 1024 (REQUIRED_MIRROR_FREE_MB) = 1024 is the actual space left out. So you have 1024M but as you want normal redundancy for your data (additional duplicate copy of your data) the USABLE_FILE_MB becomes 1024/2 = 513M.  &lt;br /&gt;&lt;br /&gt;Now I go ahead and create a tablespace worth 756M even though USABLE_FILE_MB is 513M. It works without any errors.&lt;br /&gt;&lt;br /&gt;SQL&gt; create tablespace test datafile size 756m;&lt;br /&gt;Tablespace created.&lt;br /&gt;&lt;br /&gt;Now see how does the output look like.&lt;br /&gt;&lt;br /&gt;NAME                           TYPE     TOTAL_MB    FREE_MB  REQUIRED_MIRROR_FREE_MB USABLE_FILE_MB&lt;br /&gt;---------------------------------------------------------------------------------------------------&lt;br /&gt;DATA                           NORMAL       4096        534                   1024           -245&lt;br /&gt;&lt;br /&gt;You had only 513M USABLE_FILE_MB but you wanted to create 756M of datafile. It works as you had a 1024M REQUIRED_MIRROR_FREE_MB reserved by ORACLE to protect any disk failure. But that was in case of disk failure. Now you wanted a additional disk space so it used the disk space which was reserved to protect disk failure.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Negative Values of USABLE_FILE_MB is not necessarily a critical situation, But it does mean that:&lt;br /&gt;&lt;br /&gt;-- Depending on the value of FREE_MB, you may not be able to create new files. ( in this example files not more than 245M)&lt;br /&gt;&lt;br /&gt;-- The next failure may result in files with reduced redundancy. ( As you have started using disk space which was reserved to protect disk failure REQUIRED_MIRROR_FREE_MB any disk failure in future will result in low redundancy for your files. It means your database will continue to run but with only one copy of extents the other mirrored copy can not be rebuilt as you have lost the disk and you don't have further spare disk or disk space in that failure group).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If USABLE_FILE_MB becomes negative, it is strongly recommended that you add more space to the disk group as soon as possible.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6987474324062764228-1527616760378564551?l=arulselvaraj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arulselvaraj.blogspot.com/feeds/1527616760378564551/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6987474324062764228&amp;postID=1527616760378564551' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/1527616760378564551'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/1527616760378564551'/><link rel='alternate' type='text/html' href='http://arulselvaraj.blogspot.com/2007/07/requiredmirrorfreemb-usablefilemb.html' title='REQUIRED_MIRROR_FREE_MB &amp; USABLE_FILE_MB'/><author><name>Arul</name><uri>http://www.blogger.com/profile/07889868459610579865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp3.blogger.com/__dynQ-Lq5NM/SCeNVa75UAI/AAAAAAAAACE/qyNxLdSLtzo/S220/90970001.JPG'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6987474324062764228.post-5437865238344933340</id><published>2007-07-19T01:02:00.001-07:00</published><updated>2007-07-19T21:45:04.214-07:00</updated><title type='text'>ARCHIVELOG HOUSE-KEEPING</title><content type='html'>You should backup archivelogs and delete them regularly to prevent archive destination getting 100% full.  &lt;br /&gt;&lt;br /&gt;Many people use “backup archivelog all delete input”. This command will backup all archives and delete them from disk immediately. It has two major disadvantageous. &lt;br /&gt;&lt;br /&gt;• Delay in point in time recovery&lt;br /&gt;If you need to do a point in time recovery you need to restore archive logs from the backup and to avoid this restore it’s highly recommended to keep archivelog on disk for a day or so.&lt;br /&gt;• When running in standby&lt;br /&gt;If you are a running a standby database, you would want to keep archivelogs on primary database for some time to get it shipped across the standby. (Even though its real time most of the time, any network failure or maintenance on standby server can delay this shipping) And on standby you would always want delete the archives only when they are backed up and leave them on the disk for some time to get it applied as well.&lt;br /&gt;&lt;br /&gt;So these are (and many more) scenarios when you want to delete the archivelogs from disk which are old and at the same time you want to ensure they are already backed up as well.&lt;br /&gt;&lt;br /&gt;Simple way to achieve the same is running two separate commands/scripts regularly. One to backup regularly and other to delete the files which are old enough.  &lt;br /&gt;&lt;br /&gt;For e.g. &lt;br /&gt;&lt;br /&gt;Backup archivelog all not backed up 1 times to sbt;&lt;br /&gt;&lt;br /&gt;Delete archivelog all completed before ‘sysdate-1’;&lt;br /&gt;&lt;br /&gt;But it very much possible that your backup command/script has been failing (for some reason) and your delete command/script was running without any issues. So you end up deleting files without backup.&lt;br /&gt;&lt;br /&gt;So here we go… &lt;br /&gt;&lt;br /&gt;RMAN syntax to delete archivelogs which are a day old and they are the one which are already backed up as well.&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;RMAN&gt; delete archivelog all backed up 1 times to device type sbt completed before 'sysdate-1';&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6987474324062764228-5437865238344933340?l=arulselvaraj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arulselvaraj.blogspot.com/feeds/5437865238344933340/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6987474324062764228&amp;postID=5437865238344933340' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/5437865238344933340'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/5437865238344933340'/><link rel='alternate' type='text/html' href='http://arulselvaraj.blogspot.com/2007/07/archivelog-house-keeping.html' title='ARCHIVELOG HOUSE-KEEPING'/><author><name>Arul</name><uri>http://www.blogger.com/profile/07889868459610579865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp3.blogger.com/__dynQ-Lq5NM/SCeNVa75UAI/AAAAAAAAACE/qyNxLdSLtzo/S220/90970001.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6987474324062764228.post-4334899101475097306</id><published>2007-07-11T05:42:00.000-07:00</published><updated>2007-07-11T05:48:02.516-07:00</updated><title type='text'>REBUILD OR MOVE ENTIRE SCHEMA WITH MINIMAL DOWNTIME (PRE 10G)</title><content type='html'>There are scenarios where in you want rebuild the entire schema OR move it to different tablespace online.&lt;br /&gt;&lt;br /&gt;Following script helps to do the same with minimal downtime.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;NOTE: PLEASE TEST THIS SCRIPT BEFORE USE. &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;CREATE OR REPLACE PROCEDURE schema_rebuild authid current_user IS&lt;br /&gt;  CURSOR obj_list IS&lt;br /&gt;  SELECT decode( segment_type, 'TABLE', segment_name, table_name ) order_col1,&lt;br /&gt;  decode( segment_type, 'TABLE', 1, 2 ) order_col2,&lt;br /&gt;  decode( segment_type, 'TABLE', ' move ', ' rebuild ' ) m_or_r,segment_type,segment_name&lt;br /&gt;  FROM user_segments, (SELECT table_name, index_name FROM user_indexes )&lt;br /&gt;  WHERE segment_type IN ( 'TABLE', 'INDEX' )&lt;br /&gt;  AND segment_name = index_name (+)  ORDER BY 1, 2 ;&lt;br /&gt;&lt;br /&gt;  reb_str VARCHAR2(200) ;&lt;br /&gt;  username varchar2(20);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;BEGIN&lt;br /&gt;username:=user;&lt;br /&gt;  FOR i IN OBJ_LIST LOOP&lt;br /&gt;     IF i.segment_type = 'INDEX' THEN&lt;br /&gt;                reb_str := 'alter ' || i.segment_type || ' ' || i.segment_name ||' '|| i.m_or_r ||' online';&lt;br /&gt;     ELSE&lt;br /&gt;            reb_str := 'alter ' || i.segment_type || ' ' || i.segment_name ||' '|| i.m_or_r;&lt;br /&gt;     END IF;&lt;br /&gt;     EXECUTE IMMEDIATE reb_str;&lt;br /&gt;     reb_str := '';&lt;br /&gt;  END LOOP ;&lt;br /&gt;                dbms_stats.gather_schema_stats (ownname=&gt;username, method_opt=&gt;'FOR ALL INDEXED COLUMNS', cascade=&gt;TRUE);&lt;br /&gt;END ;&lt;br /&gt;/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6987474324062764228-4334899101475097306?l=arulselvaraj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arulselvaraj.blogspot.com/feeds/4334899101475097306/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6987474324062764228&amp;postID=4334899101475097306' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/4334899101475097306'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/4334899101475097306'/><link rel='alternate' type='text/html' href='http://arulselvaraj.blogspot.com/2007/07/rebuild-or-move-entire-schema-with.html' title='REBUILD OR MOVE ENTIRE SCHEMA WITH MINIMAL DOWNTIME (PRE 10G)'/><author><name>Arul</name><uri>http://www.blogger.com/profile/07889868459610579865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp3.blogger.com/__dynQ-Lq5NM/SCeNVa75UAI/AAAAAAAAACE/qyNxLdSLtzo/S220/90970001.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6987474324062764228.post-5295660846737781085</id><published>2007-07-03T22:37:00.000-07:00</published><updated>2008-11-18T21:37:01.606-08:00</updated><title type='text'>Reading &amp; Interpreting Statspack</title><content type='html'>In Oracle, Performance Tuning is based on the following formula: &lt;br /&gt;&lt;br /&gt; &lt;strong&gt;Response Time = Service Time + Wait Time&lt;/strong&gt;&lt;br /&gt;Where&lt;br /&gt;&lt;strong&gt;• Service Time is time spent on the CPU &lt;br /&gt;• Wait Time is the sum of time spent on Wait Events&lt;/strong&gt; i.e. non-idle time spent waiting for an event to complete or for a resource to become available. &lt;br /&gt;&lt;br /&gt;Service Time is comprised of time spent on the CPU for Parsing, Recursive CPU usage (for PLSQL and recursive SQL) and CPU used for execution of SQL statements (CPU Other). &lt;br /&gt;&lt;br /&gt; &lt;strong&gt;Service Time = CPU Parse + CPU Recursive + CPU Other&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The above components of Service Time can be found from the following statistics: &lt;br /&gt;• Service Time from CPU used by this session &lt;br /&gt;• CPU Parse from parse time cpu &lt;br /&gt;• CPU Recursive from recursive cpu usage &lt;br /&gt;&lt;br /&gt;From these, CPU Other can be calculated as follows: &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;CPU other = CPU used by this session - parse time CPU - recursive CPU usage&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Many performance-tuning tools (including Statspack) produce a list of the top wait events. For example, Statspack’s report contains the "Top 5 Wait Events" section.(Pre-Oracle9i Release 2).&lt;br /&gt;&lt;br /&gt;It is a common mistake to start dealing with Wait Events first and not taking in consideration the corresponding response time. So always compare the time consumed by the top wait events to the 'CPU used by this session' and identify the biggest consumers.&lt;br /&gt;&lt;br /&gt;Here is an example where CPU Other was found to be a significant component of total Response Time even though the report shows “direct path read” as top wait event:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/__dynQ-Lq5NM/RotC7zhonjI/AAAAAAAAABI/RffDQbyddcA/s1600-h/Table1.gif"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/__dynQ-Lq5NM/RotC7zhonjI/AAAAAAAAABI/RffDQbyddcA/s320/Table1.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5083230199628734002" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;From these figures we can obtain: &lt;br /&gt;• Wait Time = 10,827 x 100% / 52,01% = 20,817 cs &lt;br /&gt;• Service Time = 358,806 cs &lt;br /&gt;• Response Time = 358,806 + 20,817 = 379,623 cs &lt;br /&gt;• CPU Other = 358,806 - 38 - 186,636 = 172,132 cs &lt;br /&gt;&lt;br /&gt;If we now calculate percentages for the top Response Time components: &lt;br /&gt;• CPU Other = 45.34% &lt;br /&gt;• CPU Recursive = 49.16% &lt;br /&gt;• direct path read = 2.85% &lt;br /&gt;• etc. etc. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So we can see the I/O-related Wait Events actually are not a significant component of the overall Response Time. For us it makes sense concentrate our tuning effort on the service time component. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;CPU Other&lt;/strong&gt; is a significant component of Response Time, so a possible next step is to look at the CPU intensive SQL and not at direct path read wait event.&lt;br /&gt;Starting with Oracle9i Release 2, Statspack presents Service Time (obtained from the statistic &lt;strong&gt;CPU used by this session&lt;/strong&gt;) together with the top Wait Events in a section called &lt;strong&gt;Top 5 Timed Events&lt;/strong&gt;, which replaces the section &lt;strong&gt;Top 5 Wait Events &lt;/strong&gt;of previous releases. &lt;br /&gt;Here is an example:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/__dynQ-Lq5NM/RotEJDhonkI/AAAAAAAAABQ/6yYoanWQtYE/s1600-h/table2.gif"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/__dynQ-Lq5NM/RotEJDhonkI/AAAAAAAAABQ/6yYoanWQtYE/s320/table2.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5083231526773628482" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;These figures give us directly the percentages of the Wait Events against the total &lt;strong&gt;Response Time&lt;/strong&gt; so no further calculations are necessary to assess the impact of Wait Events.&lt;strong&gt; Service Time &lt;/strong&gt;is presented as &lt;strong&gt;CPU time &lt;/strong&gt;in this section and corresponds to the total CPU utilisation. We can drill down to the various components of Service Time as follows: &lt;br /&gt;&lt;br /&gt;• CPU Other = 3,211 - 59 - 232 = 2,920 cs &lt;br /&gt;• CPU Other = 2,920 / 3,211 x 5.79% = 5.26% &lt;br /&gt;• CPU Parse = 59 / 3,211 x 5.79% = 0.11% &lt;br /&gt;• CPU Recursive = 232 / 3,211 x 5.79% = 0.42% &lt;br /&gt;&lt;br /&gt;In this example, the main performance problem was an issue related to the Library Cache. &lt;br /&gt;The second most important time consumer was waiting for physical I/O due to multiblock reads (db file scattered read). &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Identifying problematic SQL’s from Statspack&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;From the above calculations you will get the significant components which caused the performance problem. Based on this components lets decide on the various Statspack section to identify the problematic SQL’s.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;• Other CPU&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;If this shows CPU other as being significant the next step will be to look at the SQL performing most block accesses in the &lt;em&gt;&lt;strong&gt;SQL by Gets section &lt;/strong&gt;&lt;/em&gt;of the Statspack report. A better execution plan for this statement resulting in fewer Gets/Exec will reduce its CPU consumption.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;• CPU Parse&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;If CPU Parse time is a significant component of Response Time, it can be because cursors are repeatedly opened and closed every time they are executed instead of being opened once, kept open for multiple executions and only closed when they are no longer required. The &lt;em&gt;&lt;strong&gt;SQL ordered by Parse Calls &lt;/strong&gt;&lt;/em&gt;can help find such cursors.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;• Disk I/O related waits.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Identifying SQL statements responsible for most physical reads from the Statspack section SQL ordered by Reads has similar concepts as for &lt;em&gt;&lt;strong&gt;SQL ordered by Gets.&lt;/strong&gt;&lt;/em&gt; &lt;br /&gt;% Total can be used to evaluate the impact of each statement. Reads per Exec together with Executions can be used as a hint of whether the statement has a suboptimal execution plan causing many physical reads or if it is there simply because it is executed often. Possible reasons for high Reads per Exec are use of unselective indexes require large numbers of blocks to be fetched where such blocks are not cached well in the buffer cache, index fragmentation, large Clustering Factor in index etc.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;• Latch related waits.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Statspack has 2 sections to help find such unsharable statements, &lt;em&gt;&lt;strong&gt;SQL ordered by Sharable Memory and SQL ordered by Version Count.&lt;/strong&gt;&lt;/em&gt; This can help with Shared Pool and Library Cache/Shared Pool latch tuning. Statements with many versions (multiple child cursors with the same parent cursor i.e. identical SQL text but different properties such as owning schema of objects, optimizer session settings, types &amp; lengths of bind variables etc.) are unsharable. This means they can consume excessive memory resources in the Shared Pool and cause performance problems related to parsing e.g. Library Cache and Shared Pool latch contention or lookup time e.g. Library Cache latch contention.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6987474324062764228-5295660846737781085?l=arulselvaraj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arulselvaraj.blogspot.com/feeds/5295660846737781085/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6987474324062764228&amp;postID=5295660846737781085' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/5295660846737781085'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/5295660846737781085'/><link rel='alternate' type='text/html' href='http://arulselvaraj.blogspot.com/2007/07/reading-interpreting-statspack.html' title='Reading &amp; Interpreting Statspack'/><author><name>Arul</name><uri>http://www.blogger.com/profile/07889868459610579865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp3.blogger.com/__dynQ-Lq5NM/SCeNVa75UAI/AAAAAAAAACE/qyNxLdSLtzo/S220/90970001.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/__dynQ-Lq5NM/RotC7zhonjI/AAAAAAAAABI/RffDQbyddcA/s72-c/Table1.gif' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6987474324062764228.post-1712534196189508923</id><published>2007-06-30T21:57:00.000-07:00</published><updated>2007-07-01T03:10:11.104-07:00</updated><title type='text'>Testing New Application Release on Production database</title><content type='html'>Recently we had a new application release from Vendor for one our critical (24X7) database. It was very important to test the application against the production equivalent database and the only option was to clone the real time production database and test it against the clone database. This indirectly means new hardware, storage(2TB in our case) and lot more things. &lt;br /&gt;&lt;br /&gt;Being a critical database we had physical standby database in place, we decided to failover and open the standby database for testing upgrade of application. But in this, after application upgrade testing we need to restore a standby back from backup and bring it in sync with primary. 2TB database restore will take 12 hours and we can not afford to run a critical primary database without standby in place for such a long time. We decided to use 10g flashback database through resetlog feature to come over this problem. In 10gR2 You can flashback your database back in time through resetlogs as well which will avoid the restore of standby database and we can bring the standby database in SYNC with primary ASAP.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Lets see the generic steps involved and then walk through the actual syntax and implementing it.&lt;br /&gt;&lt;br /&gt;1. Enable Flashback on Standby&lt;br /&gt;2. Perform some transaction and verify Primary Standby&lt;br /&gt;3. Stop the LISTENER for FAL SERVER/CLIENT for fake recovery&lt;br /&gt;4. Perform FAKE failover on Standby&lt;br /&gt;5. Use Primary &amp; Standby as individual Standalone databases&lt;br /&gt;6. Perform FLASHBACK on Standby to go back in time (STANDBY_ROLE)&lt;br /&gt;7. Start listener on Primary and Standby for Log shipping&lt;br /&gt;8. Verify Standby&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Flashback database through failover/reset logs&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1. Enable Flashback on Standby&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE=2G;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; ALTER SYSTEM SET DB_FLASHBACK_RETENTION_TARGET=2880;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; ALTER SYSTEM SET DB_RECOVERY_FILE_DEST='/ULTRADB01/ORACLE/ASMDB/';&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; SHUTDOWN IMMEDIATE&lt;br /&gt;ORA-01109: database not open&lt;br /&gt;Database dismounted.&lt;br /&gt;ORACLE instance shut down.&lt;br /&gt;&lt;br /&gt;SQL&gt; STARTUP MOUNT&lt;br /&gt;ORACLE instance started.&lt;br /&gt;Total System Global Area 759169024 bytes&lt;br /&gt;Fixed Size                  1263112 bytes&lt;br /&gt;Variable Size             197134840 bytes&lt;br /&gt;Database Buffers          553648128 bytes&lt;br /&gt;Redo Buffers                7122944 bytes&lt;br /&gt;Database mounted.&lt;br /&gt;&lt;br /&gt;SQL&gt; ALTER DATABASE FLASHBACK ON;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; ALTER DATABASE OPEN;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; SHUTDOWN IMMEDIATE&lt;br /&gt;Database closed.&lt;br /&gt;Database dismounted.&lt;br /&gt;ORACLE instance shut down.&lt;br /&gt;&lt;br /&gt;SQL&gt; STARTUP MOUNT&lt;br /&gt;ORACLE instance started.&lt;br /&gt;Total System Global Area 759169024 bytes&lt;br /&gt;Fixed Size                  1263112 bytes&lt;br /&gt;Variable Size             197134840 bytes&lt;br /&gt;Database Buffers          553648128 bytes&lt;br /&gt;Redo Buffers                7122944 bytes&lt;br /&gt;Database mounted.&lt;br /&gt;&lt;br /&gt;SQL&gt; RECOVER MANAGED STANDBY DATABASE DISCONNECT;&lt;br /&gt;Media recovery complete.&lt;br /&gt;SQL&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. Perform some transaction and verify Primary Standby&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;PRIMARY&lt;br /&gt;&lt;br /&gt;SQL&gt; CREATE TABLE TESTING AS SELECT * FROM DBA_OBJECTS;&lt;br /&gt;Table created.&lt;br /&gt;&lt;br /&gt;SQL&gt; SELECT COUNT (*) FROM TESTING;&lt;br /&gt;  COUNT (*)&lt;br /&gt;----------&lt;br /&gt;     46615&lt;br /&gt;&lt;br /&gt;SQL&gt; ALTER SYSTEM SWITCH LOGFILE;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;STANDBY&lt;br /&gt;SQL&gt; RECOVER MANAGED STANDBY DATABASE CANCEL;&lt;br /&gt;Media recovery complete.&lt;br /&gt;&lt;br /&gt;SQL&gt; ALTER DATABASE OPEN READ ONLY; &lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; SELECT COUNT (*) FROM TESTING;&lt;br /&gt;  COUNT (*)&lt;br /&gt;----------&lt;br /&gt;     46615&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. Stop the LISTENER for FAL SERVER/CLIENT for fake recovery&lt;/strong&gt;&lt;br /&gt;PRIMARY&lt;br /&gt;&lt;br /&gt;lsnrctl stop LOGSHIP&lt;br /&gt;LSNRCTL for Linux: Version 10.2.0.2.0 - Production on 07-SEP-2006 09:31:42&lt;br /&gt;Copyright (c) 1991, 2005, Oracle.  All rights reserved.&lt;br /&gt;Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=hqlinux26.hq.emirates.com)(PORT=1640)))&lt;br /&gt;The command completed successfully&lt;br /&gt;&lt;br /&gt;STANDBY &lt;br /&gt;&lt;br /&gt;lsnrctl stop LOGSHIP&lt;br /&gt;LSNRCTL for Linux: Version 10.2.0.2.0 - Production on 07-SEP-2006 09:47:31&lt;br /&gt;Copyright (c) 1991, 2005, Oracle.  All rights reserved.&lt;br /&gt;Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=itlinux16.hq.emirates.com)(PORT=1640)))&lt;br /&gt;The command completed successfully&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4. Perform FAKE failover on Standby&lt;/strong&gt;&lt;br /&gt;STANDBY &lt;br /&gt;&lt;br /&gt;SQL&gt; ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; SHUTDOWN IMMEDIATE&lt;br /&gt;ORA-01109: database not open&lt;br /&gt;Database dismounted.&lt;br /&gt;ORACLE instance shut down.&lt;br /&gt;&lt;br /&gt;SQL&gt; STARTUP MOUNT&lt;br /&gt;ORACLE instance started.&lt;br /&gt;Total System Global Area 759169024 bytes&lt;br /&gt;Fixed Size                  1263112 bytes&lt;br /&gt;Variable Size             197134840 bytes&lt;br /&gt;Database Buffers          553648128 bytes&lt;br /&gt;Redo Buffers                7122944 bytes&lt;br /&gt;Database mounted.&lt;br /&gt;&lt;br /&gt;SQL&gt; ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; SHUTDOWN IMMEDIATE&lt;br /&gt;ORA-01109: database not open&lt;br /&gt;Database dismounted.&lt;br /&gt;ORACLE instance shut down.&lt;br /&gt;&lt;br /&gt;SQL&gt; STARTUP&lt;br /&gt;ORACLE instance started.&lt;br /&gt;Total System Global Area 759169024 bytes&lt;br /&gt;Fixed Size                  1263112 bytes&lt;br /&gt;Variable Size             197134840 bytes&lt;br /&gt;Database Buffers          553648128 bytes&lt;br /&gt;Redo Buffers                7122944 bytes&lt;br /&gt;Database mounted.&lt;br /&gt;Database opened.&lt;br /&gt;SQL&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;5.Use Primary &amp; Standby as individual Standalone databases&lt;/strong&gt;&lt;br /&gt;STANDBY (&lt;strong&gt;Say your application upgrade is running DMLS against the database)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; SELECT COUNT (*) FROM TESTING;&lt;br /&gt;  COUNT (*)&lt;br /&gt;----------&lt;br /&gt;     46615&lt;br /&gt;&lt;br /&gt;SQL&gt; DELETE FROM TESTING;&lt;br /&gt;46615 rows deleted.&lt;br /&gt;&lt;br /&gt;SQL&gt; COMMIT;&lt;br /&gt;Commit complete.&lt;br /&gt;&lt;br /&gt;SQL&gt; SELECT COUNT (*) FROM TESTING;&lt;br /&gt;  COUNT (*)&lt;br /&gt;----------&lt;br /&gt;         0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;PRIMARY &lt;strong&gt;(Parallely your production database is up &amp; running for business)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; SELECT DATABASE_ROLE FROM V$DATABASE;&lt;br /&gt;DATABASE_ROLE&lt;br /&gt;----------------&lt;br /&gt;PRIMARY&lt;br /&gt;&lt;br /&gt;SQL&gt; SELECT COUNT (*) FROM TESTING;&lt;br /&gt;  COUNT (*)&lt;br /&gt;----------&lt;br /&gt;     46615&lt;br /&gt;&lt;br /&gt;SQL&gt; INSERT INTO TESTING SELECT * FROM TESTING;&lt;br /&gt;46615 rows created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; INSERT INTO TESTING SELECT * FROM TESTING;&lt;br /&gt;93230 rows created.&lt;br /&gt;&lt;br /&gt;SQL&gt; COMMIT;&lt;br /&gt;Commit complete.&lt;br /&gt;&lt;br /&gt;SQL&gt; SELECT COUNT (*) FROM TESTING;&lt;br /&gt;  COUNT (*)&lt;br /&gt;----------&lt;br /&gt;    186460&lt;br /&gt;&lt;br /&gt;SQL&gt; COMMIT;&lt;br /&gt;Commit complete.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;6. Perform FLASHBACK on Standby to go back in time (STANDBY_ROLE)&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Your application upgrade is tested and you want bring your standby in Sync with primary&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;STANDBY &lt;br /&gt;&lt;br /&gt;SQL&gt; SHUTDOWN IMMEDIATE&lt;br /&gt;Database closed.&lt;br /&gt;Database dismounted.&lt;br /&gt;ORACLE instance shut down.&lt;br /&gt;&lt;br /&gt;SQL&gt; STARTUP MOUNT&lt;br /&gt;ORACLE instance started.&lt;br /&gt;Total System Global Area 759169024 bytes&lt;br /&gt;Fixed Size                  1263112 bytes&lt;br /&gt;Variable Size             197134840 bytes&lt;br /&gt;Database Buffers          553648128 bytes&lt;br /&gt;Redo Buffers                7122944 bytes&lt;br /&gt;Database mounted.&lt;br /&gt;&lt;br /&gt;SQL&gt; FLASHBACK DATABASE TO TIMESTAMP TO_DATE ('09/07/06 07:32:09','MM/DD/YY HH:MI:SS');&lt;br /&gt;Flashback complete.&lt;br /&gt;&lt;br /&gt;SQL&gt; SHUTDOWN IMMEDIATE&lt;br /&gt;Database closed.&lt;br /&gt;Database dismounted.&lt;br /&gt;ORACLE instance shut down.&lt;br /&gt;&lt;br /&gt;PRIMARY&lt;br /&gt;&lt;br /&gt;SQL&gt; ALTER DATABASE CREATE STANDBY CONTROLFILE AS '/TMP/STANDBY01.CTL';&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;Copy the same to Standby server and replace with existing controlfile.&lt;br /&gt;&lt;br /&gt;STANDBY &lt;br /&gt;&lt;br /&gt;SQL&gt; STARTUP MOUNT&lt;br /&gt;ORACLE instance started.&lt;br /&gt;Total System Global Area 759169024 bytes&lt;br /&gt;Fixed Size                  1263112 bytes&lt;br /&gt;Variable Size             197134840 bytes&lt;br /&gt;Database Buffers          553648128 bytes&lt;br /&gt;Redo Buffers                7122944 bytes&lt;br /&gt;Database mounted.&lt;br /&gt;&lt;br /&gt;SQL&gt; RECOVER MANAGED STANDBY DATABASE DISCONNECT;&lt;br /&gt;Media recovery complete.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;7.Start listener on Primary and Standby for Log shipping&lt;/strong&gt;&lt;br /&gt;PRIMARY&lt;br /&gt;lsnrctl start logship&lt;br /&gt;&lt;br /&gt;STANDBY&lt;br /&gt;lsnrctl start logship&lt;br /&gt;&lt;br /&gt;SQL&gt; RECOVER MANAGED STANDBY DATABASE CANCEL;&lt;br /&gt;Media recovery complete.&lt;br /&gt;&lt;br /&gt;SQL&gt; ALTER DATABASE OPEN READ ONLY;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;8. Verify Standby&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; SELECT COUNT (*) FROM TESTING;&lt;br /&gt;  COUNT (*)&lt;br /&gt;----------&lt;br /&gt;    186460&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;EVEN THOUGH WE HAVE DELETED RECORDS FROM STANDBY AFTER FAKE FAILOVER, NOW WE ARE IN SYNC WITH PRIMARY AFTER FLASHBACK OF DATABASE. YOU HAD ZERO DOWNTIME AGAINST YOUR PRIMARY DATABASE; YOU TESTED YOUR APPLICATION CODE UPGRADE AGAINST THE REALTIME PRODUCTION DATABASE; YOU DIDN'T HAD TO CLONE THE DATABASE; YOU DIDN'T HAD TO RESTORE STANDBY DATABASE; &lt;br /&gt;&lt;br /&gt;ALL YOU DID IS FLASHBACK THE STANDBY DATABASE.&lt;br /&gt;&lt;/strong&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6987474324062764228-1712534196189508923?l=arulselvaraj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arulselvaraj.blogspot.com/feeds/1712534196189508923/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6987474324062764228&amp;postID=1712534196189508923' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/1712534196189508923'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/1712534196189508923'/><link rel='alternate' type='text/html' href='http://arulselvaraj.blogspot.com/2007/06/testing-new-application-on-release-on.html' title='&lt;strong&gt;Testing New Application Release on Production database&lt;/strong&gt;'/><author><name>Arul</name><uri>http://www.blogger.com/profile/07889868459610579865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp3.blogger.com/__dynQ-Lq5NM/SCeNVa75UAI/AAAAAAAAACE/qyNxLdSLtzo/S220/90970001.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6987474324062764228.post-513109980014394940</id><published>2007-06-19T18:58:00.000-07:00</published><updated>2007-06-19T19:11:02.438-07:00</updated><title type='text'>Fixing the Block Corruption Online</title><content type='html'>From 9i onwards you can use RMAN to recover only corrupted blocks while your database is up and running.&lt;br /&gt;&lt;br /&gt;This could possibly save hours and hours of recovery time as a full database restore is not necessary.&lt;br /&gt;&lt;br /&gt;Let's begin with the example...&lt;br /&gt;&lt;br /&gt;1. Error reported by user pointing to block corruption.&lt;br /&gt;&lt;br /&gt;An error encountered in Populate MACS DATA process.&lt;br /&gt;The Error - Source : POPULATE_MACSDATA - ORA-01578: ORACLE data block corrupted (file # 48, block # 142713)&lt;br /&gt;ORA-01110: data file 48: '/hqlinux08db06/ORACLE/macsl/MACSDAT_2006_06.dbf'&lt;br /&gt;ORA-02063: preceding 2 lines from MODSL_MACSL_LINK&lt;br /&gt;File name : /hqlinux08db06/ORACLE/macsl/MACSDAT_2006_06.dbf&lt;br /&gt;&lt;br /&gt;2. Check if the there is only one( or few) blocks corrupted or most of the blocks are corrupted.&lt;br /&gt;&lt;br /&gt;macsl:/opt/oracle/admin/macsl/bdump&gt;&lt;br /&gt;&lt;br /&gt;Issue command below at UNIX prompt.&lt;br /&gt;&lt;br /&gt;dbv file=/hqlinux08db06/ORACLE/macsl/MACSDAT_2006_06.dbf BLOCKSIZE=8192 LOGFILE=test.log&lt;br /&gt;&lt;br /&gt;DBVERIFY: Release 10.2.0.1.0 - Production on Wed Oct 4 14:28:37 2006&lt;br /&gt;Copyright (c) 1982, 2005, Oracle.  All rights reserved.&lt;br /&gt;DBV-00200: Block, dba 201469305, already marked corrupted&lt;br /&gt;&lt;br /&gt; vi test.log&lt;br /&gt;DBVERIFY: Release 10.2.0.1.0 - Production on Wed Oct 4 14:28:37 2006&lt;br /&gt;Copyright (c) 1982, 2005, Oracle.  All rights reserved.&lt;br /&gt;DBVERIFY - Verification starting : FILE = /hqlinux08db06/ORACLE/macsl/MACSDAT_2006_06.dbf&lt;br /&gt;DBVERIFY - Verification complete&lt;br /&gt;Total Pages Examined         : 262144&lt;br /&gt;Total Pages Processed (Data) : 218615&lt;br /&gt;Total Pages Failing   (Data) : 0&lt;br /&gt;Total Pages Processed (Index): 0&lt;br /&gt;Total Pages Failing   (Index): 0&lt;br /&gt;Total Pages Processed (Other): 22422&lt;br /&gt;Total Pages Processed (Seg)  : 0&lt;br /&gt;Total Pages Failing   (Seg)  : 0&lt;br /&gt;Total Pages Empty            : 21107&lt;br /&gt;Total Pages Marked Corrupt   : 1&lt;br /&gt;Total Pages Influx           : 0&lt;br /&gt;Highest block SCN            : 2550111754 (1040.2550111754) &lt;br /&gt;&lt;br /&gt;See the value in 3rd last column which points to number of corruped blocks. (Only one block corrupted).&lt;br /&gt;&lt;br /&gt;You can get the list of corrupted blocks from v$database_block_corruption as well.&lt;br /&gt;&lt;br /&gt;Select * from v$database_block_corruption;&lt;br /&gt;&lt;br /&gt;You will get block number corrupt.&lt;br /&gt;Ex: block 142713.&lt;br /&gt;&lt;br /&gt;As we know that we have only one corrupted block we can very much use RMAN to recover the block online.&lt;br /&gt;&lt;br /&gt;3. LOGIN TO RMAN.&lt;br /&gt;&lt;br /&gt;rman target / catalog rman10/rman10@rman10p&lt;br /&gt;Recovery Manager: Release 10.2.0.1.0 - Production on Wed Oct 4 14:33:26 2006&lt;br /&gt;Copyright (c) 1982, 2005, Oracle.  All rights reserved.&lt;br /&gt;connected to target database: MACSL (DBID=1125502194)&lt;br /&gt;connected to recovery catalog database&lt;br /&gt;&lt;br /&gt;RMAN&gt; blockrecover datafile 48 block 142713;&lt;br /&gt;&lt;br /&gt;Starting blockrecover at 04-OCT-06&lt;br /&gt;allocated channel: ORA_SBT_TAPE_1&lt;br /&gt;channel ORA_SBT_TAPE_1: sid=119 devtype=SBT_TAPE&lt;br /&gt;channel ORA_SBT_TAPE_1: Tivoli Data Protection for Oracle: version 5.2.0.0&lt;br /&gt;allocated channel: ORA_DISK_1&lt;br /&gt;channel ORA_DISK_1: sid=131 devtype=DISK&lt;br /&gt;&lt;br /&gt;channel ORA_SBT_TAPE_1: restoring block(s)&lt;br /&gt;channel ORA_SBT_TAPE_1: specifying block(s) to restore from backup set&lt;br /&gt;restoring blocks of datafile 00048&lt;br /&gt;channel ORA_SBT_TAPE_1: reading from backup piece MACSL.20061004.7379.1.1.602899473&lt;br /&gt;channel ORA_SBT_TAPE_1: restored block(s) from backup piece 1&lt;br /&gt;piece handle=MACSL.20061004.7379.1.1.602899473 tag=TAG20061003T222108&lt;br /&gt;channel ORA_SBT_TAPE_1: reading from backup piece MACSL.20061004.7379.2.1.602899473&lt;br /&gt;channel ORA_SBT_TAPE_1: restored block(s) from backup piece 2&lt;br /&gt;piece handle=MACSL.20061004.7379.2.1.602899473 tag=TAG20061003T222108&lt;br /&gt;channel ORA_SBT_TAPE_1: block restore complete, elapsed time: 00:04:01&lt;br /&gt;&lt;br /&gt;starting media recovery&lt;br /&gt;media recovery complete, elapsed time: 00:00:46&lt;br /&gt;&lt;br /&gt;Finished blockrecover at 04-OCT-06&lt;br /&gt;&lt;br /&gt;Block corruption has been fixed online while the database was up &amp; running within minutes.&lt;br /&gt;&lt;br /&gt;NOTE:&lt;br /&gt;-- V$database_block_corruption is the view to check the list of corrupted blocks.&lt;br /&gt;-- If you have multiple block list as corrupt, You can use single command to recover them.&lt;br /&gt;&lt;br /&gt;RMAN&gt; BLOCKRECOVER corruption list;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6987474324062764228-513109980014394940?l=arulselvaraj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arulselvaraj.blogspot.com/feeds/513109980014394940/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6987474324062764228&amp;postID=513109980014394940' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/513109980014394940'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/513109980014394940'/><link rel='alternate' type='text/html' href='http://arulselvaraj.blogspot.com/2007/06/fixing-block-corruption-online.html' title='Fixing the Block Corruption Online'/><author><name>Arul</name><uri>http://www.blogger.com/profile/07889868459610579865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp3.blogger.com/__dynQ-Lq5NM/SCeNVa75UAI/AAAAAAAAACE/qyNxLdSLtzo/S220/90970001.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6987474324062764228.post-5226167011468469383</id><published>2007-06-19T17:58:00.000-07:00</published><updated>2007-06-19T18:03:15.361-07:00</updated><title type='text'>Implement &amp; Explore Automatic Storage Management on your Laptop/Desktop</title><content type='html'>ASM can be implemented without having expensive additional disks/logical volumes/partition for testing purpose on your laptop/desktop.&lt;br /&gt;&lt;br /&gt;All you need is a free space on your hard disk to store your database.&lt;br /&gt;&lt;br /&gt;It's much intresting to do in practice than to describe in theory, so let's begin! &lt;br /&gt;&lt;br /&gt;1) Creating a dummy disks&lt;br /&gt;&lt;br /&gt;In 10gR2 installation, Oracle ships an executable called asmtool, and it can be used to create 'solid' files -solid in the sense that they are filled with zeros, as opposed to being full of empty space. These are the sorts of files ASM demands if it is to treat them as hard disks. The utility is found in the ORACLE_HOME\bin. &lt;br /&gt;&lt;br /&gt;C:\&gt;mkdir asmdisks&lt;br /&gt;&lt;br /&gt;C:\&gt;cd asmdisks&lt;br /&gt;&lt;br /&gt;C:\asmdisks&gt;asmtool -create c:\asmdisks\disk1 1024&lt;br /&gt;&lt;br /&gt;C:\asmdisks&gt;asmtool -create c:\asmdisks\disk2 1024&lt;br /&gt;&lt;br /&gt;C:\asmdisks&gt;asmtool -create c:\asmdisks\disk3 1024&lt;br /&gt;&lt;br /&gt;Now you have 3 disks(dummy) of 1 GB each which can be used to create a ASM disk group.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2) Create ASM instance&lt;br /&gt;&lt;br /&gt;a) Configure Cluster Synchronization Servie&lt;br /&gt;&lt;br /&gt;Before you can create an ASM instance on 10g Release 2, though, you must first run a script which instantiates the Oracle Cluster Registry and its associated processes &amp; services. That's done by issuing the command: &lt;br /&gt;&lt;br /&gt;C:\&gt;c:\oracle\product\10.2.0\db_1\BIN\localconfig reset&lt;br /&gt;&lt;br /&gt;Step 1:  stopping local CSS stack&lt;br /&gt;Step 2:  deleting OCR repository&lt;br /&gt;Step 3:  creating new OCR repository&lt;br /&gt;Successfully accumulated necessary OCR keys.&lt;br /&gt;Creating OCR keys for user 'ap\arogyaa', privgrp ''..&lt;br /&gt;Operation successful.&lt;br /&gt;Step 4:  creating new CSS service&lt;br /&gt;successfully created local CSS service&lt;br /&gt;successfully reset location of CSS setup&lt;br /&gt;&lt;br /&gt;b) Create Init pfile&lt;br /&gt;&lt;br /&gt;Open notepad edit the following parameters and save file as "C:\oracle\product\10.2.0\db_1\database\init+ASM.ora"&lt;br /&gt;&lt;br /&gt;INSTANCE_TYPE=ASM&lt;br /&gt;DB_UNIQUE_NAME=+ASM&lt;br /&gt;LARGE_POOL_SIZE=8M&lt;br /&gt;ASM_DISKSTRING='c:\asmdisks\*'&lt;br /&gt;_ASM_ALLOW_ONLY_RAW_DISKS=FALSE&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;c) Create service and password file&lt;br /&gt;&lt;br /&gt;oradim will create an ASM instance and start it automatically.&lt;br /&gt;&lt;br /&gt;c:\&gt; orapwd file=C:\oracle\product\10.2.0\db_1\database\PWD+ASM.ora password=asm&lt;br /&gt;c:\&gt; oradim -NEW -ASMSID +ASM -STARTMODE auto &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3) Create ASM disk group&lt;br /&gt;&lt;br /&gt;a) Create asm disk group&lt;br /&gt;SQL&gt; select path, mount_status from v$asm_disk;&lt;br /&gt;&lt;br /&gt;PATH                    MOUNT_S&lt;br /&gt;--------------------------------&lt;br /&gt;C:\ASMDISKS\DISK1       CLOSED&lt;br /&gt;&lt;br /&gt;C:\ASMDISKS\DISK3       CLOSED&lt;br /&gt;&lt;br /&gt;C:\ASMDISKS\DISK2       CLOSED&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; create diskgroup  data external redundancy disk&lt;br /&gt;  2  'C:\ASMDISKS\DISK1',&lt;br /&gt;  3  'C:\ASMDISKS\DISK2',&lt;br /&gt;  4* 'C:\ASMDISKS\DISK3';&lt;br /&gt;&lt;br /&gt;Diskgroup created.&lt;br /&gt;&lt;br /&gt;b) Change PFILE to SPFILE, Add ASM Diskgroup parameter and your all set to go and use ASM.&lt;br /&gt;&lt;br /&gt;SQL&gt; create spfile from pfile;&lt;br /&gt;SQL&gt; startup force;&lt;br /&gt;SQL&gt; alter system set asm_diskgroups=data scope=spfile;&lt;br /&gt;SQL&gt; startup force; &lt;br /&gt;&lt;br /&gt;SQL&gt; startup force&lt;br /&gt;ASM instance started&lt;br /&gt;Total System Global Area   83886080 bytes&lt;br /&gt;Fixed Size                  1247420 bytes&lt;br /&gt;Variable Size              57472836 bytes&lt;br /&gt;ASM Cache                  25165824 bytes&lt;br /&gt;ASM diskgroups mounted&lt;br /&gt;SQL&gt;&lt;br /&gt;&lt;br /&gt;Now you can go ahead and use your DBCA and create a database and on step 6 of 13, you can use Automatic Storage management as your Filesystem.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6987474324062764228-5226167011468469383?l=arulselvaraj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arulselvaraj.blogspot.com/feeds/5226167011468469383/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6987474324062764228&amp;postID=5226167011468469383' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/5226167011468469383'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/5226167011468469383'/><link rel='alternate' type='text/html' href='http://arulselvaraj.blogspot.com/2007/06/implement-explore-automatic-storage.html' title='Implement &amp; Explore Automatic Storage Management on your Laptop/Desktop'/><author><name>Arul</name><uri>http://www.blogger.com/profile/07889868459610579865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp3.blogger.com/__dynQ-Lq5NM/SCeNVa75UAI/AAAAAAAAACE/qyNxLdSLtzo/S220/90970001.JPG'/></author><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6987474324062764228.post-520920512622604432</id><published>2007-06-06T18:59:00.000-07:00</published><updated>2007-06-06T19:45:10.396-07:00</updated><title type='text'>Moving 1.2TB database from 32bit to 64bit HOST in 12min.</title><content type='html'>Recently we moved our production 9206 database (1.2TB) from 32bit to 64bit Host.&lt;br /&gt;&lt;br /&gt;Moving 1.2TB of database using backup / restore mechanism was not acceptable due to the downtime required.&lt;br /&gt;&lt;br /&gt;We followed a dataguard as an interim solution to migrate to 64bit and managed to do it successfully within 12minutes of outage.&lt;br /&gt;&lt;br /&gt;Following were the series of steps followed:&lt;br /&gt;&lt;br /&gt;1. Perform a production database backup. (32bit current/old Server).&lt;br /&gt;&lt;br /&gt;2. Create a physical standby database on a new 64bit server. (Refer Metalink Note: 118409.1 Creating a 9i Data Guard Database with RMAN)&lt;br /&gt;&lt;br /&gt;3. Bring standby database in Sync with primary and perform a failover.&lt;br /&gt;&lt;br /&gt;4. Covert the Word Size (32bit to 64bit) of the new database.&lt;br /&gt;&lt;br /&gt;• Shutdown immediate&lt;br /&gt;&lt;br /&gt;• Startup migrate&lt;br /&gt;&lt;br /&gt;• @?/rdbms/admin/utlirp &lt;br /&gt;&lt;br /&gt;NOTE: This script first Invalidates &amp; then recompiles PL/SQL modules viz., procedures, functions, packages, types, triggers, views in a database&lt;br /&gt;&lt;br /&gt;• Shutdown immediate&lt;br /&gt;&lt;br /&gt;• Startup&lt;br /&gt;&lt;br /&gt;Database outage starts at step 3, and we finished step 3 and 4 within 12 minutes and database was released to users.&lt;br /&gt;&lt;br /&gt;NOTE: YES, Dataguard works across 32bit &amp; 64bit. (Refer Metalink Note: 413484.1 Data Guard Support for Heterogeneous Primary and Standby Systems in Same Data Guard Configuration)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6987474324062764228-520920512622604432?l=arulselvaraj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arulselvaraj.blogspot.com/feeds/520920512622604432/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6987474324062764228&amp;postID=520920512622604432' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/520920512622604432'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/520920512622604432'/><link rel='alternate' type='text/html' href='http://arulselvaraj.blogspot.com/2007/06/moing-12tb-database-from-32bit-to-64bit.html' title='Moving 1.2TB database from 32bit to 64bit HOST in 12min.'/><author><name>Arul</name><uri>http://www.blogger.com/profile/07889868459610579865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp3.blogger.com/__dynQ-Lq5NM/SCeNVa75UAI/AAAAAAAAACE/qyNxLdSLtzo/S220/90970001.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6987474324062764228.post-1862314240168616716</id><published>2007-02-15T07:19:00.000-08:00</published><updated>2007-02-15T08:39:42.886-08:00</updated><title type='text'>ASM and RAW Devices on RHEL 4</title><content type='html'>Recently I implemented ASM with RAW devices on RHEL 4. Things were running fine until&lt;br /&gt;yesterday when the server was rebooted. ASM instance failed to start-up with following error.&lt;br /&gt;&lt;br /&gt;SQL&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;startup&lt;/span&gt;&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;ASM&lt;/span&gt; instance started&lt;br /&gt;&lt;br /&gt;Total System Global Area  130023424 bytes&lt;br /&gt;Fixed Size                  2027184 bytes&lt;br /&gt;Variable Size             102830416 bytes&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;ASM&lt;/span&gt; Cache                  25165824 bytes&lt;br /&gt;ORA-15032: not all alterations performed&lt;br /&gt;ORA-15063: &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;ASM&lt;/span&gt; discovered an insufficient number of disks for &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;diskgroup&lt;/span&gt;&lt;br /&gt;"&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;DGRP&lt;/span&gt;1"&lt;br /&gt;&lt;br /&gt;Alert log had following:&lt;br /&gt;&lt;br /&gt;ERROR: no PST quorum in group 1: required 2, found 0&lt;br /&gt;NOTE: cache dismounting group 1/0x94F1292B (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;DGRP&lt;/span&gt;1)&lt;br /&gt;NOTE: &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;dbwr&lt;/span&gt; not being &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;msg'd&lt;/span&gt; to dismount&lt;br /&gt;ERROR: &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;diskgroup&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;DGRP&lt;/span&gt;1 was not mounted&lt;br /&gt;&lt;br /&gt;While diagnosis I found that raw devices were owned by root where as they must be owned by Oracle.&lt;br /&gt;&lt;br /&gt;ls -l /&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;dev&lt;/span&gt;/raw/raw1&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;crw&lt;/span&gt;-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;rw&lt;/span&gt;----  1 root disk 162, 1 Feb 14 19:55 /&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;dev&lt;/span&gt;/raw/raw1&lt;br /&gt;&lt;br /&gt;I fixed the issue by changing permissions.&lt;br /&gt;&lt;br /&gt;# &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;chown&lt;/span&gt; oracle:&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;dba&lt;/span&gt; /&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;dev&lt;/span&gt;/raw/raw1&lt;br /&gt;# &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;chmod&lt;/span&gt; 660 /&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;dev&lt;/span&gt;/raw/raw1&lt;br /&gt;&lt;br /&gt;But, It seems in RH4 raw devices are remapped as root on start-up.  Every time I reboot the server,  raw device's &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_20"&gt;permissions&lt;/span&gt; were reset to root  as "/etc/udev/permissions.d/50-udev.permissions" has a following entry:&lt;br /&gt;&lt;br /&gt;# raw devices&lt;br /&gt;raw/*:root:disk:0660&lt;br /&gt;&lt;br /&gt;To make this permissions persistent across the reboot, you can do followings:&lt;br /&gt;&lt;br /&gt;1. Add following in "/etc/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_21"&gt;rc&lt;/span&gt;.local"&lt;br /&gt;&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;chown&lt;/span&gt; oracle:&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_23"&gt;dba&lt;/span&gt; /&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_24"&gt;dev&lt;/span&gt;/raw/raw1&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_25"&gt;chmod&lt;/span&gt; 660 /&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_26"&gt;dev&lt;/span&gt;/raw/raw1&lt;br /&gt;&lt;br /&gt;OR&lt;br /&gt;&lt;br /&gt;2. Add following in "/etc/udev/permissions.d/50-udev.permissions"&lt;br /&gt;&lt;br /&gt;/raw/raw1:oracle:&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_27"&gt;dba&lt;/span&gt;:0660&lt;br /&gt;&lt;br /&gt;Note: Make sure you add the above line above "raw/*:root:disk:0660". It doesn't work if you add below this one.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6987474324062764228-1862314240168616716?l=arulselvaraj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arulselvaraj.blogspot.com/feeds/1862314240168616716/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6987474324062764228&amp;postID=1862314240168616716' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/1862314240168616716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6987474324062764228/posts/default/1862314240168616716'/><link rel='alternate' type='text/html' href='http://arulselvaraj.blogspot.com/2007/02/asm-and-raw-devices-on-rhel-4.html' title='ASM and RAW Devices on RHEL 4'/><author><name>Arul</name><uri>http://www.blogger.com/profile/07889868459610579865</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://bp3.blogger.com/__dynQ-Lq5NM/SCeNVa75UAI/AAAAAAAAACE/qyNxLdSLtzo/S220/90970001.JPG'/></author><thr:total>10</thr:total></entry></feed>
