<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
   <title>AnySQL.net English</title>
   <link rel="alternate" type="text/html" href="http://www.anysql.net/en/" />
   <link rel="self" type="application/atom+xml" href="http://www.anysql.net/en/atom.xml" />
   <id>tag:www.anysql.net,2008:/en/2</id>
   <updated>2007-08-12T12:16:22Z</updated>
   <subtitle>Personal software, life, research and professional Oracle recovery service </subtitle>
   <generator uri="http://www.sixapart.com/movabletype/">Movable Type 3.36</generator>

<entry>
   <title>Hint USE_CONCAT does not work sometime on 10g database </title>
   <link rel="alternate" type="text/html" href="http://www.anysql.net/en/oracle/use_concat_not_working.html" />
   <id>tag:www.anysql.net,2007:/en//2.643</id>
   
   <published>2007-08-12T12:14:40Z</published>
   <updated>2007-08-12T12:16:22Z</updated>
   
   <summary><![CDATA[&nbsp; &nbsp; I have introduced a fast way to access X$KSLEI kernel table. But after lots of test on different versions of Oracle database, I found that sometime this hint does not work. I hit this problem on 10g version. For example: SQL&gt; SELECT /*+ USE_CONCAT */ * FROM X$KSLEI WHERE INDX IN (1,2); ---------------------------------------------------- | Id&nbsp;&nbsp;| Operation&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| Name&nbsp;&nbsp;&nbsp;&nbsp;| Rows&nbsp;&nbsp;| Bytes | ---------------------------------------------------- |&nbsp;&nbsp; 0 | SELECT STATEMENT |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;20 |&nbsp;&nbsp;1680 | |*&nbsp;&nbsp;1 |&nbsp;&nbsp;FIXED TABLE FULL| X$KSLEI |&nbsp;&nbsp;&nbsp;&nbsp;20 |&nbsp;&nbsp;1680 | ---------------------------------------------------- &nbsp; &nbsp; Finally I have to get it done by complex way, rewrite the SQL with UNION ALL, then Oracle have no way except the right way. SQL&gt; SELECT * FROM X$KSLEI WHERE INDX = 1 UNION ALL &nbsp;&nbsp;2&nbsp;&nbsp;SELECT * FROM X$KSLEI WHERE INDX = 2 &nbsp;&nbsp;3&nbsp;&nbsp;/ ---------------------------------------------------- | Id&nbsp;&nbsp;| Operation&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| ---------------------------------------------------- |&nbsp;&nbsp; 0 | SELECT STATEMENT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | |&nbsp;&nbsp; 1 |&nbsp;&nbsp;UNION-ALL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | |*&nbsp;&nbsp;2 |&nbsp;&nbsp; FIXED TABLE FIXED INDEX| X$KSLEI (ind:2) | |*&nbsp;&nbsp;3 |&nbsp;&nbsp; FIXED TABLE FIXED INDEX| X$KSLEI (ind:2) | ---------------------------------------------------- &nbsp; &nbsp; I do think of direct SGA access, but with well tuned SQLs, we still can get the job done well....]]></summary>
   <author>
      <name></name>
      
   </author>
         <category term="Oracle" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="450" label="Kernel" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="35" label="Oracle" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="94" label="SQL" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="394" label="Table" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="317" label="Tuning" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.anysql.net/en/">
      <![CDATA[<p>&nbsp; &nbsp; I have introduced a <a href="http://www.anysql.net/en/oracle/access_kernel_table.html">fast way</a> to access X$KSLEI kernel table. But after lots of test on different versions of Oracle database, I found that sometime this hint does not work. I hit this problem on 10g version. For example: </p>

<blockquote class="prefont">
SQL&gt; SELECT /*+ USE_CONCAT */ * FROM X$KSLEI WHERE INDX IN (1,2);<br />
<br />
----------------------------------------------------<br />
| Id&nbsp;&nbsp;| Operation&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| Name&nbsp;&nbsp;&nbsp;&nbsp;| Rows&nbsp;&nbsp;| Bytes |<br />
----------------------------------------------------<br />
|&nbsp;&nbsp; 0 | SELECT STATEMENT |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;20 |&nbsp;&nbsp;1680 |<br />
|*&nbsp;&nbsp;1 |&nbsp;&nbsp;FIXED TABLE FULL| X$KSLEI |&nbsp;&nbsp;&nbsp;&nbsp;20 |&nbsp;&nbsp;1680 |<br />
----------------------------------------------------
</blockquote>

<p>&nbsp; &nbsp; Finally I have to <strong>get it done by complex way</strong>, rewrite the SQL with UNION ALL, then Oracle have no way except the right way.</p>

<blockquote class="prefont">
SQL&gt; SELECT * FROM X$KSLEI WHERE INDX = 1 UNION ALL<br />
&nbsp;&nbsp;2&nbsp;&nbsp;SELECT * FROM X$KSLEI WHERE INDX = 2<br />
&nbsp;&nbsp;3&nbsp;&nbsp;/<br />
<br />
----------------------------------------------------<br />
| Id&nbsp;&nbsp;| Operation&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />
----------------------------------------------------<br />
|&nbsp;&nbsp; 0 | SELECT STATEMENT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br />
|&nbsp;&nbsp; 1 |&nbsp;&nbsp;UNION-ALL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br />
|*&nbsp;&nbsp;2 |&nbsp;&nbsp; FIXED TABLE FIXED INDEX| X$KSLEI (ind:2) |<br />
|*&nbsp;&nbsp;3 |&nbsp;&nbsp; FIXED TABLE FIXED INDEX| X$KSLEI (ind:2) |<br />
----------------------------------------------------
</blockquote>

<p>&nbsp; &nbsp; I do think of direct SGA access, but with well tuned SQLs, we still can get the job done well.</p>
]]>
      
   </content>
</entry>
<entry>
   <title>How to access Oracle kernel table quickly? </title>
   <link rel="alternate" type="text/html" href="http://www.anysql.net/en/oracle/access_kernel_table.html" />
   <id>tag:www.anysql.net,2007:/en//2.633</id>
   
   <published>2007-08-07T10:54:58Z</published>
   <updated>2007-08-07T10:56:15Z</updated>
   
   <summary><![CDATA[&nbsp; &nbsp; There are special indexes on Oracle kernel tables (Usually the INDX column), if your query can use it, it can run more quickly, else it can be very slow. The simplest way is to equal access. Let's choose the base table of V$SYSTEM_EVENT : X$KSLEI for example. SQL&gt; SELECT INDX, KSLESWTS,KSLESTIM FROM X$KSLEI WHERE INDX=1; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;INDX&nbsp;&nbsp; KSLESWTS&nbsp;&nbsp; KSLESTIM ---------- ---------- ---------- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 Elapsed: 00:00:00.01 &nbsp; &nbsp; Replace it with IN? It becomes slowly because index is not used. SQL&gt; SELECT INDX, KSLESWTS,KSLESTIM FROM X$KSLEI WHERE INDX IN (100,200); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;INDX&nbsp;&nbsp; KSLESWTS&nbsp;&nbsp; KSLESTIM ---------- ---------- ---------- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 200&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;57927 Elapsed: 00:00:02.11 &nbsp; &nbsp; I cannot believe it! Let's add a hint into the SQL. SQL&gt; SELECT /*+ USE_CONCAT */ INDX, KSLESWTS,KSLESTIM &nbsp;&nbsp; 2 FROM X$KSLEI WHERE INDX IN (100,200); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;INDX&nbsp;&nbsp; KSLESWTS&nbsp;&nbsp; KSLESTIM ---------- ---------- ---------- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 200&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;57927 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 Elapsed: 00:00:00.03 &nbsp; &nbsp; In one of my program I use -1 to represent a non-existent wait event, the result is very bad performance! SQL&gt; SELECT /*+ USE_CONCAT */ INDX, KSLESWTS,KSLESTIM &nbsp;&nbsp; 2 FROM X$KSLEI WHERE INDX IN (100,200,-1); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;INDX&nbsp;&nbsp; KSLESWTS&nbsp;&nbsp; KSLESTIM ---------- ---------- ---------- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 200&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;57927 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 Elapsed: 00:00:02.12 &nbsp; &nbsp; One of my friend suggest to...]]></summary>
   <author>
      <name></name>
      
   </author>
         <category term="Oracle" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="450" label="Kernel" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="35" label="Oracle" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="94" label="SQL" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="394" label="Table" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="317" label="Tuning" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.anysql.net/en/">
      <![CDATA[<p>&nbsp; &nbsp; There are special indexes on Oracle kernel tables (Usually the <strong>INDX</strong> column), if your query can use it, it can run more quickly, else it can be very slow. The simplest way is to equal access. Let's choose the base table of <strong>V$SYSTEM_EVENT</strong> : X$KSLEI for example. </p> 

<blockquote class="prefont">
SQL&gt; SELECT INDX, KSLESWTS,KSLESTIM FROM X$KSLEI WHERE INDX=1;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;INDX&nbsp;&nbsp; KSLESWTS&nbsp;&nbsp; KSLESTIM<br />
---------- ---------- ----------<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0<br />
<br />
Elapsed: 00:00:00.01
</blockquote>

<p>&nbsp; &nbsp; Replace it with <strong>IN</strong>? It becomes slowly because index is not used. </p>

<blockquote class="prefont">
SQL&gt; SELECT INDX, KSLESWTS,KSLESTIM FROM X$KSLEI WHERE INDX IN (100,200);<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;INDX&nbsp;&nbsp; KSLESWTS&nbsp;&nbsp; KSLESTIM<br />
---------- ---------- ----------<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 200&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;57927<br />
<br />
Elapsed: 00:00:02.11
</blockquote>

<p>&nbsp; &nbsp; I cannot believe it! Let's add a hint into the SQL. </p>

<blockquote class="prefont">
SQL&gt; SELECT /*+ USE_CONCAT */ INDX, KSLESWTS,KSLESTIM <br />
&nbsp;&nbsp; 2 FROM X$KSLEI WHERE INDX IN (100,200);<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;INDX&nbsp;&nbsp; KSLESWTS&nbsp;&nbsp; KSLESTIM<br />
---------- ---------- ----------<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 200&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;57927<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0<br />
<br />
Elapsed: 00:00:00.03
</blockquote>

<p>&nbsp; &nbsp; In one of my program I use -1 to represent a non-existent wait event, the result is very bad performance! </p>

<blockquote class="prefont">
SQL&gt; SELECT /*+ USE_CONCAT */ INDX, KSLESWTS,KSLESTIM <br />
&nbsp;&nbsp; 2 FROM X$KSLEI WHERE INDX IN (100,200,-1);<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;INDX&nbsp;&nbsp; KSLESWTS&nbsp;&nbsp; KSLESTIM<br />
---------- ---------- ----------<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 200&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;57927<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0<br />
<br />
Elapsed: 00:00:02.12
</blockquote>

<p>&nbsp; &nbsp; One of my friend suggest to replace -1 with a big positive number. </p>

<blockquote class="prefont">
SQL&gt; SELECT /*+ USE_CONCAT */ INDX, KSLESWTS,KSLESTIM <br />
&nbsp;&nbsp; 2 FROM X$KSLEI WHERE INDX IN (100,200,100000);<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;INDX&nbsp;&nbsp; KSLESWTS&nbsp;&nbsp; KSLESTIM<br />
---------- ---------- ----------<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 200&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;57927<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0<br />
<br />
Elapsed: 00:00:00.02
</blockquote>

<p>&nbsp; &nbsp; The kerenl table indexes are not the same as normal indexes, it's just a algorith based on hash method. </p>



]]>
      
   </content>
</entry>
<entry>
   <title>How to get the current session id in Oracle?</title>
   <link rel="alternate" type="text/html" href="http://www.anysql.net/en/dba/get_current_session_id.html" />
   <id>tag:www.anysql.net,2007:/en//2.632</id>
   
   <published>2007-08-07T10:43:27Z</published>
   <updated>2007-08-07T10:44:39Z</updated>
   
   <summary><![CDATA[&nbsp; &nbsp; Usually I get it from the first row of V$MYSTAT, this is a good way. SQL&gt; SELECT SID FROM V$MYSTAT WHERE ROWNUM =1; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SID ---------- &nbsp;&nbsp;&nbsp;&nbsp; 19949 &nbsp; &nbsp; In Oracle 10g or above, we can use a more simple way with the USERENV function SQL&gt; SELECT USERENV('SID') FROM DUAL; USERENV('SID') -------------- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 19949 &nbsp; &nbsp; Sometime I also use the following method, but in Oracle 10g, it does work but return 2 rows for you, so actually not work for you in Oracle 10g or above. We should not use it any more. SQL&gt; SELECT SID FROM V$SESSION WHERE AUDSID=USERENV('SESSIONID'); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SID ---------- &nbsp;&nbsp;&nbsp;&nbsp; 19949 &nbsp;&nbsp;&nbsp;&nbsp; 19829 &nbsp; &nbsp; Are there any other ways?....]]></summary>
   <author>
      <name></name>
      
   </author>
         <category term="DBA" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="149" label="DBA" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="35" label="Oracle" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="458" label="Session" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.anysql.net/en/">
      <![CDATA[<p>&nbsp; &nbsp; Usually I get it from the first row of <strong>V$MYSTAT</strong>, this is a good way. </p>

<blockquote class="prefont">
SQL&gt; SELECT SID FROM V$MYSTAT WHERE ROWNUM =1;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SID<br />
----------<br />
&nbsp;&nbsp;&nbsp;&nbsp; 19949
</blockquote>

<p>&nbsp; &nbsp; In Oracle 10g or above, we can use a more simple way with the <strong>USERENV</strong> function </p>

<blockquote class="prefont">
SQL&gt; SELECT USERENV('SID') FROM DUAL;<br />
<br />
USERENV('SID')<br />
--------------<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 19949
</blockquote>

<p>&nbsp; &nbsp; Sometime I also use the following method, but in Oracle 10g, it does work but return 2 rows for you, so actually not work for you in Oracle 10g or above. We should not use it any more.</p>

<blockquote class="prefont">
SQL&gt; SELECT SID FROM V$SESSION WHERE AUDSID=USERENV('SESSIONID');<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SID<br />
----------<br />
&nbsp;&nbsp;&nbsp;&nbsp; 19949<br />
&nbsp;&nbsp;&nbsp;&nbsp; 19829
</blockquote>

<p>&nbsp; &nbsp; Are there any other ways?. </p>
]]>
      
   </content>
</entry>
<entry>
   <title>I have two questions, any suggestion?</title>
   <link rel="alternate" type="text/html" href="http://www.anysql.net/en/tools/two_tool_questions.html" />
   <id>tag:www.anysql.net,2007:/en//2.627</id>
   
   <published>2007-07-28T13:47:32Z</published>
   <updated>2007-07-28T13:49:13Z</updated>
   
   <summary><![CDATA[&nbsp; &nbsp; Oracle will release 11g soon, from the white paper, we can see that Oracle made some big changes to the compress tables, it will support for OLTP system, and help you to save about 50% of the storage. Because of CPU are faster and faster, but IO are really slowly improved compare to the CPU technology. So I have to enable the compress table support for my data recovery tool -- AUL/MyDUL. This is really a big challenge for me. &nbsp; &nbsp; I spent some time to continue the oracle log format research, and now I can basically extract the SQL from the redo log file (Sample). Because Oracle 11g will support open-recovery standby database, so this research have less and less value to me to convert it to a useful disaster recovery tools. I have very less resource and cannot get it done by personal. So I decide to open source it, anybody have experience of the open source? I want somebody to join the development, or anybody have fun? &nbsp; &nbsp; Is open source good for a people who are busy in making the live....]]></summary>
   <author>
      <name></name>
      
   </author>
         <category term="Tools" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="221" label="MyDUL" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="441" label="MyLOG" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="204" label="Tools" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.anysql.net/en/">
      <![CDATA[<p>&nbsp; &nbsp; Oracle will release 11g soon, from the white paper, we can see that Oracle made some big changes to the compress tables, it will support for OLTP system, and help you to save about 50% of the storage. Because of CPU are faster and faster, but IO are really slowly improved compare to the CPU technology. So I have to enable the compress table support for my data recovery tool -- AUL/MyDUL. This is really a big challenge for me.</p>

<p>&nbsp; &nbsp; I spent some time to continue the oracle log format research, and now I can basically extract the SQL from the redo log file (<a href="http://www.anysql.net/en/tools/offline_oracle_logminer.html">Sample</a>). Because Oracle 11g will support open-recovery standby database, so this research have less and less value to me to convert it to a useful disaster recovery tools. I have very less resource and cannot get it done by personal. So I decide to open source it, anybody have experience of the open source? I want somebody to join the development, or anybody have fun?</p>

<p>&nbsp; &nbsp; Is open source good for a people who are busy in making the live.</p>]]>
      
   </content>
</entry>
<entry>
   <title>Learning from MySQL, make AnySQL more powerful.</title>
   <link rel="alternate" type="text/html" href="http://www.anysql.net/en/anysql/anysql_form_display.html" />
   <id>tag:www.anysql.net,2007:/en//2.626</id>
   
   <published>2007-07-28T13:33:13Z</published>
   <updated>2007-07-28T13:34:01Z</updated>
   
   <summary><![CDATA[&nbsp; &nbsp; After some research of MySQL, Yong Huang gave me a excellent advice to add a new feature in AnySQL, to display in the form mode other than grid mode. This feature is very useful when display few rows with lots of columns. Let's get some objects for testing. ASQL&gt; select * from tab where rownum &lt; 5; TNAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TABTYPE CLUSTERID ---------- ------- --------- BONUS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TABLE CLU_A&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CLUSTER CR_5043802 TABLE DEPT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TABLE 4 rows returned. &nbsp; &nbsp; Then we are required to display the object information from table "USER_OBJECTS", by adding one of patterns ("/g","/G","\G","\g") to the standard select statement, the row will be displayed in form mode. As following. ASQL&gt; select * from user_objects where object_name='BONUS'/g; OBJECT_NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : BONUS SUBOBJECT_NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: null OBJECT_ID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 637961 DATA_OBJECT_ID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: 637961 OBJECT_TYPE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : TABLE CREATED&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 2007-05-16 22:03:27.0 LAST_DDL_TIME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 2007-05-16 22:03:27.0 TIMESTAMP&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 2007-05-16:22:03:27 STATUS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: VALID TEMPORARY&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : N GENERATED&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : N SECONDARY&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : N 1 rows returned. &nbsp; &nbsp; Download patch if you want to enjoy it!...]]></summary>
   <author>
      <name></name>
      
   </author>
         <category term="AnySQL" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="87" label="AnySQL" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="421" label="MySQL" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.anysql.net/en/">
      <![CDATA[<p>&nbsp; &nbsp; After some research of MySQL, Yong Huang gave me a excellent advice to add a new feature in AnySQL, to display in the form mode other than grid mode. This feature is very useful when display few rows with lots of columns. Let's get some objects for testing. </p>

<blockquote class="prefont">
ASQL&gt; select * from tab where rownum &lt; 5;<br />
<br />
TNAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TABTYPE CLUSTERID<br />
---------- ------- ---------<br />
BONUS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TABLE<br />
CLU_A&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CLUSTER<br />
CR_5043802 TABLE<br />
DEPT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TABLE<br />
<br />
4 rows returned.
</blockquote>

<p>&nbsp; &nbsp; Then we are required to display the object information from table "USER_OBJECTS", by adding one of patterns ("/g","/G","\G","\g") to the standard select statement, the row will be displayed in form mode. As following. </p>

<blockquote class="prefont">
ASQL&gt; select * from user_objects where object_name='BONUS'/g;<br />
<br />
OBJECT_NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : BONUS<br />
SUBOBJECT_NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: null<br />
OBJECT_ID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 637961<br />
DATA_OBJECT_ID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: 637961<br />
OBJECT_TYPE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : TABLE<br />
CREATED&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 2007-05-16 22:03:27.0<br />
LAST_DDL_TIME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 2007-05-16 22:03:27.0<br />
TIMESTAMP&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 2007-05-16:22:03:27<br />
STATUS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: VALID<br />
TEMPORARY&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : N<br />
GENERATED&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : N<br />
SECONDARY&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : N<br />
<br />
1 rows returned.
</blockquote>

<p>&nbsp; &nbsp; Download <a href="http://www.anysql.net/software/oasql.jar">patch</a> if you want to enjoy it!</p>]]>
      
   </content>
</entry>
<entry>
   <title>Delete from DBA_TABLESPACES where tablespace_name = ...</title>
   <link rel="alternate" type="text/html" href="http://www.anysql.net/en/dba/delete_dba_tablespaces.html" />
   <id>tag:www.anysql.net,2007:/en//2.608</id>
   
   <published>2007-06-28T14:59:50Z</published>
   <updated>2007-06-28T15:01:00Z</updated>
   
   <summary><![CDATA[&nbsp; &nbsp; I saw somebody execute the delete statement on DBA_TABLESPACES directly without using drop tablespace statement by mistake. Non of us hit this issue before, so it's very hard to give him an answer. Today I test it on my personal database (10g version). SQL&gt; delete from dba_tablespaces where tablespace_name='USERS'; 1 row deleted. SQL&gt; commit; Commit complete. SQL&gt; alter system checkpoint; System altered. &nbsp; &nbsp; I decide to restart the database because I am worrying about whether I can open the database. But lucky I open the database without any error, but get ORA-600 error when I try to query the table in that tablespace. SQL&gt; select * from anysql.emp; select * from anysql.emp &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * ERROR at line 1: ORA-00600: internal error code, arguments: [5119], [], [], [], [], [], [], [] &nbsp; &nbsp; I find out the deleted row with AUL software, and then load it into sys.ts$ table, and restart the database successfully. Everything is fine now, no errors when I query that table again. But of cause, you should not make this kind of mistake....]]></summary>
   <author>
      <name></name>
      
   </author>
         <category term="DBA" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="149" label="DBA" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="480" label="Delete" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="35" label="Oracle" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="223" label="Recovery" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.anysql.net/en/">
      <![CDATA[<p>&nbsp; &nbsp; I saw somebody execute the delete statement on DBA_TABLESPACES directly without using drop tablespace statement by mistake. Non of us hit this issue before, so it's very hard to give him an answer. Today I test it on my personal database (10g version). </p>

<blockquote class="prefont">
SQL&gt; delete from dba_tablespaces where tablespace_name='USERS';<br />
<br />
1 row deleted.<br />
<br />
SQL&gt; commit;<br />
<br />
Commit complete.<br />
<br />
SQL&gt; alter system checkpoint;<br />
<br />
System altered.
</blockquote>

<p>&nbsp; &nbsp; I decide to restart the database because I am worrying about whether I can open the database. But lucky I open the database without any error, but get ORA-600 error when I try to query the table in that tablespace. </p>

<blockquote class="prefont">
SQL&gt; select * from anysql.emp;<br />
select * from anysql.emp<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *<br />
ERROR at line 1:<br />
ORA-00600: internal error code, arguments: [5119], [], [], [], [], [], [], []
</blockquote>

<p>&nbsp; &nbsp; I find out the deleted row with AUL software, and then load it into sys.ts$ table, and restart the database successfully. Everything is fine now, no errors when I query that table again. But of cause, you should not make this kind of mistake.</p>
]]>
      
   </content>
</entry>
<entry>
   <title>Test Oracle 11g data file recovery with AUL utility</title>
   <link rel="alternate" type="text/html" href="http://www.anysql.net/en/aulmydul/aul_oracle_11g_reco_very.html" />
   <id>tag:www.anysql.net,2007:/en//2.606</id>
   
   <published>2007-06-20T12:25:38Z</published>
   <updated>2007-09-05T15:36:30Z</updated>
   
   <summary><![CDATA[&nbsp; &nbsp; I asked someone who have Oracle 11g beta version to send me a data file of Oracle 11g, and I got it this morning, great thanks to this unknown friend. Then I use AUL to test it, extract the zip file and create a AUL configuration file named "db.txt" as following. 1 1 users01.dbf &nbsp; &nbsp; Then run the AUL and open it, check the data file header block with ORADUMP command. "ver=0x0b100000" means the data file is from Oracle 11g, "fmt=0xa2" means the block format is the same with oracle 10g's. AUL&gt; open db.txt *&nbsp;&nbsp;ts#&nbsp;&nbsp;fno&nbsp;&nbsp;rfn ver bsize&nbsp;&nbsp;&nbsp;&nbsp; blocks filename - ---- ---- ---- --- ----- ---------- ----------------------- Y&nbsp;&nbsp;&nbsp;&nbsp;4&nbsp;&nbsp;&nbsp;&nbsp;4&nbsp;&nbsp;&nbsp;&nbsp;4 a2&nbsp;&nbsp; 8192&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;640 users01.dbf AUL&gt; oradump file 4 block 1 RDBA=0x01000001(4/1),type=0x0b,fmt=0xa2, seq=0x01, flag=0x04 DBID=0x44814ad1=1149323985, db=ORCL, ts#=4, ts=USERS, file#=4, blksiz=8192, blks=640, ver=0x0b100000, fzy=--O- &nbsp; &nbsp; There is no system information of this data file, so try the method of non-system recovery. Run the "SCAN TABLE to scan_11g.txt" command, and then find the following command lines from the generated text file. CMD:UNLOAD OBJECT 68415 CLUSTER 0 COLUMN&nbsp;&nbsp;NUMBER VARCHAR VARCHAR TO OBJD0000068415C000.txt; CMD:UNLOAD OBJECT 68417 CLUSTER 0 COLUMN&nbsp;&nbsp;NUMBER VARCHAR VARCHAR NUMBER DATE NUMBER NUMBER NUMBER TO OBJD0000068417C000.txt; CMD:UNLOAD OBJECT 68420 CLUSTER 0 COLUMN&nbsp;&nbsp;NUMBER...]]></summary>
   <author>
      <name></name>
      
   </author>
         <category term="AUL/MYDUL" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="219" label="AUL" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="106" label="DUL" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="35" label="Oracle" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="562" label="Oracle11g" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="223" label="Recovery" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.anysql.net/en/">
      <![CDATA[<p>&nbsp; &nbsp; I asked someone who have Oracle 11g beta version to send me <a href="http://www.anysql.net/software/users01_11g.zip">a data file</a> of Oracle 11g, and I got it this morning, great thanks to this unknown friend. Then I use AUL to test it, extract the zip file and create a AUL configuration file named "db.txt" as following. </p>

<blockquote class="prefont">
1 1 users01.dbf
</blockquote>

<p>&nbsp; &nbsp; Then run the AUL and open it, check the data file header block with ORADUMP command. "ver=0x0b100000" means the data file is from Oracle 11g, "fmt=0xa2" means the block format is the same with oracle 10g's.</p>

<blockquote class="prefont">
AUL&gt; open db.txt<br />
*&nbsp;&nbsp;ts#&nbsp;&nbsp;fno&nbsp;&nbsp;rfn ver bsize&nbsp;&nbsp;&nbsp;&nbsp; blocks filename<br />
- ---- ---- ---- --- ----- ---------- -----------------------<br />
Y&nbsp;&nbsp;&nbsp;&nbsp;4&nbsp;&nbsp;&nbsp;&nbsp;4&nbsp;&nbsp;&nbsp;&nbsp;4 a2&nbsp;&nbsp; 8192&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;640 users01.dbf<br />
AUL&gt; oradump file 4 block 1<br />
RDBA=0x01000001(4/1),type=0x0b,fmt=0xa2, seq=0x01, flag=0x04<br />
DBID=0x44814ad1=1149323985, db=ORCL, ts#=4, ts=USERS, file#=4, blksiz=8192, blks=640, ver=0x0b100000, fzy=--O-
</blockquote>

<p>&nbsp; &nbsp; There is no system information of this data file, so try the method of non-system recovery. Run the "SCAN TABLE to scan_11g.txt" command, and then find the following command lines from the generated text file. </p>

<blockquote class="prefont">
CMD:UNLOAD OBJECT 68415 CLUSTER 0 COLUMN&nbsp;&nbsp;NUMBER VARCHAR VARCHAR TO OBJD0000068415C000.txt; <br />
CMD:UNLOAD OBJECT 68417 CLUSTER 0 COLUMN&nbsp;&nbsp;NUMBER VARCHAR VARCHAR NUMBER DATE NUMBER NUMBER NUMBER TO OBJD0000068417C000.txt; <br />
CMD:UNLOAD OBJECT 68420 CLUSTER 0 COLUMN&nbsp;&nbsp;NUMBER NUMBER NUMBER TO OBJD0000068420C000.txt; <br />
CMD:UNLOAD OBJECT 70052 CLUSTER 0 COLUMN&nbsp;&nbsp;NUMBER VARCHAR VARCHAR NUMBER DATE NUMBER NUMBER NUMBER TO OBJD0000070052C000.txt; 
</blockquote>

<p>&nbsp; &nbsp; By carefully check, the guessed column type is completely correct, just run these command, you will see rows are recovered from Oracle 11g data file. But still need more test on Oracle 11g, then I will announce that AUL formally support Oracle 11g. </p>

]]>
      
   </content>
</entry>
<entry>
   <title>aul4b is not beta version, The &quot;B&quot; means LOB support</title>
   <link rel="alternate" type="text/html" href="http://www.anysql.net/en/aulmydul/aul4b_is_not_beta_version.html" />
   <id>tag:www.anysql.net,2007:/en//2.604</id>
   
   <published>2007-06-19T23:06:19Z</published>
   <updated>2007-06-20T00:50:19Z</updated>
   
   <summary><![CDATA[&nbsp; &nbsp; When you download the AUL binary and extract it, you may find that the execution file name on Windows is aul4b.exe, Linux is aul4b_linux, and Solaris is aul4b_solaris. However it's not a beta version, the "4b" means version 4 with LOB support. Since release 4.0.2, it's a release version after two formal recoveries of LOB data. &nbsp; &nbsp; If you see "B" is added to the suffix of the version number as following, then it's beta version. Register Code: TRBR-CCPF-F6KJ-ALTT-MNGQ AUL : AnySQL UnLoader(MyDUL) for Oracle 8/8i/9i/10g, release 4.0.1B (C) Copyright Lou Fangxin 2005-2007 (AnySQL.net), all rights reserved. AUL&gt; exit &nbsp; &nbsp; Just notice....]]></summary>
   <author>
      <name></name>
      
   </author>
         <category term="AUL/MYDUL" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="219" label="AUL" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="106" label="DUL" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="39" label="LOB" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="35" label="Oracle" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="223" label="Recovery" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.anysql.net/en/">
      <![CDATA[<p>&nbsp; &nbsp; When you download the AUL binary and extract it, you may find that the execution file name on <a href="http://www.anysql.net/software/aul4.zip">Windows</a> is aul4b.exe, <a href="http://www.anysql.net/software/aul4_linux.zip">Linux</a> is aul4b_linux, and <a href="http://www.anysql.net/software/aul4_solaris.zip">Solaris</a> is aul4b_solaris. However it's not a beta version, the "4b" means version 4 with LOB support. Since release 4.0.2, it's a release version after two formal recoveries of LOB data. </p>

<p>&nbsp; &nbsp; If you see "B" is added to the suffix of the version number as following, then it's beta version. </p>

<blockquote class="prefont">
Register Code: TRBR-CCPF-F6KJ-ALTT-MNGQ<br />
AUL : AnySQL UnLoader(MyDUL) for Oracle 8/8i/9i/10g, release 4.0.1<b>B</b><br />
<br />
(C) Copyright Lou Fangxin 2005-2007 (AnySQL.net), all rights reserved.<br />
<br />
AUL&gt; exit
</blockquote>

<p>&nbsp; &nbsp; Just notice. </p>

]]>
      
   </content>
</entry>
<entry>
   <title>The speed of LOB recovery with AUL utility, fast or slow?</title>
   <link rel="alternate" type="text/html" href="http://www.anysql.net/en/aulmydul/aul_lob_recover_speed.html" />
   <id>tag:www.anysql.net,2007:/en//2.602</id>
   
   <published>2007-06-19T13:06:29Z</published>
   <updated>2007-06-19T13:21:03Z</updated>
   
   <summary><![CDATA[&nbsp; &nbsp; Some one used AUL utility to recover millions of LOB values, and told me the recovery was very slow, about 10MB generated per minute. I don't think so, and I want to tell him it's impossible slow. They may choose the wrong method to estimate the recovery speed. There are two storage modes of the LOB values. First mode is inline storage, store the LOB value with other columns value, the second mode is file storage, store each LOB value in a distinct file. &nbsp; &nbsp; Inline is the default method (SET LOB_STORAGE 0), so all the LOB value is stored in one file, the file increase should be very fast. When I try to unload the SYS.SOURCE$ table, the speed is usually 6-8MB per second on my notebook. So this is impossible. &nbsp; &nbsp; Under file storage mode (SET LOB_STORAGE 1), each LOB value will be stored in distinct file (LOB_xxxxxxxx_xxxx.dat), and the relative LOB column will record the LOB file name. In this mode, the file increase speed maybe slow for the text file which stores the table data, and 10MB per minute is reasonable. When you estimate the recovery speed, you should take the LOB...]]></summary>
   <author>
      <name></name>
      
   </author>
         <category term="AUL/MYDUL" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="219" label="AUL" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="106" label="DUL" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="39" label="LOB" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="35" label="Oracle" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="223" label="Recovery" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.anysql.net/en/">
      <![CDATA[<p>&nbsp; &nbsp; Some one used AUL utility to recover millions of LOB values, and told me the recovery was very slow, about 10MB generated per minute. I don't think so, and I want to tell him it's impossible slow. They may choose the wrong method to estimate the recovery speed. There are two storage modes of the LOB values. First mode is inline storage, store the LOB value with other columns value, the second mode is file storage, store each LOB value in a distinct file. </p>

<p>&nbsp; &nbsp; Inline is the default method (SET LOB_STORAGE 0), so all the LOB value is stored in one file, the file increase should be very fast. When I try to unload the SYS.SOURCE$ table, the speed is usually 6-8MB per second on my notebook. So this is impossible. </p>

<p>&nbsp; &nbsp; Under file storage mode (SET LOB_STORAGE 1), each LOB value will be stored in distinct file (LOB_xxxxxxxx_xxxx.dat), and the relative LOB column will record the LOB file name. In this mode, the file increase speed maybe slow for the text file which stores the table data, and 10MB per minute is reasonable. When you estimate the recovery speed, you should take the LOB files into account. Or you just count the rows of the text file contains the table data (<a href="http://www.anysql.net/en/aulmydul/aul4_blob_demo.html">BLOB Recovery Example</a>). 

<p>&nbsp; &nbsp; If AUL give you such a bad impression, it's really unlucky, for me not a big issue, but for you, it's critical because you are not choosing the right recovery methods, and spend a lot of time in doing nothing. On a Linux platform based Intel x86 CPUs, it will run very fast.</p>

]]>
      
   </content>
</entry>
<entry>
   <title>How much files can be stored in one directory?</title>
   <link rel="alternate" type="text/html" href="http://www.anysql.net/en/aulmydul/aul_max_lob_dirs.html" />
   <id>tag:www.anysql.net,2007:/en//2.601</id>
   
   <published>2007-06-19T13:04:16Z</published>
   <updated>2007-06-19T13:05:34Z</updated>
   
   <summary><![CDATA[&nbsp; &nbsp; How many files can be stored in on directory? I don't know the answer. But when one directory have a lot of files, it will be very hard to operate, and may slow down the file access speed. &nbsp; &nbsp; I performed two times of LOB recovery, all recovered in TXT mode. At this mode, each LOB values is stored as a single file in the directory where you run the AUL binary. For this two times, there are no so many LOB rows, the first time has about 12000 LOB values, the second time has about 15000 LOB values, so there is no problem for all of them are stored in one directory. &nbsp; &nbsp; But how about there are millions of LOB values? I add a new option to AUL to distribute the LOB files among different subdirectories. The option name is "MAXLOBDIR" with default value 500 (The maximum value you can give is 2000). Then the LOB files will be stored in different directories, which can support millions of LOB values recovery, the subdirectory name will look like "LOBxxxx" (xxxx is four digit). For example : AUL&gt; set MAXLOBDIR 1000 &nbsp;&nbsp;Current MAXLOBDIR is : 1000...]]></summary>
   <author>
      <name></name>
      
   </author>
         <category term="AUL/MYDUL" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="219" label="AUL" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="106" label="DUL" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="39" label="LOB" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="35" label="Oracle" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="223" label="Recovery" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.anysql.net/en/">
      <![CDATA[<p>&nbsp; &nbsp; How many files can be stored in on directory? I don't know the answer. But when one directory have a lot of files, it will be very hard to operate, and may slow down the file access speed. </p>

<p>&nbsp; &nbsp; I performed two times of LOB recovery, all recovered in TXT mode. At this mode, each LOB values is stored as a single file in the directory where you run the AUL binary. For this two times, there are no so many LOB rows, the first time has about 12000 LOB values, the second time has about 15000 LOB values, so there is no problem for all of them are stored in one directory. </p>

<p>&nbsp; &nbsp; But how about there are millions of LOB values? I add a new option to AUL to distribute the LOB files among different subdirectories. The option name is "MAXLOBDIR" with default value 500 (The maximum value you can give is 2000). Then the LOB files will be stored in different directories, which can support millions of LOB values recovery, the subdirectory name will look like "LOBxxxx" (xxxx is four digit). For example :</p>

<blockquote class="prefont">
AUL&gt; set MAXLOBDIR 1000<br />
&nbsp;&nbsp;Current MAXLOBDIR is : 1000<br />
AUL&gt;
</blockquote> 

<p>&nbsp; &nbsp; Now perform the LOB recovery, and check the current directory. </p>

<blockquote class="prefont">
C:\MYDUL\LOBREC&gt;ls<br />
AULCOL.TXT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LOB0245&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOB0394<br />
AULOBJ.TXT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LOB0246&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOB0395<br />
AULTAB.TXT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LOB0247&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOB0396<br />
AULUSR.TXT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LOB0248&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOB0397<br />
LOB0212&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOB0377&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOB0398<br />
LOB0213&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOB0378&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOB0399<br />
LOB0214&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOB0379&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOB0400<br />
LOB0215&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOB0380&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOB0402<br />
LOB0216&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOB0381&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOB0403<br />
LOB0233&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOB0382&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOB0404<br />
LOB0234&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOB0383&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOB0405<br />
LOB0235&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOB0384&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOB0406<br />
LOB0236&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOB0386&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOB0407<br />
LOB0237&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOB0387&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOB0408<br />
LOB0238&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOB0388&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOB0413<br />
LOB0239&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOB0389&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; T_LOBTEST_sqlldr.ctl<br />
LOB0240&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOB0390&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; T_LOBTEST_syntax.sql<br />
LOB0242&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOB0391&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; aul4b.exe<br />
LOB0243&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOB0392&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lobtest.txt<br />
LOB0244&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOB0393&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t_lobtest.txt
</blockquote>

<p>&nbsp; &nbsp; I unload about 5000 LOB values in the example, it looks much better than store all of them in one directory.</p>


]]>
      
   </content>
</entry>
<entry>
   <title>Don&apos;t abuse the resetlogs option when open database</title>
   <link rel="alternate" type="text/html" href="http://www.anysql.net/en/dba/dont_abuse_open_resetlogs.html" />
   <id>tag:www.anysql.net,2007:/en//2.598</id>
   
   <published>2007-06-14T13:20:40Z</published>
   <updated>2007-06-14T13:22:52Z</updated>
   
   <summary><![CDATA[&nbsp; &nbsp; Someone required a database recovery after a sudden server crash due to the CPU fans. He asked to use AUL software to recovery the table structure, procedure &amp; package source code etc. AUL is not good at recovering them, it's good at recover the data. And a server crash should not cause such a big problem usually, you should be able to open it in normal way in most cases, even the database is running in noarchivelog mode. &nbsp; &nbsp; Let me tell you the correct steps you should take : 1, Mount the database. If you lost the control file, recreate it. 2, Get the active online log file and current online log file. 3, Try to open the database with "alter database open" command. 4, If failed to open the database, then issue the "recover database" command, input the absolute path of the active online log file, then current online log file when prompted for the archive log file. &nbsp; &nbsp; Usually you should be able to open the database after a server crash. Don't issue the "ALTER DATABASE OPEN RESETLOGS" first, always backup all the files before you open it with resetlogs option, so when...]]></summary>
   <author>
      <name></name>
      
   </author>
         <category term="DBA" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="521" label="Crash" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="35" label="Oracle" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="223" label="Recovery" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="523" label="Resetlogs" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.anysql.net/en/">
      <![CDATA[<p>&nbsp; &nbsp; Someone required a database recovery after a sudden server crash due to the CPU fans. He asked to use AUL software to recovery the table structure, procedure &amp; package source code etc. AUL is not good at recovering them, it's good at recover the data. And a server crash should not cause such a big problem usually, you should be able to open it in normal way in most cases, even the database is running in noarchivelog mode. </p>

<p>&nbsp; &nbsp; Let me tell you the correct steps you should take : </p>

<blockquote>
<div>1, Mount the database. If you lost the control file, recreate it.</div>
<div>2, Get the active online log file and current online log file.</div>
<div>3, Try to open the database with "alter database open" command. </div>
<div>4, If failed to open the database, then issue the "recover database" command, input the absolute path of the active online log file, then current online log file when prompted for the archive log file.</div>
</blockquote>

<p>&nbsp; &nbsp; Usually you should be able to open the database after a server crash. Don't issue the "ALTER DATABASE OPEN RESETLOGS" first, always backup all the files before you open it with resetlogs option, so when anything wrong, you can restore to the original state. </p>

<p>&nbsp; &nbsp; For today's case, the DBA try to open the database with resetlogs option first without backup, so I have use some hidden parameters to skip the consistent check, and offline some rollback segments to skip the transaction recovery. The problem is he have to create a new database and export the data from old database, and import them to the new database. </p>

<p>&nbsp; &nbsp; The data volume is 210GB, is it easy and quick to perform export and import? </p>]]>
      
   </content>
</entry>
<entry>
   <title>Create a SQL file to create the table for faster recovery</title>
   <link rel="alternate" type="text/html" href="http://www.anysql.net/en/aulmydul/aul_create_table_sql.html" />
   <id>tag:www.anysql.net,2007:/en//2.597</id>
   
   <published>2007-06-14T08:21:45Z</published>
   <updated>2007-06-14T08:22:52Z</updated>
   
   <summary><![CDATA[&nbsp; &nbsp; When we cannot open the database for access, we can try AUL software. With system available we can use the DMP format for recovery, however TXT format is more robust according to the previous experience. And sometime DBA cannot find out the script to recreate the tables in new database, so generate a script to recreate the tables is useful during recovery. I made this change, when you recover database with TXT format, a new SQL file will be created. &nbsp; &nbsp; For example, describe the table structure in AUL. AUL&gt; desc anysql.emp Storage(OBJ#=10560 OBJD=10560 TS=4 FILE=4 BLOCK=627 CLUSTER=0) No. SEQ INT Column Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Type --- --- --- ----------------------------- ---------------- &nbsp;&nbsp;1&nbsp;&nbsp; 1&nbsp;&nbsp; 1 EMPNO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NUMBER(4) NOT NULL &nbsp;&nbsp;2&nbsp;&nbsp; 2&nbsp;&nbsp; 2 ENAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VARCHAR2(30) &nbsp;&nbsp;3&nbsp;&nbsp; 3&nbsp;&nbsp; 3 JOB&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VARCHAR2(9) &nbsp;&nbsp;4&nbsp;&nbsp; 4&nbsp;&nbsp; 4 MGR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NUMBER(4) &nbsp;&nbsp;5&nbsp;&nbsp; 5&nbsp;&nbsp; 5 HIREDATE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DATE &nbsp;&nbsp;6&nbsp;&nbsp; 6&nbsp;&nbsp; 6 SAL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NUMBER(7,2) &nbsp;&nbsp;7&nbsp;&nbsp; 7&nbsp;&nbsp; 7 COMM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NUMBER(7,2) &nbsp;&nbsp;8&nbsp;&nbsp; 8&nbsp;&nbsp; 8 DEPTNO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NUMBER(2) &nbsp; &nbsp; Recover the table by TXT format. AUL&gt; unload table anysql.emp to emp.txt; 2007-05-31 21:43:35 Unload OBJD=10560 FILE=4 BLOCK=627 CLUSTER=0 ... 2007-05-31 21:43:35 AUL&gt; &nbsp; &nbsp; You will find that a new SQL file (tablename_syntax.sql) will be created under the directory where you run the AUL, for example...]]></summary>
   <author>
      <name></name>
      
   </author>
         <category term="AUL/MYDUL" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="219" label="AUL" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="221" label="MyDUL" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="35" label="Oracle" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="223" label="Recovery" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.anysql.net/en/">
      <![CDATA[<p>&nbsp; &nbsp; When we cannot open the database for access, we can try AUL software. With system available we can use the DMP format for recovery, however TXT format is more robust according to the previous experience. And sometime DBA cannot find out the script to recreate the tables in new database, so generate a script to recreate the tables is useful during recovery. I made this change, when you recover database with TXT format, a new SQL file will be created. </p>

<p>&nbsp; &nbsp; For example, describe the table structure in AUL. </p>

<blockquote class="prefont">
AUL&gt; desc anysql.emp<br />
<br />
Storage(OBJ#=10560 OBJD=10560 TS=4 FILE=4 BLOCK=627 CLUSTER=0)<br />
No. SEQ INT Column Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Type<br />
--- --- --- ----------------------------- ----------------<br />
&nbsp;&nbsp;1&nbsp;&nbsp; 1&nbsp;&nbsp; 1 EMPNO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NUMBER(4) NOT NULL<br />
&nbsp;&nbsp;2&nbsp;&nbsp; 2&nbsp;&nbsp; 2 ENAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VARCHAR2(30)<br />
&nbsp;&nbsp;3&nbsp;&nbsp; 3&nbsp;&nbsp; 3 JOB&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VARCHAR2(9)<br />
&nbsp;&nbsp;4&nbsp;&nbsp; 4&nbsp;&nbsp; 4 MGR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NUMBER(4)<br />
&nbsp;&nbsp;5&nbsp;&nbsp; 5&nbsp;&nbsp; 5 HIREDATE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DATE<br />
&nbsp;&nbsp;6&nbsp;&nbsp; 6&nbsp;&nbsp; 6 SAL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NUMBER(7,2)<br />
&nbsp;&nbsp;7&nbsp;&nbsp; 7&nbsp;&nbsp; 7 COMM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NUMBER(7,2)<br />
&nbsp;&nbsp;8&nbsp;&nbsp; 8&nbsp;&nbsp; 8 DEPTNO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NUMBER(2)<br />
</blockquote>

<p>&nbsp; &nbsp; Recover the table by TXT format. </p>

<blockquote class="prefont">
AUL&gt; unload table anysql.emp to emp.txt;<br />
2007-05-31 21:43:35<br />
Unload OBJD=10560 FILE=4 BLOCK=627 CLUSTER=0 ...<br />
2007-05-31 21:43:35<br />
AUL&gt;<br />
</blockquote>

<p>&nbsp; &nbsp; You will find that a new SQL file (<i>tablename</i>_syntax.sql) will be created under the directory where you run the AUL, for example (EMP_syntax.sql) : </p>

<blockquote class="prefont">
CREATE TABLE "EMP" ( "EMPNO"  NUMBER(4) NOT NULL , "ENAME"  VARCHAR2(30)  , "JOB"  VARCHAR2(9)  , "MGR"  NUMBER(4)  , "HIREDATE"  DATE  , "SAL"  NUMBER(7,2)  , "COMM"  NUMBER(7,2)  , "DEPTNO"  NUMBER(2)  );
</blockquote>

<p>&nbsp; &nbsp; Hope this improvement can fasten the database recovery. </p>
]]>
      
   </content>
</entry>
<entry>
   <title>Filter table? Filter index? The OR where clause.</title>
   <link rel="alternate" type="text/html" href="http://www.anysql.net/en/dba/index_vs_table_filter.html" />
   <id>tag:www.anysql.net,2007:/en//2.596</id>
   
   <published>2007-06-06T11:23:57Z</published>
   <updated>2007-06-06T11:24:52Z</updated>
   
   <summary><![CDATA[&nbsp; &nbsp; I created a composite index on DEPTNO and ENAME columns for EMP table under SCOTT schema. Then run a SQL with OR in the where clause, check the execute plan: SQL&gt; SELECT /*+ first_rows no_expand */ * FROM EMP &nbsp;&nbsp; 2 WHERE deptNO=10 AND (ENAME IS NULL OR ENAME &gt; 'A'); --------------------------------------------------------------- | Id&nbsp;&nbsp;| Operation&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Name&nbsp;&nbsp;&nbsp;&nbsp;| Rows&nbsp;&nbsp;| Bytes | --------------------------------------------------------------- |&nbsp;&nbsp; 0 | SELECT STATEMENT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp; 3 |&nbsp;&nbsp; 330 | |*&nbsp;&nbsp;1 |&nbsp;&nbsp;TABLE ACCESS BY INDEX ROWID| EMP&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp; 3 |&nbsp;&nbsp; 330 | |*&nbsp;&nbsp;2 |&nbsp;&nbsp; INDEX RANGE SCAN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| IDX_EMP |&nbsp;&nbsp;&nbsp;&nbsp; 3 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | --------------------------------------------------------------- &nbsp;&nbsp; 1 - filter("ENAME" IS NULL OR "ENAME"&gt;'A') &nbsp;&nbsp; 2 - access("DEPTNO"=10) &nbsp; &nbsp; The filter operation performed on the table access. Then I rewrite the SQL with a NVL function, and check execution plan again : SQL&gt; SELECT /*+ first_rows no_expand */ * FROM EMP &nbsp;&nbsp; 2 WHERE deptNO=10 AND NVL(ENAME,'B') &gt; 'A'; --------------------------------------------------------------- | Id&nbsp;&nbsp;| Operation&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Name&nbsp;&nbsp;&nbsp;&nbsp;| Rows&nbsp;&nbsp;| Bytes | --------------------------------------------------------------- |&nbsp;&nbsp; 0 | SELECT STATEMENT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp; 3 |&nbsp;&nbsp; 330 | |&nbsp;&nbsp; 1 |&nbsp;&nbsp;TABLE ACCESS BY INDEX ROWID| EMP&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp; 3 |&nbsp;&nbsp; 330 | |*&nbsp;&nbsp;2 |&nbsp;&nbsp; INDEX RANGE SCAN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| IDX_EMP |&nbsp;&nbsp;&nbsp;&nbsp; 1 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | --------------------------------------------------------------- &nbsp;&nbsp; 2 - access("DEPTNO"=10) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; filter(NVL("ENAME",'B')&gt;'A')...]]></summary>
   <author>
      <name></name>
      
   </author>
         <category term="DBA" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="149" label="DBA" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="35" label="Oracle" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="94" label="SQL" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="317" label="Tuning" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.anysql.net/en/">
      <![CDATA[<p>&nbsp; &nbsp; I created a composite index on DEPTNO and ENAME columns for EMP table under SCOTT schema. Then run a SQL with OR in the where clause, check the execute plan: </p>

<blockquote class="prefont">
SQL&gt; SELECT /*+ first_rows no_expand */ * FROM EMP<br />
&nbsp;&nbsp; 2 WHERE deptNO=10 AND (ENAME IS NULL OR ENAME &gt; 'A');<br />
<br />
---------------------------------------------------------------<br />
| Id&nbsp;&nbsp;| Operation&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Name&nbsp;&nbsp;&nbsp;&nbsp;| Rows&nbsp;&nbsp;| Bytes |<br />
---------------------------------------------------------------<br />
|&nbsp;&nbsp; 0 | SELECT STATEMENT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp; 3 |&nbsp;&nbsp; 330 |<br />
|*&nbsp;&nbsp;1 |&nbsp;&nbsp;TABLE ACCESS BY INDEX ROWID| EMP&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp; 3 |&nbsp;&nbsp; 330 |<br />
|*&nbsp;&nbsp;2 |&nbsp;&nbsp; INDEX RANGE SCAN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| IDX_EMP |&nbsp;&nbsp;&nbsp;&nbsp; 3 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br />
---------------------------------------------------------------<br />
<br />
&nbsp;&nbsp; 1 - filter("ENAME" IS NULL OR "ENAME"&gt;'A')<br />
&nbsp;&nbsp; 2 - access("DEPTNO"=10)
</blockquote>

<p>&nbsp; &nbsp; The filter operation performed on the table access. Then I rewrite the SQL with a NVL function, and check execution plan again : </p>

<blockquote class="prefont">
SQL&gt; SELECT /*+ first_rows no_expand */ * FROM EMP <br />
&nbsp;&nbsp; 2 WHERE deptNO=10 AND NVL(ENAME,'B') &gt; 'A';<br />
<br />
---------------------------------------------------------------<br />
| Id&nbsp;&nbsp;| Operation&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Name&nbsp;&nbsp;&nbsp;&nbsp;| Rows&nbsp;&nbsp;| Bytes |<br />
---------------------------------------------------------------<br />
|&nbsp;&nbsp; 0 | SELECT STATEMENT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp; 3 |&nbsp;&nbsp; 330 |<br />
|&nbsp;&nbsp; 1 |&nbsp;&nbsp;TABLE ACCESS BY INDEX ROWID| EMP&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp; 3 |&nbsp;&nbsp; 330 |<br />
|*&nbsp;&nbsp;2 |&nbsp;&nbsp; INDEX RANGE SCAN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| IDX_EMP |&nbsp;&nbsp;&nbsp;&nbsp; 1 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br />
---------------------------------------------------------------<br />
<br />
&nbsp;&nbsp; 2 - access("DEPTNO"=10)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; filter(NVL("ENAME",'B')&gt;'A')
</blockquote>


<p>&nbsp; &nbsp; In a real case of our database, the first SQL need more than 10k consistent gets, while the second just need 150 consistent gets. </p>
]]>
      
   </content>
</entry>
<entry>
   <title>Don&apos;t use 128 for multiple block read count</title>
   <link rel="alternate" type="text/html" href="http://www.anysql.net/en/oracle/no_128_multiblock_read_count.html" />
   <id>tag:www.anysql.net,2007:/en//2.594</id>
   
   <published>2007-06-04T09:43:42Z</published>
   <updated>2007-06-04T09:46:03Z</updated>
   
   <summary><![CDATA[&nbsp; &nbsp; We have a very old database which upgraded from Oracle 7, when I was creating an index on this database, the database run out of memory. Before I started to create the index, I did check the free memory of the host, it's 8GB free memory there. &nbsp; &nbsp; I run the following statement to tuning the index creation. alter session set sort_area_size=100000000; alter session set sort_area_retained_size=100000000; alter session set db_file_multiblock_read_count=128; &nbsp; &nbsp; We found that each parallel process is allocated about 5G memory as PGA, this is abnormal. Did anyone else hit this problem before? We filed a tar, but Oracle did not give us a solution, just told us that do not specify 128 as the multiple block read count. &nbsp; &nbsp; After we change the value to 64, it works fine....]]></summary>
   <author>
      <name></name>
      
   </author>
         <category term="Oracle" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="89" label="Index" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="35" label="Oracle" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="519" label="Parallel" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="245" label="Sort" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.anysql.net/en/">
      <![CDATA[<p>&nbsp; &nbsp; We have a very old database which upgraded from Oracle 7, when I was creating an index on this database, the database run out of memory. Before I started to create the index, I did check the free memory of the host, it's 8GB free memory there. </P>

<p>&nbsp; &nbsp; I run the following statement to tuning the index creation. </p>

<blockquote class="prefont">
alter session set sort_area_size=100000000;<br />
alter session set sort_area_retained_size=100000000;<br />
alter session set db_file_multiblock_read_count=128;<br />
</blockquote>

<p>&nbsp; &nbsp; We found that each parallel process is allocated about 5G memory as PGA, this is abnormal. Did anyone else hit this problem before? We filed a tar, but Oracle did not give us a solution, just told us that do not specify 128 as the multiple block read count. </p>

<p>&nbsp; &nbsp; After we change the value to 64, it works fine. </p>]]>
      
   </content>
</entry>
<entry>
   <title>An Offline Oracle Log Miner, 8i/9i Version.</title>
   <link rel="alternate" type="text/html" href="http://www.anysql.net/en/tools/offline_oracle_logminer_9i.html" />
   <id>tag:www.anysql.net,2007:/en//2.593</id>
   
   <published>2007-06-04T05:18:40Z</published>
   <updated>2007-09-05T15:30:08Z</updated>
   
   <summary><![CDATA[&nbsp; &nbsp; After announcing the test version of offline oracle log miner for 10g, I spent a few day's free time in testing and bug fixing. Also I try to modify the code to support 8i/19 version oracle log files. Fortunately it's not so difficult thing to make the code work for 8i/9i, only few code need to be changed. Now you can download the MyLOG binary for oracle 8i/9i. &nbsp; &nbsp; No new command added, all the same as MyLOG 10g version. &nbsp; &nbsp; I also provide the binary file for RedHat (x86) and Solaris (Sparc64), for other platforms, I haven't the compile environments. But you can open log file from any platform by setting the BYTE_ORDER option. For example, I open an Solaris oracle log file on windows computer. LOG&gt; set BYTE_ORDER BIG BYTE_ORDER = BIG LOG&gt; open c:\mydul\utility\gbcust1_24112.arc DBID = 0x9d671cf9 = 2640780537 GROUP&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= 8, SEQUENCE&nbsp;&nbsp; = 24112 File Type&nbsp;&nbsp;= 2, Next Block = 16059 Start SCN&nbsp;&nbsp;= 0x031f.05c00824 = 3431775340580 Start Time = 2006-08-23 19:08:21 End SCN&nbsp;&nbsp;&nbsp;&nbsp;= 0x031f.05c00990 = 3431775340944 End Time&nbsp;&nbsp; = 2006-08-23 19:08:58 LOG&gt; &nbsp; &nbsp; Do not use this script for any data recovery, it's just for testing, and no replace of Oracle's log...]]></summary>
   <author>
      <name></name>
      
   </author>
         <category term="Tools" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="382" label="Log" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="56" label="Log Miner" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="35" label="Oracle" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="568" label="Oracle9i" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="423" label="Replication" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="94" label="SQL" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.anysql.net/en/">
      <![CDATA[<p>&nbsp; &nbsp; After announcing the test version of offline oracle log miner for 10g, I spent a few day's free time in testing and bug fixing. Also I try to modify the code to support 8i/19 version oracle log files. Fortunately it's not so difficult thing to make the code work for 8i/9i, only few code need to be changed. Now you can download the <a href="http://www.anysql.net/software/mylog9.zip">MyLOG binary</a> for oracle 8i/9i.</p>

<p>&nbsp; &nbsp; No new command added, all the same as MyLOG 10g version. </p>

<p>&nbsp; &nbsp; I also provide the binary file for RedHat (x86) and Solaris (Sparc64), for other platforms, I haven't the compile environments. But you can open log file from any platform by setting the <b>BYTE_ORDER</b> option. For example, I open an Solaris oracle log file on windows computer. </p>

<blockquote class="prefont">
LOG&gt; set BYTE_ORDER BIG<br />
 BYTE_ORDER = BIG<br />
LOG&gt; open c:\mydul\utility\gbcust1_24112.arc<br />
 DBID = 0x9d671cf9 = 2640780537<br />
 GROUP&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= 8, SEQUENCE&nbsp;&nbsp; = 24112<br />
 File Type&nbsp;&nbsp;= 2, Next Block = 16059<br />
 Start SCN&nbsp;&nbsp;= 0x031f.05c00824 = 3431775340580<br />
 Start Time = 2006-08-23 19:08:21<br />
 End SCN&nbsp;&nbsp;&nbsp;&nbsp;= 0x031f.05c00990 = 3431775340944<br />
 End Time&nbsp;&nbsp; = 2006-08-23 19:08:58<br />
LOG&gt;
</blockquote>

<p>&nbsp; &nbsp; Do not use this script for any data recovery, it's just for testing, and no replace of Oracle's log miner work. </p>]]>
      
   </content>
</entry>

</feed>
