<?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-28434899</id><updated>2012-01-05T14:25:39.347-08:00</updated><category term='RMAN convert database'/><category term='compression'/><category term='RAC'/><category term='cursor sharing'/><category term='sga_target'/><category term='systemstate dump'/><category term='sga'/><category term='data dictionary'/><category term='AWR'/><category term='CRS'/><category term='optimizer cache statistics'/><category term='patches'/><category term='10g RAC DRM'/><category term='ASMM'/><category term='X$KCCCP checkpoint progress'/><title type='text'>el-caro</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>56</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-28434899.post-5824221189594423097</id><published>2010-07-29T21:36:00.001-07:00</published><updated>2010-07-30T04:58:15.796-07:00</updated><title type='text'>RDBMS events</title><content type='html'>RDBMS events are often used to do additional tracing and for debug purposes.&lt;br /&gt;Most of them are listed in $ORACLE_HOME/rdbms/mesg/oraus.msg&lt;br /&gt;One such event I use quite often to determine which locks/enqueues a session is requesting is the following.&lt;br /&gt;For example the below trace indicates that an innocuous looking query on v$flash_recovery_area_usage takes a controlfile lock in mode 4 which might not be the best thing to happen on a high throughput multi node RAC environment with a huge number of flashback logs.&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;SQL&gt; alter session set events '10704 trace name context forever, level 10';&lt;br /&gt;&lt;br /&gt;Session altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; oradebug setmypid&lt;br /&gt;Statement processed. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;SQL&gt; oradebug&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;tracefile_name /u01/app/oracle/diag/rdbms/TEST/TEST1/trace/TEST1_ora_600.trc&lt;br /&gt;SQL&gt; select * from v$flash_recovery_area_usage;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;*** 2010-07-30 10:07:33.978&lt;br /&gt;ksqgtl *** CF-00000000-00000000 mode=4 flags=0x1a011 timeout=900 ***&lt;br /&gt;ksqgtl: no transaction&lt;br /&gt;ksqgtl: use existing ksusetxn DID&lt;br /&gt;ksqgtl:&lt;br /&gt;ksqlkdid: 0001-0036-00000169&lt;br /&gt;&lt;br /&gt;*** 2010-07-30 10:07:33.978&lt;br /&gt;*** ksudidTrace: ksqgtl&lt;br /&gt;ksusesdi: 0001-0036-00000168&lt;br /&gt;ksusetxn: 0001-0036-00000169&lt;br /&gt;&lt;br /&gt;*** 2010-07-30 10:07:33.978&lt;br /&gt;ksqcmi: CF,0,0 mode=4 timeout=900&lt;br /&gt;ksqcmi: returns 0&lt;br /&gt;ksqgtl: RETURNS 0&lt;br /&gt;&lt;br /&gt;*** 2010-07-30 10:07:33.978&lt;br /&gt;ksqgtl *** CF-00000000-00000004 mode=4 flags=0x10010 timeout=0 ***&lt;br /&gt;ksqgtl: no transaction&lt;br /&gt;ksqgtl: use existing ksusetxn DID&lt;br /&gt;ksqgtl:&lt;br /&gt;ksqlkdid: 0001-0036-00000169&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Another event I have used in the past is related to parallel query to determine why PQ slaves do not get spawned&lt;br /&gt;But to my surprise this event does not work anymore in 11.2&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;SQL&gt; alter session set events '10392 trace name context forever, level 1';&lt;br /&gt;Session altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; oradebug setmypid&lt;br /&gt;Statement processed.&lt;br /&gt;&lt;br /&gt;SQL&gt; oradebug tracefile_name&lt;br /&gt;/u01/app/oracle/diag/rdbms/TEST/TEST1/trace/TEST1_ora_14748.trc&lt;br /&gt;&lt;br /&gt;SQL&gt; select /*+ parallel(a,8) */ count(*) from sys.obj$ a;&lt;br /&gt;&lt;br /&gt;COUNT(*)&lt;br /&gt;----------&lt;br /&gt;231692&lt;br /&gt;&lt;br /&gt;SQL&gt; !cat /u01/app/oracle/diag/rdbms/TEST/TEST1/trace/TEST1_ora_14748.trc&lt;br /&gt;&lt;br /&gt;*** 2010-07-30 14:41:02.547&lt;br /&gt;*** SESSION ID:(316.58074) 2010-07-30 14:41:02.547&lt;br /&gt;*** CLIENT ID:() 2010-07-30 14:41:02.547&lt;br /&gt;*** SERVICE NAME:(SYS$USERS) 2010-07-30 14:41:02.547&lt;br /&gt;*** MODULE NAME:(sqlplus@bart.au (TNS V1-V3)) 2010-07-30 14:41:02.547&lt;br /&gt;*** ACTION NAME:() 2010-07-30 14:41:02.547&lt;br /&gt;&lt;br /&gt;Processing Oradebug command 'setmypid'&lt;br /&gt;&lt;br /&gt;*** 2010-07-30 14:41:02.547&lt;br /&gt;Oradebug command 'setmypid' console output: &lt;none&gt;&lt;br /&gt;&lt;br /&gt;*** 2010-07-30 14:41:08.598&lt;br /&gt;Processing Oradebug command 'tracefile_name'&lt;br /&gt;&lt;br /&gt;*** 2010-07-30 14:41:08.598&lt;br /&gt;Oradebug command 'tracefile_name' console output:&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;The trace does not contain any information&lt;br /&gt;&lt;br /&gt;Feedback from Oracle was that “not many people use the px numeric ones and so they removed the code.”…&lt;br /&gt;You can still use the _px_trace underscore parameter to determine why queries are not running in parallel&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-5824221189594423097?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/5824221189594423097/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=5824221189594423097&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/5824221189594423097'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/5824221189594423097'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2010/07/rdbms-events.html' title='RDBMS events'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-2892586851218624068</id><published>2010-04-07T04:19:00.000-07:00</published><updated>2010-04-07T04:29:04.982-07:00</updated><title type='text'>Dynamic Re-Mastering in 11g</title><content type='html'>This is a follow-up on a post from last year&lt;br /&gt;&lt;br /&gt;&lt;a href="http://el-caro.blogspot.com/search/label/10g%20RAC%20DRM"&gt;http://el-caro.blogspot.com/search/label/10g%20RAC%20DRM&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Node 1&lt;br /&gt;========&lt;br /&gt;SQL&gt; create table obj as select * from sys.obj$;&lt;br /&gt;&lt;br /&gt;Table created.&lt;br /&gt;&lt;br /&gt;SQL&gt; select object_id,owner,object_type from dba_objects where object_name='OBJ' and object_type='TABLE';&lt;br /&gt;&lt;br /&gt;OBJECT_ID OWNER OBJECT_TYPE&lt;br /&gt;---------- ------------------------------ -------------------&lt;br /&gt;136388 REGOFA TABLE&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from V$GCSPFMASTER_INFO where DATA_OBJECT_ID=136388;&lt;br /&gt;&lt;br /&gt;no rows selected&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now we go to node 2 and manually master the object there...&lt;br /&gt;&lt;br /&gt;Node 2&lt;br /&gt;=========&lt;br /&gt;SQL&gt; oradebug setmypid&lt;br /&gt;Statement processed.&lt;br /&gt;SQL&gt; oradebug lkdebug -m pkey 136388&lt;br /&gt;Statement processed.&lt;br /&gt;SQL&gt; select * from V$GCSPFMASTER_INFO where data_object_id=136388;&lt;br /&gt;&lt;br /&gt;FILE_ID DATA_OBJECT_ID GC_MASTERIN CURRENT_MASTER PREVIOUS_MASTER&lt;br /&gt;---------- -------------- ----------- -------------- ---------------&lt;br /&gt;REMASTER_CNT&lt;br /&gt;------------&lt;br /&gt;0 136388 Affinity 1 32767&lt;br /&gt;1&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Node 1&lt;br /&gt;======&lt;br /&gt;&lt;br /&gt;SQL&gt; oradebug setmypid&lt;br /&gt;Statement processed.&lt;br /&gt;SQL&gt; oradebug lkdebug -m pkey 136388&lt;br /&gt;Statement processed.&lt;br /&gt;&lt;br /&gt;Also Bug 5649377: REMASTER_CNT IN V$GCSPFMASTER_INFO IS NOT GETTING UPDATED&lt;br /&gt;which I logged in 2006 is fixed in 11g&lt;br /&gt;&lt;br /&gt;SQL&gt; /&lt;br /&gt;&lt;br /&gt;FILE_ID DATA_OBJECT_ID GC_MASTERIN CURRENT_MASTER PREVIOUS_MASTER&lt;br /&gt;---------- -------------- ----------- -------------- ---------------&lt;br /&gt;REMASTER_CNT&lt;br /&gt;------------&lt;br /&gt;0 136388 Affinity 0 1&lt;br /&gt;2&lt;br /&gt;&lt;br /&gt;As you can see the remaster_cnt is correctly set to 2 above&lt;br /&gt;SQL&gt; select * from X$KJDRMAFNSTATS;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ADDR INDX INST_ID DRMS AVG_DRM_TIME OBJECTS_PER_DRM&lt;br /&gt;---------------- ---------- ---------- ---------- ------------ ---------------&lt;br /&gt;QUIESCE_T FRZ_T CLEANUP_T REPLAY_T FIXWRITE_T SYNC_T RES_CLEANED&lt;br /&gt;---------- ---------- ---------- ---------- ---------- ---------- -----------&lt;br /&gt;REPLAY_S REPLAY_R MY_OBJECTS&lt;br /&gt;---------- ---------- ----------&lt;br /&gt;0000000060016FC0 0 1 104 11291 186&lt;br /&gt;3219 28 1622 1302 4589 510 0&lt;br /&gt;26 191959 2&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; select count(*) from V$GCSPFMASTER_INFO where current_master=0;&lt;br /&gt;&lt;br /&gt;COUNT(*)&lt;br /&gt;----------&lt;br /&gt;2&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;DRM info is now also available in AWR tables via DBA_HIST_DYN_REMASTER_STATS&lt;br /&gt;&lt;br /&gt;Also the following event can be used to trace DRM information&lt;br /&gt;&lt;br /&gt;Event can be turned ON dynamically&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system set events '10430 trace name context forever, level 10';&lt;br /&gt;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;*** 2010-04-07 21:02:23.831&lt;br /&gt;Begin DRM(245) (swin 0) - AFFINITY transfer pkey &lt;strong&gt;136388&lt;/strong&gt;.0 to 2 oscan 1.1&lt;br /&gt;kjiobjscn 1&lt;br /&gt;ftd (30) received from node 1 (8/0.0.0)&lt;br /&gt;all ftds received&lt;br /&gt;&lt;br /&gt;* kjxftdn: break from kjxftdn, post lmon later&lt;br /&gt;&lt;br /&gt;Event can be turned off&lt;br /&gt;SQL&gt; alter system set events '10430 trace name context off';&lt;br /&gt;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Also the LMON and LMS trace files contains DRM related info&lt;br /&gt;&lt;br /&gt;Although I have seen a lot of issues in 10G and turned off DRM in many cases I haven't seen any such issues&lt;br /&gt;in 11.2 so far&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-2892586851218624068?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/2892586851218624068/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=2892586851218624068&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/2892586851218624068'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/2892586851218624068'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2010/04/dynamic-re-mastering-in-11g.html' title='Dynamic Re-Mastering in 11g'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-5344124908963585675</id><published>2009-12-05T18:28:00.000-08:00</published><updated>2009-12-05T18:38:54.629-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='compression'/><title type='text'>Oracle Advanced Compression Advisor</title><content type='html'>Am currently working on how best  to use compression techniques in an OLTP environment on a current 10g database which is due to be migrated to 11.2 in the next 6 months and I came across this OTN note&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.oracle.com/technology/products/database/compression/compression-advisor.html"&gt;http://www.oracle.com/technology/products/database/compression/compression-advisor.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The following statement got me very interested&lt;br /&gt;&lt;br /&gt;This package can be used on Oracle Databases running Oracle Database 9i Release 2 through 11g Release 1.&lt;br /&gt;A compression advisor (DBMS_COMPRESSION) comes packaged with Oracle Database 11g Release 2. &lt;br /&gt;&lt;br /&gt;So lets give it a try...&lt;br /&gt;&lt;br /&gt;I downloaded the package and compiled it..&lt;br /&gt;&lt;br /&gt;SQL&gt; @dbmscomp.sql&lt;br /&gt;&lt;br /&gt;Package created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Synonym created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Grant succeeded.&lt;br /&gt;&lt;br /&gt;No errors.&lt;br /&gt;&lt;br /&gt;SQL&gt; @prvtcomp.plb&lt;br /&gt;&lt;br /&gt;Package body created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Synonym created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Grant succeeded.&lt;br /&gt;&lt;br /&gt;No errors.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; set serveroutput on&lt;br /&gt;&lt;br /&gt;SQL&gt; exec dbms_comp_advisor.getratio('OWNER1','CROSS','OLTP',1);&lt;br /&gt;&lt;br /&gt;Invalid Compression option for the current COMPAT setting&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Thankfully the package body is not encrypted and a quick look at the code reveals that it does the following&lt;br /&gt;&lt;br /&gt;SQL&gt; create table DBMS_COMPRESSION_TEMP_UNCMP as select /*+ full('CROSS') */ * from cross sample block( 1);&lt;br /&gt;&lt;br /&gt;Table created.&lt;br /&gt;&lt;br /&gt;SQL&gt; create table DBMS_COMPRESSION_TEMP_CMP compress for all operations as select * from DBMS_COMPRESSION_TEMP_UNCMP;&lt;br /&gt;create table DBMS_COMPRESSION_TEMP_CMP compress for all operations as select * from DBMS_COMPRESSION_TEMP_UNCMP&lt;br /&gt;                                                *&lt;br /&gt;ERROR at line 1:&lt;br /&gt;ORA-00922: missing or invalid option&lt;br /&gt;&lt;br /&gt;Hmmm... not sure how they expect "compress for all operations" to work in a pre 11g database...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-5344124908963585675?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/5344124908963585675/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=5344124908963585675&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/5344124908963585675'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/5344124908963585675'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2009/12/oracle-advanced-compression-advisor.html' title='Oracle Advanced Compression Advisor'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-7977378327616425549</id><published>2009-09-18T18:52:00.000-07:00</published><updated>2009-09-18T19:11:08.069-07:00</updated><title type='text'>Interrupting Flashback Database</title><content type='html'>So a user called me up and said he was flashing back a database and he was not too happy with the amount of time it was taking to complete the operation and so he did a Ctrl-C...&lt;br /&gt;&lt;br /&gt;When he tried to open the database this is what he saw..&lt;br /&gt;&lt;br /&gt;==================================================================================&lt;br /&gt;&lt;br /&gt;SQL&gt; shutdown abort&lt;br /&gt;ORACLE instance shut down.&lt;br /&gt;SQL&gt; startup&lt;br /&gt;ORACLE instance started.&lt;br /&gt;&lt;br /&gt;Total System Global Area  838860800 bytes&lt;br /&gt;Fixed Size                  2033832 bytes&lt;br /&gt;Variable Size             520099672 bytes&lt;br /&gt;Database Buffers          310378496 bytes&lt;br /&gt;Redo Buffers                6348800 bytes&lt;br /&gt;Database mounted.&lt;br /&gt;ORA-38760: This database instance failed to turn on flashback database&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database flashback off;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database open;&lt;br /&gt;alter database open&lt;br /&gt;*&lt;br /&gt;ERROR at line 1:&lt;br /&gt;ORA-38760: This database instance failed to turn on flashback database&lt;br /&gt;&lt;br /&gt;===&gt;... Well he just turned off flashback..&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database open resetlogs;&lt;br /&gt;alter database open resetlogs&lt;br /&gt;*&lt;br /&gt;ERROR at line 1:&lt;br /&gt;ORA-01139: RESETLOGS option only valid after an incomplete database recovery&lt;br /&gt;&lt;br /&gt;==================================================================================&lt;br /&gt;&lt;br /&gt;Looking through the alert.log&lt;br /&gt;&lt;br /&gt;Fri Sep 18 08:35:05 2009&lt;br /&gt;flashback database to restore point TEST_AFTER&lt;br /&gt;Fri Sep 18 08:35:05 2009&lt;br /&gt;ORA-38757 signalled during: flashback database to restore point TEST_AFTER...&lt;br /&gt;Fri Sep 18 12:00:48 2009&lt;br /&gt;&lt;br /&gt;No errors in the RVWR process trace file &lt;br /&gt;&lt;br /&gt;So I just dropped the restore point and voila&lt;br /&gt;&lt;br /&gt;&gt; drop restore point TEST_AFTER;&lt;br /&gt;&lt;br /&gt;Restore point dropped.&lt;br /&gt;&lt;br /&gt;&gt; select flashback_on from v$database;&lt;br /&gt;&lt;br /&gt;FLASHBACK_ON&lt;br /&gt;------------------&lt;br /&gt;NO&lt;br /&gt;&lt;br /&gt;&gt;  alter database open;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-7977378327616425549?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/7977378327616425549/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=7977378327616425549&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/7977378327616425549'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/7977378327616425549'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2009/09/interrupting-flashback-database.html' title='Interrupting Flashback Database'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-3721794978186617848</id><published>2009-06-28T04:50:00.000-07:00</published><updated>2009-06-28T05:01:26.945-07:00</updated><title type='text'>Are you sure you will be able to activate your standby??</title><content type='html'>A couple of weeks I faced a scenario where the standby database crashed &lt;br /&gt;&lt;br /&gt;On looking at the alert.log I see the following message in the alert.log of the standby&lt;br /&gt;&lt;br /&gt;***********************************************************&lt;br /&gt;Sat Jun  6 06:48:52 2009&lt;br /&gt;Recovery interrupted!&lt;br /&gt; cannot find needed online log for redo thread 1&lt;br /&gt;Some recovered datafiles maybe left media fuzzy&lt;br /&gt;Media recovery may continue but open resetlogs may fail&lt;br /&gt;Sat Jun  6 06:48:53 2009&lt;br /&gt;Errors in file /u01/app/oracle/admin/TEST/bdump/test1_mrp0_24533.trc:&lt;br /&gt;ORA-10576: Give up restoring recovered datafiles to consistent state: some error occurred&lt;br /&gt;ORA-16037: user requested cancel of managed recovery operation&lt;br /&gt;Some recovered datafiles maybe left media fuzzy&lt;br /&gt;Media recovery may continue but open resetlogs may fail&lt;br /&gt;Sat Jun  6 06:48:54 2009&lt;br /&gt;Waiting for MRP0 pid 24533 to terminate&lt;br /&gt;************************************************************&lt;br /&gt;&lt;br /&gt;Hmmm... this means that if the standby does not have the redo and cannot get it from the primary you will not be able to online media fuzzy files using supported methods&lt;br /&gt;&lt;br /&gt;The same issue is explained in Bug &lt;a href="https://metalink2.oracle.com/metalink/plsql/f?p=130:15:1582997132709471353::::p15_database_id,p15_docid,p15_show_header,p15_show_help,p15_black_frame,p15_font:BUG,5956646,1,1,1,helvetica"&gt;5956646&lt;/a&gt;&lt;br /&gt;as an architectural limitation.&lt;br /&gt;&lt;br /&gt;This is a very unlikely scenario but a possibility none the less&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-3721794978186617848?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/3721794978186617848/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=3721794978186617848&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/3721794978186617848'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/3721794978186617848'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2009/06/are-you-sure-you-will-be-able-to.html' title='Are you sure you will be able to activate your standby??'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-7649333257166069358</id><published>2009-01-27T15:34:00.000-08:00</published><updated>2009-01-27T19:28:48.145-08:00</updated><title type='text'>Outbound_connect_timeout</title><content type='html'>Outbound_connect_timeout comes into play when nodes in a cluster are down and we cannot wait for the OS timeout as this causes long delays in connect time. For example on Solaris the value of  tcp_ip_abort_interval  = 180000  ==&gt; which is 180 seconds ==&gt; 3 mins&lt;br /&gt;&lt;br /&gt;In this post I will demonstrate how outbound_connect_timeout (OCT) can effectively avoid timeouts experienced by clients connecting to RAC nodes&lt;br /&gt;&lt;br /&gt;If we take an example of the following connect string&lt;br /&gt;&lt;br /&gt;&lt;em&gt;TEST =&lt;br /&gt;  (DESCRIPTION =&lt;br /&gt;    (ADDRESS_LIST =&lt;br /&gt;      (LOAD_BALANCE = OFF)&lt;br /&gt;      (ADDRESS = (PROTOCOL = TCP)(HOST = sdby1-vip)(PORT = 1521))&lt;br /&gt;      (ADDRESS = (PROTOCOL = TCP)(HOST = sdby2-vip)(PORT = 1521))&lt;br /&gt;      (ADDRESS = (PROTOCOL = TCP)(HOST = sdby3-vip)(PORT = 1521))&lt;br /&gt;      (ADDRESS = (PROTOCOL = TCP)(HOST = sdby4-vip)(PORT = 1521))&lt;br /&gt;      (ADDRESS = (PROTOCOL = TCP)(HOST = prim1-vip)(PORT = 1521))&lt;br /&gt;    )&lt;br /&gt;    (CONNECT_DATA =&lt;br /&gt;      (SERVER = DEDICATED)&lt;br /&gt;      (SERVICE_NAME = TEST)&lt;br /&gt;    )&lt;br /&gt;  )&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;In the above alias the first 4 nodes are non existent nodes and the service TEST&lt;br /&gt;runs on the node prim1 which is listed last in the above alias.&lt;br /&gt;&lt;br /&gt;I have deliberately set load_balance to OFF so that the client has to traverse through all nodes serially.&lt;br /&gt;&lt;br /&gt;If we set an OUTBOUND_CONNECT_TIMEOUT of 3 seconds in the client's sqlnet.ora&lt;br /&gt;(client is 10.2.0.3 Solaris) then the time to establish the connection is around 12 seconds.&lt;br /&gt;&lt;br /&gt;If we were to run a sqlnet trace on the connection we see that the connection starts at&lt;br /&gt;&lt;br /&gt;Connection started at&lt;br /&gt;&lt;em&gt;[27-JAN-2009 22:52:33:741] --- TRACE CONFIGURATION INFORMATION FOLLOWS ---&lt;br /&gt;[27-JAN-2009 22:52:33:741] New trace stream is /tmp/cli_262.trc &lt;/em&gt;&lt;br /&gt;and the first address which is tried is&lt;br /&gt;&lt;br /&gt;&lt;em&gt;[27-JAN-2009 22:52:33:757] nsc2addr: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=sdb1-vip)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=TEST)(CID=(PROGRAM=sqlplus@bart)(HOST=bart)(USER=oracle))))&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Moving on we can see that OCT is enabled due to the line&lt;br /&gt;&lt;br /&gt;&lt;em&gt;[27-JAN-2009 22:52:33:759] nstoSetupTimeout: entry&lt;br /&gt;[27-JAN-2009 22:52:33:759] nstoSetupTimeout: ATO enabled for ctx=0x1001c9280, val=3000(millisecs)&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;After this we the following pattern is seen continuously&lt;br /&gt;&lt;br /&gt;&lt;em&gt;[27-JAN-2009 22:52:33:776] nsevwtsg: entry&lt;br /&gt;[27-JAN-2009 22:52:33:776] nsevwtsg: cid=0&lt;br /&gt;[27-JAN-2009 22:52:33:776] nsevwait: entry&lt;br /&gt;[27-JAN-2009 22:52:33:776] nsevwait: 1 registered connection(s)&lt;br /&gt;[27-JAN-2009 22:52:33:776] nsevwait: 0 pre-posted event(s)&lt;br /&gt;[27-JAN-2009 22:52:33:776] nsevwait: waiting for transport event (0 thru 0)...&lt;br /&gt;[27-JAN-2009 22:52:33:776] nsevwait: 0 newly-posted event(s)&lt;br /&gt;[27-JAN-2009 22:52:33:776] nsevwait: 0 posted event(s)&lt;br /&gt;[27-JAN-2009 22:52:33:776] nsevwait: exit (0)&lt;br /&gt;[27-JAN-2009 22:52:33:776] nstoToqCheckSingle: entry&lt;br /&gt;[27-JAN-2009 22:52:33:776] nstoToqCheckSingle: normal exit&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;and the timeout occurs in 3 seconds&lt;br /&gt;&lt;br /&gt;&lt;em&gt;[27-JAN-2009 22:52:36:771] nstoHandleEventTO: ATO occurred for ctx=0x1001c9280&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Ergo the OCT seems to be working perfectly&lt;br /&gt;&lt;br /&gt;The client then tries to establish a connection with sdby2-vip and experiences&lt;br /&gt;the same timeout&lt;br /&gt;&lt;br /&gt;The connection is finally established at &lt;br /&gt;&lt;br /&gt;&lt;em&gt;[27-JAN-2009 22:52:45:915] nscon: no connect data&lt;br /&gt;[27-JAN-2009 22:52:45:915] nscon: connect handshake is complete&lt;br /&gt;[27-JAN-2009 22:52:45:915] nscon: nsctxinf[0]=0x41, [1]=0x41&lt;br /&gt;[27-JAN-2009 22:52:45:915] nscon: normal exit&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;which translates to around 12 seconds.&lt;br /&gt;&lt;br /&gt;From my testing for clients on Windows&lt;br /&gt;&lt;br /&gt;OUTBOUND_CONNECT_TIMEOUT does not work with 10.2.0.3 base windows client. (Clients may get errors)&lt;br /&gt;It works with patch 21 on top of 10.2.0.3&lt;br /&gt;OUTBOUND_CONNECT_TIMEOUT does  work with 11g client&lt;br /&gt;&lt;br /&gt;Without OCT if we trace the connection again we see that we wait for more than 3 mins&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;[28-JAN-2009 14:18:35:299] nttcni: entry&lt;br /&gt;&lt;strong&gt;[28-JAN-2009 14:18:35:299] nttcni: trying to connect to socket 10.&lt;br /&gt;[28-JAN-2009 14:22:19:915] ntt2err: entry&lt;/strong&gt;&lt;br /&gt;[28-JAN-2009 14:22:19:915] ntt2err: soc 10 error - operation=1, ntresnt[0]=505, ntresnt[1]=145, ntresnt[2]=0&lt;br /&gt;[28-JAN-2009 14:22:19:915] ntt2err: exit&lt;br /&gt;[28-JAN-2009 14:22:19:915] nttcni: exit&lt;br /&gt;[28-JAN-2009 14:22:19:915] nttcon: exit&lt;br /&gt;[28-JAN-2009 14:22:19:921] nserror: entry&lt;br /&gt;[28-JAN-2009 14:22:19:921] nserror: nsres: id=0, op=65, ns=12535, ns2=12560; nt[0]=505, nt[1]=145, nt[2]=0; ora[0]=0, ora[1]=0, ora[2]=0&lt;br /&gt;[28-JAN-2009 14:22:19:921] nsopen: unable to open transport&lt;br /&gt;[28-JAN-2009 14:22:19:921] nsiocancel: entry&lt;/em&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-7649333257166069358?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/7649333257166069358/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=7649333257166069358&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/7649333257166069358'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/7649333257166069358'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2009/01/outboundconnecttimeout.html' title='Outbound_connect_timeout'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-6250721226177434418</id><published>2008-11-30T01:13:00.000-08:00</published><updated>2008-11-30T15:17:08.458-08:00</updated><title type='text'>Parallel Rollback</title><content type='html'>I had a user call up and ask to kill a session which was causing him grief and hence I killed it without much thought since it was not a Production system&lt;br /&gt;&lt;br /&gt;A few hours later I noticed that SMON was doing parallel txn recovery. This was validated by  the view &lt;br /&gt;select * from x$ktprxrt;&lt;br /&gt;&lt;br /&gt;Unfortunately I have lost the output but it did show that it would take eons&lt;br /&gt;&lt;br /&gt;But this was also confirmed from the pstack of smon which included the function  ktprbeg which I believe begins parallel rollback. (Snippet below)&lt;br /&gt;&lt;br /&gt;[syd0904:oracle:OSTA1]/u01/app/oracle =&gt; pstack 11905&lt;br /&gt;11905:  ora_smon_OSTA1&lt;br /&gt;&lt;br /&gt;  0000000100d80868 kturax (fffffffffffffffe, 380017150, b, 380017, 105ebe510, 5) + 928&lt;br /&gt; 0000000100e15620 ktprbeg (106502000, 0, 1065033c8, 105400, 1056b5, 1065033c8) + 1a0                 ===&gt; Begin parallel rollback&lt;br /&gt; 00000001007e9238 ktmmon (ffffffffffffffff, ffffffff7fffdda8, 0, 1056b5000, 1, 106502000) + f58&lt;br /&gt; 000000010106e0dc ksbrdp (105f1b000, 38000e, 106505ce0, 105f1b000, 105f1b, 1007e8260) + 39c&lt;br /&gt; 00000001024efed8 opirip (106510000, 106400, 106518, 380007000, 106510, 1066a5650) + 338&lt;br /&gt; 000000010033f7b4 opidrv (106512a90, 0, 32, 10650f7c8, 32, 0) + 4b4&lt;br /&gt; 0000000100339c50 sou2o (ffffffff7ffff3e8, 32, 4, ffffffff7ffff410, 105de9000, 105de9) + 50&lt;br /&gt; 00000001002fc00c opimai_real (3, ffffffff7ffff4e8, 0, 0, 247e09c, 14800) + 10c&lt;br /&gt; 00000001002fbe38 main (1, ffffffff7ffff5f8, 0, ffffffff7ffff4f0, ffffffff7ffff600, ffffffff79d00140) + 98&lt;br /&gt; 00000001002fbd5c _start (0, 0, 0, 0, 0, 0) + 17c&lt;br /&gt;-----------------  lwp# 2 / thread# 2  --------------------&lt;br /&gt;&lt;br /&gt;and also confirmed from the SMON trace file&lt;br /&gt;&lt;br /&gt;*** 2008-11-28 12:03:16.828&lt;br /&gt;Parallel Transaction recovery caught exception 30319&lt;br /&gt;Parallel Transaction recovery caught error 30319&lt;br /&gt;*** 2008-11-28 12:07:17.163&lt;br /&gt;Parallel Transaction recovery caught exception 30319&lt;br /&gt;Parallel Transaction recovery caught error 30319&lt;br /&gt;&lt;br /&gt;So the first thing I did was to disable parallel recovery because of the issue documented in &lt;a href="https://metalink2.oracle.com/metalink/plsql/f?p=130:14:5489891601949199542::::p14_database_id,p14_docid,p14_show_header,p14_show_help,p14_black_frame,p14_font:NOT,736348.1,1,1,1,helvetica"&gt;Metalink&lt;/a&gt;&lt;br /&gt;using &lt;br /&gt;&lt;br /&gt;SQL&gt; ALTER SYSTEM SET fast_start_parallel_rollback='FALSE';&lt;br /&gt;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;IMHO (atleast from past experience)  serial recovery is faster than parallel recovery atleast in the case  where the transaction causes a lot of index block splits.&lt;br /&gt;&lt;br /&gt;After this the row from x$ktprxrt disappeared and the following appeared in the SMON trace file&lt;br /&gt;&lt;br /&gt;*** 2008-11-28 12:08:32.763&lt;br /&gt;SMON: parallel recovery restart with degree=0 (!=16)&lt;br /&gt;Parallel Transaction recovery caught exception 30312&lt;br /&gt;Parallel Transaction recovery caught error 30312&lt;br /&gt;*** 2008-11-28 12:08:33.039&lt;br /&gt;SMON: parallel recovery restart with degree=0 (!=16)&lt;br /&gt;Parallel Transaction recovery caught exception 30312&lt;br /&gt;Parallel Transaction recovery caught error 30312&lt;br /&gt;&lt;br /&gt;The following views agree on how much time it is going to take to complete the rollback&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from x$ktuxe where KTUXECFL='DEAD' and KTUXESTA='ACTIVE';&lt;br /&gt;&lt;br /&gt;ADDR                   INDX    INST_ID   KTUXEUSN   KTUXESLT   KTUXESQN  KTUXERDBF  KTUXERDBB  KTUXESCNB  KTUXESCNW KTUXESTA&lt;br /&gt;---------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------------&lt;br /&gt;KTUXECFL                   KTUXEUEL  KTUXEDDBF  KTUXEDDBB  KTUXEPUSN  KTUXEPSLT  KTUXEPSQN   KTUXESIZ&lt;br /&gt;------------------------ ---------- ---------- ---------- ---------- ---------- ---------- ----------&lt;br /&gt;FFFFFFFF79969D78        114          1          1         16     174276          2      36154 1113256061       1021 ACTIVE&lt;br /&gt;DEAD                             13          0          0          0          0          0     639787&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from GV$FAST_START_TRANSACTIONS ;&lt;br /&gt;&lt;br /&gt;   INST_ID        USN        SLT        SEQ STATE            UNDOBLOCKSDONE UNDOBLOCKSTOTAL        PID    CPUTIME  PARENTUSN  PARENTSLT&lt;br /&gt;---------- ---------- ---------- ---------- ---------------- -------------- --------------- ---------- ---------- ---------- ----------&lt;br /&gt; PARENTSEQ XID              PXID             RCVSERVERS&lt;br /&gt;---------- ---------------- ---------------- ----------&lt;br /&gt;         1          1         16     174276 RECOVERING               122712          762423                  6312&lt;br /&gt;           000100100002A8C4                           0&lt;br /&gt;&lt;br /&gt;As you can see the value of &lt;br /&gt;KTUXESIZ matches (UNDOBLOCKSTOTAL - UNDOBLOCKSDONE)&lt;br /&gt;&lt;br /&gt;So rollback will complete when KTUXESIZ in x$ktuxe drops down to 0 which looks like alot of time !!!&lt;br /&gt;Dumping the redo confirmed that it was the same transaction which was killed&lt;br /&gt;&lt;br /&gt;Surprisingly the value of "rollback changes - undo records applied" in v$sysstat was not increasing during this timeline. I have tested this again (kill a long running job and watch the rollback) and can confirm that the stat does get incremented.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-6250721226177434418?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/6250721226177434418/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=6250721226177434418&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/6250721226177434418'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/6250721226177434418'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2008/11/parallel-rollback.html' title='Parallel Rollback'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-5133568317732736148</id><published>2008-07-30T01:14:00.000-07:00</published><updated>2008-07-30T01:16:16.146-07:00</updated><title type='text'>11g SQLNet Client trace files</title><content type='html'>I spent half an hour wondering why I was not able to generate a SQL* Net client trace file from a 11g client to a 10.2 database.&lt;br /&gt;Here are the  contents of my client sqlnet.ora&lt;br /&gt;&lt;br /&gt;bart:ELEV:/opt/oracle/product/11.1.0/db_1/network/admin&gt; cat sqlnet.ora&lt;br /&gt;#SQLNET.OUTBOUND_CONNECT_TIMEOUT = 3&lt;br /&gt;TRACE_LEVEL_CLIENT= 16&lt;br /&gt;TRACE_DIRECTORY_CLIENT = /tmp&lt;br /&gt;TRACE_FILE_CLIENT= cli.trc&lt;br /&gt;TRACE_TIMESTAMP_CLIENT = ON&lt;br /&gt;TRACE_UNIQUE_CLIENT = ON&lt;br /&gt;&lt;br /&gt;It took me a while to realize that thanks to ADR the client trace files were actually going to $ORACLE_BASE/diag/clients/user_oracle/host_xxx/trace&lt;br /&gt;&lt;br /&gt;The only way to disable this is to add the following  in the sqlnet.ora&lt;br /&gt;DIAG_ADR_ENABLED=off&lt;br /&gt;&lt;br /&gt;After setting the above line in the sqlnet.ora the client trace files were generated in /tmp&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-5133568317732736148?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/5133568317732736148/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=5133568317732736148&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/5133568317732736148'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/5133568317732736148'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2008/07/11g-sqlnet-client-trace-files.html' title='11g SQLNet Client trace files'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-5315107440232731437</id><published>2008-07-28T19:23:00.000-07:00</published><updated>2008-07-28T19:37:08.649-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='patches'/><title type='text'>One off patches, conflicts and merges</title><content type='html'>So you are applying one of the zillion patches on top of 10.2.0.3 and you hit the following error&lt;br /&gt;&lt;br /&gt;************************************************************************&lt;br /&gt;&lt;br /&gt;ApplySession applying interim patch '6338357' to OH &lt;br /&gt;'/opt/oracle/product/10.2.0/db_1'&lt;br /&gt;Interim patch 6338357 has File Conflict with patch(es) [ 5399670 ] &lt;br /&gt;in OH /opt/oracle/product/10.2.0/db_1&lt;br /&gt;&lt;br /&gt;************************************************************************&lt;br /&gt;&lt;br /&gt;Wouldn't it be nice if you could check for conflicts before you apply a patch &lt;br /&gt;Here is one way to do the same&lt;br /&gt;&lt;br /&gt;1. You can check which source code file is being modified by doing the following&lt;br /&gt;&lt;br /&gt;cd 6338357/etc/config&lt;br /&gt;cat actions | grep .o&lt;br /&gt;oneoff_actions&lt;br /&gt;    oracle.rdbms version="10.2.0.3.0" opt_req="R"&lt;br /&gt;        archive name="libserver10.a" path="%ORACLE_HOME%/lib" object_name="lib/libserver10.a/&lt;strong&gt;kelt.o&lt;/strong&gt;"&lt;br /&gt;        make change_dir="%ORACLE_HOME%/rdbms/lib" make_file="ins_rdbms.mk" make_target="ioracle"&lt;br /&gt;    oracle.rdbms&lt;br /&gt;oneoff_actions&lt;br /&gt;&lt;br /&gt;2. Then go to the $ORACLE_HOME/.patch_storage and see if any of the previous patches have modified the same file&lt;br /&gt;&lt;br /&gt;bart:TEST:/opt/oracle/product/10.2.0/db_1/.patch_storage&gt; find . -name 'kelt.o' -print&lt;br /&gt;./verify/archive/lib/libserver10.a/kelt.o&lt;br /&gt;./5399670_Mar_20_2008_20_30_34/backup/.patch_storage/5399670_Mar_20_2008_20_30_34/files/lib/libserver10.a/kelt.o&lt;br /&gt;./5399670_Mar_20_2008_20_30_34/original_patch/files/lib/libserver10.a/&lt;strong&gt;kelt.o&lt;/strong&gt;&lt;br /&gt;./5399670_Mar_20_2008_20_30_34/scratch/&lt;strong&gt;kelt.o&lt;/strong&gt;./5399670_Mar_20_2008_20_30_34/files/lib/libserver10.a/&lt;strong&gt;kelt.o&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;So this clearly shows that Patch 5399670 was previously applied which modified the same source code file and you need a merge patch for both bugs (5399670 and 6338357)&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/28434899-5315107440232731437?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/5315107440232731437/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=5315107440232731437&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/5315107440232731437'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/5315107440232731437'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2008/07/one-off-patches-conflicts-and-merges.html' title='One off patches, conflicts and merges'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-8134955419779944654</id><published>2008-02-04T17:47:00.000-08:00</published><updated>2008-02-04T17:49:52.541-08:00</updated><title type='text'>Rolling invalidations Addendum</title><content type='html'>If you enable cursor trace for the testcase in my previous post using the method described in &lt;a href="http://el-caro.blogspot.com/search?q=unshared"&gt;http://el-caro.blogspot.com/search?q=unshared&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The generated trace in udump will have the following&lt;br /&gt;&lt;br /&gt;************************************************************&lt;br /&gt;kksCheckCursor: pinning child #0 in shared mode 7d42bd0e8 7d7e87600&lt;br /&gt;&lt;strong&gt;Failed sharing : Rolling invalidation&lt;/strong&gt;&lt;br /&gt;kksUnlockChild: releasing child&lt;br /&gt;Failed sharing : 800000000000&lt;br /&gt;kksSearchChildList: no suitable child found&lt;br /&gt;&lt;strong&gt;Creating new child object #1&lt;/strong&gt;&lt;br /&gt;kksLoadChild: reload 0 child_reload 0&lt;br /&gt;kksLoadChild: reload 0 child_reload 0&lt;br /&gt;Compilation environment difference Failed sharing : 0&lt;br /&gt;Change in cursor environment&lt;br /&gt;************************************************************&lt;br /&gt;&lt;br /&gt;Also the parameter _optimizer_invalidation_period does not work for statements using PQ. This can be tested by changing the degree of the table to 4 (say) and running the same test. In this case  a new child cursor is generated on the first re-execution of the statement after stats are gathered even when the auto_invalidate flag is used.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-8134955419779944654?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/8134955419779944654/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=8134955419779944654&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/8134955419779944654'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/8134955419779944654'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2008/02/rolling-invalidations-addendum.html' title='Rolling invalidations Addendum'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-5257718183185429297</id><published>2008-01-30T01:17:00.000-08:00</published><updated>2008-01-31T15:58:07.254-08:00</updated><title type='text'>Rolling invalidations</title><content type='html'>There have been discussions which I have seen related to the feature of auto invalidation in dbms_stats. A couple of references are&lt;br /&gt;&lt;br /&gt;&lt;a href="http://forums.oracle.com/forums/thread.jspa?threadID=592771&amp;tstart=30"&gt;http://forums.oracle.com/forums/thread.jspa?threadID=592771&amp;tstart=30&lt;/a&gt;&lt;br /&gt;and&lt;br /&gt;&lt;a href="http://www.orafaq.com/maillist/oracle-l/2006/10/10/0429.htm"&gt;http://www.orafaq.com/maillist/oracle-l/2006/10/10/0429.htm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I have tested the relevant parameter “_optimizer_invalidation_period” on 10.2.0.3 and believe that this is working as expected&lt;br /&gt;&lt;br /&gt;Let us take the below testcase where the parameter (it is dynamic) is set to a value of 120&lt;br /&gt;&lt;br /&gt;SQL&gt; show parameter optimizer_inva&lt;br /&gt;&lt;br /&gt;NAME                                 TYPE        VALUE&lt;br /&gt;------------------------------------ ----------- ------------------------------&lt;br /&gt;_optimizer_invalidation_period       integer     120&lt;br /&gt;&lt;br /&gt;We have the following sql statement&lt;br /&gt;&lt;br /&gt;11:00:00 SQL&gt; select * from source where rownum&lt;2;&lt;br /&gt;&lt;br /&gt;      OBJ#       LINE SOURCE&lt;br /&gt;---------- ---------- ---------------------------------------------------------------------------&lt;br /&gt;    194107        171 -- *Action: Start a new job, or attach to an existing job that has a&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1 row selected.&lt;br /&gt;&lt;br /&gt;Elapsed: 00:00:00.12&lt;br /&gt;11:00:00 SQL&gt; select * from source where rownum&lt;2;&lt;br /&gt;&lt;br /&gt;      OBJ#       LINE SOURCE&lt;br /&gt;---------- ---------- ---------------------------------------------------------------------------&lt;br /&gt;    194107        171 -- *Action: Start a new job, or attach to an existing job that has a&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1 row selected.&lt;br /&gt;&lt;br /&gt;Elapsed: 00:00:00.00&lt;br /&gt;11:00:00 SQL&gt; select a.child_number,LAST_LOAD_TIME, to_char(LAST_ACTIVE_TIME,'dd-mon-yyyy hh24:mi:ss') ,b.invalidations from&lt;br /&gt;v$SQL_SHARED_CURSOR a, v$sql b where a.sql_id='954g5yyw5tn1s' and  a.child_address=b.child_address ;&lt;br /&gt;&lt;br /&gt;CHILD_NUMBER LAST_LOAD_TIME      TO_CHAR(LAST_ACTIVE_ INVALIDATIONS&lt;br /&gt;------------ ------------------- -------------------- -------------&lt;br /&gt;           0 2008-01-29/11:00:00 29-jan-2008 11:00:00             0&lt;br /&gt;&lt;br /&gt;1 row selected.&lt;br /&gt;&lt;br /&gt;Elapsed: 00:00:00.14&lt;br /&gt;11:00:00 SQL&gt;&lt;br /&gt;11:00:00 SQL&gt; select executions, invalidations,child_number from v$sql where sql_id='954g5yyw5tn1s';&lt;br /&gt;&lt;br /&gt;EXECUTIONS INVALIDATIONS CHILD_NUMBER&lt;br /&gt;---------- ------------- ------------&lt;br /&gt;         2             0            0&lt;br /&gt;&lt;br /&gt;1 row selected.&lt;br /&gt;&lt;br /&gt;Now we gather stats on the table with the auto_invalidate parameter passed to the API.&lt;br /&gt;&lt;br /&gt;11:00:00 SQL&gt; exec dbms_stats.gather_table_stats('REGOFA','SOURCE',no_invalidate =&gt; DBMS_STATS.AUTO_INVALIDATE);&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;Elapsed: 00:00:01.50&lt;br /&gt;&lt;br /&gt;Then we keep executing the sql statement of interest to check when the new cursor will be generated.&lt;br /&gt;&lt;br /&gt;Elapsed: 00:00:01.50&lt;br /&gt;11:00:13 SQL&gt; select a.child_number,LAST_LOAD_TIME, to_char(LAST_ACTIVE_TIME,'dd-mon-yyyy hh24:mi:ss') ,b.invalidations from&lt;br /&gt;v$SQL_SHARED_CURSOR a, v$sql b where a.sql_id='954g5yyw5tn1s' and  a.child_address=b.child_address ;&lt;br /&gt;&lt;br /&gt;CHILD_NUMBER LAST_LOAD_TIME      TO_CHAR(LAST_ACTIVE_ INVALIDATIONS&lt;br /&gt;------------ ------------------- -------------------- -------------&lt;br /&gt;           0 2008-01-29/11:00:00 29-jan-2008 11:00:09             0&lt;br /&gt;&lt;br /&gt;1 row selected.&lt;br /&gt;&lt;br /&gt;Elapsed: 00:00:00.05&lt;br /&gt;11:00:13 SQL&gt; select executions, invalidations,child_number from v$sql where sql_id='954g5yyw5tn1s';&lt;br /&gt;&lt;br /&gt;EXECUTIONS INVALIDATIONS CHILD_NUMBER&lt;br /&gt;---------- ------------- ------------&lt;br /&gt;         3             0            0&lt;br /&gt;&lt;br /&gt;1 row selected.&lt;br /&gt;&lt;br /&gt;Elapsed: 00:00:00.00&lt;br /&gt;11:00:13 SQL&gt; select * from v$sql_shared_cursor where sql_id='954g5yyw5tn1s';&lt;br /&gt;&lt;br /&gt;SQL_ID        ADDRESS          CHILD_ADDRESS    CHILD_NUMBER U S O O S L S E B P&lt;br /&gt;------------- ---------------- ---------------- ------------ - - - - - - - - - -&lt;br /&gt;I S T A B D L T R I I R L I O S M U T N F A I T D L D B P C S R P T M B M R O P&lt;br /&gt;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;M F L&lt;br /&gt;- - -&lt;br /&gt;954g5yyw5tn1s 00000007D3BBCBD8 00000007D5644028            0 N N N N N N N N N N&lt;br /&gt;N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N&lt;br /&gt;N N N&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1 row selected.&lt;br /&gt;…….&lt;br /&gt;11:00:37 SQL&gt; select * from source where rownum&lt;2;&lt;br /&gt;&lt;br /&gt;      OBJ#       LINE SOURCE&lt;br /&gt;---------- ---------- ---------------------------------------------------------------------------&lt;br /&gt;    194107        171 -- *Action: Start a new job, or attach to an existing job that has a&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1 row selected.&lt;br /&gt;&lt;br /&gt;Elapsed: 00:00:00.01&lt;br /&gt;11:00:39 SQL&gt; select a.child_number,LAST_LOAD_TIME, to_char(LAST_ACTIVE_TIME,'dd-mon-yyyy hh24:mi:ss') ,b.invalidations from&lt;br /&gt;v$SQL_SHARED_CURSOR a, v$sql b where a.sql_id='954g5yyw5tn1s' and  a.child_address=b.child_address ;&lt;br /&gt;&lt;br /&gt;CHILD_NUMBER LAST_LOAD_TIME      TO_CHAR(LAST_ACTIVE_ INVALIDATIONS&lt;br /&gt;------------ ------------------- -------------------- -------------&lt;br /&gt;           0 2008-01-29/11:00:00 29-jan-2008 11:00:25             0&lt;br /&gt;           1 2008-01-29/11:00:37 29-jan-2008 11:00:37             0&lt;br /&gt;&lt;br /&gt;2 rows selected.&lt;br /&gt;&lt;br /&gt;Elapsed: 00:00:00.04&lt;br /&gt;11:00:39 SQL&gt; select executions, invalidations,child_number from v$sql where sql_id='954g5yyw5tn1s';&lt;br /&gt;&lt;br /&gt;EXECUTIONS INVALIDATIONS CHILD_NUMBER&lt;br /&gt;---------- ------------- ------------&lt;br /&gt;         7             0            0&lt;br /&gt;         1             0            1&lt;br /&gt;&lt;br /&gt;2 rows selected.&lt;br /&gt;&lt;br /&gt;Elapsed: 00:00:00.00&lt;br /&gt;11:00:39 SQL&gt; select * from v$sql_shared_cursor where sql_id='954g5yyw5tn1s';&lt;br /&gt;&lt;br /&gt;SQL_ID        ADDRESS          CHILD_ADDRESS    CHILD_NUMBER U S O O S L S E B P&lt;br /&gt;------------- ---------------- ---------------- ------------ - - - - - - - - - -&lt;br /&gt;I S T A B D L T R I I R L I O S M U T N F A I T D L D B P C S R P T M B M R O P&lt;br /&gt;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;M F L&lt;br /&gt;- - -&lt;br /&gt;954g5yyw5tn1s 00000007D3BBCBD8 00000007D5644028            0 N N N N N N N N N N&lt;br /&gt;N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N&lt;br /&gt;N N N&lt;br /&gt;&lt;br /&gt;954g5yyw5tn1s 00000007D3BBCBD8 00000007D3753DC0            1 N N N N N N N N N N&lt;br /&gt;N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N Y N N&lt;br /&gt;N N N&lt;br /&gt;&lt;br /&gt;So somewhere between  11:00:00  and 11:00:39 (within the 2 minute window) a new child cursor has been generated with roll_invalid_mismatch set to ‘Y”&lt;br /&gt;&lt;br /&gt;I have tested for the following values of _optimizer_invalidation_period and I see consistent results&lt;br /&gt;&lt;br /&gt;    120&lt;br /&gt;    210&lt;br /&gt;    600&lt;br /&gt;   1800&lt;br /&gt;  18000&lt;br /&gt;&lt;br /&gt;Hence this would be an ideal way to avoid a hard parse storm&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-5257718183185429297?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/5257718183185429297/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=5257718183185429297&amp;isPopup=true' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/5257718183185429297'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/5257718183185429297'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2008/01/rolling-invalidations.html' title='Rolling invalidations'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-2555886279825013487</id><published>2007-11-06T03:10:00.000-08:00</published><updated>2007-11-06T03:17:56.992-08:00</updated><title type='text'>OCR Mirroring</title><content type='html'>In my last blog I talked about adding mirrors to your voting disk. Here I will document how to add mirrors to your OCR on a clustered file system like vxfs.&lt;br /&gt;&lt;br /&gt;In the existing configuration there is only one ocr. The location of your ocr is specified in /var/opt/oracle/ocr.loc (on Solaris). It would be different depending on your port.&lt;br /&gt;&lt;br /&gt;You need to add an OCR mirror when CRS is up else you get an error message like the one below&lt;br /&gt;&lt;br /&gt;root@bart # /u01/app/oracle/product/10.1.0/crs/bin/ocrconfig -replace ocrmirror /u02/oracrs/ocr_file_02&lt;br /&gt;PROT-1: Failed to initialize ocrconfig&lt;br /&gt;&lt;br /&gt;For more details on why you have received an error check the latest ocrconfig log file under $ORA_CRS_HOME/log/node/client&lt;br /&gt;&lt;br /&gt;root@bart # cat ocrconfig_1742.log&lt;br /&gt;Oracle Database 10g CRS Release 10.2.0.1.0 Production Copyright 1996, 2005 Oracle.  All rights reserved.&lt;br /&gt;2007-10-27 12:32:19.130: [ OCRCONF][1]ocrconfig starts...&lt;br /&gt;2007-10-27 12:32:20.933: [ OCRCONF][1]Failure in initializing ocr in DEFAULT level. error:[PROC-32: Cluster Ready Services on the local node i&lt;br /&gt;s not running Messaging error [9]]&lt;br /&gt;2007-10-27 12:32:20.933: [ OCRCONF][1]Exiting [status=failed]...&lt;br /&gt;&lt;br /&gt;From the above error message it is clear that CRS needs to be up.&lt;br /&gt;&lt;br /&gt;So after starting up CRS&lt;br /&gt;&lt;br /&gt;root@bart # /u01/app/oracle/product/10.1.0/crs/bin/ocrconfig -replace ocrmirror /u02/oracrs/ocr_file_02&lt;br /&gt;PROT-16: Internal Error&lt;br /&gt;&lt;br /&gt;But even though I get an error it appears to have created the mirror&lt;br /&gt;&lt;br /&gt;root@bart # cat /var/opt/oracle/ocr.loc&lt;br /&gt;#Device/file getting replaced by device &lt;br /&gt;/u02/oracrs/ocr_file_02&lt;br /&gt;ocrconfig_loc=/u02/oracrs/ocr.dbf&lt;br /&gt;ocrmirrorconfig_loc=/u02/oracrs/ocr_file_02&lt;br /&gt;local_only=falseroot@bart &lt;br /&gt;&lt;br /&gt;# ocrcheck&lt;br /&gt;Status of Oracle Cluster Registry is as follows :&lt;br /&gt;Version : 2&lt;br /&gt;Total space (kbytes) : 262120&lt;br /&gt;Used space (kbytes) : 24932&lt;br /&gt;Available space (kbytes) : 237188&lt;br /&gt;ID : 1909893349&lt;br /&gt;Device/File Name : /u02/oracrs/ocr.dbf&lt;br /&gt;Device/File integrity check succeeded&lt;br /&gt;Device/File Name : /u02/oracrs/ocr_file_02&lt;br /&gt;Device/File integrity check succeeded&lt;br /&gt;&lt;br /&gt;Now let us replace the existing OCR with a new one file&lt;br /&gt;&lt;br /&gt;u01/app/oracle/product/10.1.0/crs/bin/ocrconfig -replace ocr /u02/oracrs/ocr_file_01&lt;br /&gt;PROT-16: Internal Error&lt;br /&gt;&lt;br /&gt;root@bart # cat /var/opt/oracle/ocr.loc&lt;br /&gt;#Device/file /u02/oracrs/ocr.dbf getting replaced by device &lt;br /&gt;/u02/oracrs/ocr_file_01&lt;br /&gt;ocrconfig_loc=/u02/oracrs/ocr_file_01&lt;br /&gt;ocrmirrorconfig_loc=/u02/oracrs/ocr_file_02&lt;br /&gt;local_only=falseroot@bart &lt;br /&gt;&lt;br /&gt;# ocrcheck&lt;br /&gt;Status of Oracle Cluster Registry is as follows :&lt;br /&gt;Version : 2&lt;br /&gt;Total space (kbytes) : 262120&lt;br /&gt;Used space (kbytes) : 24932&lt;br /&gt;Available space (kbytes) : 237188&lt;br /&gt;ID : 1909893349&lt;br /&gt;Device/File Name : /u02/oracrs/ocr_file_01&lt;br /&gt;Device/File integrity check succeeded&lt;br /&gt;Device/File Name : /u02/oracrs/ocr_file_02&lt;br /&gt;Device/File integrity check succeeded&lt;br /&gt;&lt;br /&gt;Cluster registry integrity check succeeded&lt;br /&gt;&lt;br /&gt;At this point you can shutdown and startup CRS and see if all is fine. One point to note is that you should check that the ocr.loc files on all remote nodes are updated with the updated location of the OCR file. In my testing the CRS stack on the remote node was down and in such cases the ocr.loc on the remote node does not get updated.&lt;br /&gt;&lt;br /&gt;When the cluster is running if the OCR mirror is removed/corrupted the cluster continues running and all crs commands including ocrcheck can be run if you comment the following line from /var/opt/oracle/ocr.loc&lt;br /&gt;ocrmirrorconfig_loc=/u02/oracrs/ocr_file_02&lt;br /&gt;&lt;br /&gt;If you lose the primary OCR the cluster keeps running but &lt;br /&gt;ocrcheck fails and CRS cannot be stopped even if you comment out the following line even though the mirror is available.&lt;br /&gt;&lt;br /&gt;root@bart # cat /var/opt/oracle/ocr.loc&lt;br /&gt;#Device/file /u02/oracrs/ocr_file_01 getting replaced by device /u02/oracrs/ocr_file_01&lt;br /&gt;#ocrconfig_loc=/u02/oracrs/ocr_file_01&lt;br /&gt;ocrmirrorconfig_loc=/u02/oracrs/ocr_file_02&lt;br /&gt;&lt;br /&gt;Things are fine if I replace the ocr using &lt;br /&gt;root@bart # /u01/app/oracle/product/10.1.0/crs/bin/ocrconfig -replace ocr /u02/oracrs/ocr_file_01&lt;br /&gt;PROT-16: Internal Error&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-2555886279825013487?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/2555886279825013487/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=2555886279825013487&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/2555886279825013487'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/2555886279825013487'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2007/11/ocr-mirroring.html' title='OCR Mirroring'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-1465982984745492511</id><published>2007-11-03T02:34:00.000-07:00</published><updated>2007-11-05T04:38:15.903-08:00</updated><title type='text'>Voting disk mirroring</title><content type='html'>A while ago I had blogged on how to add a voting disk to an existing RAC setup &lt;a href="http://el-caro.blogspot.com/2006/12/adding-voting-disk-online.html"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To be safe it is best to do this with the cluster down. &lt;br /&gt;I did the same recently on a 2 node RAC on 10.2.0.3 running Veritas SFRAC 4.1.&lt;br /&gt;&lt;br /&gt;In the setup I am working on there is only one voting disk the location of which is &lt;br /&gt;root@bart # /u01/app/oracle/product/10.1.0/crs/bin/crsctl query css votedisk&lt;br /&gt;0.     0    /u02/oravoting/voting&lt;br /&gt;&lt;br /&gt;With CRS down on all nodes you have to use the force option else you receive an error&lt;br /&gt;&lt;br /&gt;root@bart # /u01/app/oracle/product/10.1.0/crs/bin/crsctl add css votedisk /u02/oravoting/voting_disk_01&lt;br /&gt;Cluster is not in a ready state for online disk addition&lt;br /&gt;&lt;br /&gt;root@bart # /u01/app/oracle/product/10.1.0/crs/bin/crsctl add css votedisk /u02/oravoting/voting_disk_01 -force&lt;br /&gt;Now formatting voting disk: /u02/oravoting/voting_disk_01&lt;br /&gt;CLSFMT returned with error [4].&lt;br /&gt;failed 9 to initailize votedisk /u02/oravoting/voting_disk_01&lt;br /&gt;&lt;br /&gt;root@bart # cd /u02/oravoting/&lt;br /&gt;root@bart # ls -ltr&lt;br /&gt;total 99992&lt;br /&gt;-rw-r--r--   1 oracle   oinstall 10238976 Oct 30 11:53 voting&lt;br /&gt;-rw-r--r--   1 root     other    10240000 Oct 30 12:05 voting_disk_01&lt;br /&gt;&lt;br /&gt;So although it has created a second voting disk it has been created with the wrong permissions. When you do a fresh install of  CRS the rootconfig script called from root.sh sets the owner of the voting disk to the owner of the crs software (in this case oracle). Hence this is a bug and the startup of css fails and you will see errors in the Unix logfile since the permissions are incorrect.&lt;br /&gt;&lt;br /&gt;Lets’ add a second one..&lt;br /&gt;&lt;br /&gt;root@bart # /u01/app/oracle/product/10.1.0/crs/bin/crsctl add css votedisk /u02/oravoting/voting_disk_02 -force&lt;br /&gt;Now formatting voting disk: /u02/oravoting/voting_disk_02&lt;br /&gt;CLSFMT returned with error [4].&lt;br /&gt;failed 9 to initailize votedisk /u02/oravoting/voting_disk_02&lt;br /&gt;&lt;br /&gt;If we do not change permissions of the second mirror css will startup (since we have 2 voting disks online and the algorithm requires that a majority of disks to be available) but the following message will be logged in the ocssd.log file&lt;br /&gt;&lt;br /&gt;[ CSSD]2007-11-01 11:46:26.400 [1] &gt;TRACE: clssnmDiskStateChange: state from 1 to 2 disk (0//u02/oravoting/voting)&lt;br /&gt;[ CSSD]2007-11-01 11:46:26.401 [6] &gt;TRACE: clssnmvDPT: spawned for disk 0 &lt;br /&gt;(/u02/oravoting/voting)&lt;br /&gt;[ CSSD]2007-11-01 11:46:26.402 [1] &gt;TRACE: clssnmDiskStateChange: state from 1 to 2 disk &lt;br /&gt;(1//u02/oravoting/voting_disk_01&lt;br /&gt;)&lt;br /&gt;[ CSSD]2007-11-01 11:46:26.402 [7] &gt;TRACE: clssnmvDPT: spawned for disk 1 (/u02/oravoting/voting_disk_01)&lt;br /&gt;[ CSSD]2007-11-01 11:46:26.403 [1] &gt;TRACE: clssnmDiskStateChange: state from 1 &lt;br /&gt;to 2 disk (2//u02/oravoting/voting_disk_02&lt;br /&gt;)&lt;br /&gt;[ CSSD]2007-11-01 11:46:26.404 [8] &gt;TRACE: clssnmvDPT: spawned for disk 2 (/u02/oravoting/voting_disk_02)&lt;br /&gt;[ CSSD]2007-11-01 11:46:26.405 [8] &gt;ERROR: Internal Error Information:&lt;br /&gt;Category: 1234&lt;br /&gt;Operation: scls_block_open&lt;br /&gt;Location: open&lt;br /&gt;Other: open failed /u02/oravoting/voting_disk_02&lt;br /&gt;Dep: 9&lt;br /&gt;&lt;br /&gt;[ CSSD]2007-11-01 11:46:26.405 [8] &gt;TRACE: clssnmvDiskOpen: Unable to open voting device (2: &lt;br /&gt;/u02/oravoting/voting_disk_0&lt;br /&gt;2)&lt;br /&gt;&lt;br /&gt;If you were to change the permissions to oracle:dba the 2nd mirror you would not see the above.&lt;br /&gt;&lt;br /&gt;Remember that when you install CRS in 10.2 and use normal redundancy for your voting disk configuration it is mandatory to have 2 mirrors. The installer does not allow you to proceed with one mirror.&lt;br /&gt;&lt;br /&gt;If you are adding mirrors manually using crsctl it is recommended that you add 2 mirrors. If you had a 1+1 configuration css will not come up if the mirror is unavailable/corrupt.&lt;br /&gt;&lt;br /&gt;If you are deleting a voting disk you have to update the following files in $ORA_CRS_HOME/install with the new voting disk location&lt;br /&gt;&lt;br /&gt;paramfile.crs&lt;br /&gt;params.crs&lt;br /&gt;rootconfig&lt;br /&gt;&lt;br /&gt;This is required if you need to re-initialize your OCR by re-running root.sh assuming your OCR backups are stuffed and you cannot restore your OCR.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-1465982984745492511?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/1465982984745492511/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=1465982984745492511&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/1465982984745492511'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/1465982984745492511'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2007/11/voting-disk-mirroring.html' title='Voting disk mirroring'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-8392740934613013224</id><published>2007-10-16T18:55:00.000-07:00</published><updated>2007-10-17T01:28:05.556-07:00</updated><title type='text'>Identifying mutex holder</title><content type='html'>In my previous post on flushing a cursor we see that a process is waiting on a mutex. In this post we will try to identify the holder from a systemstate dump&lt;br /&gt;&lt;br /&gt;• Find the process executing the purge API. In this case it was process 22&lt;br /&gt;• Open the systemstate dump and go to PROCESS 22&lt;br /&gt;• Under this (if the systemstate is at level 266) you will see the short stack of the process&lt;br /&gt;&lt;br /&gt;&lt;em&gt;ksdxfstk()+36&lt;-ksdxcb()+2452&lt;-sspuser()+176&lt;-sigacthandler()+44&lt;-__systemcall()+52&lt;-semtimedop()+28&lt;-sskgpwwait()+224&lt;-ksliwat&lt;br /&gt;()+988&lt;-kslwaitns_timed()+48&lt;-kskthbwt()+232&lt;-kslwait()+116&lt;-kksLockWait()+396&lt;-kgxWait()+444&lt;-kgxExclusive()+132&lt;-kxsPurgeCur&lt;br /&gt;sor()+476&lt;-psdpur()+1444&lt;-pevm_icd_call_common()+728&lt;-pfrinstr_ICAL()+132&lt;-pfrrun_no_tool()+72&lt;-pfrrun()+832&lt;-plsql_run()+696&lt;&lt;br /&gt;-peicnt()+260&lt;-kkxexe()+824&lt;-opiexe()+12736&lt;-kpoal8()+1912&lt;-opiodr()+1548&lt;-ttcpip()+1284&lt;-opitsk()+1432&lt;-opiino()+1128&lt;-opiodr&lt;br /&gt;()+1548&lt;-opidrv()+896&lt;-sou2o()+80&lt;-opimai_real()+124&lt;-main()+152&lt;-_start()+380&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;As can be seen from the above stack it includes the function kxsPurgeCursor() which contains this piece of functionality (to flush the cursor)&lt;br /&gt;&lt;br /&gt;• Under the session state object of this process you will see that the session is waiting on &lt;br /&gt;&lt;br /&gt;    &lt;em&gt;waiting for 'cursor: pin X' blocking sess=0x0 seq=9208 wait_time=0 seconds since wait started=0 idn=dbabc3c, value=1, where|sleeps=e00000629&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;wait_time=0 indicates the session is waiting at the time this process was dumped.&lt;br /&gt;&lt;br /&gt;• If you scroll down further in the same process state object and search for idn=dbabc3c&lt;br /&gt;&lt;br /&gt;      &lt;em&gt;KGX Atomic Operation Log 3d6e12a08&lt;br /&gt;       Mutex 3da75c7d0(0, 1) idn dbabc3c oper GET_EXCL&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Hence this process is waiting to acquire the mutex in exclusive mode.&lt;br /&gt;&lt;br /&gt;• To find the process holding the mutex search on the string  "dbabc3c oper"&lt;br /&gt;&lt;br /&gt;You will find something like the below&lt;br /&gt;&lt;br /&gt;      &lt;em&gt;KGX Atomic Operation Log 3d6e671e0&lt;br /&gt;       Mutex 3da75c7d0(0, 1) idn dbabc3c oper SHRD&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Search the process holding this. &lt;br /&gt;In vi editor you can use ?PROCESS which will lead you to &lt;br /&gt;&lt;br /&gt;&lt;em&gt;PROCESS 15:&lt;br /&gt;-------------------------------------------&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Hence Process 15 is holding the mutex and this is the process doing the merge join Cartesian in Session 1.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-8392740934613013224?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/8392740934613013224/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=8392740934613013224&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/8392740934613013224'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/8392740934613013224'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2007/10/identifying-mutex-holder.html' title='Identifying mutex holder'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-1396367920798235555</id><published>2007-10-12T17:33:00.000-07:00</published><updated>2007-10-14T16:52:49.472-07:00</updated><title type='text'>Flushing a single cursor</title><content type='html'>In a very intensive OLTP environment plan stability is of utmost importance as a single sub optimal query can bring the  system down to its knees.&lt;br /&gt;&lt;br /&gt;Using sql outlines and sql profiles is always not possible if you have an application with more&lt;br /&gt;than a million lines of code and any one of the thousands of sql statements could have a plan flip.&lt;br /&gt;&lt;br /&gt;In 11g there is a new procedure in the DBMS_SHARED_POOL package which helps you flush out a single cursor.&lt;br /&gt;There is a typo in the syntax portion of the  documentation in &lt;br /&gt;&lt;a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28419/d_shpool.htm#sthref8578"&gt;http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28419/d_shpool.htm#sthref8578&lt;/a&gt;&lt;br /&gt;which I will try to get corrected in the next week.&lt;br /&gt;&lt;br /&gt;PURGE Procedure&lt;br /&gt;This procedure purges the named object or specified heap(s) of the object.&lt;br /&gt;&lt;br /&gt;Syntax&lt;br /&gt;&lt;br /&gt;DBMS_SHARED_POOL.KEEP (&lt;br /&gt;   name    VARCHAR2, &lt;br /&gt;   flag    CHAR DEFAULT 'P', &lt;br /&gt;   heaps   NUMBER DEFAULT 1)&lt;br /&gt;Parameters&lt;br /&gt;&lt;br /&gt;Table 118-4 KEEP Procedure Parameters&lt;br /&gt;&lt;br /&gt;Parameter Description &lt;br /&gt;name Name of the object to keep. &lt;br /&gt;The value for this identifier is the concatenation of the address and hash_value columns from the v$sqlarea view. This is displayed by the SIZES procedure.&lt;br /&gt;&lt;br /&gt;Currently, TABLE and VIEW objects may not be kept.&lt;br /&gt; &lt;br /&gt;flag (Optional) If this is not specified, then the package assumes that the first parameter is the name of a package/procedure/function and resolves the name. &lt;br /&gt;Set to 'P' or 'p' to fully specify that the input is the name of a package/procedure/function.&lt;br /&gt;&lt;br /&gt;Set to 'T' or 't' to specify that the input is the name of a type.&lt;br /&gt;&lt;br /&gt;Set to 'R' or 'r' to specify that the input is the name of a trigger.&lt;br /&gt;&lt;br /&gt;Set to 'Q' or 'q' to specify that the input is the name of a sequence.&lt;br /&gt;&lt;br /&gt;In case the first argument is a cursor address and hash-value, the parameter should be set to any character except 'P' or 'p' or 'Q' or 'q' or 'R' or 'r' or 'T' or 't'.&lt;br /&gt; &lt;br /&gt;heaps Heaps to be purged. For example, if heap 0 and heap 6 are to be purged: &lt;br /&gt;1&lt;&lt;0 | 1&lt;&lt;6 =&gt; hex 0x41 =&gt; decimal 65, so specify heaps =&gt;65.Default is 1, that is, heap 0 which means the whole object would be purged&lt;br /&gt;&lt;br /&gt;This feature was introduced via the fix in bug 5614566 and I actually know a customer who has this applied on top of 10.2.0.3.&lt;br /&gt;&lt;br /&gt;E.g&lt;br /&gt;&lt;br /&gt;SQL&gt; exec dbms_shared_pool.purge('00000003DE576D40,353632309','C',65);  ==&gt; purge heap 0 and heap 6 &lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;This would actually not work against a cursor which is currently executing.(pinned)&lt;br /&gt;&lt;br /&gt;Session 1:&lt;br /&gt;=========&lt;br /&gt;Do a massive Merge Join Cartesian&lt;br /&gt;select * from dba_objects a, dba_objects b, dba_objects c;&lt;br /&gt;&lt;br /&gt;Session 2:&lt;br /&gt;=========&lt;br /&gt;Identify the sql address and hash value and try to purge the cursor..&lt;br /&gt;&lt;br /&gt;exec dbms_shared_pool.purge('00000003DE825198,3691928467','C',65);  ==&gt; This hangs&lt;br /&gt;&lt;br /&gt;and this session is waiting on "cursor: pin X" requesting an exclusive mutex pin for the cursor object whilst it has already been pinned by session 1&lt;br /&gt;&lt;br /&gt;Session 3&lt;br /&gt;==========&lt;br /&gt;select event,p1,p2 from v$session where username='SYS' and type='USER';&lt;br /&gt;EVENT                                          P1         P2&lt;br /&gt;----------------------------------------- ---------- ----------&lt;br /&gt;cursor: pin X                              3691928467      1&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The p1 value here is the Hash value of the cursor we are trying to flush.&lt;br /&gt;&lt;br /&gt;From the short stack of the process which is executing the purge API a function called kxsPurgeCursor is called which would try to take a mutex (since _kks_use_mutex_pin is TRUE by default)&lt;br /&gt;The purge completes only after you cancel the sql in session 1 and exit from the same&lt;br /&gt;or kill the session executing the sql.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-1396367920798235555?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/1396367920798235555/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=1396367920798235555&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/1396367920798235555'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/1396367920798235555'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2007/10/flushing-single-cursor.html' title='Flushing a single cursor'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-7843392280619394663</id><published>2007-09-17T13:02:00.000-07:00</published><updated>2007-09-22T19:33:47.887-07:00</updated><title type='text'>Redwood Shores</title><content type='html'>&lt;a href="http://bp0.blogger.com/_3T6egGX_13s/RvXPwRHwT_I/AAAAAAAAABQ/nQU6OFepgtI/s1600-h/DSCN0820.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://bp0.blogger.com/_3T6egGX_13s/RvXPwRHwT_I/AAAAAAAAABQ/nQU6OFepgtI/s400/DSCN0820.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5113221380085665778" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I was in Redwood last week and got a chance to meet some of the best minds in Server Technologies including a few ex-colleagues and a couple of guys on the revered &lt;br /&gt;&lt;a href="http://www.oaktable.net/main.jsp"&gt;Oak Table&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;And although a significant part of the week was spent in the wine and lounge bars of San Francisco it was quite an enriching experience..&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-7843392280619394663?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/7843392280619394663/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=7843392280619394663&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/7843392280619394663'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/7843392280619394663'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2007/09/blog-post.html' title='Redwood Shores'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_3T6egGX_13s/RvXPwRHwT_I/AAAAAAAAABQ/nQU6OFepgtI/s72-c/DSCN0820.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-816382045423458108</id><published>2007-09-05T06:55:00.000-07:00</published><updated>2007-09-05T07:05:36.072-07:00</updated><title type='text'>Disabling cursor trace</title><content type='html'>Sometime last year I had blogged about unshared cursors and an event to trace the same here &lt;br /&gt;http://el-caro.blogspot.com/search?q=cursor+trace&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Well after you set the trace on and have got the required information you would obviously want to turn it off.&lt;br /&gt;&lt;br /&gt;The command to do the same is&lt;br /&gt;&lt;br /&gt;alter system set events 'immediate trace name cursortrace level 2147483648, addr 1'; &lt;br /&gt;&lt;br /&gt;However this does not work as I realized today when I was diagnosing multiple versions created for pl/sql procedure calls with ref cursors as arguments and the trace almost filled up my udump. New sessions spawned have entries such as the below&lt;br /&gt;for any cursor executed.&lt;br /&gt;&lt;br /&gt;CUR#2 XSC 0xxxxxxxx CHILD#0 CI 0xxxxxxx CTX (nil)&lt;br /&gt;&lt;br /&gt;To fix this issue you need to apply the fix for unpublished bug&lt;br /&gt;&lt;br /&gt;5555371 NO WAY TO TURN OFF TRACE AFTER SETTING CURSORTRACE EVENT&lt;br /&gt;&lt;br /&gt;on top of 10.2.0.x&lt;br /&gt;&lt;br /&gt;Another way to disable the trace would be to restart the instance.&lt;a href="http://el-caro.blogspot.com/search?q=cursor+trace"&gt;&lt;/a&gt;&lt;a href="http://el-caro.blogspot.com/search?q=cursor+trace"&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-816382045423458108?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/816382045423458108/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=816382045423458108&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/816382045423458108'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/816382045423458108'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2007/09/disabling-cursor-trace.html' title='Disabling cursor trace'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-3048222226773038888</id><published>2007-07-14T06:45:00.000-07:00</published><updated>2007-07-15T01:41:52.466-07:00</updated><title type='text'>Using dbx collector</title><content type='html'>It is quite possible that you have a single piece of sql which consumes more and more cpu over time without an increase in logical i/o for the statement or due to increased amount of hard parsing.&lt;br /&gt;&lt;br /&gt;The reason could be extra burning of cpu in an Oracle source code function with time which has not been instrumented as a wait in the RDBMS kernel. One way to find out which function in the Oracle source code is the culprit is via the dbx collector function available in the Sun Studio 11. I guess dtrace would also help but I haven’t played with it. This tool can also be used in diagnosing increased cpu usage of Oracle tools across different RDBMS versions.&lt;br /&gt;&lt;br /&gt;Let us take a simple example on how to run this tool on a simple insert statement.&lt;br /&gt;&lt;br /&gt;SQL&gt; create table foo ( a  number);&lt;br /&gt;&lt;br /&gt;Table created.&lt;br /&gt;&lt;br /&gt;&gt; sqlplus&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 10.2.0.3.0 - Production on Sat Jul 14 23:46:03 2007&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.&lt;br /&gt;&lt;br /&gt;Enter user-name: /&lt;br /&gt;&lt;br /&gt;Connected to:&lt;br /&gt;Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production&lt;br /&gt;With the Partitioning, Real Application Clusters, OLAP and Data Mining options&lt;br /&gt;&lt;br /&gt;SQL&gt; set sqlp sess1&gt;&gt;&lt;br /&gt;sess1&gt;&gt;&lt;br /&gt;&lt;br /&gt;Session 2&lt;br /&gt;Find the server process servicing the previously spawned sqlplus session and attach to it via the debugger.&lt;br /&gt;&lt;br /&gt;&gt; ps -ef | grep sqlplus&lt;br /&gt;  oracle 20296  5857  0 23:47:38 pts/1    0:00 grep sqlplus&lt;br /&gt;  oracle 17205 23919  0 23:46:03 pts/4    0:00 sqlplus&lt;br /&gt;&gt; ps -ef | grep 17205&lt;br /&gt;  oracle 20615  5857  0 23:47:48 pts/1    0:00 grep 17205&lt;br /&gt;  oracle 17237 17205  0 23:46:04 ?        0:00 oracleTEST1 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))&lt;br /&gt;  oracle 17205 23919  0 23:46:03 pts/4    0:00 sqlplus&lt;br /&gt;&lt;br /&gt;&gt; /opt/SUNWspro/bin/dbx $ORACLE_HOME/bin/oracle 17237&lt;br /&gt;&lt;br /&gt;Reading oracle&lt;br /&gt;==&gt; Output trimmed for brevity.&lt;br /&gt;&lt;br /&gt;dbx: warning: thread related commands will not be available&lt;br /&gt;dbx: warning: see `help lwp', `help lwps' and `help where'&lt;br /&gt;Attached to process 17237 with 2 LWPs&lt;br /&gt;(l@1) stopped in _read at 0xffffffff7bfa8724&lt;br /&gt;0xffffffff7bfa8724: _read+0x0008:       ta       64&lt;br /&gt;(dbx)  collector enable&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Session 1&lt;br /&gt;==================================================================&lt;br /&gt;begin&lt;br /&gt;for i in 1..1000&lt;br /&gt;loop&lt;br /&gt;insert into foo values(i);&lt;br /&gt;end loop;&lt;br /&gt;end;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;Session 2&lt;br /&gt;==================================================================&lt;br /&gt;&lt;br /&gt;(dbx) cont&lt;br /&gt;Creating experiment database test.3.er ...&lt;br /&gt;Reading libcollector.so&lt;br /&gt;&lt;br /&gt;Session 1&lt;br /&gt;==================================================================&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;sess1&gt;&gt;exit&lt;br /&gt;Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production&lt;br /&gt;With the Partitioning, Real Application Clusters, OLAP and Data Mining options&lt;br /&gt;&lt;br /&gt;Session 2&lt;br /&gt;=========&lt;br /&gt;&lt;br /&gt;execution completed, exit code is 0&lt;br /&gt;(dbx) quit&lt;br /&gt;&lt;br /&gt;The debugger creates a directory called test.1.er.&lt;br /&gt;You can analyse the collected data by using analyser which is a GUI tool.&lt;br /&gt;&lt;br /&gt;&gt; export DISPLAY=10.59.49.9:0.0&lt;br /&gt;&gt; /opt/SUNWspro/bin/analyzer test.3.er&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bp2.blogger.com/_3T6egGX_13s/RpnZrPIvHhI/AAAAAAAAAAk/CTLPhYPH-IQ/s1600-h/collector.bmp"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_3T6egGX_13s/RpnZrPIvHhI/AAAAAAAAAAk/CTLPhYPH-IQ/s400/collector.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5087336590912462354" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You can also generate a callers-callees report using the following syntax&lt;br /&gt;&lt;br /&gt;/opt/SUNWspro/bin/er_print test.3.er&lt;br /&gt;test.3.er: Experiment has warnings, see header for details&lt;br /&gt;(/opt/SUNWspro/bin/er_print) callers-callees&lt;br /&gt;&lt;br /&gt;A before and after image of the performance problem would help in diagnosing the function in the code which consumes more CPU with time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-3048222226773038888?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/3048222226773038888/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=3048222226773038888&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/3048222226773038888'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/3048222226773038888'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2007/07/using-dbx-collector.html' title='Using dbx collector'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_3T6egGX_13s/RpnZrPIvHhI/AAAAAAAAAAk/CTLPhYPH-IQ/s72-c/collector.bmp' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-1512522674440639939</id><published>2007-07-08T06:13:00.001-07:00</published><updated>2007-07-10T01:53:23.376-07:00</updated><title type='text'></title><content type='html'>So 11g is finally upon us and it seems just the other day that 10g was released. I am looking forward to playing with some of the new features.&lt;br /&gt;&lt;br /&gt;So here are some of the features in the TO DO list&lt;br /&gt;&lt;br /&gt;Real Application Testing (RAT), which includes Database Replay and SQL Workload Analyzer.  &lt;br /&gt;APIs like&lt;br /&gt;DBMS_WORKLOAD_CAPTURE&lt;br /&gt;DBMS_WORKLOAD_REPLAY&lt;br /&gt;&lt;br /&gt;Sql Plan Management&lt;br /&gt;DBMS_SPM&lt;br /&gt;&lt;br /&gt;DBMS_SHARED_POOL.PURGE api which can be used to flush a single cursor. This is important in a high intensive OLTP environment where you have a sql statement which has gone bad because of a sub-optimal execution plan. I believe this feature can be backported to 10.2.0.2/10.2.0.3&lt;br /&gt;&lt;br /&gt;A new parameter MEMORY_MAX_TARGET has been introduced which would control both SGA and PGA memory allocation. I have not been a big fan of sga_target and hence would not pin my hopes too much on this feature.&lt;br /&gt;&lt;br /&gt;There is a new SQL repair advisory provided through the DBMS_SQLDIAG api.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-1512522674440639939?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/1512522674440639939/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=1512522674440639939&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/1512522674440639939'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/1512522674440639939'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2007/07/so-11g-is-finally-upon-us-and-it-seems.html' title=''/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-4150037630618950814</id><published>2007-06-30T06:59:00.000-07:00</published><updated>2007-07-02T16:12:25.107-07:00</updated><title type='text'>Fix Control</title><content type='html'>Oracle has introduced a fix control mechanism in 10.2 which allows customers to turn off fixes for optimizer related bugs. This is governed by the underscore parameter _fix_control. The bugs for which fixes can be turned off are listed in v$session_fix_control and v$system_fix_control and can also be seen in a 10053 output.&lt;br /&gt;&lt;br /&gt;On a 10.2.0.2 database&lt;br /&gt;&lt;br /&gt;SQL&gt; select distinct bugno from v$session_fix_control;&lt;br /&gt;&lt;br /&gt;     BUGNO&lt;br /&gt;----------&lt;br /&gt;   3499674&lt;br /&gt;   4556762&lt;br /&gt;   4569940&lt;br /&gt;   3118776&lt;br /&gt;   4519016&lt;br /&gt;   4175830&lt;br /&gt;   4663698&lt;br /&gt;   4631959&lt;br /&gt;   4550003&lt;br /&gt;   4584065&lt;br /&gt;   4487253&lt;br /&gt;   4611850&lt;br /&gt;   4663804&lt;br /&gt;   4602374&lt;br /&gt;   4728348&lt;br /&gt;   4723244&lt;br /&gt;   4554846&lt;br /&gt;   4545833&lt;br /&gt;   4488689&lt;br /&gt;   4519340&lt;br /&gt;&lt;br /&gt;20 rows selected.&lt;br /&gt;&lt;br /&gt;SQL&gt;  select distinct sid from v$mystat;&lt;br /&gt;&lt;br /&gt;       SID&lt;br /&gt;----------&lt;br /&gt;       143&lt;br /&gt;&lt;br /&gt;SQL&gt; alter session set "_fix_control"='4728348:OFF';&lt;br /&gt;&lt;br /&gt;Session altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from v$session_fix_control where session_id=143 and bugno=4728348;&lt;br /&gt;&lt;br /&gt;SESSION_ID      BUGNO      VALUE DESCRIPTION                                                      OPTIMIZER_FEATURE_ENABLE       EVENT IS_DEFAULT&lt;br /&gt;---------- ---------- ---------- ---------------------------------------------------------------- --&lt;br /&gt;       143    4728348          0 consider mjc if equi-joined pred is dropped in kkoipt            10.2.0.2                 &lt;br /&gt;&lt;br /&gt;A value of 0 indicates the fix is off.      &lt;br /&gt;&lt;br /&gt;SQL&gt; alter session set "_fix_control"='4728348:ON';&lt;br /&gt;&lt;br /&gt;Session altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from v$session_fix_control where session_id=143 and bugno=4728348;&lt;br /&gt;&lt;br /&gt;SESSION_ID      BUGNO      VALUE DESCRIPTION                                                      OPTIMIZER_FEATURE_ENABLE       EVENT IS_DEFAULT&lt;br /&gt;---------- ---------- ---------- ---------------------------------------------------------------- --&lt;br /&gt;       143    4728348          1 consider mjc if equi-joined pred is dropped in kkoipt            10.2.0.2                       &lt;br /&gt;&lt;br /&gt;It appears to me that if you need two fixes off in a session you have to specify them together else you lose the first change.&lt;br /&gt;&lt;br /&gt;SQL&gt;  alter session set "_fix_control"='4728348:OFF';&lt;br /&gt;&lt;br /&gt;Session altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter session set "_fix_control"='4663698:OFF';&lt;br /&gt;&lt;br /&gt;Session altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from v$session_fix_control where session_id=143 and bugno in (4728348,4663698);&lt;br /&gt;&lt;br /&gt;SESSION_ID      BUGNO      VALUE DESCRIPTION                                                      OPTIMIZER_FEATURE_ENABLE       EVENT IS_DEFAULT&lt;br /&gt;---------- ---------- ---------- ---------------------------------------------------------------- --&lt;br /&gt;       143    4663698          0 for cached NL table set tab_cost_io to zero                      10.2.0.2                           0          0&lt;br /&gt;       143    4728348          1 consider mjc if equi-joined pred is dropped in kkoipt            10.2.0.2                       &lt;br /&gt;&lt;br /&gt;Hence if you need more than one fix OFF you need to supply both bug numbers in the same command&lt;br /&gt;&lt;br /&gt;SQL&gt; alter session set "_fix_control"='4728348:OFF','4663698:OFF';&lt;br /&gt;&lt;br /&gt;Session altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from v$session_fix_control where session_id=143 and bugno in (4728348,4663698);&lt;br /&gt;&lt;br /&gt;SESSION_ID      BUGNO      VALUE DESCRIPTION                                                      OPTIMIZER_FEATURE_ENABLE       EVENT IS_DEFAULT&lt;br /&gt;---------- ---------- ---------- ---------------------------------------------------------------- --&lt;br /&gt;       143    4663698          0 for cached NL table set tab_cost_io to zero                      10.2.0.2                           0          0&lt;br /&gt;       143    4728348          0 consider mjc if equi-joined pred is dropped in kkoipt            10.2.0.2&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-4150037630618950814?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/4150037630618950814/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=4150037630618950814&amp;isPopup=true' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/4150037630618950814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/4150037630618950814'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2007/06/fix-control.html' title='Fix Control'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-4962423541973629508</id><published>2007-06-02T06:25:00.000-07:00</published><updated>2007-06-02T07:02:50.895-07:00</updated><title type='text'>DBA_HIST_FILEMETRIC_HISTORY</title><content type='html'>There are so many new views in 10G that you begin to wonder if many of them are&lt;br /&gt;actually  populated correctly. For example there are quite a few bugs with some of the DBA_HIST* views not being populated correctly. One such view DBA_HIST_TBSPC_SPACE_USAGE is notorious for incorrect values .But the view DBA_HIST_FILEMETRIC_HISTORY  which supposedly stores alerts only for 7 days does not even seem to be getting populated.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So on a 10.1.0.5 database&lt;br /&gt;&lt;br /&gt;SQL&gt; select count(*) from dba_hist_filemetric_history;&lt;br /&gt;&lt;br /&gt;COUNT(*)&lt;br /&gt;----------&lt;br /&gt;0&lt;br /&gt;&lt;br /&gt;If you have a look at the definition of the view from catawrvw.sql&lt;br /&gt;&lt;br /&gt;create or replace view DBA_HIST_FILEMETRIC_HISTORY&lt;br /&gt;(SNAP_ID, DBID, INSTANCE_NUMBER, FILEID, CREATIONTIME, BEGIN_TIME,&lt;br /&gt;END_TIME, INTSIZE, GROUP_ID, AVGREADTIME, AVGWRITETIME, PHYSICALREAD,&lt;br /&gt;PHYSICALWRITE, PHYBLKREAD, PHYBLKWRITE)&lt;br /&gt;as&lt;br /&gt;select fm.snap_id, fm.dbid, fm.instance_number,&lt;br /&gt;fileid, creationtime, begin_time,&lt;br /&gt;end_time, intsize, group_id, avgreadtime, avgwritetime,&lt;br /&gt;physicalread, physicalwrite, phyblkread, phyblkwrite&lt;br /&gt;from wrm$_snapshot sn, WRH$_FILEMETRIC_HISTORY fm&lt;br /&gt;where sn.snap_id = fm.snap_id&lt;br /&gt;and sn.dbid = fm.dbid&lt;br /&gt;and sn.instance_number = fm.instance_number&lt;br /&gt;and sn.status = 0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; select count(*) from WRH$_FILEMETRIC_HISTORY;&lt;br /&gt;&lt;br /&gt;COUNT(*)&lt;br /&gt;----------&lt;br /&gt;0&lt;br /&gt;&lt;br /&gt;I have tried various ways to get this base table populated but&lt;br /&gt;am not sure when information is flushed to WRH$_FILEMETRIC_HISTORY.&lt;br /&gt;This behaviour is also consistent in 10.2.0.3&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-4962423541973629508?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/4962423541973629508/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=4962423541973629508&amp;isPopup=true' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/4962423541973629508'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/4962423541973629508'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2007/06/dbahistfilemetrichistory.html' title='DBA_HIST_FILEMETRIC_HISTORY'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-3273803520464106460</id><published>2007-05-18T20:29:00.000-07:00</published><updated>2007-05-20T23:04:48.806-07:00</updated><title type='text'>What is Timeout?</title><content type='html'>The problem with semi documented APIs like DBMS_SPACE is that some of the subprograms might not work as you might expect them to.&lt;br /&gt;For example the object_space_usage procedure has a parameter called timeout_value which I would assume to mean the amount of time after the procedure will abort if it cannot complete its space calculations. But this does not work as I would expect it to&lt;br /&gt;&lt;br /&gt;SQL&gt; set timing on&lt;br /&gt;SQL&gt; set serveroutput on&lt;br /&gt;&lt;br /&gt;SQL&gt; declare&lt;br /&gt;v_space_used number;&lt;br /&gt;v_space_allocated number;&lt;br /&gt;begin&lt;br /&gt;dbms_space.object_space_usage('SCOTT','EMP','TABLE',0,v_space_used, v_space_allocated,'',TRUE,5);&lt;br /&gt;dbms_output.put_line('SPACE USED = '||v_space_used);&lt;br /&gt;dbms_output.put_line('SPACE ALLOCATED = '||v_space_allocated);&lt;br /&gt;end;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;SPACE USED = 0&lt;br /&gt;SPACE ALLOCATED = 68034756608&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;Elapsed: 00:00:36.12&lt;br /&gt;&lt;br /&gt;So even if I specify a timeout value of 5 the procedure completes in 36 seconds.&lt;br /&gt;&lt;br /&gt;This behaviour reproduces on 10.1.0.5 and 10.2.0.3.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-3273803520464106460?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/3273803520464106460/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=3273803520464106460&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/3273803520464106460'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/3273803520464106460'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2007/05/what-is-timeout.html' title='What is Timeout?'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-1697691871885599595</id><published>2007-04-24T23:45:00.000-07:00</published><updated>2007-04-24T23:50:32.414-07:00</updated><title type='text'>More undocumented APIs in DBMS_SPACE</title><content type='html'>There seem to be quite a few procedures in the package DBMS_SPACE which do not find a mention in the Oracle documentation. One such procedure is &lt;br /&gt;&lt;br /&gt;PROCEDURE OBJECT_SPACE_USAGE&lt;br /&gt; Argument Name                  Type                    In/Out Default?&lt;br /&gt; ------------------------------ ----------------------- ------ --------&lt;br /&gt; OBJECT_OWNER                   VARCHAR2                IN&lt;br /&gt; OBJECT_NAME                    VARCHAR2                IN&lt;br /&gt; OBJECT_TYPE                    VARCHAR2                IN&lt;br /&gt; SAMPLE_CONTROL                 NUMBER                  IN&lt;br /&gt; SPACE_USED                     NUMBER                  OUT&lt;br /&gt; SPACE_ALLOCATED                NUMBER                  OUT&lt;br /&gt; PARTITION_NAME                 VARCHAR2                IN     DEFAULT&lt;br /&gt; PRESERVE_RESULT                BOOLEAN                 IN     DEFAULT&lt;br /&gt; TIMEOUT_SECONDS                NUMBER                  IN     DEFAULT&lt;br /&gt;&lt;br /&gt;which is used by OEM if you use the Segment Findings section on the Database Home page if you configure the same.&lt;br /&gt;&lt;br /&gt;It could be useful to monitor space consumption of segments whilst subjected to continuous DML operations.&lt;br /&gt;&lt;br /&gt;set serveroutput on;&lt;br /&gt;declare&lt;br /&gt;   v_space_used number;&lt;br /&gt;   v_space_allocated number;&lt;br /&gt;     begin&lt;br /&gt;   dbms_space.object_space_usage(‘SCOTT’,'EMP','TABLE PARTITION',0,v_space_used, v_space_allocated, 'P1');&lt;br /&gt; dbms_output.put_line('SPACE USED = '||v_space_used);&lt;br /&gt; dbms_output.put_line('SPACE ALLOCATED = '||v_space_allocated);&lt;br /&gt; end;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SPACE USED = 454248&lt;br /&gt;SPACE ALLOCATED = 458752&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;I haven’t figured out what sample_control is though. Also this procedure does not work for spatial indexes as you encounter an ora-600.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-1697691871885599595?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/1697691871885599595/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=1697691871885599595&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/1697691871885599595'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/1697691871885599595'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2007/04/more-undocumented-apis-in-dbmsspace.html' title='More undocumented APIs in DBMS_SPACE'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-6695751320837019870</id><published>2007-04-23T05:11:00.000-07:00</published><updated>2007-05-20T21:36:16.295-07:00</updated><title type='text'>KST tracing</title><content type='html'>In a recent &lt;a href="http://kevinclosson.wordpress.com/2007/03/23/do-not-exhaust-free-space-under-ora_crs_home-who-was-the-culprit/"&gt;post&lt;/a&gt; Kevin Closson highlights the perils of the effect of the the ORA_CRS_HOME mounpoint filling up.&lt;br /&gt;If you use the RAC service framework services would relocate to another node after going offline on the node on which the filesystem is full&lt;br /&gt;&lt;br /&gt;In a RAC cluster if a process encounters an ora-600 or an ora-7445 (I haven't checked for other errors) each node in the cluster dumps trace files for each process with suffix trw in directories called cdmp_YYYYMMDDHHMISS under bdump. This instrumentation is referred to as KST tracing. So if you have a batch job which continuously encounters the before mentioned errors this can cause a plethora of cdmp* directories generated which could fill up the filesystem.&lt;br /&gt;These trace files can be formatted by an internal Oracle tool called Trace Loader (trcldr).&lt;br /&gt;&lt;br /&gt;You can disable this functionality by setting trace_enabled=false which&lt;br /&gt;can be changed dynamically. After making this change you will see the following&lt;br /&gt;message in the diag trace file&lt;br /&gt;&lt;br /&gt;***********************************************&lt;br /&gt;KST tracing is turned off, no data is logged&lt;br /&gt;***********************************************&lt;br /&gt;&lt;br /&gt;This functionality is also disabled if you set _diag_daemon=false. This would disable the DIAG daemon and hence disable other functionality like the dumping of systemstates by the DIAG process when a self deadlock occurs. DIAG is the only background process which can be killed without instance death.It is the 2nd last process to be terminated because it needs to perform trace flushing to file system. By default, the terminating process, usually PMON, gives 5 seconds to DIAG for dumping. This is governed by the parameter _ksu_diag_kill_time. So after dumping all&lt;br /&gt;diagnostic data PMON will wait for _ksu_diag_kill_time before killing the instance.&lt;br /&gt;This delay has been fixed via bug &lt;a href="https://metalink.oracle.com/metalink/plsql/f?p=130:15:6117857109236914127::::p15_database_id,p15_docid,p15_show_header,p15_show_help,p15_black_frame,p15_font:BUG,5599293,1,1,1,helvetica"&gt;5599293&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-6695751320837019870?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/6695751320837019870/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=6695751320837019870&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/6695751320837019870'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/6695751320837019870'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2007/04/kst-tracing.html' title='KST tracing'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-803783903707600314</id><published>2007-03-24T05:24:00.000-07:00</published><updated>2007-03-24T05:26:58.767-07:00</updated><title type='text'>Diagnosing archivelog corruption</title><content type='html'>When you encounter an archivelog corruption issue as seen from an ora-353 or ora-600 [3020]  (stuck recovery) It is a common practice to dump the archivelog to determine  the nature of the corruption.&lt;br /&gt;Metalink note &lt;a href="https://metalink.oracle.com/metalink/plsql/f?p=130:14:466065973827512015::::p14_database_id,p14_docid,p14_show_header,p14_show_help,p14_black_frame,p14_font:NOT,1031381.6,1,1,1,helvetica"&gt;1031381.6&lt;/a&gt; explains various methods you can use to dump the same.&lt;br /&gt;&lt;br /&gt;In addition you can also use the following command which only dumps the redo log file header although it reads the complete log file ( a truss on the associated server process can confirm the same) and hence you do not have the overhead of a large trace file (especially for large archivelogs)&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system dump logfile 'D:\ARCHIVELOG\2007_03_24\O1_MF_1_48_3090F2FO_.ARC' layer 999 opcode 999;&lt;br /&gt;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;The associated trace file is shown below&lt;br /&gt;&lt;br /&gt;***********************************************************&lt;br /&gt;DUMP OF REDO FROM FILE 'D:\ARCHIVELOG\2007_03_24\O1_MF_1_48_3090F2FO_.ARC'&lt;br /&gt; Opcode 999.999 only&lt;br /&gt; RBAs: 0x000000.00000000.0000 thru 0xffffffff.ffffffff.ffff&lt;br /&gt; SCNs: scn: 0x0000.00000000 thru scn: 0xffff.ffffffff&lt;br /&gt; Times: creation thru eternity&lt;br /&gt; FILE HEADER:&lt;br /&gt; Compatibility Vsn = 169869824=0xa200200&lt;br /&gt; Db ID=4004875527=0xeeb58d07, Db Name='TEN2'&lt;br /&gt; Activation ID=4004873735=0xeeb58607&lt;br /&gt; Control Seq=845=0x34d, File size=102400=0x19000&lt;br /&gt; File Number=3, Blksiz=512, File Type=2 LOG&lt;br /&gt; descrip:"Thread 0001, Seq# 0000000048, SCN 0x0000001614ba-0x0000001614df"&lt;br /&gt; thread: 1 nab: 0xc seq: 0x00000030 hws: 0x2 eot: 0 dis: 0&lt;br /&gt; resetlogs count: 0x2433e987 scn: 0x0000.00000001 (1)&lt;br /&gt; resetlogs terminal rcv count: 0x0 scn: 0x0000.00000000&lt;br /&gt; prev resetlogs count: 0x0 scn: 0x0000.00000000&lt;br /&gt; prev resetlogs terminal rcv count: 0x0 scn: 0x0000.00000000&lt;br /&gt; Low  scn: 0x0000.001614ba (1447098) 03/24/2007 12:39:20&lt;br /&gt; Next scn: 0x0000.001614df (1447135) 03/24/2007 12:40:50&lt;br /&gt; Enabled scn: 0x0000.00000001 (1) 11/24/2006 21:11:44&lt;br /&gt; Thread closed scn: 0x0000.001614ba (1447098) 03/24/2007 12:39:20&lt;br /&gt; Disk cksum: 0xefe4 Calc cksum: 0xefe4&lt;br /&gt; Terminal recovery stop scn: 0x0000.00000000&lt;br /&gt; Terminal recovery  01/01/1988 00:00:00&lt;br /&gt; Most recent redo scn: 0x0000.00000000&lt;br /&gt; Largest LWN: 3 blocks&lt;br /&gt; End-of-redo stream : No&lt;br /&gt; Unprotected mode&lt;br /&gt; Miscellaneous flags: 0x11&lt;br /&gt; Thread internal enable indicator: thr: 0, seq: 0 scn: 0x0000.00000000&lt;br /&gt;END OF REDO DUMP&lt;br /&gt;----- Redo read statistics for thread 1 -----&lt;br /&gt;Read rate (ASYNC): 5Kb in 0.05s =&gt; 0.10 Mb/sec&lt;br /&gt;Total physical reads: 5Kb&lt;br /&gt;Longest record: 1Kb, moves: 0/5 (0%)&lt;br /&gt;Change moves: 6/33 (18%), moved: 0Mb&lt;br /&gt;Longest LWN: 1Kb, moves: 0/4 (0%), moved: 0Mb&lt;br /&gt;Last redo scn: 0x0000.001614db (1447131)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-803783903707600314?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/803783903707600314/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=803783903707600314&amp;isPopup=true' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/803783903707600314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/803783903707600314'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2007/03/diagnosing-archivelog-corruption.html' title='Diagnosing archivelog corruption'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-5590770324870687049</id><published>2007-02-27T21:38:00.001-08:00</published><updated>2007-02-27T21:39:32.583-08:00</updated><title type='text'>RMAN priorities</title><content type='html'>Whilst playing around with "_high_priority_processes” I ran across another hidden parameter called _rman_io_priority. Ostensibly this looks like another magic switch like _serial_direct_read to improve the speed of RMAN backups and restores.&lt;br /&gt;But alas this parameter cannot be modified  from its default value of 3&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system set "_rman_io_priority"=6 scope=spfile;&lt;br /&gt;alter system set "_rman_io_priority"=6 scope=spfile&lt;br /&gt;*&lt;br /&gt;ERROR at line 1:&lt;br /&gt;ORA-00068: invalid value 6 for parameter _rman_io_priority, must be between 6&lt;br /&gt;and 18446744073709551615&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system set  "_rman_io_priority"=7 ;&lt;br /&gt;alter system set  "_rman_io_priority"=7&lt;br /&gt;*&lt;br /&gt;ERROR at line 1:&lt;br /&gt;ORA-00068: invalid value 7 for parameter _rman_io_priority, must be between 6 and 18446744073709551615&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system set  "_rman_io_priority"=18446744073709551614;&lt;br /&gt;alter system set  "_rman_io_priority"=18446744073709551614&lt;br /&gt;                                      *&lt;br /&gt;ERROR at line 1:&lt;br /&gt;ORA-02017: integer value required&lt;br /&gt;&lt;br /&gt;The maximum value of an integer is 2147483647 or (2e31 -1)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt;  alter system set  "_rman_io_priority"=2147483647;&lt;br /&gt; alter system set  "_rman_io_priority"=2147483647&lt;br /&gt;*&lt;br /&gt;ERROR at line 1:&lt;br /&gt;ORA-00068: invalid value 2147483647 for parameter _rman_io_priority, must be between 6 and 18446744073709551615&lt;br /&gt;&lt;br /&gt;As this is an undocumented parameter I cannot raise an SR on this issue. My understanding is that this has been fixed in 11g although it still remains an undocumented parameter.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-5590770324870687049?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/5590770324870687049/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=5590770324870687049&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/5590770324870687049'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/5590770324870687049'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2007/02/rman-priorities.html' title='RMAN priorities'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-7932394816342801876</id><published>2007-02-18T13:51:00.000-08:00</published><updated>2007-02-19T14:46:20.924-08:00</updated><title type='text'>LMS and real time priorities (2)</title><content type='html'>From my testing on 10.2.0.3 with the following combination of parameters these are the results&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;_high_priority_processes _os_sched_high_priority Scheduler class&lt;/strong&gt;&lt;br /&gt;LMS* (default) 1 (default) RR&lt;br /&gt;Null 0 TS&lt;br /&gt;LMS* (default) 0 RR&lt;br /&gt;Null 1 (default) TS&lt;br /&gt;&lt;br /&gt;As can be seen the value of _os_sched_high_priority doesn’t seem to matter (or is this another bug) and LMS seems to run in the RR class only if the value of _high_priority_processes is LMS*.&lt;br /&gt;&lt;br /&gt;Also we put other oracle processes in the RR class using this same parameter?&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system set "_high_priority_processes"='PMON' scope=spfile;&lt;br /&gt;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; exit&lt;br /&gt;Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production&lt;br /&gt;With the Partitioning, Real Application Clusters, OLAP and Data Mining options&lt;br /&gt;&lt;br /&gt;elephant-&gt; srvctl stop database -d F8902PRD&lt;br /&gt;elephant-&gt; srvctl start database -d F8902PRD&lt;br /&gt;&lt;br /&gt;elephant-&gt; ps -efc | grep pmon | grep –v grep&lt;br /&gt;oracle 4929 1 &lt;strong&gt;RR&lt;/strong&gt; 90 17:57 ? 00:00:00 ora_pmon_F8902PRD1&lt;br /&gt;&lt;br /&gt;Also the parameter _high_priority_processes was not in the base release (10.2.0.1)&lt;br /&gt;and introduced in the 10.2.0.3 patchset&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-7932394816342801876?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/7932394816342801876/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=7932394816342801876&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/7932394816342801876'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/7932394816342801876'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2007/02/lms-and-real-time-priorities-2.html' title='LMS and real time priorities (2)'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-7892177838292798439</id><published>2007-02-16T06:07:00.000-08:00</published><updated>2007-02-16T06:21:09.671-08:00</updated><title type='text'>LMS and real time priorities</title><content type='html'>One of the oft mentioned RAC best practices is that the priority of LMS processes which ship blocks across the interconnect be higher so that they are not competing for cpu cycles with other processes.&lt;br /&gt;Starting with 10.2 LMS is supposed to run in the real time class. This is new functionality which is governed by the underscore parameter _os_sched_high_priority &lt;br /&gt;&lt;br /&gt;However in 10.2.0.1 LMS still runs in the time-sharing TS class (SCHED_OTHER standard time-sharing) due to the absence of the oradism executable&lt;br /&gt;buffalo &gt;ls -al oradism&lt;br /&gt;-r-sr-s---  1 root dba 0 Jul  1  2005 oradism&lt;br /&gt;&lt;br /&gt;buffalo &gt;ps -efc|grep lms&lt;br /&gt;oracle   27263     1 &lt;strong&gt;TS&lt;/strong&gt;   24  2006 ?        00:12:38 ora_lms0_F8900DMO1&lt;br /&gt;oracle   27273     1 &lt;strong&gt;TS&lt;/strong&gt;   24  2006 ?        00:04:30 ora_lms1_F8900DMO1&lt;br /&gt;&lt;br /&gt;When you apply the 10.2.0.3 patchset you notice that the oradism executable seems to be generated and LMS runs in the RR class (SCHED_RR round robin)&lt;br /&gt;&lt;br /&gt;elephant-&gt; ls -al oradism&lt;br /&gt;-r-sr-s---  1 root dba 14456 Nov 15 12:52 oradism&lt;br /&gt;&lt;br /&gt;elephant-&gt; ps -efc | grep lms&lt;br /&gt;&lt;br /&gt;oracle   11554     1 &lt;strong&gt;RR&lt;/strong&gt;   90 15:09 ?        00:00:01 ora_lms0_F8902PRD1&lt;br /&gt;oracle   11558     1 &lt;strong&gt;RR&lt;/strong&gt;   90 15:09 ?        00:00:01 ora_lms1_F8902PRD1&lt;br /&gt;&lt;br /&gt;whereas other background processes like PMON still run in TS &lt;br /&gt;&lt;br /&gt;elephant-&gt; ps -efc | grep pmon | grep PRD&lt;br /&gt;oracle   11544     1 &lt;strong&gt;TS&lt;/strong&gt;   23 Feb14 ?        00:00:00 ora_pmon_F8902PRD1&lt;br /&gt;&lt;br /&gt;I am not sure if this is ideal on a box with a low number of CPUs or if cache fusion traffic is not a major concern.If you want LMS to run in the same class as other processes you need to set _os_sched_high_priority back to 0 from its default value of 1 as seen from below&lt;br /&gt;&lt;br /&gt;But doing this does not seem to change the class to TS&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system set "_os_sched_high_priority"=0 scope=spfile;&lt;br /&gt;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; exit&lt;br /&gt;Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production&lt;br /&gt;With the Partitioning, Real Application Clusters, OLAP and Data Mining options&lt;br /&gt;elephant-&gt; srvctl stop database -d F8902PRD&lt;br /&gt;elephant-&gt; srvctl start  database -d F8902PRD&lt;br /&gt;elephant-&gt; ps -efc | grep lms | grep PRD&lt;br /&gt;oracle   17097     1 &lt;strong&gt;RR&lt;/strong&gt;   90 09:54 ?        00:00:00 ora_lms0_F8902PRD1&lt;br /&gt;oracle   17101     1 &lt;strong&gt;RR&lt;/strong&gt;   90 09:54 ?        00:00:00 ora_lms1_F8902PRD1&lt;br /&gt;&lt;br /&gt;  1  select  a.ksppinm  "Parameter",&lt;br /&gt;  2               b.ksppstvl "Session Value",&lt;br /&gt;  3               c.ksppstvl "Instance Value"&lt;br /&gt;  4        from x$ksppi a, x$ksppcv b, x$ksppsv c&lt;br /&gt;  5       where a.indx = b.indx and a.indx = c.indx&lt;br /&gt;  6*        and a.ksppinm like '%os_sched%'&lt;br /&gt;SQL&gt; /&lt;br /&gt;&lt;br /&gt;Parameter&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;Session Value&lt;br /&gt;-------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;Instance Value&lt;br /&gt;-------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;_os_sched_high_priority&lt;br /&gt;0&lt;br /&gt;0&lt;br /&gt;&lt;br /&gt;From bug &lt;a href="https://metalink.oracle.com/metalink/plsql/f?p=130:15:8900835576288411642::::p15_database_id,p15_docid,p15_show_header,p15_show_help,p15_black_frame,p15_font:BUG,5635098,1,1,1,helvetica"&gt;5635098&lt;/a&gt; it appears there is another parameter called&lt;br /&gt;_high_priority_processes which needs to be set to null for this to work.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system set "_high_priority_processes"='' scope=spfile;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;elephant-&gt; srvctl stop database -d F8902PRD&lt;br /&gt;elephant-&gt; srvctl start database -d F8902PRD&lt;br /&gt;&lt;br /&gt;elephant-&gt; ps -efc | grep lms | grep -v grep&lt;br /&gt;&lt;br /&gt;oracle   31654     1 &lt;strong&gt;TS&lt;/strong&gt;   24 00:58 ?        00:00:01 ora_lms0_F8902PRD1&lt;br /&gt;oracle   31656     1 &lt;strong&gt;TS&lt;/strong&gt;   24 00:58 ?        00:00:00 ora_lms1_F8902PRD1&lt;br /&gt;&lt;br /&gt;As you can lms is now running in TS class.&lt;br /&gt;On Solaris Sparc 64 bit be aware of bug &lt;a href="https://metalink.oracle.com/metalink/plsql/f?p=130:15:8900835576288411642::::p15_database_id,p15_docid,p15_show_header,p15_show_help,p15_black_frame,p15_font:BUG,5258549,1,1,1,helvetica"&gt;5258549&lt;/a&gt;  which causes boxes with low number of CPUs to freeze.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-7892177838292798439?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/7892177838292798439/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=7892177838292798439&amp;isPopup=true' title='16 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/7892177838292798439'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/7892177838292798439'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2007/02/lms-and-real-time-priorities.html' title='LMS and real time priorities'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>16</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-9095767134110395056</id><published>2007-02-09T05:03:00.000-08:00</published><updated>2007-02-09T05:07:26.437-08:00</updated><title type='text'>CRS Version</title><content type='html'>I notice that on a lot of forums the following is quite a common question&lt;br /&gt;"How can I verify what version CRS is?".&lt;br /&gt;&lt;br /&gt;The version of CRS can be higher than the version of database/ASM software. The commands to see the same are&lt;br /&gt;&lt;br /&gt;crsctl query crs softwareversion &lt;br /&gt;crsctl query crs activeversion&lt;br /&gt;&lt;br /&gt;So although the difference between the two commands might be obvious I am not sure if this is documented anywhere. Also after upgrading from 10.2.0.1 to 10.2.0.2/10.2.0.3 the active version does not seem to change. This maybe due to bug &lt;a href="https://metalink.oracle.com/metalink/plsql/f?p=130:15:9186808088845040264::::p15_database_id,p15_docid,p15_show_header,p15_show_help,p15_black_frame,p15_font:BUG,5467342,1,1,1,helvetica"&gt;5278777&lt;/a&gt; which should be fixed in the 10.2.0.4 patchset.&lt;br /&gt;&lt;br /&gt;I upgraded a couple of clusters yesterday from 10.2.0.1 to 10.2.0.3 (without any issues per se) and this is what I see after the CRS upgrade.&lt;br /&gt;&lt;br /&gt;elephant-&gt; crsctl query crs softwareversion&lt;br /&gt;CRS software version on node [elephant] is [10.2.0.3.0]&lt;br /&gt;elephant-&gt; crsctl query crs activeversion&lt;br /&gt;CRS active version on the cluster is [10.2.0.1.0]&lt;br /&gt;&lt;br /&gt;elephant-&gt; cemutlo -w&lt;br /&gt;2:1:&lt;br /&gt;&lt;br /&gt;The cemutlo command is used by the EM agent to query CRS version.&lt;br /&gt;&lt;br /&gt;Also a rolling upgrade of CRS causes the VIP to relocate to some other node and you have to manually relocate the same using crs_relocate. This is mentioned in the patchset readme though I am not sure how many customers actually read the section “Known Issues”.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-9095767134110395056?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/9095767134110395056/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=9095767134110395056&amp;isPopup=true' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/9095767134110395056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/9095767134110395056'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2007/02/crs-version_09.html' title='CRS Version'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-2045443540820543949</id><published>2007-01-21T18:57:00.000-08:00</published><updated>2007-01-22T21:24:50.073-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='X$KCCCP checkpoint progress'/><title type='text'>Checkpoint progress record</title><content type='html'>The checkpoint process record is written to by the CKPT  process every 3 seconds.This update is more commonly known as the heartbeat.This can be verified from the following query&lt;br /&gt;&lt;br /&gt;SELECT CPHBT from X$KCCCP where rownum &lt; 2&lt;br /&gt;CPHBT&lt;br /&gt;----------&lt;br /&gt;&lt;strong&gt; 612542768&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;In versions prior to 10G there was only one record. For a single&lt;br /&gt;instance in 10G there are 8 records in the above structure.&lt;br /&gt;&lt;br /&gt;You can also check the same from a controlfile dump using the following event&lt;br /&gt;&lt;br /&gt;alter session set events 'immediate trace name controlf level 12';&lt;br /&gt;&lt;br /&gt;In versions prior to 10G level 10 would suffice to obtain a logical dump but &lt;br /&gt;in my testing on versions 10.1.0.x and 10.2.0.x on various platforms &lt;br /&gt;I have been able to get a controlfile dump only at level 12.&lt;br /&gt;&lt;br /&gt;From the generate trace file in udump&lt;br /&gt;&lt;br /&gt;***************************************************************************&lt;br /&gt;CHECKPOINT PROGRESS RECORDS&lt;br /&gt;***************************************************************************&lt;br /&gt; (size = 8180, compat size = 8180, section max = 11, section in-use = 0,&lt;br /&gt;  last-recid= 0, old-recno = 0, last-recno = 0)&lt;br /&gt; (extent = 1, blkno = 2, numrecs = 11)&lt;br /&gt;THREAD #1 - status:0x2 flags:0x0 dirty:68&lt;br /&gt;low cache rba:(0x7d.e82d.0) on disk rba:(0x7d.e8d9.0)&lt;br /&gt;on disk scn: 0x0000.0043bea2 01/22/2007 13:10:24&lt;br /&gt;resetlogs scn: 0x0000.0008026d 11/16/2006 16:57:26&lt;br /&gt;&lt;strong&gt;heartbeat: 612542768&lt;/strong&gt; mount id: 2427095148&lt;br /&gt;......&lt;br /&gt;&lt;br /&gt;To verify that the heartbeat happens every 3 secs you can do an strace on the CKPT&lt;br /&gt;process.&lt;br /&gt;&lt;br /&gt;eiger-&gt; ps -ef | grep ckp | grep -v grep&lt;br /&gt;oracle    2739     1  0 07:14 ?        00:00:04 ora_ckpt_HRDEV&lt;br /&gt;eiger-&gt; strace -tt -o /tmp/ckpt.out -p 2739&lt;br /&gt;Process 2739 attached - interrupt to quit&lt;br /&gt;&lt;br /&gt;From  /tmp/ckpt.out&lt;br /&gt;&lt;br /&gt;13:31:26.742402 gettimeofday({1169433086, 742475}, NULL) = 0&lt;br /&gt;13:31:26.742531 times(NULL)             = 431667132&lt;br /&gt;&lt;strong&gt;13:31:26&lt;/strong&gt;.742602 pwrite(16, "\25\302\0\0\3\0\0\0\0\0\0\0\0\0\1\4a1\0\0\2\0\0\0\0\0\0"..., 16384, 49152) = 16384&lt;br /&gt;13:31:26.743399 times(NULL)             = 431667132&lt;br /&gt;13:31:26.743529 times(NULL)             = 431667132&lt;br /&gt;13:31:26.743600 pwrite(17, "\25\302\0\0\3\0\0\0\0\0\0\0\0\0\1\4a1\0\0\2\0\0\0\0\0\0"..., 16384, 49152) = 16384&lt;br /&gt;13:31:26.744262 times(NULL)             = 431667132&lt;br /&gt;13:31:26.744338 times(NULL)             = 431667132&lt;br /&gt;13:31:26.744409 pwrite(18, "\25\302\0\0\3\0\0\0\0\0\0\0\0\0\1\4a1\0\0\2\0\0\0\0\0\0"..., 16384, 49152) = 16384&lt;br /&gt;13:31:26.744938 times(NULL)             = 431667132&lt;br /&gt;.........&lt;br /&gt;13:31:29.750559 gettimeofday({1169433089, 750559}, NULL) = 0&lt;br /&gt;13:31:29.750559 times(NULL)             = 431667433&lt;br /&gt;&lt;strong&gt;13:31:29&lt;/strong&gt;.750559 pwrite(16, "\25\302\0\0\3\0\0\0\0\0\0\0\0\0\1\4`1\0\0\2\0\0\0\0\0\0"..., 16384, 49152) = 16384&lt;br /&gt;13:31:29.752055 times(NULL)             = 431667433&lt;br /&gt;13:31:29.752122 times(NULL)             = 431667433&lt;br /&gt;13:31:29.752659 pwrite(17, "\25\302\0\0\3\0\0\0\0\0\0\0\0\0\1\4`1\0\0\2\0\0\0\0\0\0"..., 16384, 49152) = 16384&lt;br /&gt;13:31:29.753758 times(NULL)             = 431667433&lt;br /&gt;13:31:29.753827 times(NULL)             = 431667433&lt;br /&gt;13:31:29.753896 pwrite(18, "\25\302\0\0\3\0\0\0\0\0\0\0\0\0\1\4`1\0\0\2\0\0\0\0\0\0"..., 16384, 49152) = 16384&lt;br /&gt;13:31:29.754706 times(NULL)             = 431667433&lt;br /&gt;&lt;br /&gt;As seen from below file descriptors 16,17 and 18 correspond to the 3 controlfiles of this database&lt;br /&gt;&lt;br /&gt;eiger-&gt; cd /proc&lt;br /&gt;eiger-&gt; cd 2739&lt;br /&gt;eiger-&gt; cd fd&lt;br /&gt;eiger-&gt; ls -al 1?&lt;br /&gt;&lt;br /&gt;eiger-&gt; ls -al 1? | grep contro&lt;br /&gt;lrwx------  1 oracle oracle 64 Jan 22 13:42 16 -&gt; /usr/opt/oracle/u01/oradata/HRDEV/control01.ctl&lt;br /&gt;lrwx------  1 oracle oracle 64 Jan 22 13:42 17 -&gt; /usr/opt/oracle/u01/oradata/HRDEV/control02.ctl&lt;br /&gt;lrwx------  1 oracle oracle 64 Jan 22 13:42 18 -&gt; /usr/opt/oracle/u01/oradata/HRDEV/control03.ctl&lt;br /&gt;&lt;br /&gt;The block which holds the checkpoint progress record also holds the CFVRR (controlfile vote result record)which is used to resolve a split brain scenario when nodes in a cluster cannot talk to each other.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-2045443540820543949?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/2045443540820543949/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=2045443540820543949&amp;isPopup=true' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/2045443540820543949'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/2045443540820543949'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2007/01/checkpoint-progress-record.html' title='Checkpoint progress record'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-6767395419402740533</id><published>2007-01-18T15:03:00.000-08:00</published><updated>2007-01-18T15:07:33.221-08:00</updated><title type='text'>RAC, Archivelog mode and cluster_database</title><content type='html'>In version prior to 10.2 one had to set the parameter cluster_database&lt;br /&gt;to FALSE to switch the archivelog mode of a database&lt;br /&gt;&lt;br /&gt;Starting with 10.2 you no longer need to modify the CLUSTER_DATABASE parameter setting to&lt;br /&gt;change the archiving mode in RAC. You can change archivelog mode as long as&lt;br /&gt;the database is mounted in the local instance and not open in any instances.&lt;br /&gt;&lt;br /&gt;Lets' test the same...&lt;br /&gt;&lt;br /&gt;elephant-&gt; srvctl status database -d F8902PRD&lt;br /&gt;Instance F8902PRD1 is running on node elephant&lt;br /&gt;Instance F8902PRD2 is running on node rhino&lt;br /&gt;Instance F8902PRD3 is running on node hippo&lt;br /&gt;&lt;br /&gt;elephant-&gt; sqlplus&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 10.2.0.1.0 - Production on Fri Jan 19 09:12:21 2007&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2005, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;Enter user-name: / as sysdba&lt;br /&gt;&lt;br /&gt;Connected to:&lt;br /&gt;Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production&lt;br /&gt;With the Partitioning, Real Application Clusters, OLAP and Data Mining options&lt;br /&gt;&lt;br /&gt;SQL&gt; archive log list&lt;br /&gt;Database log mode              Archive Mode&lt;br /&gt;Automatic archival             Enabled&lt;br /&gt;Archive destination            /u03/backup/F8902PRD/arch/&lt;br /&gt;Oldest online log sequence     1103&lt;br /&gt;Next log sequence to archive   1104&lt;br /&gt;Current log sequence           1104&lt;br /&gt;&lt;br /&gt;elephant-&gt; srvctl stop database -d F8902PRD&lt;br /&gt;&lt;br /&gt;elephant-&gt; srvctl start instance -d F8902PRD -i F8902PRD1 -o mount&lt;br /&gt;elephant-&gt; srvctl status database -d F8902PRD&lt;br /&gt;Instance F8902PRD1 is running on node elephant&lt;br /&gt;Instance F8902PRD2 is not running on node rhino&lt;br /&gt;Instance F8902PRD3 is not running on node hippo&lt;br /&gt;&lt;br /&gt;SQL&gt; show parameter cluster_database&lt;br /&gt;&lt;br /&gt;NAME                                 TYPE        VALUE&lt;br /&gt;------------------------------------ ----------- ------------------------------&lt;br /&gt;cluster_database                     boolean     TRUE&lt;br /&gt;cluster_database_instances           integer     3&lt;br /&gt;SQL&gt; alter database noarchivelog;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;SQL&gt; archive log list&lt;br /&gt;Database log mode              No Archive Mode&lt;br /&gt;Automatic archival             Disabled&lt;br /&gt;Archive destination            /u03/backup/F8902PRD/arch/&lt;br /&gt;Oldest online log sequence     1103&lt;br /&gt;Current log sequence           1104&lt;br /&gt;&lt;br /&gt;elephant-&gt; srvctl stop instance -d F8902PRD -i F8902PRD1&lt;br /&gt;&lt;br /&gt;Now lets try to change back to archivelog mode by mounting the database from more&lt;br /&gt;than one instance.&lt;br /&gt;&lt;br /&gt;elephant-&gt; srvctl start instance -d F8902PRD -i F8902PRD1 -o mount&lt;br /&gt;elephant-&gt; srvctl start instance -d F8902PRD -i F8902PRD2 -o mount&lt;br /&gt;elephant-&gt; srvctl status database -d F8902PRD&lt;br /&gt;Instance F8902PRD1 is running on node elephant&lt;br /&gt;Instance F8902PRD2 is running on node rhino&lt;br /&gt;Instance F8902PRD3 is not running on node hippo&lt;br /&gt;&lt;br /&gt;SQL&gt; show parameter cluster_database&lt;br /&gt;&lt;br /&gt;NAME                                 TYPE        VALUE&lt;br /&gt;------------------------------------ ----------- ------------------------------&lt;br /&gt;cluster_database                     boolean     TRUE&lt;br /&gt;cluster_database_instances           integer     3&lt;br /&gt;SQL&gt; alter database archivelog;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; archive log list&lt;br /&gt;Database log mode              Archive Mode&lt;br /&gt;Automatic archival             Enabled&lt;br /&gt;Archive destination            /u03/backup/F8902PRD/arch/&lt;br /&gt;Oldest online log sequence     1103&lt;br /&gt;Next log sequence to archive   1104&lt;br /&gt;Current log sequence           1104&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;elephant-&gt; srvctl stop database -d F8902PRD&lt;br /&gt;elephant-&gt; srvctl start instance -d F8902PRD -i F8902PRD1 -o mount&lt;br /&gt;elephant-&gt; srvctl start instance -d F8902PRD -i F8902PRD2 -o mount&lt;br /&gt;elephant-&gt; srvctl start instance -d F8902PRD -i F8902PRD2 -o open   ==&gt; I made a typo here. It should have been F8902PRD3&lt;br /&gt;instead of F8902PRD2 but notice srvctl does not generate any errors. So u don't know if instance 2 has actually opened the database.&lt;br /&gt;elephant-&gt; srvctl start instance -d F8902PRD -i F8902PRD3 -o open&lt;br /&gt;&lt;br /&gt;SQL&gt; select inst_id,open_mode from gv$database;&lt;br /&gt;&lt;br /&gt;   INST_ID OPEN_MODE&lt;br /&gt;---------- ----------&lt;br /&gt;         1 MOUNTED&lt;br /&gt;         2 MOUNTED&lt;br /&gt;         3 READ WRITE&lt;br /&gt;&lt;br /&gt;So instance 3 has the db open while instances 1 and 2 have just mounted the database.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database noarchivelog;&lt;br /&gt;alter database noarchivelog&lt;br /&gt;*&lt;br /&gt;ERROR at line 1:&lt;br /&gt;ORA-01126: database must be mounted in this instance and not open in any&lt;br /&gt;instance&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;*****************************************************************************************&lt;br /&gt;However if you need to recreate the controlfile you need to set cluster_database to false&lt;br /&gt;&lt;br /&gt;elephant-&gt; srvctl stop database -d F8902PRD&lt;br /&gt;elephant-&gt; srvctl start instance -d F8902PRD -i F8902PRD1 -o nomount&lt;br /&gt;elephant-&gt; srvctl status database -d F8902PRD&lt;br /&gt;Instance F8902PRD1 is running on node elephant&lt;br /&gt;Instance F8902PRD2 is not running on node rhino&lt;br /&gt;Instance F8902PRD3 is not running on node hippo&lt;br /&gt;&lt;br /&gt;SQL&gt; select inst_id,DATABASE_STATUS  from gv$instance;&lt;br /&gt;&lt;br /&gt;   INST_ID DATABASE_STATUS&lt;br /&gt;---------- -----------------&lt;br /&gt;         1 ACTIVE&lt;br /&gt;&lt;br /&gt;SQL&gt; @controlfile.sql&lt;br /&gt;CREATE CONTROLFILE REUSE DATABASE "F8902PRD" NORESETLOGS  ARCHIVELOG&lt;br /&gt;*&lt;br /&gt;ERROR at line 1:&lt;br /&gt;ORA-01503: CREATE CONTROLFILE failed&lt;br /&gt;ORA-12720: operation requires database is in EXCLUSIVE mode&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-6767395419402740533?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/6767395419402740533/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=6767395419402740533&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/6767395419402740533'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/6767395419402740533'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2007/01/rac-archivelog-mode-and-clusterdatabase.html' title='RAC, Archivelog mode and cluster_database'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-4502119677979131788</id><published>2007-01-10T20:21:00.000-08:00</published><updated>2007-01-11T02:52:25.793-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='optimizer cache statistics'/><title type='text'>The Optimizer and cache related statistics.</title><content type='html'>&lt;a href="http://jonathanlewis.wordpress.com/"&gt;Jonathan Lewis&lt;/a&gt; in his excellent &lt;a href="http://www.amazon.com/exec/obidos/ASIN/1590596366/jlcomp"&gt;book&lt;/a&gt; on the CBO talks about new functionality within Oracle’s optimizer wherein the optimizer can use cache related statistics of objects to evaluate a more optimal execution plan.&lt;br /&gt;&lt;br /&gt;All the following testing has been done on 10.2.0.3 with the hidden parameter _cache_stats_monitor set to TRUE (default is false)&lt;br /&gt;&lt;br /&gt;The table cache_stats_1$ which is used to monitor lifetime caching statistics (c0902000.sql)  is populated by MMON periodically via a MERGE statement which does not seem to be using bind variables. You can also populate the same directly using &lt;br /&gt;&lt;br /&gt;SQL&gt; exec dbms_stats_internal.flush_cache_stats;&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;For the purpose of this discussion we will concentrate on a normal heap table SCOTT.T1 with data_object_id = 58417 which is a replica of dba_tables.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from cache_stats_1$ where  DATAOBJ#=58417&lt;br /&gt;&lt;br /&gt;  DATAOBJ#    INST_ID CACHED_AVG CACHED_SQR_AVG  CACHED_NO CACHED_SEQ_NO&lt;br /&gt;---------- ---------- ---------- -------------- ---------- -------------&lt;br /&gt;   CHR_AVG CHR_SQR_AVG     CHR_NO CHR_SEQ_NO    LGR_SUM   LGR_LAST   PHR_LAST&lt;br /&gt;---------- ----------- ---------- ---------- ---------- ---------- ----------&lt;br /&gt;    SPARE1     SPARE2     SPARE3     SPARE4     SPARE5&lt;br /&gt;---------- ---------- ---------- ---------- ----------&lt;br /&gt;     58417          1 118.889076     14192.4521         35          2644&lt;br /&gt;         0           0          1       2575          0        768          0&lt;br /&gt;&lt;br /&gt;Now if we were to gather cache related statistics for this table&lt;br /&gt;&lt;br /&gt;SQL&gt; exec dbms_stats.gather_table_stats('SCOTT','T1',stattype=&gt;'CACHE');&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;A trace on the above API call reveals the following statement&lt;br /&gt;&lt;br /&gt;********************************************************&lt;br /&gt;insert into tab_stats$ (obj#,cachedblk,cachehit,logicalread) values (:1,:2,:3,:4)&lt;br /&gt;&lt;br /&gt;Bind#0&lt;br /&gt;  oacdty=02 mxl=22(22) mxlc=00 mal=00 scl=00 pre=00&lt;br /&gt;  oacflg=08 fl2=0001 frm=00 csi=00 siz=24 off=0&lt;br /&gt;  kxsbbbfp=07723aa8  bln=22  avl=04  flg=05&lt;br /&gt;  value=58417&lt;br /&gt; Bind#1&lt;br /&gt;  oacdty=02 mxl=22(22) mxlc=00 mal=00 scl=00 pre=00&lt;br /&gt;  oacflg=08 fl2=0001 frm=00 csi=00 siz=24 off=0&lt;br /&gt;  kxsbbbfp=07723a84  bln=24  avl=03  flg=05&lt;br /&gt;  value=118&lt;br /&gt; Bind#2&lt;br /&gt;  oacdty=02 mxl=22(00) mxlc=00 mal=00 scl=00 pre=00&lt;br /&gt;  oacflg=08 fl2=0001 frm=00 csi=00 siz=24 off=0&lt;br /&gt;  kxsbbbfp=07723a60  bln=24  avl=00  flg=05&lt;br /&gt; Bind#3&lt;br /&gt;  oacdty=02 mxl=22(00) mxlc=00 mal=00 scl=00 pre=00&lt;br /&gt;  oacflg=08 fl2=0001 frm=00 csi=00 siz=24 off=0&lt;br /&gt;  kxsbbbfp=07723a3c  bln=24  avl=00  flg=05&lt;br /&gt;&lt;br /&gt;********************************************************&lt;br /&gt;&lt;br /&gt;Only the cachedblk column appears to be populated. (I haven’t had a chance to check this value against x$bh)&lt;br /&gt;SQL&gt; select * from tab_stats$ where obj#=58417;&lt;br /&gt;&lt;br /&gt;      OBJ#  CACHEDBLK   CACHEHIT LOGICALREAD     ROWCNT     BLKCNT     EMPCNT&lt;br /&gt;---------- ---------- ---------- ----------- ---------- ---------- ----------&lt;br /&gt;    AVGSPC     CHNCNT     AVGRLN AVGSPC_FLB     FLBCNT ANALYZETI SAMPLESIZE&lt;br /&gt;---------- ---------- ---------- ---------- ---------- --------- ----------&lt;br /&gt;     FLAGS     SPARE1     SPARE2     SPARE3&lt;br /&gt;---------- ---------- ---------- ----------&lt;br /&gt;SPARE4&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;SPARE5&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;SPARE6&lt;br /&gt;---------&lt;br /&gt;     58417        118&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Checking the execution plans of statements with "_optimizer_cache_stats" set to TRUE and FALSE we find the cost of the table is almost half in the former.&lt;br /&gt;&lt;br /&gt;SQL&gt; conn scott/tiger&lt;br /&gt;Connected.&lt;br /&gt;SQL&gt; set autotrace traceonly explain&lt;br /&gt;SQL&gt; alter session set "_optimizer_cache_stats" = true;&lt;br /&gt;&lt;br /&gt;Session altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; select count(*) from t1;&lt;br /&gt;&lt;br /&gt;Execution Plan&lt;br /&gt;----------------------------------------------------------&lt;br /&gt;Plan hash value: 3724264953&lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------&lt;br /&gt;| Id  | Operation          | Name | Rows  | Cost (%CPU)| Time     |&lt;br /&gt;-------------------------------------------------------------------&lt;br /&gt;|   0 | SELECT STATEMENT   |      |     1 |    29   (0)| 00:00:01 |&lt;br /&gt;|   1 |  SORT AGGREGATE    |      |     1 |            |          |&lt;br /&gt;|   2 |   TABLE ACCESS FULL| T1   |  6446 |    29   (0)| 00:00:01 |&lt;br /&gt;-------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; alter session set "_optimizer_cache_stats" = false;&lt;br /&gt;&lt;br /&gt;Session altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; select count(*) from t1;&lt;br /&gt;&lt;br /&gt;Execution Plan&lt;br /&gt;----------------------------------------------------------&lt;br /&gt;Plan hash value: 3724264953&lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------&lt;br /&gt;| Id  | Operation          | Name | Rows  | Cost (%CPU)| Time     |&lt;br /&gt;-------------------------------------------------------------------&lt;br /&gt;|   0 | SELECT STATEMENT   |      |     1 |    56   (0)| 00:00:01 |&lt;br /&gt;|   1 |  SORT AGGREGATE    |      |     1 |            |          |&lt;br /&gt;|   2 |   TABLE ACCESS FULL| T1   |  6446 |    56   (0)| 00:00:01 |&lt;br /&gt;-------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Also for fixed objects the API dbms_stats.gather_fixed_objects_stats populates tab_stats$&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-4502119677979131788?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/4502119677979131788/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=4502119677979131788&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/4502119677979131788'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/4502119677979131788'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2007/01/optimizer-and-cache-related-statistics.html' title='The Optimizer and cache related statistics.'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-7785783254803466897</id><published>2007-01-08T19:26:00.000-08:00</published><updated>2007-01-09T18:05:52.924-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AWR'/><title type='text'>Extracting info from AWR</title><content type='html'>The Automatic Workload Repository stores a wealth of performance related data in an Oracle 10g Database. Historical data can be viewed from the DBA_HIST* views depending on the retention period.&lt;br /&gt;&lt;br /&gt;One can either write a query against any of the dba_hist_* views or use the API&lt;br /&gt;dbms_sqltune.select_workload_repository&lt;br /&gt;&lt;br /&gt;For e.g&lt;br /&gt;To find out all sql stmts which took more than 1 hour to execute between 7:00 am and 10:00 am this morning&lt;br /&gt;&lt;br /&gt;• Find the snapshots for that period&lt;br /&gt;  select snap_id,BEGIN_INTERVAL_TIME from DBA_HIST_SNAPSHOT&lt;br /&gt;where BEGIN_INTERVAL_TIME between to_timestamp('09-JAN-2007 07:00:00','DD-MON-YYYY HH24:MI:SS')and to_timestamp('09-JAN-2007 10:00:00','DD-MON-YYYY HH24:MI:SS')&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;   5064 09-JAN-07 09.00.45.370 AM&lt;br /&gt;   5062 09-JAN-07 07.00.45.786 AM&lt;br /&gt;   5063 09-JAN-07 08.00.47.623 AM&lt;br /&gt;&lt;br /&gt;• Find the sql ids of statements which meet the criteria&lt;br /&gt;&lt;br /&gt;SQL&gt; select sql_id,ELAPSED_TIME_TOTAL,ELAPSED_TIME_DELTA  from&lt;br /&gt;dba_hist_sqlstat where snap_id between 5062 and 5064 and ELAPSED_TIME_TOTAL &gt; 3600000000  &lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;5umujs4y5q05f         252683861535          14085330457&lt;br /&gt;5umujs4y5q05f         266739511867          14055650332&lt;br /&gt;5umujs4y5q05f         280852257550          14112745683&lt;br /&gt;&lt;br /&gt;• Find the sql statement corresponding to this sql_id&lt;br /&gt;&lt;br /&gt;SQL&gt; select sql_text from dba_hist_sqltext where sql_id='5umujs4y5q05f';&lt;br /&gt;&lt;br /&gt;SELECT A.JOURNAL_ID, B.SOURCE, B.ACCOUNTING_PERIOD, A.ACCOUNT, A.DEPTID, A.PROJE&lt;br /&gt;CT_ID, A.CLASS_FLD, A.MONETARY_AMOUNT, A.LINE_DESCR, A.JRNL_LN_REF, TO_CHAR(A.JO&lt;br /&gt;URNAL_DATE,'YYYY-MM-DD'), B.JRNL_HDR_STATUS, TO_CHAR(SYSDATE,'YYYY-MM-DD')    FR&lt;br /&gt;OM PS_JRNL_LN A, PS_JRNL_HEADER B, PS_DEPT_TBL C    WHERE B.BUSINESS_UNIT = A.BU&lt;br /&gt;SINESS_UNIT      AND B.JOURNAL_ID = A.JOURNAL_ID      AND B.JOURNAL_DATE = A.JOU&lt;br /&gt;RNAL_DATE      AND B.UNPOST_SEQ = A.UNPOST_SEQ      AND ( C.EFFDT =          (SE&lt;br /&gt;LECT MAX(C_ED.EFFDT) FROM PS_DEPT_TBL C_ED          WHERE C.SETID = C_ED.SETID&lt;br /&gt;          AND C.DEPTID = C_ED.DEPTID            AND C_ED.EFFDT &lt;= SYSDATE)&lt;br /&gt; AND A.BUSINESS_UNIT = 'UNSYD'       AND A.LEDGER = 'ACTUALS'       AND A.CURREN&lt;br /&gt;CY_CD = 'AUD'       AND C.DEPTID = A.DEPTID       AND B.FISCAL_YEAR = :1       A&lt;br /&gt;ND B.ACCOUNTING_PERIOD BETWEEN :2 AND :3       AND ( A.ACCOUNT = :4       OR A.A&lt;br /&gt;CCOUNT = :5       OR ( A.ACCOUNT = :6       OR A.ACCOUNT = :7       AND A.JOURNA&lt;br /&gt;L_ID IN (SELECT D.JOURNAL_ID    FROM PS_JRNL_LN D    WHERE ( D.ACCOUNT = :8&lt;br /&gt;  OR D.ACCOUNT = :9))))       AND B.JRNL_HDR_STATUS IN ('P','U') )    ORDER BY 3&lt;br /&gt;, 1, 4&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You can obtain the same result with a single statement using the dbms_sqltune.select_workload_repository API as shown below&lt;br /&gt;&lt;br /&gt;SELECT VALUE(P).sql_text FROM table(dbms_sqltune.select_workload_repository(5062,5064,'elapsed_time &gt; 3600000000')) P ;&lt;br /&gt;&lt;br /&gt;SELECT A.JOURNAL_ID, B.SOURCE, B.ACCOUNTING_PERIOD, A.ACCOUNT, A.DEPTID, A.PROJE &lt;br /&gt;CT_ID, A.CLASS_FLD, A.MONETARY_AMOUNT, A.LINE_DESCR, A.JRNL_LN_REF, TO_CHAR(A.JO&lt;br /&gt;URNAL_DATE,'YYYY-MM-DD'), B.JRNL_HDR_STATUS, TO_CHAR(SYSDATE,'YYYY-MM-DD')    FR&lt;br /&gt;OM PS_JRNL_LN A, PS_JRNL_HEADER B, PS_DEPT_TBL C    WHERE B.BUSINESS_UNIT = A.BU&lt;br /&gt;SINESS_UNIT      AND B.JOURNAL_ID = A.JOURNAL_ID      AND B.JOURNAL_DATE = A.JOU&lt;br /&gt;RNAL_DATE      AND B.UNPOST_SEQ = A.UNPOST_SEQ      AND ( C.EFFDT =          (SE&lt;br /&gt;LECT MAX(C_ED.EFFDT) FROM PS_DEPT_TBL C_ED          WHERE C.SETID = C_ED.SETID&lt;br /&gt;          AND C.DEPTID = C_ED.DEPTID            AND C_ED.EFFDT &lt;= SYSDATE)&lt;br /&gt; AND A.BUSINESS_UNIT = 'UNSYD'       AND A.LEDGER = 'ACTUALS'       AND A.CURREN&lt;br /&gt;CY_CD = 'AUD'       AND C.DEPTID = A.DEPTID       AND B.FISCAL_YEAR = :1       A&lt;br /&gt;ND B.ACCOUNTING_PERIOD BETWEEN :2 AND :3       AND ( A.ACCOUNT = :4       OR A.A&lt;br /&gt;CCOUNT = :5       OR ( A.ACCOUNT = :6       OR A.ACCOUNT = :7       AND A.JOURNA&lt;br /&gt;L_ID IN (SELECT D.JOURNAL_ID    FROM PS_JRNL_LN D    WHERE ( D.ACCOUNT = :8&lt;br /&gt;  OR D.ACCOUNT = :9))))       AND B.JRNL_HDR_STATUS IN ('P','U') )    ORDER BY 3&lt;br /&gt;, 1, 4&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;P.S  You have to be licensed to use the Diagnostics Pack to use AWR and licensed to use Oracle Tuning Pack to use SQL Tuning Sets. For more information please refer to the Oracle Licensing documentation at &lt;br /&gt;http://download-west.oracle.com/docs/cd/B19306_01/license.102/b14199/options.htm#sthref80&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-7785783254803466897?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/7785783254803466897/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=7785783254803466897&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/7785783254803466897'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/7785783254803466897'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2007/01/extracting-info-from-awr.html' title='Extracting info from AWR'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-4071548430643647075</id><published>2006-12-13T16:25:00.000-08:00</published><updated>2006-12-13T23:24:04.698-08:00</updated><title type='text'>Merry Xmas and Happy New Year</title><content type='html'>&lt;a href="http://bp2.blogger.com/_3T6egGX_13s/RYD77Zw_mXI/AAAAAAAAAAM/atAQsZEY8_o/s1600-h/christmas-tree.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_3T6egGX_13s/RYD77Zw_mXI/AAAAAAAAAAM/atAQsZEY8_o/s320/christmas-tree.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5008279783583226226" /&gt;&lt;/a&gt;&lt;br /&gt;I am off to &lt;a href="http://en.wikipedia.org/wiki/Goa"&gt;Goa&lt;/a&gt; for my annual Xmas vacation.&lt;br /&gt;&lt;br /&gt;Here's wishing u all a Merry Christmas and a Happy New Year&lt;br /&gt;&lt;br /&gt;See you all in the New Year&lt;br /&gt;&lt;br /&gt;Regards&lt;br /&gt;-Fairlie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-4071548430643647075?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/4071548430643647075/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=4071548430643647075&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/4071548430643647075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/4071548430643647075'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2006/12/merry-xmas-and-happy-new-year.html' title='Merry Xmas and Happy New Year'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_3T6egGX_13s/RYD77Zw_mXI/AAAAAAAAAAM/atAQsZEY8_o/s72-c/christmas-tree.jpg' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-3910398494129365170</id><published>2006-12-11T18:32:00.000-08:00</published><updated>2006-12-13T16:09:08.306-08:00</updated><title type='text'>Analysing systemstate dumps</title><content type='html'>In my last article I discussed how to dump the systemstate using various methods. These files are quite huge and are sometimes difficult to decipher. You can parse the file using an awk script in &lt;br /&gt;&lt;a href="https://metalink.oracle.com/metalink/plsql/f?p=130:14:522216038878656480::::p14_database_id,p14_docid,p14_show_header,p14_show_help,p14_black_frame,p14_font:NOT,352363.1,1,1,1,helvetica"&gt;LTOM&lt;/a&gt;&lt;br /&gt;provided by Oracle’s center of expertise. LTOM is a lite onboard monitor which is a diagnostic tool.&lt;br /&gt;&lt;br /&gt;Once you download and install LTOM you can find a script called ass109.awk in tom_base/tom/src which parses the systemstate into a more readable format &lt;br /&gt;&lt;br /&gt;buffalo&gt;pwd&lt;br /&gt;/usr/opt/oracle/bin/tom_base/tom/src&lt;br /&gt;buffalo&gt;ls -al ass*&lt;br /&gt;-rwxr-x---  1 oracle dba 34549 Nov 25  2003 ass109.awk&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;We will attempt to analyse a systemstate dump generated by the following error&lt;br /&gt;&lt;br /&gt;&gt;&gt;&gt; WAITED TOO LONG FOR A ROW CACHE ENQUEUE LOCK! pid=42&lt;br /&gt;System State dumped to trace file /u00/app/oracle/admin/F8900DEV/udump/f8900dev1_ora_12057.trc&lt;br /&gt;Mon Dec 11 09:58:05 2006&lt;br /&gt;&lt;br /&gt;buffalo &gt;awk -f ass109.awk f8900dev1_ora_12057.trc &gt; rowcache.out&lt;br /&gt;&lt;br /&gt;If you look at rowcache.out&lt;br /&gt;42: last wait for 'ksdxexeotherwait'   [Rcache object=0x483a70e4,]&lt;br /&gt;The holder of  0x483a70e4 is &lt;br /&gt;   Rcache object=0x483a70e4,    48: 48: is waiting for Latch 5213eeb4&lt;br /&gt;&lt;br /&gt;If you look at rowcache.out in conjunction with the raw trace file it can be concluded that process 42 has requested row cache lock on dc_profiles which is held by process 48.&lt;br /&gt;Process 48 is in turn waiting on the “Child object queue header” latch which is held by process 44 &lt;br /&gt;Process 44 which is a DataPump Worker  is in turn waiting on 'SGA: allocation forcing component growth' which is seen when using ASMM (sga_target)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-3910398494129365170?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/3910398494129365170/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=3910398494129365170&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/3910398494129365170'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/3910398494129365170'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2006/12/analysing-systemstate-dumps-using-ltom.html' title='Analysing systemstate dumps'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-3788500909250457610</id><published>2006-12-10T22:08:00.001-08:00</published><updated>2007-06-02T16:22:28.333-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='systemstate dump'/><title type='text'>Systemstate dumps</title><content type='html'>A system state dump is trace file containing a snapshot of all processes running in a database. It is used to diagnose hang issues and has more information compared to a hanganalyze dump.There are various ways to dump the systemstate.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If you can connect to the database you can dump it using&lt;br /&gt;&lt;br /&gt;SQL&gt; oradebug setmypid&lt;br /&gt;Statement processed.&lt;br /&gt;SQL&gt; oradebug unlimit   this is important so that the file is not truncated.&lt;br /&gt;Statement processed.&lt;br /&gt;SQL&gt; oradebug dump systemstate 10&lt;br /&gt;Statement processed.&lt;br /&gt;SQL&gt; oradebug tracefile_name&lt;br /&gt;c:\oracle\product\10.2.0\admin\usyd\udump\usyd_ora_17452.trc&lt;br /&gt;&lt;br /&gt;A complete file should have the following string at the end&lt;br /&gt;END OF SYSTEM STATE&lt;br /&gt;&lt;br /&gt;If you want only the short stack of each process in the instance&lt;br /&gt;you need to use&lt;br /&gt;&lt;br /&gt;SQL&gt; oradebug dump systemstate 256&lt;br /&gt;Statement processed.&lt;br /&gt;&lt;br /&gt;Alternatively you can dump the system state using&lt;br /&gt;&lt;br /&gt;SQL&gt; ALTER SESSION SET EVENTS 'IMMEDIATE TRACE NAME SYSTEMSTATE LEVEL 10'; &lt;br /&gt;&lt;br /&gt;Session altered.&lt;br /&gt;&lt;br /&gt;If you cannot connect to the database instance you can use a session less connection in 10g using&lt;br /&gt;sqlplus -prelim / as sysdba&lt;br /&gt;oradebug setmypid&lt;br /&gt;oradebug unlimit;&lt;br /&gt;oradebug dump systemstate 10&lt;br /&gt;&lt;br /&gt;Prior to 10g you can use a unix debugger like gdb, adb or dbx to attach to a shadow process and dump the system state using the function ksudss which is the subroutine in the Oracle source code which does the same.&lt;br /&gt;&lt;br /&gt;eiger-&gt; ps -ef | grep HRDEV | grep j00 | grep –v grep&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;oracle   14022     1  0 Dec10 ?        00:00:21 ora_j000_HRDEV&lt;br /&gt;&lt;br /&gt;eiger-&gt; gdb&lt;br /&gt;GNU gdb Red Hat Linux (6.3.0.0-1.132.EL4rh)&lt;br /&gt;Copyright 2004 Free Software Foundation, Inc.&lt;br /&gt;GDB is free software, covered by the GNU General Public License, and you are&lt;br /&gt;welcome to change it and/or distribute copies of it under certain conditions.&lt;br /&gt;Type "show copying" to see the conditions.&lt;br /&gt;There is absolutely no warranty for GDB.Type "show warranty" for details.&lt;br /&gt;This GDB was configured as "x86_64-redhat-linux-gnu".&lt;br /&gt;(gdb) attach&lt;br /&gt;Argument required (process-id to attach).&lt;br /&gt;(gdb) attach 14022&lt;br /&gt;Attaching to process 14022&lt;br /&gt;Reading symbols &lt;br /&gt;…… (output deleted for readability purposes)&lt;br /&gt;0x000000324f7c7c0c in semtimedop () from /lib64/tls/libc.so.6&lt;br /&gt;(gdb) print ksudss(10)&lt;br /&gt;[Switching to Thread 182922098368 (LWP 14022)]&lt;br /&gt;$1 = -1073747016&lt;br /&gt;(gdb) detach&lt;br /&gt;Detaching from program: /usr/opt/oracle/u00/app/oracle/product/10.2.0/bin/oracle, process 14022&lt;br /&gt;(gdb) quit&lt;br /&gt;&lt;br /&gt;Since in the above case we have attached to a job process the trace file containing the dump will be in bdump else the trace file would be in udump.&lt;br /&gt;&lt;br /&gt;For RAC databases if you need to dump the systemstate on all instances&lt;br /&gt;&lt;br /&gt;SQL&gt;  oradebug setmypid&lt;br /&gt;Statement processed.&lt;br /&gt;SQL&gt; oradebug unlimit&lt;br /&gt;Statement processed.&lt;br /&gt;SQL&gt; oradebug -g all dump systemstate 266&lt;br /&gt;Statement processed.&lt;br /&gt;SQL&gt; oradebug tracefile_name&lt;br /&gt;/u00/app/oracle/admin/F8902UAT/udump/f8902uat1_ora_2513.trc&lt;br /&gt;&lt;br /&gt;The trace file will have only the following contents&lt;br /&gt;&lt;br /&gt;PORADEBUG REMOTE COMMAND BEGIN SERIAL:0 MYPID:2513&lt;br /&gt;PORADEBUG REMOTE COMMAND END SERIAL:0 MYPID:2513 [SUCCESS]&lt;br /&gt;&lt;br /&gt;The systemstate dump will be written to by the DIAG process on each node.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Please use these commands with caution. On busy systems with a large number of processes these commands can take quite a while. Also a systemstate dump need not always portray the correct information of a system especially when the time to &lt;br /&gt;dump all the processes is long.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-3788500909250457610?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/3788500909250457610/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=3788500909250457610&amp;isPopup=true' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/3788500909250457610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/3788500909250457610'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2006/12/systemstate-dumps.html' title='Systemstate dumps'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-295255100656834024</id><published>2006-12-03T21:25:00.000-08:00</published><updated>2006-12-06T18:19:13.510-08:00</updated><title type='text'>Adding a voting disk online</title><content type='html'>In 10.2 RAC it is now possible to add a voting disk online in addition to specifying more than one voting disk during the ClusterWare install.In 10G R1 there was no software level mirroring of the voting disk.&lt;br /&gt;&lt;br /&gt;I tried this out for the first time today and things didn't go as I expected.&lt;br /&gt;&lt;br /&gt;[root@dbrac1 ~]# /home/oracle/oracle/product/10.2.0/crs/bin/crsctl add css votedisk /dev/raw/raw4&lt;br /&gt;Cluster is not in a ready state for online disk addition&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You have to use the force option in the above command due to &lt;br /&gt;Bug &lt;a href="https://metalink.oracle.com/metalink/plsql/f?p=130:15:12268830655410534615::::p15_database_id,p15_docid,p15_show_header,p15_show_help,p15_black_frame,p15_font:BUG,4898020,1,1,1,helvetica"&gt;4898020&lt;/a&gt; ADDING VOTING DISK ONLINE CRASH THE CRS &lt;br /&gt;which is fixed in the 10.2.0.4 patchset. This is again another case where clearly documented functionality in 10.2 does not work.&lt;br /&gt;&lt;br /&gt;Before using the force option make sure the CRS stack is not up on any of the nodes.&lt;br /&gt;&lt;br /&gt;[root@dbrac1 init.d]#  ps -ef | grep d.bin | grep -v grep&lt;br /&gt;should retrun no rows.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;[root@dbrac1 init.d]# /home/oracle/oracle/product/10.2.0/crs/bin/crsctl add css votedisk /dev/raw/raw4 -force&lt;br /&gt;Now formatting voting disk: /dev/raw/raw4&lt;br /&gt;successful addition of votedisk /dev/raw/raw4.&lt;br /&gt;[root@dbrac1 init.d]#&lt;br /&gt;&lt;br /&gt;Check that the newly added disk can be seen from both nodes.&lt;br /&gt;&lt;br /&gt;[root@dbrac1 init.d]# /home/oracle/oracle/product/10.2.0/crs/bin/crsctl query css votedisk&lt;br /&gt; 0.     0    /dev/raw/raw2&lt;br /&gt; 1.     0    /dev/raw/raw4&lt;br /&gt;&lt;br /&gt;located 2 votedisk(s).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;[root@dbrac2 init.d]# /home/oracle/oracle/product/10.2.0/crs/bin/crsctl query css votedisk&lt;br /&gt; 0.     0    /dev/raw/raw2&lt;br /&gt; 1.     0    /dev/raw/raw4&lt;br /&gt;&lt;br /&gt;located 2 votedisk(s).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The same error is encountered should you wish to delete the newly added disk&lt;br /&gt;&lt;br /&gt;[root@dbrac1 bin]# ./crsctl delete css votedisk /dev/raw/raw4&lt;br /&gt;Cluster is not in a ready state for online disk removal&lt;br /&gt;[root@dbrac1 bin]#  ./crsctl delete css votedisk /dev/raw/raw4 -force&lt;br /&gt;successful deletion of votedisk /dev/raw/raw4.&lt;br /&gt;&lt;br /&gt;Again please note that the force option should be used only after the CRS stack&lt;br /&gt;is shutdown on all nodes. Failure to do so could result in OCR corruption.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-295255100656834024?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/295255100656834024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=295255100656834024&amp;isPopup=true' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/295255100656834024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/295255100656834024'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2006/12/adding-voting-disk-online.html' title='Adding a voting disk online'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-5144886678375464717</id><published>2006-11-29T14:57:00.000-08:00</published><updated>2006-11-30T14:48:29.820-08:00</updated><title type='text'>Size of ASM files</title><content type='html'>Whilst testing compression of archivelogs on ASM I was looking for ways to find the size of an archivelog stored on ASM &lt;br /&gt;&lt;br /&gt;You can &lt;br /&gt;&lt;br /&gt;• Use the bytes column in v$asm_file.&lt;br /&gt;• Use the asmcmd line utility and use the du command there in&lt;br /&gt;• Use an API called dbms_diskgroup as shown below&lt;br /&gt;&lt;br /&gt;SQL&gt;  select thread#,blocks,compressed from v$archived_log where thread#=2 and SEQUENCE#=19&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;   THREAD#  SEQUENCE#     BLOCKS COM&lt;br /&gt;---------- ---------- ---------- ---&lt;br /&gt;         2         19       &lt;strong&gt;3794&lt;/strong&gt; YES&lt;br /&gt;&lt;br /&gt;[oracle@dbrac2 ~]$ asmcmd&lt;br /&gt;ASMCMD&gt; cd ARCHIVELOG&lt;br /&gt;ASMCMD&gt; ls&lt;br /&gt;2006_11_28/&lt;br /&gt;ASMCMD&gt; cd 2006_11_28&lt;br /&gt;ASMCMD&gt; ls&lt;br /&gt;thread_1_seq_10.289.607731765&lt;br /&gt;thread_1_seq_11.293.607732151&lt;br /&gt;thread_1_seq_12.296.607732301&lt;br /&gt;thread_1_seq_8.286.607731393&lt;br /&gt;thread_1_seq_9.287.607731413&lt;br /&gt;thread_2_seq_13.288.607731413&lt;br /&gt;thread_2_seq_14.290.607731771&lt;br /&gt;thread_2_seq_15.291.607732073&lt;br /&gt;thread_2_seq_16.292.607732151&lt;br /&gt;thread_2_seq_17.294.607732277&lt;br /&gt;thread_2_seq_18.295.607732301&lt;br /&gt;thread_2_seq_19.297.607732423&lt;br /&gt;&lt;br /&gt;set serveroutput on &lt;br /&gt;declare&lt;br /&gt;vfilename varchar2(4000);&lt;br /&gt;vfilesize number;&lt;br /&gt;vlbks number;&lt;br /&gt;vfiletype number;&lt;br /&gt;begin&lt;br /&gt;dbms_output.enable(5000);&lt;br /&gt;vfilename := '&amp;file_name';&lt;br /&gt;dbms_diskgroup.getfileattr(vfilename,vfiletype,vfilesize,vlbks);&lt;br /&gt;dbms_output.put_line('File: '||vfilename); dbms_output.new_line;&lt;br /&gt;dbms_output.put_line('Size (Logical Block Size): '||vfilesize); dbms_output.new_line;&lt;br /&gt;dbms_output.put_line('Logical Block Size: '||vlbks); dbms_output.new_line;&lt;br /&gt;dbms_output.put_line('File type: '||vfiletype); dbms_output.new_line;&lt;br /&gt;end;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Enter value for file_name: +ORADATA1/TEST/ARCHIVELOG/2006_11_28/thread_2_seq_19.297.607732423&lt;br /&gt;old   9: vfilename := '&amp;file_name';&lt;br /&gt;new   9: vfilename := '+ORADATA1/TEST/ARCHIVELOG/2006_11_28/thread_2_seq_19.297.607732423';&lt;br /&gt;File: +ORADATA1/TEST/ARCHIVELOG/2006_11_28/thread_2_seq_19.297.607732423&lt;br /&gt;Size (Logical Block Size): &lt;strong&gt;3794&lt;/strong&gt;&lt;br /&gt;Logical Block Size: 512&lt;br /&gt;File type: 4&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-5144886678375464717?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/5144886678375464717/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=5144886678375464717&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/5144886678375464717'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/5144886678375464717'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2006/11/size-of-asm-files.html' title='Size of ASM files'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-2081919495402560367</id><published>2006-11-28T14:35:00.000-08:00</published><updated>2006-11-28T14:37:49.310-08:00</updated><title type='text'>Recovery using compressed archivelogs</title><content type='html'>A couple of days ago I mentioned about an undocumented feature where by it is&lt;br /&gt;possible to generate &lt;a href="http://el-caro.blogspot.com/2006/11/archivelog-compression.html"&gt;compressed archivelogs&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I did manage to test a couple of scenarios where I did manage to recover my database&lt;br /&gt;with a mixture of compressed and non compressed archivelogs.&lt;br /&gt;&lt;br /&gt;I guess this begs the question as to why this feature is not documented.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-2081919495402560367?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/2081919495402560367/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=2081919495402560367&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/2081919495402560367'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/2081919495402560367'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2006/11/recovery-using-compressed-archivelogs.html' title='Recovery using compressed archivelogs'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-2193472851478509658</id><published>2006-11-26T19:44:00.001-08:00</published><updated>2006-11-28T01:02:04.817-08:00</updated><title type='text'>Archivelog compression?</title><content type='html'>Apparently there is a command which could generate compressed archivelogs which goes something like this.&lt;br /&gt;&lt;br /&gt;SQL&gt; ALTER DATABASE ARCHIVELOG COMPRESS enable;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;I have skimmed through the documentation but can't seem to find a reference to the same but the view v$archived_log seems to have a column called compressed which from the docs is&lt;br /&gt;&lt;br /&gt;COMPRESSED VARCHAR2(3) This column is reserved for internal use only &lt;br /&gt;&lt;br /&gt;I am assuming this is related to the underscore parameter _log_archive_compress_enable the description of which is below.&lt;br /&gt;But changing the value of this parameter has not prevented the command from&lt;br /&gt;working.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;SQL&gt; REM Formatting columns&lt;br /&gt;SQL&gt; set lines 9999&lt;br /&gt;SQL&gt; col indx format 9999&lt;br /&gt;SQL&gt; col inst_id heading "INST" format 9999&lt;br /&gt;SQL&gt; col ksppinm heading "NAME" format a30&lt;br /&gt;SQL&gt; col ksppdesc heading "DESC" format a60&lt;br /&gt;SQL&gt; col ksppstvl heading "CURR VAL" format a15&lt;br /&gt;SQL&gt; col ksppstdf heading "DEFAULT VAL" format a15      &lt;br /&gt;&lt;br /&gt;SQL&gt; select v.indx,v.inst_id,ksppinm,ksppstvl,ksppstdf,ksppdesc from x$ksppi i ,&lt;br /&gt;x$ksppcv v where i.indx=v.indx and ksppinm like '_log_archive_compress_enable';&lt;br /&gt;&lt;br /&gt; INDX  INST NAME                           CURR VAL        DEFAULT VAL     DESC&lt;br /&gt;----- ----- ------------------------------ --------------- --------------- -------------------------&lt;br /&gt;  473     1 _log_archive_compress_enable   FALSE           TRUE            Bypass database rules for enabling archiv&lt;br /&gt;&lt;br /&gt;1 row selected.&lt;/em&gt;&lt;br /&gt;So by default archivelogs are not compressed.&lt;br /&gt;SQL&gt; select distinct compressed from  v$archived_log;&lt;br /&gt;&lt;br /&gt;COM&lt;br /&gt;---&lt;br /&gt;NO&lt;br /&gt;&lt;br /&gt;So I used this command, generated a few archivelogs and got the following message in one of the trace files.&lt;br /&gt;&lt;br /&gt;Archivelog compression complete.&lt;br /&gt;  Input: 3139072 bytes Output: 810830 bytes&lt;br /&gt;  Compression Performance: 74.17 percent or 2.07 bits per byte&lt;br /&gt;&lt;br /&gt;Lets verify the same.&lt;br /&gt;SQL&gt; alter database archivelog compress disable;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system switch logfile;&lt;br /&gt;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; create table scott.obj$ as select * from dba_objects;&lt;br /&gt;&lt;br /&gt;Table created.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system switch logfile;&lt;br /&gt;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;       &lt;br /&gt;SQL&gt; alter database archivelog compress enable;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt;  create table frego.obj$ as select * from dba_objects;&lt;br /&gt;&lt;br /&gt;Table created.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system switch logfile;&lt;br /&gt;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;SQL&gt;  select sequence#,blocks,compressed from v$archived_log where sequence#&gt;225;&lt;br /&gt;&lt;br /&gt; SEQUENCE#     BLOCKS COM&lt;br /&gt;---------- ---------- ---&lt;br /&gt;       226       3820 NO&lt;br /&gt;       227          1 NO&lt;br /&gt;       228      11579 NO&lt;br /&gt;       229         83 YES&lt;br /&gt;       230          8 YES&lt;br /&gt;       231       1911 YES&lt;br /&gt;&lt;br /&gt;6 rows selected.&lt;br /&gt;&lt;br /&gt;If you compare the 2 logs of interest (228 and 231 since there were other commands in the interim) you find a compression performance similar to the one indicated above. &lt;br /&gt;&lt;br /&gt;It would be wise to check if I can recover using compressed archivelogs though.&lt;br /&gt;&lt;br /&gt;P.S This is an undocumented feature (AFAIK) and hence I do not advise anyone to use the same in a Production environment.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-2193472851478509658?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/2193472851478509658/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=2193472851478509658&amp;isPopup=true' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/2193472851478509658'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/2193472851478509658'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2006/11/archivelog-compression.html' title='Archivelog compression?'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-1721698601756062881</id><published>2006-11-26T18:46:00.000-08:00</published><updated>2006-11-26T18:52:52.409-08:00</updated><title type='text'>Block Change Tracking</title><content type='html'>If anybody is using the new 10G backup feature of incremental backups using a block change tracking file or thinking of doing so I sincerely recommend reading Alex Gorbachev's &lt;a href="http://www.pythian.com/documents/UKOUG06-10gBCT.ppt"&gt;presentation&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-1721698601756062881?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/1721698601756062881/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=1721698601756062881&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/1721698601756062881'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/1721698601756062881'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2006/11/block-change-tracking.html' title='Block Change Tracking'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-5582582772873015719</id><published>2006-11-21T15:35:00.000-08:00</published><updated>2006-11-29T03:53:21.231-08:00</updated><title type='text'>Converting database at target</title><content type='html'>There was a valid response for yesterday's &lt;a href="http://el-caro.blogspot.com/2006/11/performing-cross-platform-database.html"&gt;post&lt;/a&gt; by &lt;a href="http://www.blogger.com/profile/16089943"&gt;The Human Fly&lt;/a&gt; where he suggested that this method was not feasible for large databases because of the need for a staging area to hold the converted files.&lt;br /&gt;Well according to Oracle disk space is cheap :-) and I know a lot of bugs that have been closed on this premise (where the workaround has meant additional disk space)&lt;br /&gt;&lt;br /&gt;But seriously you can get around this&lt;br /&gt;&lt;br /&gt;• You can take a backup of the source database to tape and then overwrite the datafile location (assuming you don’t need the source database anymore) &lt;br /&gt;&lt;br /&gt;CONVERT DATABASE NEW DATABASE 'USYD'&lt;br /&gt;transport script 'C:\temp\newtransportscript'&lt;br /&gt;to platform 'Linux 64-bit for AMD'&lt;br /&gt;db_file_name_convert 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\USYD\' 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\USYD\'&lt;br /&gt;;&lt;br /&gt;&lt;br /&gt;It is also possible to convert the database at the target to free up CPU on the source. You need to run the following on the source database &lt;br /&gt;&lt;br /&gt;CONVERT DATABASE ON TARGET PLATFORM&lt;br /&gt;CONVERT SCRIPT 'C:\temp\convertscript.rman'&lt;br /&gt;        TRANSPORT SCRIPT 'C:\temp\transport_at_target.sql'&lt;br /&gt;        new database 'USYD'&lt;br /&gt;        FORMAT 'C:\temp\target\%U';&lt;br /&gt;&lt;br /&gt;This will create 2 scripts&lt;br /&gt;&lt;br /&gt;• convertscript.rman which will have convert commands for each datafile of the database to be converted.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;• transport_at_target.sql contains the syntax to create the controlfile and start the database at the target&lt;br /&gt;&lt;br /&gt;LINUX64&gt;&gt;startup nomount pfile='/u01/oradata/USYD/initUSYD.ora'&lt;br /&gt;ORACLE instance started.&lt;br /&gt;&lt;br /&gt;Total System Global Area  171966464 bytes&lt;br /&gt;Fixed Size                  2069712 bytes&lt;br /&gt;Variable Size             113249072 bytes&lt;br /&gt;Database Buffers           50331648 bytes&lt;br /&gt;Redo Buffers                6316032 bytes&lt;br /&gt;&lt;br /&gt;LINUX64&gt;&gt;CREATE CONTROLFILE REUSE SET DATABASE "USYD" RESETLOGS ARCHIVELOG&lt;br /&gt;  2  MAXLOGFILES 16&lt;br /&gt;  3  MAXLOGMEMBERS 3&lt;br /&gt;  4  MAXDATAFILES 100&lt;br /&gt;  5  MAXINSTANCES 8&lt;br /&gt;  6  MAXLOGHISTORY 292&lt;br /&gt;  7  LOGFILE&lt;br /&gt;  8  GROUP 1&lt;br /&gt;  9  '/u01/oradata/USYD/ARCH_D-USYD_ID-768471617_S-212_T-1_A-600609988_00I2I4PR' SIZE 50M,&lt;br /&gt;GROUP 2&lt;br /&gt; 10   11  '/u01/oradata/USYD/ARCH_D-USYD_ID-768471617_S-213_T-1_A-600609988_00I2I4PR' SIZE 50M,&lt;br /&gt;GROUP 3&lt;br /&gt; 12   13  '/u01/oradata/USYD/ARCH_D-USYD_ID-768471617_S-211_T-1_A-600609988_00I2I4PR' SIZE 50M&lt;br /&gt; 14  DATAFILE&lt;br /&gt; 15   '/u01/oradata/USYD/SYSTEM01.DBF',&lt;br /&gt; 16   '/u01/oradata/USYD/UNDOTBS01.DBF',&lt;br /&gt; 17   '/u01/oradata/USYD/SYSAUX01.DBF',&lt;br /&gt; 18   '/u01/oradata/USYD/USERS01.DBF'&lt;br /&gt; 19  CHARACTER SET WE8MSWIN1252;&lt;br /&gt;&lt;br /&gt;Control file created.&lt;br /&gt;&lt;br /&gt;Now convert the files using the script convertscript.rman &lt;br /&gt;eiger-&gt; rman target /&lt;br /&gt;&lt;br /&gt;Recovery Manager: Release 10.2.0.2.0 - Production on Wed Nov 22 14:32:33 2006&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2005, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;connected to target database: USYD (DBID=768471617, not open)&lt;br /&gt;&lt;br /&gt;RUN {&lt;br /&gt;&lt;br /&gt;  CONVERT DATAFILE '/u01/oradata/USYD/SYSTEM01.DBF' &lt;br /&gt;  FROM PLATFORM 'Microsoft Windows IA (32-bit)' &lt;br /&gt;  FORMAT '/u01/oradata/USYD/NEW/SYSTEM01.DBF';&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  CONVERT DATAFILE '/u01/oradata/USYD/SYSAUX01.DBF' &lt;br /&gt;  FROM PLATFORM 'Microsoft Windows IA (32-bit)' &lt;br /&gt;  FORMAT '/u01/oradata/USYD/NEW/SYSAUX01.DBF';&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  CONVERT DATAFILE '/u01/oradata/USYD/UNDOTBS01.DBF' &lt;br /&gt;  FROM PLATFORM 'Microsoft Windows IA (32-bit)' &lt;br /&gt;  FORMAT '/u01/oradata/USYD/NEW/UNDOTBS01.DBF';&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  CONVERT DATAFILE '/u01/oradata/USYD/USERS01.DBF' &lt;br /&gt;  FROM PLATFORM 'Microsoft Windows IA (32-bit)' &lt;br /&gt;  FORMAT '/u01/oradata/USYD/NEW/USERS01.DBF';&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;Starting backup at 22-NOV-06&lt;br /&gt;using target database control file instead of recovery catalog&lt;br /&gt;allocated channel: ORA_DISK_1&lt;br /&gt;using channel ORA_DISK_1&lt;br /&gt;channel ORA_DISK_1: starting datafile conversion&lt;br /&gt;input filename=/u01/oradata/USYD/SYSTEM01.DBF&lt;br /&gt;converted datafile=/u01/oradata/USYD/NEW/SYSTEM01.DBF&lt;br /&gt;channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:46&lt;br /&gt;Finished backup at 22-NOV-06&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Starting backup at 22-NOV-06&lt;br /&gt;channel ORA_DISK_1: sid=39 devtype=DISK&lt;br /&gt;channel ORA_DISK_1: starting datafile conversion&lt;br /&gt;input filename=/u01/oradata/USYD/SYSAUX01.DBF&lt;br /&gt;converted datafile=/u01/oradata/USYD/NEW/SYSAUX01.DBF&lt;br /&gt;channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:02:17&lt;br /&gt;Finished backup at 22-NOV-06&lt;br /&gt;&lt;br /&gt;Starting backup at 22-NOV-06&lt;br /&gt;using channel ORA_DISK_1&lt;br /&gt;channel ORA_DISK_1: starting datafile conversion&lt;br /&gt;input filename=/u01/oradata/USYD/UNDOTBS01.DBF&lt;br /&gt;converted datafile=/u01/oradata/USYD/NEW/UNDOTBS01.DBF&lt;br /&gt;channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:02:48&lt;br /&gt;Finished backup at 22-NOV-06&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Starting backup at 22-NOV-06&lt;br /&gt;using channel ORA_DISK_1&lt;br /&gt;channel ORA_DISK_1: starting datafile conversion&lt;br /&gt;input filename=/u01/oradata/USYD/USERS01.DBF&lt;br /&gt;converted datafile=/u01/oradata/USYD/NEW/USERS01.DBF&lt;br /&gt;channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:07&lt;br /&gt;Finished backup at 22-NOV-06&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Unfortunately it appears that the file cannot be overwritten and hence&lt;br /&gt;a staging area is required because when I tried to do that &lt;br /&gt;&lt;br /&gt;RMAN&gt; CONVERT DATAFILE '/u01/oradata/USYD/SYSTEM01.DBF'&lt;br /&gt;  FROM PLATFORM 'Microsoft Windows IA (32-bit)'&lt;br /&gt;  FORMAT '/u01/oradata/USYD/SYSTEM01.DBF';&lt;br /&gt;&lt;br /&gt;&lt;em&gt;Starting backup at 22-NOV-06&lt;br /&gt;using target database control file instead of recovery catalog&lt;br /&gt;allocated channel: ORA_DISK_1&lt;br /&gt;channel ORA_DISK_1: sid=36 devtype=DISK&lt;br /&gt;channel ORA_DISK_1: starting datafile conversion&lt;br /&gt;input filename=/u01/oradata/USYD/SYSTEM01.DBF&lt;br /&gt;RMAN-00571: ===========================================================&lt;br /&gt;RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============&lt;br /&gt;RMAN-00571: ===========================================================&lt;br /&gt;RMAN-03009: failure of backup command on ORA_DISK_1 channel at 11/22/2006 14:35:00&lt;br /&gt;ORA-19635: input and output filenames are identical: /u01/oradata/USYD/SYSTEM01.DBF&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;You then need to move the files from the staging area and resetlogs to start&lt;br /&gt;the database&lt;br /&gt;&lt;br /&gt;SQL&gt; shutdown immediate&lt;br /&gt;ORA-01109: database not open&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Database dismounted.&lt;br /&gt;ORACLE instance shut down.&lt;br /&gt;&lt;br /&gt;eiger-&gt; cd USYD/N*&lt;br /&gt;eiger-&gt; ls&lt;br /&gt;SYSAUX01.DBF  SYSTEM01.DBF  UNDOTBS01.DBF  USERS01.DBF&lt;br /&gt;eiger-&gt; pwd&lt;br /&gt;/u01/oradata/USYD/NEW&lt;br /&gt;eiger-&gt; mv * ../&lt;br /&gt;&lt;br /&gt;SQL&gt;  startup mount pfile='/u01/oradata/USYD/initUSYD.ora'&lt;br /&gt;ORACLE instance started.&lt;br /&gt;&lt;br /&gt;Total System Global Area  171966464 bytes&lt;br /&gt;Fixed Size                  2069712 bytes&lt;br /&gt;Variable Size             113249072 bytes&lt;br /&gt;Database Buffers           50331648 bytes&lt;br /&gt;Redo Buffers                6316032 bytes&lt;br /&gt;Database mounted.&lt;br /&gt;&lt;br /&gt;SQL&gt; recover database using BACKUP CONTROLFILE until cancel;&lt;br /&gt;ORA-00279: change 6936865 generated at 11/22/2006 10:13:25 needed for thread 1&lt;br /&gt;ORA-00289: suggestion :&lt;br /&gt;/u00/app/oracle/product/10.2.0/dbs/arch1_219_600609988.dbf&lt;br /&gt;ORA-00280: change 6936865 for thread 1 is in sequence #219&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Specify log: {&lt;RET&gt;=suggested | filename | AUTO | CANCEL}&lt;br /&gt;cancel&lt;br /&gt;Media recovery cancelled.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database open resetlogs;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-5582582772873015719?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/5582582772873015719/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=5582582772873015719&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/5582582772873015719'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/5582582772873015719'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2006/11/converting-database-at-target.html' title='Converting database at target'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-2910945956421957021</id><published>2006-11-20T00:00:00.000-08:00</published><updated>2006-11-21T19:30:30.134-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RMAN convert database'/><title type='text'>Performing Cross-Platform Database Transport</title><content type='html'>Starting with 10g R2 it is now possible to transport an entire database (not just a few tablespaces) using the convert database RMAN command.&lt;br /&gt;&lt;br /&gt;In the below scenario we are converting from a Windows 32 bit system to a Linux x86-64 bit system.&lt;br /&gt;&lt;br /&gt;First we check if both platforms (source and destination) have the same endianness&lt;br /&gt;using the dbms_tdb package.&lt;br /&gt;&lt;br /&gt;The database needs to be open in read only mode for the following procedure to&lt;br /&gt;work.&lt;br /&gt;&lt;br /&gt;WINDOWS&gt;&gt;set serveroutput on&lt;br /&gt;WINDOWS&gt;&gt;declare&lt;br /&gt;  2         db_ready boolean;&lt;br /&gt;  3       begin&lt;br /&gt;  4         db_ready := dbms_tdb.check_db('Linux 64-bit for&lt;br /&gt;AMD',dbms_tdb.skip_readonly);&lt;br /&gt;  5       end;&lt;br /&gt;  6  /&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;If they did not have the same endianness we would have got a message like the one shown below&lt;br /&gt;&lt;br /&gt;WINDOWS&gt;&gt;declare&lt;br /&gt;  2         db_ready boolean;&lt;br /&gt;  3       begin&lt;br /&gt;  4         db_ready := dbms_tdb.check_db('Solaris[tm] OE &lt;br /&gt;(64-bit)',dbms_tdb.skip_readonly);&lt;br /&gt;  5       end;&lt;br /&gt;  6  /&lt;br /&gt;&lt;br /&gt;The specified target platform name 'Solaris[tm] OE (64-bit)' is invalid &lt;br /&gt;or the target platform is not transportable.&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;Next we need to identify any external objects which will not be transported.&lt;br /&gt;These include external tables,directories or BFILES.&lt;br /&gt;&lt;br /&gt;WINDOWS&gt;&gt;declare&lt;br /&gt;  2       external boolean;&lt;br /&gt;  3    begin&lt;br /&gt;  4      /* value of external is ignored, but with SERVEROUTPUT set to &lt;br /&gt;ON&lt;br /&gt;  5       * dbms_tdb.check_external displays report of external objects&lt;br /&gt;  6       * on console */&lt;br /&gt;  7      external := dbms_tdb.check_external;&lt;br /&gt;  8    end;&lt;br /&gt;  9  &lt;br /&gt; 10  /&lt;br /&gt;&lt;br /&gt;The following directories exist in the database:&lt;br /&gt;SYS.WORK_DIR, SYS.ADMIN_DIR, SYS.DATA_PUMP_DIR&lt;br /&gt;&lt;br /&gt;RMAN&gt; CONVERT DATABASE NEW DATABASE 'USYD'&lt;br /&gt;2&gt; transport script 'C:\temp\transportscript'&lt;br /&gt;3&gt; to platform 'Linux 64-bit for AMD'&lt;br /&gt;4&gt; db_file_name_convert 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\USYD\' &lt;br /&gt;'C:\temp\USYD\'&lt;br /&gt;5&gt; ;&lt;br /&gt;&lt;br /&gt;In the above command C:\ORACLE\PRODUCT\10.2.0\ORADATA\USYD is the &lt;br /&gt;source destination for the datafiles and C:\temp\USYD\ is the folder in which &lt;br /&gt;the files will be placed after they are converted. You can open this database in read write mode once the database is converted.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;Starting convert at 16/NOV/06&lt;br /&gt;using channel ORA_DISK_1&lt;br /&gt;&lt;br /&gt;Directory SYS.WORK_DIR found in the database&lt;br /&gt;Directory SYS.ADMIN_DIR found in the database&lt;br /&gt;Directory SYS.DATA_PUMP_DIR found in the database&lt;br /&gt;&lt;br /&gt;User SYS with SYSDBA and SYSOPER privilege found in password file&lt;br /&gt;channel ORA_DISK_1: starting datafile conversion&lt;br /&gt;input datafile fno=00001 &lt;br /&gt;name=C:\ORACLE\PRODUCT\10.2.0\ORADATA\USYD\SYSTEM01.DBF&lt;br /&gt;&lt;br /&gt;converted datafile=C:\TEMP\USYD\SYSTEM01.DBF&lt;br /&gt;channel ORA_DISK_1: datafile conversion complete, elapsed time: &lt;br /&gt;00:00:25&lt;br /&gt;channel ORA_DISK_1: starting datafile conversion&lt;br /&gt;input datafile fno=00003 &lt;br /&gt;name=C:\ORACLE\PRODUCT\10.2.0\ORADATA\USYD\SYSAUX01.DBF&lt;br /&gt;&lt;br /&gt;converted datafile=C:\TEMP\USYD\SYSAUX01.DBF&lt;br /&gt;channel ORA_DISK_1: datafile conversion complete, elapsed time: &lt;br /&gt;00:00:27&lt;br /&gt;channel ORA_DISK_1: starting datafile conversion&lt;br /&gt;input datafile fno=00002 &lt;br /&gt;name=C:\ORACLE\PRODUCT\10.2.0\ORADATA\USYD\UNDOTBS01.DBF&lt;br /&gt;&lt;br /&gt;converted datafile=C:\TEMP\USYD\UNDOTBS01.DBF&lt;br /&gt;channel ORA_DISK_1: datafile conversion complete, elapsed time: &lt;br /&gt;00:00:25&lt;br /&gt;channel ORA_DISK_1: starting datafile conversion&lt;br /&gt;input datafile fno=00004 &lt;br /&gt;name=C:\ORACLE\PRODUCT\10.2.0\ORADATA\USYD\USERS01.DBF&lt;br /&gt;converted datafile=C:\TEMP\USYD\USERS01.DBF&lt;br /&gt;channel ORA_DISK_1: datafile conversion complete, elapsed time: &lt;br /&gt;00:00:08&lt;br /&gt;Run SQL script C:\TEMP\TRANSPORTSCRIPT on the target platform to create &lt;br /&gt;database&lt;br /&gt;&lt;br /&gt;Edit init.ora file C:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\INIT_00I2I4PR_1_0.ORA.&lt;br /&gt;This pfile will be used to create the database on the target platform&lt;br /&gt;To recompile all PL/SQL modules, run utlirp.sql and utlrp.sql on the &lt;br /&gt;target platform&lt;br /&gt;To change the internal database identifier, use DBNEWID Utility&lt;br /&gt;Finished backup at 16/NOV/06&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Since the source is a Windows Machine and the destination Linux x86-64 &lt;br /&gt;bit you have to change the location of the files in the transportscript created&lt;br /&gt;&lt;br /&gt;Create an init.ora file called initUSYD.ora with the following parameters&lt;br /&gt;control_files            = "/u01/oradata/USYD/cf_D-USYD_id-1778429277_00gb9u2s"&lt;br /&gt;instance_name            = "USYD"&lt;br /&gt;plsql_native_library_dir = "/tmp/convertdb/plsqlnld1"&lt;br /&gt;db_name                  = "USYD"&lt;br /&gt;sga_max_size =5000000&lt;br /&gt;compatible='10.2.0'&lt;br /&gt;&lt;br /&gt;eiger-&gt; sqlplus&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 10.2.0.2.0 - Production on Mon Nov 20 17:10:28 2006&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.&lt;br /&gt;&lt;br /&gt;Enter user-name: / as sysdba&lt;br /&gt;Connected to an idle instance.&lt;br /&gt;&lt;br /&gt;SQL&gt; startup nomount pfile='/u01/oradata/USYD/initUSYD.ora'&lt;br /&gt;ORACLE instance started.&lt;br /&gt;&lt;br /&gt;Total System Global Area  171966464 bytes&lt;br /&gt;Fixed Size                  2069712 bytes&lt;br /&gt;Variable Size             113249072 bytes&lt;br /&gt;Database Buffers           50331648 bytes&lt;br /&gt;Redo Buffers                6316032 bytes&lt;br /&gt;&lt;br /&gt;Cut and paste the commands from the transportscript created.&lt;br /&gt;&lt;br /&gt;SQL&gt; CREATE CONTROLFILE REUSE SET DATABASE "USYD" RESETLOGS  ARCHIVELOG&lt;br /&gt;  2      MAXLOGFILES 16&lt;br /&gt;  3      MAXLOGMEMBERS 3&lt;br /&gt;  4      MAXDATAFILES 100&lt;br /&gt;      MAXINSTANCES 8&lt;br /&gt;  5     MAXLOGHISTORY 292&lt;br /&gt;  7      LOGFILE&lt;br /&gt;  8    GROUP 1 &lt;br /&gt;'/u01/oradata/USYD/ARCH_D-USYD_ID-768471617_S-212_T-1_A-600609988_00I2I4PR'  SIZE 50M,&lt;br /&gt;  9    GROUP 2 &lt;br /&gt;'/u01/oradata/USYD/ARCH_D-USYD_ID-768471617_S-213_T-1_A-600609988_00I2I4PR'  SIZE 50M,&lt;br /&gt; 10    GROUP 3 &lt;br /&gt;'/u01/oradata/USYD/ARCH_D-USYD_ID-768471617_S-211_T-1_A-600609988_00I2I4PR'  SIZE 50M&lt;br /&gt; 11  DATAFILE&lt;br /&gt; 12    '/u01/oradata/USYD/SYSTEM01.DBF',&lt;br /&gt; 13    '/u01/oradata/USYD/UNDOTBS01.DBF',&lt;br /&gt; 14    '/u01/oradata/USYD/SYSAUX01.DBF',&lt;br /&gt; 15    '/u01/oradata/USYD/USERS01.DBF'&lt;br /&gt; 16  CHARACTER SET WE8MSWIN1252&lt;br /&gt; 17  ;&lt;br /&gt;&lt;br /&gt;Control file created.&lt;br /&gt;&lt;br /&gt;SQL&gt; set numwidth 20&lt;br /&gt;SQL&gt; select distinct checkpoint_change# from v$datafile;&lt;br /&gt;&lt;br /&gt;  CHECKPOINT_CHANGE#&lt;br /&gt;--------------------&lt;br /&gt;             6631021&lt;br /&gt;&lt;br /&gt;SQL&gt;  select distinct checkpoint_change# from v$datafile_header;&lt;br /&gt;&lt;br /&gt;  CHECKPOINT_CHANGE#&lt;br /&gt;--------------------&lt;br /&gt;             6631021&lt;br /&gt;&lt;br /&gt;SQL&gt; ALTER DATABASE OPEN RESETLOGS;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; ALTER TABLESPACE TEMP ADD TEMPFILE '/u01/oradata/USYD/DATA_D-USYD_I-768471617_TS-TEMP_FNO-1_00I2I4PR' SIZE 27262976  AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;&lt;br /&gt;&lt;br /&gt;Tablespace altered.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-2910945956421957021?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/2910945956421957021/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=2910945956421957021&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/2910945956421957021'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/2910945956421957021'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2006/11/performing-cross-platform-database.html' title='Performing Cross-Platform Database Transport'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-2832625402100964462</id><published>2006-11-14T18:48:00.000-08:00</published><updated>2006-11-14T18:55:33.718-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='data dictionary'/><title type='text'>Searching for X$ tables</title><content type='html'>You can query the names of X$ tables from X$KQFTA.&lt;br /&gt;&lt;br /&gt;I was looking for the X$ tables related to Dynamic Remastering and found them from&lt;br /&gt;&lt;br /&gt;SQL&gt; select KQFTANAM from x$kqfta where KQFTANAM like 'X$KJDR%';&lt;br /&gt;&lt;br /&gt;KQFTANAM&lt;br /&gt;------------------------------&lt;br /&gt;X$KJDRHV&lt;br /&gt;X$KJDRPCMHV&lt;br /&gt;X$KJDRPCMPF&lt;br /&gt;X$KJDRMAFNSTATS&lt;br /&gt;X$KJDRMHVSTATS&lt;br /&gt;X$KJDRMREQ&lt;br /&gt;&lt;br /&gt;6 rows selected.&lt;br /&gt;&lt;br /&gt;Similary to look for dictionary tables I query from the public synonym DICT which is based on SYS.DICTIONARY.&lt;br /&gt;&lt;br /&gt;For e.g&lt;br /&gt;SQL&gt; select table_name from dict where table_name like '%FILEST%';&lt;br /&gt;&lt;br /&gt;TABLE_NAME&lt;br /&gt;------------------------------&lt;br /&gt;DBA_HIST_FILESTATXS&lt;br /&gt;GV$FILESTAT&lt;br /&gt;V$FILESTAT&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-2832625402100964462?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/2832625402100964462/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=2832625402100964462&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/2832625402100964462'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/2832625402100964462'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2006/11/searching-for-x-tables.html' title='Searching for X$ tables'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-7674508721838187700</id><published>2006-11-13T15:51:00.000-08:00</published><updated>2006-11-13T16:07:20.635-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cursor sharing'/><title type='text'>Diagnosing unshared SQL in 10g</title><content type='html'>One of the ways to increase scalability and throughput of an application is to see to it that SQL statements are shared and reduce the number of children of sql statements. In versions prior to 10g the view V$SQL_SHARED_CURSOR would aid in diagnosing why sql statements were not being shared.In 10g there is a new event called CURSORTRACE which aids in the same.&lt;br /&gt;&lt;br /&gt;Let us take the following simple sql statement.&lt;br /&gt;&lt;br /&gt;SESSION1&gt;&gt; select count(*) from dept;&lt;br /&gt;&lt;br /&gt;  COUNT(*)&lt;br /&gt;----------&lt;br /&gt;         4&lt;br /&gt;         &lt;br /&gt;SESSION1&gt;&gt; select sql_text, hash_value,address from v$sqlarea where sql_text like 'select count(*) from dept%';&lt;br /&gt;&lt;br /&gt;SQL_TEXT                            HASH_VALUE ADDRESS&lt;br /&gt;----------------------------------- ---------- --------&lt;br /&gt;select count(*) from dept            761178024 19156098&lt;br /&gt;&lt;br /&gt;This the first child of the above sql statement with all 'N's&lt;br /&gt;&lt;br /&gt;SESSION1&gt;&gt; select * from v$sql_shared_cursor where address = '19156098';&lt;br /&gt;&lt;br /&gt;SQL_ID        ADDRESS  CHILD_AD CHILD_NUMBER U S O O S L S E B P I S T A B D L T&lt;br /&gt;------------- -------- -------- ------------ - - - - - - - - - - - - - - - - - -&lt;br /&gt;R I I R L I O S M U T N F A I T D L D B P C S R P T M B M R O P M F L&lt;br /&gt;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;1jrz3ucqpx9x8 19156098 1CEFB584            0 N N N N N N N N N N N N N N N N N N&lt;br /&gt;N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N&lt;br /&gt;&lt;br /&gt;Now let us open a new session and issue the above sql statement but see to it that the cursor is not shared&lt;br /&gt;&lt;br /&gt;SESSION2&gt;&gt;alter session set optimizer_mode='RULE';&lt;br /&gt;&lt;br /&gt;Session altered.&lt;br /&gt;&lt;br /&gt;SESSION2&gt;&gt;select count(*) from dept;&lt;br /&gt;&lt;br /&gt;  COUNT(*)&lt;br /&gt;----------&lt;br /&gt;         4&lt;br /&gt;         &lt;br /&gt;Check from Session 1 how many children have been generated&lt;br /&gt;SESSION1&gt;&gt;select * from v$sql_shared_cursor where address = '19156098';&lt;br /&gt;&lt;br /&gt;SQL_ID        ADDRESS  CHILD_AD CHILD_NUMBER U S O O S L S E B P I S T A B D L T&lt;br /&gt;------------- -------- -------- ------------ - - - - - - - - - - - - - - - - - -&lt;br /&gt;R I I R L I O S M U T N F A I T D L D B P C S R P T M B M R O P M F L&lt;br /&gt;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;1jrz3ucqpx9x8 19156098 1CEFB584            0 N N N N N N N N N N N N N N N N N N&lt;br /&gt;N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N&lt;br /&gt;&lt;br /&gt;1jrz3ucqpx9x8 19156098 1BA90164            1 N N N N N N N N N N N N N N N N N N&lt;br /&gt;N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N &lt;strong&gt;Y&lt;/strong&gt; N N N N&lt;br /&gt;&lt;br /&gt;As expected we have one more child caused by the OPTIMIZER_MODE_MISMATCH which we&lt;br /&gt;forced.&lt;br /&gt;&lt;br /&gt;SESSION2&gt;&gt;alter session set events 'immediate trace name cursortrace level 612, address 761178024';&lt;br /&gt;&lt;br /&gt;==&gt; 761178024 is the hash value of the sql statement.&lt;br /&gt;&lt;br /&gt;Session altered.&lt;br /&gt;&lt;br /&gt;SESSION2&gt;&gt;select count(*) from dept;&lt;br /&gt;&lt;br /&gt;  COUNT(*)&lt;br /&gt;----------&lt;br /&gt;         4&lt;br /&gt;&lt;br /&gt;SESSION2&gt;&gt;alter session set optimizer_mode='FIRST_ROWS_1';&lt;br /&gt;&lt;br /&gt;Session altered.&lt;br /&gt;&lt;br /&gt;SESSION2&gt;&gt;select count(*) from dept;&lt;br /&gt;&lt;br /&gt;  COUNT(*)&lt;br /&gt;----------&lt;br /&gt;         4&lt;br /&gt;&lt;br /&gt;The resultant trace file generated in user_dump_dest will throw more&lt;br /&gt;light into why the sql statement is not shared.&lt;br /&gt;&lt;br /&gt;Here is a snippet from the trace file&lt;br /&gt;&lt;br /&gt;*************************************************************************&lt;br /&gt; PARSING SQLTEXT=select count(*) from dept&lt;br /&gt; SQLHASH=2d5ea7a8&lt;br /&gt; Checking for already pinned child.&lt;br /&gt; No valid child pinned&lt;br /&gt; Parent 1EA853E8(19156098) ready for search&lt;br /&gt; kksSearchChildList outside while loop&lt;br /&gt; kksCheckCursor: next child is #1&lt;br /&gt; kksCheckCursor: pinning child #1 in shared mode 1eb62650 1ba90164&lt;br /&gt; Compilation environment difference Failed sharing : 0&lt;br /&gt;    optimizer_mode                      = first_rows_1         rule                &lt;br /&gt;    sqlstat_enabled                     = false                true                &lt;br /&gt; SQL pgadep:0 pgapls:0 user&lt;br /&gt; &lt;strong&gt;Failed sharing : Compilation environment mismatch&lt;/strong&gt;&lt;br /&gt; kksUnlockChild: releasing child&lt;br /&gt;*************************************************************************&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-7674508721838187700?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/7674508721838187700/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=7674508721838187700&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/7674508721838187700'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/7674508721838187700'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2006/11/diagnosing-unshared-sql-in-10g.html' title='Diagnosing unshared SQL in 10g'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-8077918576917437761</id><published>2006-11-05T15:41:00.000-08:00</published><updated>2006-11-14T18:24:33.167-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='10g RAC DRM'/><title type='text'>To use DRM or not to use DRM</title><content type='html'>10g Real Application Clusters introduced a concept of resource remastering via Dynamic Resource Mastering (DRM). With DRM a resource can be re-mastered on another node in the cluster if it is found that the cache resource is accessed more frequently from that node. &lt;br /&gt;&lt;br /&gt;In 10G R1 this was file based whereas the 10G R2 it is object based.&lt;br /&gt;In 10G R1 due to a few bugs many related to high CPU usage during the DRM freeze window most customers disabled DRM by setting the following parameters&lt;br /&gt;_gc_affinity_time=0 &lt;br /&gt;_gc_undo_affinity=FALSE &lt;br /&gt;&lt;br /&gt;_gc_affinity_time defines the frequency in minutes to check if remastering&lt;br /&gt;is needed.&lt;br /&gt;_gc_affinity_limit defines the number of times a node must access an object&lt;br /&gt;for it to be a DRM candidate&lt;br /&gt;_gc_affinity_minimum defines the minimum number of times an object is accessed per minute before affinity kicks in&lt;br /&gt;&lt;br /&gt;The performance problems may manifest themselves in terms of a DRM related wait event like 'gcs drm freeze in enter server mode'&lt;br /&gt;&lt;br /&gt;In 10G R2 this feature appears to be more stable.&lt;br /&gt;&lt;br /&gt;You can also manually remaster an object on a different node which&lt;br /&gt;is different from the node on which the object is currrently mastered as shown below&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;SQL&gt; select object_id,current_master, previous_master ,remaster_cnt from V$GCSPFMASTER_INFO where object_id = 144615&lt;br /&gt;&lt;br /&gt; OBJECT_ID CURRENT_MASTER PREVIOUS_MASTER REMASTER_CNT&lt;br /&gt;---------- -------------- --------------- ------------&lt;br /&gt;    144615              0               2            0&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The object 144615 is currently mastered on node 0.&lt;br /&gt;To remaster the object onto node 2 connect to node 2 as sysdba&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Go to instance 2&lt;br /&gt;&lt;strong&gt;NODE2&gt; oradebug setmypid&lt;br /&gt;Statement processed.&lt;br /&gt;NODE2&gt; oradebug lkdebug -m pkey 144615&lt;br /&gt;Statement processed.&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;NODE2&gt; select object_id,current_master, previous_master ,remaster_cnt from V$GCSPFMASTER_INFO where object_id = 144615&lt;br /&gt;&lt;br /&gt; OBJECT_ID CURRENT_MASTER PREVIOUS_MASTER REMASTER_CNT&lt;br /&gt;---------- -------------- --------------- ------------&lt;br /&gt;    144615              2               0            0&lt;/strong&gt;&lt;br /&gt;Note: In V$GCSPFMASTER_INFO you will also see resources with object ids in the 4Gb range (e.g. 4294950913)&lt;br /&gt;These are for undo segments.&lt;br /&gt;&lt;br /&gt;To dissolve remastering of this object on this instance&lt;br /&gt;&lt;strong&gt;SQL&gt; oradebug lkdebug -m dpkey 144615&lt;br /&gt;Statement processed.&lt;br /&gt;&lt;br /&gt;SQL&gt; select object_id,current_master, previous_master ,remaster_cnt from V$GCSPFMASTER_INFO where object_id = 144615;&lt;br /&gt;no rows selected&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The remaster_cnt appears to be 0 for all objects. I have got Oracle&lt;br /&gt;to log bug  &lt;a href="https://metalink.oracle.com/metalink/plsql/f?p=130:15:2787386578773606273::::p15_database_id,p15_docid,p15_show_header,p15_show_help,p15_black_frame,p15_font:BUG,5649377,1,1,1,helvetica"&gt;5649377&lt;/a&gt; on this issue.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;SQL&gt; select distinct remaster_cnt from V$GCSPFMASTER_INFO ;&lt;br /&gt;&lt;br /&gt;REMASTER_CNT&lt;br /&gt;------------&lt;br /&gt;           0&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;DRM statistics are available in X$KJDRMAFNSTATS&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from X$KJDRMAFNSTATS&lt;br /&gt;  2  /&lt;br /&gt;&lt;br /&gt;ADDR           INDX    INST_ID       DRMS AVG_DRM_TIME OBJECTS_PER_DRM   QUISCE_T      FRZ_T  CLEANUP_T   REPLAY_T FIXWRITE_T  SYNC_T&lt;br /&gt;-------- ---------- ---------- ---------- ------------ --------------- ---------- ---------- ---------- ---------- ---------- ----------&lt;br /&gt;RES_CLEANED   REPLAY_S   REPLAY_R MY_OBJECTS&lt;br /&gt;----------- ---------- ---------- ----------&lt;br /&gt;200089CC          0          1         32          214               1          3         14          0          0          0      99&lt;br /&gt;          0       2441       6952         &lt;strong&gt;30&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The column MY_OBJECTS denotes the number of objects mastered on that node.&lt;br /&gt;This should match with the following&lt;br /&gt;&lt;br /&gt;SQL&gt; select count(*) from V$GCSPFMASTER_INFO  where current_master=0&lt;br /&gt;  2  /&lt;br /&gt;&lt;br /&gt;  COUNT(*)&lt;br /&gt;----------&lt;br /&gt;        &lt;strong&gt;30&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-8077918576917437761?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/8077918576917437761/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=8077918576917437761&amp;isPopup=true' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/8077918576917437761'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/8077918576917437761'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2006/11/to-use-drm-or-not-to-use-drm.html' title='To use DRM or not to use DRM'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-8856690626232125955</id><published>2006-10-24T21:29:00.000-07:00</published><updated>2006-10-24T22:18:21.300-07:00</updated><title type='text'>Recovering a Standby database from a missing archivelog</title><content type='html'>A Physical Standby database relies on continuous application of archivelogs from a Primary Database to be in synch with it. In Oracle Database versions prior to 10g in the event of an archivelog gone missing or corrupt you had to rebuild the standby database from scratch.&lt;br /&gt;&lt;br /&gt;In 10g you can use an incremental backup and recover the standby using the same to compensate for the missing archivelogs as shown below&lt;br /&gt;&lt;br /&gt;In the case below archivelogs with sequence numbers 137 and 138 which are required on the standby are deleted to simulate this problem.&lt;br /&gt;&lt;br /&gt;Step 1: On the standby database check the current scn.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;STDBY&gt;&gt;select current_scn from v$database;&lt;/strong&gt;&lt;br /&gt;CURRENT_SCN&lt;br /&gt;-----------&lt;br /&gt;    4793543&lt;br /&gt;    &lt;br /&gt;Step 2: On the primary database create the needed incremental backup from the above SCN&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;C:\Documents and Settings\frego&gt;rman target /&lt;/strong&gt;&lt;br /&gt;Recovery Manager: Release 10.2.0.2.0 - Production on Wed Oct 25 13:39:04 2006&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2005, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;connected to target database: USYD (DBID=768471617)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;RMAN&gt; BACKUP DEVICE TYPE DISK INCREMENTAL FROM SCN 4793543 DATABASE&lt;br /&gt;FORMAT 'C:\temp\bkup_%U';&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Starting backup at 25/OCT/06&lt;br /&gt;using channel ORA_DISK_1&lt;br /&gt;channel ORA_DISK_1: starting full datafile backupset&lt;br /&gt;channel ORA_DISK_1: specifying datafile(s) in backupset&lt;br /&gt;input datafile fno=00001 name=C:\ORACLE\PRODUCT\10.2.0\ORADATA\USYD\SYSTEM01.DBF&lt;br /&gt;input datafile fno=00002 name=C:\ORACLE\PRODUCT\10.2.0\ORADATA\USYD\UNDOTBS01.DBF&lt;br /&gt;input datafile fno=00003 name=C:\ORACLE\PRODUCT\10.2.0\ORADATA\USYD\SYSAUX01.DBF&lt;br /&gt;input datafile fno=00004 name=C:\ORACLE\PRODUCT\10.2.0\ORADATA\USYD\USERS01.DBF&lt;br /&gt;channel ORA_DISK_1: starting piece 1 at 25/OCT/06&lt;br /&gt;channel ORA_DISK_1: finished piece 1 at 25/OCT/06&lt;br /&gt;piece handle=C:\TEMP\BKUP_02I0NSNE_1_1 tag=TAG20061025T134102 comment=NONE&lt;br /&gt;channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35&lt;br /&gt;channel ORA_DISK_1: starting full datafile backupset&lt;br /&gt;channel ORA_DISK_1: specifying datafile(s) in backupset&lt;br /&gt;including current control file in backupset&lt;br /&gt;including current SPFILE in backupset&lt;br /&gt;channel ORA_DISK_1: starting piece 1 at 25/OCT/06&lt;br /&gt;channel ORA_DISK_1: finished piece 1 at 25/OCT/06&lt;br /&gt;piece handle=C:\TEMP\BKUP_03I0NSOI_1_1 tag=TAG20061025T134102 comment=NONE&lt;br /&gt;channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02&lt;br /&gt;Finished backup at 25/OCT/06&lt;br /&gt;&lt;br /&gt;Step 3: Cancel managed recovery at the standby database&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;STDBY&gt;&gt;recover managed standby database cancel;&lt;/strong&gt;&lt;br /&gt;Media recovery complete.&lt;br /&gt;&lt;br /&gt;Move the backup files to a new folder called INCR_BACKUP so that they are the only files in that folder.&lt;br /&gt;&lt;br /&gt;Step 4: Catalog the Incremental Backup Files at the Standby Database&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;C:\oracle\product\10.2.0\db_1\database&gt;rman target /&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Recovery Manager: Release 10.2.0.2.0 - Production on Wed Oct 25 14:54:27 2006&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2005, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;connected to target database: USYD (DBID=768471617, not open)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;RMAN&gt; CATALOG START WITH 'C:\temp\INCR_BACKUP';&lt;/strong&gt;&lt;br /&gt;searching for all files that match the pattern C:\temp\INCR_BACKUP&lt;br /&gt;&lt;br /&gt;List of Files Unknown to the Database&lt;br /&gt;=====================================&lt;br /&gt;File Name: C:\TEMP\INCR_BACKUP\BKUP_02I0NSNE_1_1&lt;br /&gt;File Name: C:\TEMP\INCR_BACKUP\BKUP_03I0NSOI_1_1&lt;br /&gt;&lt;br /&gt;Do you really want to catalog the above files (enter YES or NO)? YES&lt;br /&gt;cataloging files...&lt;br /&gt;cataloging done&lt;br /&gt;&lt;br /&gt;List of Cataloged Files&lt;br /&gt;=======================&lt;br /&gt;File Name: C:\TEMP\INCR_BACKUP\BKUP_02I0NSNE_1_1&lt;br /&gt;File Name: C:\TEMP\INCR_BACKUP\BKUP_03I0NSOI_1_1&lt;br /&gt;&lt;br /&gt;Step 5: Apply the Incremental Backup to the Standby Database&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;RMAN&gt; RECOVER DATABASE NOREDO;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Starting recover at 25/OCT/06&lt;br /&gt;allocated channel: ORA_DISK_1&lt;br /&gt;channel ORA_DISK_1: sid=151 devtype=DISK&lt;br /&gt;channel ORA_DISK_1: starting incremental datafile backupset restore&lt;br /&gt;channel ORA_DISK_1: specifying datafile(s) to restore from backup set&lt;br /&gt;destination for restore of datafile 00001: C:\ORACLE\PRODUCT\10.2.0\ORADATA\STDB&lt;br /&gt;Y\SYSTEM01.DBF&lt;br /&gt;destination for restore of datafile 00002: C:\ORACLE\PRODUCT\10.2.0\ORADATA\STDB&lt;br /&gt;Y\UNDOTBS01.DBF&lt;br /&gt;destination for restore of datafile 00003: C:\ORACLE\PRODUCT\10.2.0\ORADATA\STDB&lt;br /&gt;Y\SYSAUX01.DBF&lt;br /&gt;destination for restore of datafile 00004: C:\ORACLE\PRODUCT\10.2.0\ORADATA\STDB&lt;br /&gt;Y\USERS01.DBF&lt;br /&gt;channel ORA_DISK_1: reading from backup piece C:\TEMP\INCR_BACKUP\BKUP_02I0NSNE_&lt;br /&gt;1_1&lt;br /&gt;channel ORA_DISK_1: restored backup piece 1&lt;br /&gt;piece handle=C:\TEMP\INCR_BACKUP\BKUP_02I0NSNE_1_1 tag=TAG20061025T134102&lt;br /&gt;channel ORA_DISK_1: restore complete, elapsed time: 00:00:03&lt;br /&gt;Finished recover at 25/OCT/06&lt;br /&gt;&lt;br /&gt;Step 6: Put the standby database back to managed recovery mode.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;STDBY&gt;&gt; recover managed standby database nodelay disconnect;&lt;/strong&gt;&lt;br /&gt;Media recovery complete.&lt;br /&gt;&lt;br /&gt;From the alert.log you will notice that the standby database is still looking for the old log files&lt;br /&gt;&lt;br /&gt;*************************************************&lt;br /&gt;FAL[client]: Failed to request gap sequence &lt;br /&gt; GAP - thread 1 sequence 137-137&lt;br /&gt; DBID 768471617 branch 600609988&lt;br /&gt;**************************************************&lt;br /&gt;&lt;br /&gt;This is because the controlfile has not been updated.&lt;br /&gt;Hence the standby controlfile has to be recreated&lt;br /&gt;&lt;br /&gt;On the primary&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;PRIM&gt;&gt;alter database create standby controlfile as 'C:\temp\standby01.ctl';&lt;/strong&gt;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;Copy the standby control file to the standby site and restart the standby database in managed recovery mode...&lt;br /&gt;&lt;br /&gt;Managed Standby Recovery not using Real Time Apply&lt;br /&gt; parallel recovery started with 2 processes&lt;br /&gt;Media Recovery Waiting for thread 1 sequence 139&lt;br /&gt;&lt;br /&gt;As you can see from the above output the standby is now looking for the next archivelog.&lt;br /&gt;If you have the luxury of time at your disposal you can do an export of the standby database in read only mode.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-8856690626232125955?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/8856690626232125955/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=8856690626232125955&amp;isPopup=true' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/8856690626232125955'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/8856690626232125955'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2006/10/recovering-standby-database-from.html' title='Recovering a Standby database from a missing archivelog'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-2426046734289806679</id><published>2006-10-15T21:59:00.000-07:00</published><updated>2006-10-15T23:36:21.350-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CRS'/><category scheme='http://www.blogger.com/atom/ns#' term='RAC'/><title type='text'>Case Study on How to diagnose a node reboot</title><content type='html'>The following article looks at how to diagnose a node reboot in a 10G RAC cluster.&lt;br /&gt;&lt;br /&gt;Configuration:&lt;br /&gt;2 node RAC on 10.2.0.1 on RH ES 4.0 (kernel 2.6.9-34.0.2.ELsmp)&lt;br /&gt;&lt;br /&gt;To diagnose such issues it is very important that you get the timelines of the occurrences of the reboot spot on. It is a recommended practice to have the NTP daemon running on all nodes in the cluster so that the wall clocks of all nodes in the cluster are in sync.&lt;br /&gt;&lt;br /&gt;hippo &gt;ps -ef | grep ntp | grep -v 'grep'&lt;br /&gt;ntp       3349     1  0 Oct15 ?        00:00:00 ntpd -u ntp:ntp -p /var/run/ntpd.pid -g&lt;br /&gt;&lt;br /&gt;1. Check the Linux log file (/var/log/messages) to determine the time of the reboot&lt;br /&gt;&lt;br /&gt;In this case the reboot occurred at 02:09 hours on the node hippo&lt;br /&gt;&lt;br /&gt;Oct 12 09:24:34 hippo sshd(pam_unix)[5885]: session opened for user frego by frego (uid=0)&lt;br /&gt;Oct 15 02:09:17 hippo syslogd 1.4.1: restart.&lt;br /&gt;Oct 15 02:09:17 hippo syslog: syslogd startup succeeded&lt;br /&gt;Oct 15 02:09:17 hippo kernel: klogd 1.4.1, log source = /proc/kmsg started.&lt;br /&gt;&lt;br /&gt;Check the Linux log file on the other node (elephant) at the same point in time.&lt;br /&gt;&lt;br /&gt;Oct 14 17:42:01 elephant su(pam_unix)[18041]: session closed for user root&lt;br /&gt;Oct 15 02:09:12 elephant syslogd 1.4.1: restart.&lt;br /&gt;Oct 15 02:09:12 elephant syslog: syslogd startup succeeded&lt;br /&gt;Oct 15 02:09:12 elephant kernel: klogd 1.4.1, log source = /proc/kmsg started.&lt;br /&gt;&lt;br /&gt;From the above output it is clear that both the nodes rebooted at approximately the same time.&lt;br /&gt;&lt;br /&gt;2. Check which process is responsible for the reboot.&lt;br /&gt;&lt;br /&gt;Review the log file of the CSS daemon. The log file resides in $ORA_CRS_HOME/log/&lt;node&gt;&lt;br /&gt;&lt;br /&gt;hippo &gt;pwd&lt;br /&gt;/u00/app/oracle/product/10.2.0/crs/log/hippo&lt;br /&gt;&lt;br /&gt;hippo &gt;cd cssd&lt;br /&gt;&lt;br /&gt;hippo &gt;pwd&lt;br /&gt;/u00/app/oracle/product/10.2.0/crs/log/hippo/cssd&lt;br /&gt;&lt;br /&gt;hippo &gt;ls -ltr&lt;br /&gt;total 9376&lt;br /&gt;drwxr-xr-x  2 oracle dba    4096 Sep  8 18:08 oclsmon&lt;br /&gt;-rw-r-----  1 oracle dba     105 Oct 15 02:02 ocssd.trc&lt;br /&gt;-rw-r--r--  1 oracle dba       5 Oct 15 02:11 hippo.pid&lt;br /&gt;-rw-r--r--  1 oracle dba      17 Oct 15 02:11 cssdOUT.log&lt;br /&gt;-rw-r--r--  1 oracle dba 9567227 Oct 16 15:13 ocssd.log&lt;br /&gt;&lt;br /&gt;From the ocssd.log file&lt;br /&gt;&lt;br /&gt;[    CSSD]2006-10-15 02:02:48.697 [50609072] &gt;WARNING: clssnmDiskPMT: long disk latency (54990 ms) to voting disk (0//crs/voting.dsk)&lt;br /&gt;[    CSSD]2006-10-15 02:02:50.719 [50609072] &gt;ERROR:   clssnmDiskPMT: 1 of 1 voting disks unavailable (0/0/1)&lt;br /&gt;[    CSSD]2006-10-15 02:02:50.734 [50609072] &gt;TRACE:   clssscctx:  dump of 0x0x810d500, len 3528&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Hence the reboot has been caused due to latency issues in accessing the voting disk. The specific function which monitors this is the DiskPing Monitor Thread which monitors the length of a single I/O to the voting disk and marks the voting disk is unavailable. This has caused the CSS daemon to fail. &lt;br /&gt;&lt;br /&gt;As seen from the /etc/inittab &lt;br /&gt;h2:35:respawn:/etc/init.d/init.cssd fatal &gt; /dev/null 2&gt;&amp;1 &lt; /dev/null&lt;br /&gt;&lt;br /&gt;a failure exit of the CSS daemon causes the machine to reboot.&lt;br /&gt;This indicates the node is rebooted in case of CSS daemon failure.&lt;br /&gt;&lt;br /&gt;This is also logged in the alertelephant.log in the $ORA_CRS_HOME/log/&lt;node&gt; which is the alert.log of the CRS stack.&lt;br /&gt;&lt;br /&gt;2006-10-15 02:02:50.740&lt;br /&gt;[cssd(8533)]CRS-1606:CSSD Insufficient voting files available [0 of 1]. Details in /u00/app/oracle/product/10.2.0/crs/log/elephant/cssd/ocssd.log.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Check the ocssd.log file on the other node (elephant) too&lt;br /&gt;&lt;br /&gt;[    CSSD]2006-10-15 02:01:40.255 [50617264] &gt;TRACE:   clssgmClientConnectMsg: Connect from con(0xb7c3f580) proc(0xb7c67918) pid() proto(10:2:1:1)&lt;br /&gt;[    CSSD]2006-10-15 02:02:50.724 [112925616] &gt;ERROR:   clssnmDiskPMT: 1 of 1 voting disks unavailable (0/0/1)&lt;br /&gt;[    CSSD]2006-10-15 02:02:50.777 [112925616] &gt;TRACE:   clssscctx:  dump of 0x0x810d500, len 3528&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;There have been a couple of additional CSS related parameters introduced in the 10.2.0.2  patchset to address long I/O requirements of storage vendors such as EMC and NetApp.&lt;br /&gt;&lt;br /&gt;• reboottime: (default 3 seconds)&lt;br /&gt;The amount of time allowed for a node to complete a reboot after the CSS daemon has been evicted.&lt;br /&gt;This parameter can be set via the command&lt;br /&gt;crsctl set css reboottime R [-force]  (R is seconds)&lt;br /&gt;&lt;br /&gt;• disktimeout (default 200 seconds) &lt;br /&gt;The maximum amount of time allowed for a voting file I/O to complete; if this time is exceeded the voting disk will be marked as unavailable&lt;br /&gt;This parameter can be set via the command&lt;br /&gt;crsctl set css disktimeout D [-force] (D is seconds)&lt;br /&gt;&lt;br /&gt;These commands must be run as root on a node where the CRSD is up, unless &lt;br /&gt;'-force' is specified, in which case the the CRS stack should not be up on any other node.  &lt;br /&gt;After the commands are run all CSS daemons must be restarted for the settings to take effect on all nodes asap.&lt;br /&gt;You can verify the settings by doing an ocrdump and checking the values in the OCRDUMPFILE&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-2426046734289806679?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/2426046734289806679/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=2426046734289806679&amp;isPopup=true' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/2426046734289806679'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/2426046734289806679'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2006/10/case-study-on-how-to-diagnose-node.html' title='Case Study on How to diagnose a node reboot'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-115994314650866604</id><published>2006-10-03T23:21:00.000-07:00</published><updated>2006-10-26T23:56:15.430-07:00</updated><title type='text'>Clearing UNKNOWN status of CRS resources</title><content type='html'>If you get the following errors whilst starting up nodeapps on a 10G RAC&lt;br /&gt;cluster&lt;br /&gt;&lt;br /&gt;bart-&gt; srvctl start nodeapps -n bart&lt;br /&gt;CRS-1028: Dependency analysis failed because of:&lt;br /&gt;CRS-0223: Resource 'ora.bart.gsd' has placement error.&lt;br /&gt;CRS-1028: Dependency analysis failed because of:&lt;br /&gt;CRS-0223: Resource 'ora.bart.ons' has placement error.&lt;br /&gt;&lt;br /&gt;Check the status of these resources.&lt;br /&gt;&lt;br /&gt;bart-&gt; ./ShowCRS | grep UNK&lt;br /&gt;ora.bart.gsd                              ONLINE     UNKNOWN on bart&lt;br /&gt;ora.bart.ons                              ONLINE     UNKNOWN on bart&lt;br /&gt;&lt;br /&gt;To clear the state of the resource you have to use the force option&lt;br /&gt;in the crs_stop command&lt;br /&gt;&lt;br /&gt;bart-&gt; crs_stop ora.bart.gsd -f&lt;br /&gt;Attempting to stop `ora.bart.gsd` on member `bart`&lt;br /&gt;Stop of `ora.bart.gsd` on member `bart` succeeded.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;bart-&gt; crs_stop ora.bart.ons  -f&lt;br /&gt;Attempting to stop `ora.bart.ons` on member `bart`&lt;br /&gt;Stop of `ora.bart.ons` on member `bart` succeeded.&lt;br /&gt;&lt;br /&gt;bart-&gt; srvctl start nodeapps -n bart&lt;br /&gt;bart-&gt; ./ShowCRS | grep UNK&lt;br /&gt;&lt;br /&gt;bart-&gt; ./ShowCRS | grep bart&lt;br /&gt;ora.bart.gsd                              ONLINE     ONLINE on bart&lt;br /&gt;ora.bart.ons                              ONLINE     ONLINE on bart&lt;br /&gt;ora.bart.vip                              ONLINE     ONLINE on bart&lt;br /&gt;&lt;br /&gt;ShowCRS is a shell script which is based on Metalink Note &lt;a href="https://www.metalink.oracle.com/metalink/plsql/f?p=130:14:4582677898037598856::::p14_database_id,p14_docid,p14_show_header,p14_show_help,p14_black_frame,p14_font:NOT,259301.1,1,1,1,helvetica"&gt;259301.1&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-115994314650866604?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/115994314650866604/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=115994314650866604&amp;isPopup=true' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/115994314650866604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/115994314650866604'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2006/10/clearing-unknown-status-of-crs.html' title='Clearing UNKNOWN status of CRS resources'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-115761238244830685</id><published>2006-09-06T23:58:00.000-07:00</published><updated>2006-09-07T17:49:46.836-07:00</updated><title type='text'>How to find the location of your voting disk</title><content type='html'>Below is a quick way to find the location of your voting disk in a 10G RAC cluster&lt;br /&gt;&lt;br /&gt;bart-&gt; ocrdump -stdout -keyname SYSTEM.css.diskfile&lt;br /&gt;09/07/2006 16:51:53&lt;br /&gt;ocrdump -stdout -keyname SYSTEM.css.diskfile&lt;br /&gt;&lt;br /&gt;[SYSTEM.css.diskfile]&lt;br /&gt;ORATEXT : /crs/voting.dsk&lt;br /&gt;SECURITY : {USER_PERMISSION : PROCR_ALL_ACCESS, GROUP_PERMISSION : PROCR_READ, OTHER_PERMISSION : PROCR_READ, USER_NAME : root, GROUP_NAME : root}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-115761238244830685?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/115761238244830685/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=115761238244830685&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/115761238244830685'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/115761238244830685'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2006/09/how-to-find-location-of-your-voting.html' title='How to find the location of your voting disk'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-115700036853660211</id><published>2006-08-30T21:41:00.000-07:00</published><updated>2006-10-16T20:27:50.039-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sga_target'/><category scheme='http://www.blogger.com/atom/ns#' term='ASMM'/><category scheme='http://www.blogger.com/atom/ns#' term='sga'/><title type='text'>Automatic Shared Memory Management</title><content type='html'>Starting with Oracle 10G R1 there is a new parameter sga_target which determines whether you want Oracle to manage the sizes of various pools within the SGA or whether you want to manually manage memory allocated to Oracle.&lt;br /&gt;To use this feature the value of STATISTICS_LEVEL should either be set to TYPICAL or ALL.&lt;br /&gt;&lt;br /&gt;But this feature is not without its fair share of issues especially on large and intensive databases.&lt;br /&gt;&lt;br /&gt;The reason for this is two fold.&lt;br /&gt;The following bugs exist &lt;br /&gt;&lt;br /&gt;4587117 (P) LARGE_POOL_SIZE AND JAVA_POOL_SIZE DO NOT SHRINK IN ASMM  Fixed in 11.0&lt;br /&gt;4466399 (U)&lt;br /&gt;4472338 (U)&lt;br /&gt;(duplicate of the above 4466399) &lt;br /&gt;4507532 (U)&lt;br /&gt;(turned out to be a bad diagnosis, but the bug is real) &lt;br /&gt;4920199 (U)&lt;br /&gt;&lt;br /&gt;Secondly the default behaviour is that if the shared pool is stressed and requires more memory it is removed from the buffer cache. But the reverse is not true. However this default behaviour can be changed by setting _memory_broker_shrink_heaps=30&lt;br /&gt;The default value for the above parameter is 0&lt;br /&gt;&lt;br /&gt;The shrinking of the Java pool depends on the value of _memory_broker_shrink_java_heaps. The default value is 900.&lt;br /&gt;&lt;br /&gt;You can set the following event to trace memory management. The MMON process trace file will update statistics related to the different pools every 5 mins.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system set "_memory_management_tracing"=31;&lt;br /&gt;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;The default value for the above parameter is 0&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-115700036853660211?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/115700036853660211/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=115700036853660211&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/115700036853660211'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/115700036853660211'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2006/08/automatic-shared-memory-management.html' title='Automatic Shared Memory Management'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-115639532567160802</id><published>2006-08-23T21:33:00.000-07:00</published><updated>2006-08-23T21:55:25.690-07:00</updated><title type='text'>Shrinking segments</title><content type='html'>Shrinking of a segment makes unused space available to other segments in the tablespace and may improve the performance of queries and DML operations.&lt;br /&gt;&lt;br /&gt;The function VERIFY_SHRINK_CANDIDATE in the DBMS_SPACE is an undocumented function which informs us about the size of the segment upto which we can shrink.&lt;br /&gt;&lt;br /&gt;declare&lt;br /&gt;res boolean;&lt;br /&gt;begin&lt;br /&gt;res := dbms_space.verify_shrink_candidate('SCOTT','EMP','TABLE',1032192);&lt;br /&gt;if (res)&lt;br /&gt;then dbms_output.put_line('Can shrink to this size');&lt;br /&gt;end if;&lt;br /&gt;end;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;Can shrink to this size&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;declare&lt;br /&gt;res boolean;&lt;br /&gt;begin&lt;br /&gt;res := dbms_space.verify_shrink_candidate('SCOTT','EMP','TABLE',1032191);&lt;br /&gt;if (res)&lt;br /&gt;then dbms_output.put_line('Can shrink to this size');&lt;br /&gt;end if;&lt;br /&gt;end;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;In the above example we can shrink a segment to 1032192 bytes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-115639532567160802?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/115639532567160802/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=115639532567160802&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/115639532567160802'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/115639532567160802'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2006/08/shrinking-segments.html' title='Shrinking segments'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-115286612185170084</id><published>2006-07-14T01:15:00.000-07:00</published><updated>2006-09-19T19:27:30.860-07:00</updated><title type='text'>OCR backups</title><content type='html'>In Oracle 10G Release 1 there is no provision to mirror the Oracle cluster registry (OCR) at the software level. In 10G R2 you can specify a mirror location.&lt;br /&gt;&lt;br /&gt;Oracle automatically backs up the OCR every 4 hours. If your Oracle Home is not sitting on a shared mountpoint the backups go to&lt;br /&gt;$ORA_CRS_HOME/cdata on the master node. This presents a single point of failure.&lt;br /&gt;&lt;br /&gt;Oracle recommends that the CRS backups are put on shared storage. This can be done using the ocrconfig tool.&lt;br /&gt;&lt;br /&gt;The syntax for the same is&lt;br /&gt;ocrconfig -backuploc "dir"&lt;br /&gt;&lt;br /&gt;Please note that the above command has to be run as root. If you run the command as the oracle user it does not take effect although the command returns successfully and you will see the following error in the ocrconfig.log file&lt;br /&gt;&lt;br /&gt;ocrconfig starts... &lt;br /&gt;Warning!! cluster checking is disabled &lt;br /&gt;Failure in creating key [SYSTEM.OCR.BACKUP.LOC] OCR error [PROC-5: User does not have permission to perform a cluster registry operation on this key.]&lt;br /&gt;&lt;br /&gt;Use the ocrconfig -showbackup command to check if the destination has changed&lt;br /&gt;&lt;br /&gt;You can also take a logical backup using the export option in the ocrconfig command.&lt;br /&gt;The command needs to be run as root&lt;br /&gt;&lt;br /&gt;# &lt;strong&gt;ocrconfig -export ocr.tmp -s online&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;As you can see from the below output there is a difference in size between a backup taken by the export option and the OCR backup which is automatically taken every 4 hours.&lt;br /&gt;&lt;br /&gt;/tmp&gt; ls -ltr&lt;br /&gt;-rw-r-----   1 root     root     26951680 Aug 26 09:08 backup00.ocr&lt;br /&gt;-rw-r--r--   1 root     other     690062 Aug 26 09:27 ocr.tmp&lt;br /&gt;&lt;br /&gt;This is because the export is a logical backup and is to be restored using the import option. The OCR backups which happen every 4 hours are binary block by block&lt;br /&gt;copies of the OCR.&lt;br /&gt;&lt;br /&gt;As with all backups the only way to test their integrity is to restore them.&lt;br /&gt;&lt;br /&gt;But you can use the following command to check the CRS stack and OCR integrity&lt;br /&gt;&lt;br /&gt;bart:TEST1:/tmp/bin&gt; &lt;strong&gt;./cluvfy stage -post crsinst -n all -verbose&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Performing post-checks for cluster services setup&lt;br /&gt;&lt;br /&gt;Checking node reachability...&lt;br /&gt;&lt;br /&gt;Check: Node reachability from node "bart"&lt;br /&gt;  Destination Node                      Reachable?&lt;br /&gt;  ------------------------------------  ------------------------&lt;br /&gt;  homer                           yes&lt;br /&gt;  bart                           yes&lt;br /&gt;Result: Node reachability check passed from node "bart".&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Checking user equivalence...&lt;br /&gt;&lt;br /&gt;Check: User equivalence for user "oracle"&lt;br /&gt;  Node Name                             Comment&lt;br /&gt;  ------------------------------------  ------------------------&lt;br /&gt;  homer                           passed&lt;br /&gt;  bart                           passed&lt;br /&gt;Result: User equivalence check passed for user "oracle".&lt;br /&gt;&lt;br /&gt;Checking Cluster manager integrity...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Checking CSS daemon...&lt;br /&gt;  Node Name                             Status&lt;br /&gt;  ------------------------------------  ------------------------&lt;br /&gt;  homer                           running&lt;br /&gt;  bart                           running&lt;br /&gt;Result: Daemon status check passed for "CSS daemon".&lt;br /&gt;&lt;br /&gt;Cluster manager integrity check passed.&lt;br /&gt;&lt;br /&gt;Checking cluster integrity...&lt;br /&gt;&lt;br /&gt;  Node Name&lt;br /&gt;  ------------------------------------&lt;br /&gt;  bart&lt;br /&gt;  homer&lt;br /&gt;&lt;br /&gt;Cluster integrity check passed&lt;br /&gt;&lt;br /&gt;Checking OCR integrity...&lt;br /&gt;&lt;br /&gt;Checking the absence of a non-clustered configuration...&lt;br /&gt;All nodes free of non-clustered, local-only configurations.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Checking the version of OCR...&lt;br /&gt;OCR of correct Version "2" exists.&lt;br /&gt;&lt;br /&gt;Checking data integrity of OCR...&lt;br /&gt;Data integrity check for OCR passed.&lt;br /&gt;&lt;br /&gt;OCR integrity check passed.&lt;br /&gt;&lt;br /&gt;Checking CRS integrity...&lt;br /&gt;&lt;br /&gt;Checking daemon liveness...&lt;br /&gt;&lt;br /&gt;Check: Liveness for "CRS daemon"&lt;br /&gt;  Node Name                             Running&lt;br /&gt;  ------------------------------------  ------------------------&lt;br /&gt;  homer                           yes&lt;br /&gt;  bart                           yes&lt;br /&gt;Result: Liveness check passed for "CRS daemon".&lt;br /&gt;&lt;br /&gt;Checking daemon liveness...&lt;br /&gt;&lt;br /&gt;Check: Liveness for "CSS daemon"&lt;br /&gt;  Node Name                             Running&lt;br /&gt;  ------------------------------------  ------------------------&lt;br /&gt;  homer                           yes&lt;br /&gt;  bart                           yes&lt;br /&gt;Result: Liveness check passed for "CSS daemon".&lt;br /&gt;&lt;br /&gt;Checking daemon liveness...&lt;br /&gt;&lt;br /&gt;Check: Liveness for "EVM daemon"&lt;br /&gt;  Node Name                             Running&lt;br /&gt;  ------------------------------------  ------------------------&lt;br /&gt;  homer                           yes&lt;br /&gt;  bart                           yes&lt;br /&gt;Result: Liveness check passed for "EVM daemon".&lt;br /&gt;&lt;br /&gt;Liveness of all the daemons&lt;br /&gt;  Node Name     CRS daemon                CSS daemon                EVM daemon&lt;br /&gt;  ------------  ------------------------  ------------------------  ----------&lt;br /&gt;  homer   yes                       yes                       yes&lt;br /&gt;  bart   yes                       yes                       yes&lt;br /&gt;&lt;br /&gt;Checking CRS health...&lt;br /&gt;&lt;br /&gt;Check: Health of CRS&lt;br /&gt;  Node Name                             CRS OK?&lt;br /&gt;  ------------------------------------  ------------------------&lt;br /&gt;  homer                           yes&lt;br /&gt;  bart                           yes&lt;br /&gt;Result: CRS health check passed.&lt;br /&gt;&lt;br /&gt;CRS integrity check passed.&lt;br /&gt;&lt;br /&gt;Post-check for cluster services setup was successful.&lt;br /&gt;&lt;br /&gt;bart:TEST1:/tmp/bin&gt; &lt;strong&gt;./cluvfy comp ocr  -n all -verbose&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Verifying OCR integrity&lt;br /&gt;&lt;br /&gt;Checking OCR integrity...&lt;br /&gt;&lt;br /&gt;Checking the absence of a non-clustered configuration...&lt;br /&gt;All nodes free of non-clustered, local-only configurations.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Checking the version of OCR...&lt;br /&gt;OCR of correct Version "2" exists.&lt;br /&gt;&lt;br /&gt;Checking data integrity of OCR...&lt;br /&gt;Data integrity check for OCR passed.&lt;br /&gt;&lt;br /&gt;OCR integrity check passed.&lt;br /&gt;&lt;br /&gt;Verification of OCR integrity was successful.&lt;br /&gt;&lt;br /&gt;bart:TEST1:/tmp/bin&gt; &lt;strong&gt;ocrcheck&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Status of Oracle Cluster Registry is as follows :&lt;br /&gt;         Version                  :          2&lt;br /&gt;         Total space (kbytes)     :     262144&lt;br /&gt;         Used space (kbytes)      :      16256&lt;br /&gt;         Available space (kbytes) :     245888&lt;br /&gt;&lt;br /&gt;         Cluster registry integrity check succeeded&lt;br /&gt;&lt;br /&gt;You can also compare the properties of different nodes in the cluster&lt;br /&gt;using cluvfy comp peer -n all&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-115286612185170084?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/115286612185170084/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=115286612185170084&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/115286612185170084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/115286612185170084'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2006/07/ocr-backups.html' title='OCR backups'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-114865124827557592</id><published>2006-05-26T06:34:00.000-07:00</published><updated>2006-05-26T06:48:18.483-07:00</updated><title type='text'>How to check the category of a Stored Outline</title><content type='html'>Stored Outlines is a feature within Oracle which helps preserve Execution Plan Stability.&lt;br /&gt;&lt;br /&gt;Unfortunately the parameter use_stored_oulines is not an initialisation parameter and hence cannot be set in the init.ora or spfile.The only way to determine if outlines are being used and their category is by using the oradebug utility.&lt;br /&gt;&lt;br /&gt;SQL&gt; oradebug setmypid&lt;br /&gt;Statement processed.&lt;br /&gt;&lt;br /&gt;SQL&gt; oradebug dumpvar sga sgauso&lt;br /&gt;qolprm sgauso_ [3C4C708, 3C4C72C) = 00000000 00000000 00000000 00000000 00000000 00000000 00000000 0&lt;br /&gt;&lt;br /&gt;The above output indicates that no outlines are being used&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system set use_stored_outlines = true;&lt;br /&gt;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; oradebug dumpvar sga sgauso&lt;br /&gt;qolprm sgauso_ [3C4C708, 3C4C72C) = 00000001 45440007 4C554146 00000054 00000000 00000000 00000000 0&lt;br /&gt;&lt;br /&gt;The above output indicates that the stored outlines are being used and the category &lt;br /&gt;is DEFAULT&lt;br /&gt;(Ascii equivalent of 44 45 46 41 55 4C 54)&lt;br /&gt;The 7 here stands for the length of the category.&lt;br /&gt;&lt;br /&gt;If you set a value at the session level you need to check the UGA&lt;br /&gt;&lt;br /&gt;SQL&gt; alter session set use_stored_outlines = false;&lt;br /&gt;&lt;br /&gt;Session altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; oradebug dumpvar uga ugauso&lt;br /&gt;qolprm ugauso_p [8EE7A90, 8EE7AB4) = 00000004 00000000 00000000 00000000 00000000 00000000 00000000 &lt;br /&gt;&lt;br /&gt;SQL&gt; alter session set use_stored_outlines = true;&lt;br /&gt;&lt;br /&gt;Session altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; oradebug dumpvar uga ugauso&lt;br /&gt;qolprm ugauso_p [8EE7A90, 8EE7AB4) = 00000004 45440007 4C554146 00000054 00000000 00000000 00000000&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-114865124827557592?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/114865124827557592/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=114865124827557592&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/114865124827557592'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/114865124827557592'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2006/05/how-to-check-category-of-stored.html' title='How to check the category of a Stored Outline'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-114844479671611218</id><published>2006-05-23T21:25:00.000-07:00</published><updated>2006-05-26T22:16:23.906-07:00</updated><title type='text'>Block Recovery using RMAN</title><content type='html'>BLOCK RECOVERY USING RMAN&lt;br /&gt;&lt;br /&gt;The purpose of this article is to simulate a block level corruption and recover from the same using RMAN.&lt;br /&gt;In this situation the datafile remains online throughout the recovery operation and hence other segments within the tablespace remain accessible.&lt;br /&gt;&lt;br /&gt;Corrupt a block&lt;br /&gt;Let us take the EMP table and find out the segment header of the same.&lt;br /&gt;SQL&gt; select header_file,header_block from dba_segments where segment_name='EMP';&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;HEADER_FILE HEADER_BLOCK&lt;br /&gt;----------- ------------&lt;br /&gt;          4        24163&lt;br /&gt;&lt;br /&gt;We now use the bbed utility to corrupt a block below the segment header which contains the actual data belonging to the EMP table.&lt;br /&gt;In the exercise below we are corrupting the block which belongs to file 4 and block 24165&lt;br /&gt;&lt;br /&gt;C:\&gt;bbed parfile=bbed.par&lt;br /&gt;Password:&lt;br /&gt;&lt;br /&gt;BBED: Release 2.0.0.0.0 - Limited Production on Sat Feb 19 16:25:09 2005&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.&lt;br /&gt;&lt;br /&gt;************* !!! For Oracle Internal Use only !!! ***************&lt;br /&gt;&lt;br /&gt;BBED&gt; set dba 4,10&lt;br /&gt;        DBA             0x0100000a (16777226 4,10)&lt;br /&gt;&lt;br /&gt;BBED&gt; copy to block 24166&lt;br /&gt;&lt;br /&gt;Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) Y&lt;br /&gt; File: E:\ORACLE\ORADATA\TENG\USERS01.DBF (4)&lt;br /&gt; Block: 24166            Offsets:    0 to  511           Dba:0x01005e66&lt;br /&gt;------------------------------------------------------------------------&lt;br /&gt; 1e820000 09000001 33280000 00000104 2fe10000 04000000 11002d00 00000000&lt;br /&gt; 00000000 00780000 00000000 00000000 00000000 00000000 00000000 00000000&lt;br /&gt; 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000&lt;br /&gt; 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000&lt;br /&gt; 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000&lt;br /&gt; 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000&lt;br /&gt; 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000&lt;br /&gt; 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000&lt;br /&gt; 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000&lt;br /&gt; 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000&lt;br /&gt; 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000&lt;br /&gt; 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000&lt;br /&gt; 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000&lt;br /&gt; 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000&lt;br /&gt; 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000&lt;br /&gt; 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000&lt;br /&gt;&lt;br /&gt; &lt;32 bytes per line&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from emp;&lt;br /&gt;select * from emp&lt;br /&gt;              *&lt;br /&gt;ERROR at line 1:&lt;br /&gt;ORA-01578: ORACLE data block corrupted (file # 4, block # 24165)&lt;br /&gt;ORA-01110: data file 4: 'E:\ORACLE\ORADATA\TENG\USERS01.DBF'&lt;br /&gt;&lt;br /&gt;Recover the block&lt;br /&gt;&lt;br /&gt;We now run a validate database command which &lt;br /&gt;- Checks datafiles for physical and logical corruption  &lt;br /&gt;- Confirms that all database files exist and are in the correct locations  &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;RMAN&gt; run {BACKUP VALIDATE DATABASE;}&lt;br /&gt;&lt;br /&gt;Starting backup at 19-FEB-05&lt;br /&gt;using target database controlfile instead of recovery catalog&lt;br /&gt;allocated channel: ORA_DISK_1&lt;br /&gt;channel ORA_DISK_1: sid=91 devtype=DISK&lt;br /&gt;channel ORA_DISK_1: starting full datafile backupset&lt;br /&gt;channel ORA_DISK_1: specifying datafile(s) in backupset&lt;br /&gt;input datafile fno=00004 name=E:\ORACLE\ORADATA\TENG\USERS01.DBF&lt;br /&gt;input datafile fno=00001 name=E:\ORACLE\ORADATA\TENG\SYSTEM01.DBF&lt;br /&gt;input datafile fno=00002 name=E:\ORACLE\ORADATA\TENG\UNDOTBS01.DBF&lt;br /&gt;input datafile fno=00003 name=E:\ORACLE\ORADATA\TENG\SYSAUX01.DBF&lt;br /&gt;channel ORA_DISK_1: backup set complete, elapsed time: 00:01:35&lt;br /&gt;channel ORA_DISK_1: starting full datafile backupset&lt;br /&gt;channel ORA_DISK_1: specifying datafile(s) in backupset&lt;br /&gt;including current controlfile in backupset&lt;br /&gt;including current SPFILE in backupset&lt;br /&gt;channel ORA_DISK_1: backup set complete, elapsed time: 00:00:11&lt;br /&gt;Finished backup at 19-FEB-05&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from V$backup_corruption;&lt;br /&gt;&lt;br /&gt;     RECID      STAMP  SET_STAMP  SET_COUNT     PIECE#      FILE#     BLOCK#     BLOCKS CORRUPTION_CHANGE# MAR CO&lt;br /&gt;---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --------------------------&lt;br /&gt;         1  550688483  550688389         46          1          4      24165          1                  0 YES CORRUPT&lt;br /&gt;&lt;br /&gt;The above output confirms that block 24165 in file 4 is indeed corrupt!&lt;br /&gt;We can recover the same using the following command.&lt;br /&gt;&lt;br /&gt;RMAN&gt; run {blockrecover datafile 4 block 24165;}&lt;br /&gt;&lt;br /&gt;Starting blockrecover at 19-FEB-05&lt;br /&gt;using channel ORA_DISK_1&lt;br /&gt;&lt;br /&gt;channel ORA_DISK_1: restoring block(s)&lt;br /&gt;channel ORA_DISK_1: specifying block(s) to restore from backup set&lt;br /&gt;restoring blocks of datafile 00004&lt;br /&gt;channel ORA_DISK_1: restored block(s) from backup piece 1&lt;br /&gt;piece handle=E:\ORACLE\FLASH_RECOVERY_AREA\TENG\BACKUPSET\2005_02_19\O1_MF_NNNDF_TAG20050219T164615_11FNO9BQ_.BKP tag=TAG20050219T164615&lt;br /&gt;channel ORA_DISK_1: block restore complete&lt;br /&gt;&lt;br /&gt;starting media recovery&lt;br /&gt;media recovery complete&lt;br /&gt;&lt;br /&gt;Finished blockrecover at 19-FEB-05&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from emp;&lt;br /&gt;&lt;br /&gt;     EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO&lt;br /&gt;---------- ---------- --------- ---------- --------- ---------- ---------- ----------&lt;br /&gt;      7369 SMITH      CLERK           7902 17-DEC-80        800                    20&lt;br /&gt;      7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30&lt;br /&gt;      7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30&lt;br /&gt;      7566 JONES      MANAGER         7839 02-APR-81       2975                    20&lt;br /&gt;      7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30&lt;br /&gt;      7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30&lt;br /&gt;      7782 CLARK      MANAGER         7839 09-JUN-81       2450                    10&lt;br /&gt;      7788 SCOTT      ANALYST         7566 19-APR-87       3000                    20&lt;br /&gt;      7839 KING       PRESIDENT            17-NOV-81       5000                    10&lt;br /&gt;      7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30&lt;br /&gt;      7876 ADAMS      CLERK           7788 23-MAY-87       1100                    20&lt;br /&gt;      7900 JAMES      CLERK           7698 03-DEC-81        950                    30&lt;br /&gt;      7902 FORD       ANALYST         7566 03-DEC-81       3000                    20&lt;br /&gt;      7934 MILLER     CLERK           7782 23-JAN-82       1300                    10&lt;br /&gt;&lt;br /&gt;14 rows selected.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-114844479671611218?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/114844479671611218/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=114844479671611218&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/114844479671611218'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/114844479671611218'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2006/05/block-recovery-using-rman.html' title='Block Recovery using RMAN'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28434899.post-114836939807722578</id><published>2006-05-23T00:27:00.000-07:00</published><updated>2006-05-27T02:41:19.183-07:00</updated><title type='text'>Migrating an Oracle database from non ASM to ASM</title><content type='html'>Migrating an Oracle database from non ASM to ASM is a piece of cake with new functionality available in 10G R2 Database Console.&lt;br /&gt;Details are available in my article on &lt;br /&gt;&lt;A HREF="http://www.oracle.com/technology/pub/notes/technote_rego.html"&gt;OTN&lt;/A&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28434899-114836939807722578?l=el-caro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://el-caro.blogspot.com/feeds/114836939807722578/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28434899&amp;postID=114836939807722578&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/114836939807722578'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28434899/posts/default/114836939807722578'/><link rel='alternate' type='text/html' href='http://el-caro.blogspot.com/2006/05/migrating-oracle-database-from-non-asm.html' title='Migrating an Oracle database from non ASM to ASM'/><author><name>Fairlie Rego</name><uri>http://www.blogger.com/profile/12472975937585205288</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://photos1.blogger.com/blogger/8049/1068/1600/Fairlie.jpg'/></author><thr:total>0</thr:total></entry></feed>
