<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Oramoss Blog</title><link>http://www.oramoss.com/blog/</link><description>The rants and ramblings, technical or otherwise, of Jeff Moss, Director of Oramoss Ltd.</description><language>en</language><managingEditor>noreply@blogger.com (Jeff Moss)</managingEditor><lastBuildDate>Thu, 12 Nov 2009 10:14:46 PST</lastBuildDate><generator>Blogger http://www.blogger.com</generator><openSearch:totalResults xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">125</openSearch:totalResults><openSearch:startIndex xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">1</openSearch:startIndex><openSearch:itemsPerPage xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/OramossOracle" type="application/rss+xml" /><feedburner:browserFriendly>This is an XML content feed. It is intended to be viewed in a newsreader or syndicated to another site, subject to copyright and fair use.</feedburner:browserFriendly><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item><title>Congratulations to my mate Paul!</title><link>http://www.oramoss.com/blog/2009/07/congratulations-to-my-mate-paul.html</link><category>social</category><category>certification</category><category>dba</category><author>noreply@blogger.com (Jeff Moss)</author><pubDate>Sat, 11 Jul 2009 02:52:36 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-12193242.post-2202646387133389110</guid><description>Just a quick note to say congratulations to &lt;a href="http://www.linkedin.com/in/pauldtill"&gt;Paul Till&lt;/a&gt;, a mate of mine, at my current client, who has recently passed his OCM certification. I knew Paul was good, from having worked with him, on a DR implementation / upgrade for a large DW, but I hadn't realised how good. As certifications go, it's the daddy and the Oracle one to have.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12193242-2202646387133389110?l=www.oramoss.com%2Fblog'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>$deleted$ tablespace names bug</title><link>http://www.oramoss.com/blog/2009/07/deleted-tablespace-names-bug.html</link><category>partitioning</category><category>bugs</category><category>dba</category><author>noreply@blogger.com (Jeff Moss)</author><pubDate>Sat, 11 Jul 2009 02:45:52 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-12193242.post-754912579429321742</guid><description>This one turned out to be a an interesting bug the other day...&lt;br /&gt;&lt;br /&gt;I did a simple select from DBA_TAB_PARTITIONS and noticed that some tablespace_names were of the form "_$deleted$n$m" where n and m are numbers. Slightly worrying, but at least the data was all present and correct, when I checked. I knew the DBA team had been doing some reorganisations the previous weekend, to recover some space, so I wondered if that was connected....it was, and after opening an SR, the DBA, &lt;a href="http://www.linkedin.com/pub/phil-bridges/1/340/b4a"&gt;Phil&lt;/a&gt;, found an explanation (from Oracle Note: 604648.1) and a resolution.&lt;br /&gt;&lt;br /&gt;Reproducing the issue and the way to fix it, is simple, using this script...&lt;br /&gt;&lt;br /&gt;&lt;PRE&gt;&lt;br /&gt;DROP TABLESPACE old_tbs INCLUDING CONTENTS AND DATAFILES;&lt;br /&gt;&lt;br /&gt;CREATE TABLESPACE new_tbs &lt;br /&gt;DATAFILE 'C:\APP\ORACLE\ORADATA\T111\NEW_TBS.DBF'&lt;br /&gt;SIZE 100M&lt;br /&gt;ONLINE;&lt;br /&gt;&lt;br /&gt;CREATE TABLESPACE old_tbs &lt;br /&gt;DATAFILE 'C:\APP\ORACLE\ORADATA\T111\OLD_TBS.DBF'&lt;br /&gt;SIZE 100M&lt;br /&gt;ONLINE;&lt;br /&gt;&lt;br /&gt;SELECT ts#,name FROM sys.ts$ WHERE name LIKE '%TBS';&lt;br /&gt;&lt;br /&gt;CREATE TABLE jeff_test(col1 DATE NOT NULL&lt;br /&gt;                      ,col2 NUMBER NOT NULL&lt;br /&gt;                      ,col3 VARCHAR2(200) NOT NULL&lt;br /&gt;                      )&lt;br /&gt;TABLESPACE old_tbs&lt;br /&gt;PARTITION BY RANGE(col1)&lt;br /&gt;SUBPARTITION BY LIST(col2)&lt;br /&gt;SUBPARTITION TEMPLATE(&lt;br /&gt; SUBPARTITION "S1" VALUES(1)&lt;br /&gt;,SUBPARTITION "S2" VALUES(2)&lt;br /&gt;)&lt;br /&gt;(PARTITION p1 VALUES LESS THAN(TO_DATE('31-DEC-2009','DD-MON-YYYY'))&lt;br /&gt;,PARTITION p2 VALUES LESS THAN(TO_DATE('31-DEC-2010','DD-MON-YYYY'))&lt;br /&gt;)&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;SELECT partition_name,tablespace_name FROM dba_tab_partitions WHERE table_name='JEFF_TEST';&lt;br /&gt;SELECT subpartition_name,tablespace_name FROM dba_tab_subpartitions WHERE table_name='JEFF_TEST';&lt;br /&gt;&lt;br /&gt;ALTER TABLE jeff_test MOVE SUBPARTITION p1_s1 TABLESPACE NEW_TBS;&lt;br /&gt;ALTER TABLE jeff_test MOVE SUBPARTITION p1_s2 TABLESPACE NEW_TBS;&lt;br /&gt;ALTER TABLE jeff_test MOVE SUBPARTITION p2_s1 TABLESPACE NEW_TBS;&lt;br /&gt;ALTER TABLE jeff_test MOVE SUBPARTITION p2_s2 TABLESPACE NEW_TBS;&lt;br /&gt;&lt;br /&gt;DROP TABLESPACE old_tbs INCLUDING CONTENTS AND DATAFILES;&lt;br /&gt;ALTER TABLESPACE new_tbs RENAME TO old_tbs;&lt;br /&gt;&lt;br /&gt;SELECT partition_name,tablespace_name FROM dba_tab_partitions WHERE table_name='JEFF_TEST';&lt;br /&gt;SELECT subpartition_name,tablespace_name FROM dba_tab_subpartitions WHERE table_name='JEFF_TEST';&lt;br /&gt;&lt;br /&gt;ALTER TABLE jeff_test MODIFY DEFAULT ATTRIBUTES FOR PARTITION p1 TABLESPACE old_tbs;&lt;br /&gt;ALTER TABLE jeff_test MODIFY DEFAULT ATTRIBUTES FOR PARTITION p2 TABLESPACE old_tbs;&lt;br /&gt;&lt;br /&gt;SELECT partition_name,tablespace_name FROM dba_tab_partitions WHERE table_name='JEFF_TEST';&lt;br /&gt;SELECT subpartition_name,tablespace_name FROM dba_tab_subpartitions WHERE table_name='JEFF_TEST';&lt;br /&gt;&lt;/PRE&gt;&lt;br /&gt;&lt;br /&gt;Which, when run in 11.1.0.6 on Windows 2003 Server 64 bit, gives:&lt;br /&gt;&lt;br /&gt;&lt;PRE&gt;&lt;br /&gt;DROP TABLESPACE old_tbs succeeded.&lt;br /&gt;CREATE TABLESPACE succeeded.&lt;br /&gt;CREATE TABLESPACE succeeded.&lt;br /&gt;TS#                    NAME                           &lt;br /&gt;---------------------- ------------------------------ &lt;br /&gt;9                      NEW_TBS                        &lt;br /&gt;10                     OLD_TBS                        &lt;br /&gt;&lt;br /&gt;2 rows selected&lt;br /&gt;&lt;br /&gt;CREATE TABLE succeeded.&lt;br /&gt;PARTITION_NAME                 TABLESPACE_NAME                &lt;br /&gt;------------------------------ ------------------------------ &lt;br /&gt;P1                             OLD_TBS                        &lt;br /&gt;P2                             OLD_TBS                        &lt;br /&gt;&lt;br /&gt;2 rows selected&lt;br /&gt;&lt;br /&gt;SUBPARTITION_NAME              TABLESPACE_NAME                &lt;br /&gt;------------------------------ ------------------------------ &lt;br /&gt;P1_S2                          OLD_TBS                        &lt;br /&gt;P1_S1                          OLD_TBS                        &lt;br /&gt;P2_S2                          OLD_TBS                        &lt;br /&gt;P2_S1                          OLD_TBS                        &lt;br /&gt;&lt;br /&gt;4 rows selected&lt;br /&gt;&lt;br /&gt;ALTER TABLE jeff_test succeeded.&lt;br /&gt;ALTER TABLE jeff_test succeeded.&lt;br /&gt;ALTER TABLE jeff_test succeeded.&lt;br /&gt;ALTER TABLE jeff_test succeeded.&lt;br /&gt;DROP TABLESPACE old_tbs succeeded.&lt;br /&gt;ALTER TABLESPACE new_tbs succeeded.&lt;br /&gt;PARTITION_NAME                 TABLESPACE_NAME                &lt;br /&gt;------------------------------ ------------------------------ &lt;br /&gt;P1                             _$deleted$10$0                 &lt;br /&gt;P2                             _$deleted$10$0                 &lt;br /&gt;&lt;br /&gt;2 rows selected&lt;br /&gt;&lt;br /&gt;SUBPARTITION_NAME              TABLESPACE_NAME                &lt;br /&gt;------------------------------ ------------------------------ &lt;br /&gt;P1_S2                          OLD_TBS                        &lt;br /&gt;P1_S1                          OLD_TBS                        &lt;br /&gt;P2_S2                          OLD_TBS                        &lt;br /&gt;P2_S1                          OLD_TBS                        &lt;br /&gt;&lt;br /&gt;4 rows selected&lt;br /&gt;&lt;br /&gt;ALTER TABLE jeff_test succeeded.&lt;br /&gt;ALTER TABLE jeff_test succeeded.&lt;br /&gt;PARTITION_NAME                 TABLESPACE_NAME                &lt;br /&gt;------------------------------ ------------------------------ &lt;br /&gt;P1                             OLD_TBS                        &lt;br /&gt;P2                             OLD_TBS                        &lt;br /&gt;&lt;br /&gt;2 rows selected&lt;br /&gt;&lt;br /&gt;SUBPARTITION_NAME              TABLESPACE_NAME                &lt;br /&gt;------------------------------ ------------------------------ &lt;br /&gt;P1_S2                          OLD_TBS                        &lt;br /&gt;P1_S1                          OLD_TBS                        &lt;br /&gt;P2_S2                          OLD_TBS                        &lt;br /&gt;P2_S1                          OLD_TBS                        &lt;br /&gt;&lt;br /&gt;4 rows selected&lt;br /&gt;&lt;br /&gt;&lt;/PRE&gt;&lt;br /&gt;&lt;br /&gt;Notice that the $n in "_$deleted$n$m" is 10, which is the ts# of the OLD_TBS before the rename. The problem revolves around entries in TS$, when you rename tablespaces to names that have previously been used and then dropped, basically because the old entries are not removed from TS$.&lt;br /&gt;&lt;br /&gt;Related references:&lt;br /&gt;Bug Numbers:8291493, itself a duplicate of 5769963&lt;br /&gt;Note: 604648.1&lt;br /&gt;&lt;br /&gt;According to the SR and bug, it was noticed in 10.2.0.4 and is fixed in 10.2.0.5. We've reproduced it in 11.1.0.6 on various ports, (results above) and updated our SR, so I guess the fix might also find it's way into 11.1.0.7, perhaps.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12193242-754912579429321742?l=www.oramoss.com%2Fblog'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total></item><item><title>No pruning for MIN/MAX of partition key column</title><link>http://www.oramoss.com/blog/2009/06/no-pruning-for-minmax-of-partition-key.html</link><category>partitioning</category><category>tuning</category><category>bugs</category><category>code</category><category>cbo</category><category>DW</category><category>dba</category><author>noreply@blogger.com (Jeff Moss)</author><pubDate>Fri, 26 Jun 2009 03:23:20 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-12193242.post-1993759673225681513</guid><description>Recently, I wanted to work out the maximum value of a column on a partitioned table. The column I wanted the maximum value for, happened to be the (single and only) partition key column. The table in question was range partitioned on this single key column, into monthly partitions for 2009, with data in all the partitions behind the current date, i.e. January through mid June were populated. There were no indexes on the table.&lt;br /&gt;&lt;br /&gt;NOTE - I tried this on 10.2.04 (AIX) and 11.1.0 (Fedora 11) - the example below is from 11.1.0.&lt;br /&gt;&lt;br /&gt;I'll recreate the scenario here:&lt;br /&gt;&lt;br /&gt;&lt;PRE&gt;&lt;br /&gt;CREATE TABLESPACE tsp1&lt;br /&gt;datafile '/u01/app/oracle/oradata/T111/tsp1.dbf' size 100M &lt;br /&gt;autoextend off extent management local  uniform size 1m segment space management auto online&lt;br /&gt;/&lt;br /&gt;CREATE TABLESPACE tsp2&lt;br /&gt;datafile '/u01/app/oracle/oradata/T111/tsp2.dbf' size 100M &lt;br /&gt;autoextend off extent management local  uniform size 1m segment space management auto online&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;DROP TABLE test PURGE&lt;br /&gt;/&lt;br /&gt;CREATE TABLE test(col_date_part_key DATE            NOT NULL&lt;br /&gt;                 ,col2              VARCHAR2(2000)  NOT NULL&lt;br /&gt;                 )&lt;br /&gt;PARTITION BY RANGE(col_date_part_key)&lt;br /&gt;(PARTITION month_01 VALUES LESS THAN (TO_DATE('01-FEB-2009','DD-MON-YYYY')) TABLESPACE tsp1&lt;br /&gt;,PARTITION month_02 VALUES LESS THAN (TO_DATE('01-MAR-2009','DD-MON-YYYY')) TABLESPACE tsp2&lt;br /&gt;,PARTITION month_03 VALUES LESS THAN (TO_DATE('01-APR-2009','DD-MON-YYYY')) TABLESPACE tsp2&lt;br /&gt;,PARTITION month_04 VALUES LESS THAN (TO_DATE('01-MAY-2009','DD-MON-YYYY')) TABLESPACE tsp2&lt;br /&gt;,PARTITION month_05 VALUES LESS THAN (TO_DATE('01-JUN-2009','DD-MON-YYYY')) TABLESPACE tsp2&lt;br /&gt;,PARTITION month_06 VALUES LESS THAN (TO_DATE('01-JUL-2009','DD-MON-YYYY')) TABLESPACE tsp2&lt;br /&gt;,PARTITION month_07 VALUES LESS THAN (TO_DATE('01-AUG-2009','DD-MON-YYYY')) TABLESPACE tsp2&lt;br /&gt;,PARTITION month_08 VALUES LESS THAN (TO_DATE('01-SEP-2009','DD-MON-YYYY')) TABLESPACE tsp2&lt;br /&gt;,PARTITION month_09 VALUES LESS THAN (TO_DATE('01-OCT-2009','DD-MON-YYYY')) TABLESPACE tsp2&lt;br /&gt;,PARTITION month_10 VALUES LESS THAN (TO_DATE('01-NOV-2009','DD-MON-YYYY')) TABLESPACE tsp2&lt;br /&gt;,PARTITION month_11 VALUES LESS THAN (TO_DATE('01-DEC-2009','DD-MON-YYYY')) TABLESPACE tsp2&lt;br /&gt;,PARTITION month_12 VALUES LESS THAN (TO_DATE('01-JAN-2010','DD-MON-YYYY')) TABLESPACE tsp2&lt;br /&gt;)&lt;br /&gt;/&lt;br /&gt;REM Insert rows, but only up to 14-JUN-2009&lt;br /&gt;INSERT INTO test(col_date_part_key,col2)&lt;br /&gt;SELECT TO_DATE('31-DEC-2008','DD-MON-YYYY') + l&lt;br /&gt;,      LPAD('X',2000,'X')&lt;br /&gt;FROM   (SELECT level l FROM dual CONNECT BY level &lt; 166)&lt;br /&gt;/&lt;br /&gt;COMMIT&lt;br /&gt;/&lt;br /&gt;SELECT COUNT(*)&lt;br /&gt;FROM   test&lt;br /&gt;/&lt;br /&gt;SELECT MIN(col_date_part_key) min_date&lt;br /&gt;,      MAX(col_date_part_key) max_date&lt;br /&gt;FROM   test&lt;br /&gt;/&lt;br /&gt;&lt;/PRE&gt;&lt;br /&gt;This runs and gives the following output:&lt;br /&gt;&lt;PRE&gt;&lt;br /&gt;DROP TABLE test PURGE                                               &lt;br /&gt;           *                                                        &lt;br /&gt;ERROR at line 1:                                                    &lt;br /&gt;ORA-00942: table or view does not exist                             &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;DROP TABLESPACE tsp1 INCLUDING CONTENTS&lt;br /&gt;*                                      &lt;br /&gt;ERROR at line 1:                       &lt;br /&gt;ORA-00959: tablespace 'TSP1' does not exist&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;DROP TABLESPACE tsp2 INCLUDING CONTENTS&lt;br /&gt;*                                      &lt;br /&gt;ERROR at line 1:&lt;br /&gt;ORA-00959: tablespace 'TSP2' does not exist&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Tablespace created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Tablespace created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Table created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;165 rows created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Commit complete.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  COUNT(*)&lt;br /&gt;----------&lt;br /&gt;       165&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;MIN_DATE  MAX_DATE&lt;br /&gt;--------- ---------&lt;br /&gt;01-JAN-09 14-JUN-09&lt;br /&gt;&lt;/PRE&gt;&lt;br /&gt;Now, lets see what the plan looks like from AUTOTRACE when we run the following query to get the maximum value of COL_DATE_PART_KEY:&lt;br /&gt;&lt;br /&gt;&lt;PRE&gt;&lt;br /&gt;SQL&gt; SET AUTOTRACE ON&lt;br /&gt;SQL&gt; SELECT MAX(col_date_part_key) min_date&lt;br /&gt;  2  FROM   test                           &lt;br /&gt;  3  /                                     &lt;br /&gt;&lt;br /&gt;MIN_DATE&lt;br /&gt;---------&lt;br /&gt;14-JUN-09&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Execution Plan&lt;br /&gt;----------------------------------------------------------&lt;br /&gt;Plan hash value: 784602781                                &lt;br /&gt;&lt;br /&gt;---------------------------------------------------------------------------------------------&lt;br /&gt;| Id  | Operation            | Name | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |&lt;br /&gt;---------------------------------------------------------------------------------------------&lt;br /&gt;|   0 | SELECT STATEMENT     |      |     1 |     9 |    99   (0)| 00:00:02 |       |       |&lt;br /&gt;|   1 |  SORT AGGREGATE      |      |     1 |     9 |            |          |       |       |&lt;br /&gt;|   2 |   PARTITION RANGE ALL|      |   132 |  1188 |    99   (0)| 00:00:02 |     1 |    12 |&lt;br /&gt;|   3 |    TABLE ACCESS FULL | TEST |   132 |  1188 |    99   (0)| 00:00:02 |     1 |    12 |&lt;br /&gt;---------------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;Note&lt;br /&gt;-----&lt;br /&gt;   - dynamic sampling used for this statement&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Statistics&lt;br /&gt;----------------------------------------------------------&lt;br /&gt;          0  recursive calls&lt;br /&gt;          0  db block gets&lt;br /&gt;        320  consistent gets&lt;br /&gt;         51  physical reads&lt;br /&gt;          0  redo size&lt;br /&gt;        527  bytes sent via SQL*Net to client&lt;br /&gt;        524  bytes received via SQL*Net from client&lt;br /&gt;          2  SQL*Net roundtrips to/from client&lt;br /&gt;          0  sorts (memory)&lt;br /&gt;          0  sorts (disk)&lt;br /&gt;          1  rows processed&lt;br /&gt;&lt;br /&gt;SQL&gt; SET AUTOTRACE OFF&lt;br /&gt;&lt;/PRE&gt;&lt;br /&gt;It shows a full scan of all twelve partitions. I figured that the the plan for such a query would show a full table scan, of all partitions for that table - because, in theory, if all but the first partition were empty, then the whole table would have to be scanned to answer the query - and Oracle wouldn't know at plan creation time, whether the data met this case, so it would have to do the full table scan to ensure the correct result. &lt;br /&gt;&lt;br /&gt;What I thought might happen though, is that in executing the query, it would be able to short circuit things, by working through the partitions in order, from latest to earliest, and finding the first, non null, value. Once it found the first, non null, value, it would know not to continue looking in the earlier partitions, since the value of COL_DATE_PART_KEY couldn't possibly be greater than the non null value already identified. &lt;br /&gt;&lt;br /&gt;It doesn't appear to have this capability, which we can check by taking one of the partitions offline and then rerunning the query, whereupon it complains that not all the data is present...&lt;br /&gt;&lt;br /&gt;&lt;PRE&gt;&lt;br /&gt;SQL&gt; ALTER TABLESPACE tsp1 OFFLINE;&lt;br /&gt;&lt;br /&gt;Tablespace altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; SET AUTOTRACE ON&lt;br /&gt;SQL&gt; SELECT MAX(col_date_part_key) min_date&lt;br /&gt;  2  FROM   test&lt;br /&gt;  3  /&lt;br /&gt;SELECT MAX(col_date_part_key) min_date&lt;br /&gt;*&lt;br /&gt;ERROR at line 1:&lt;br /&gt;ORA-00376: file 6 cannot be read at this time&lt;br /&gt;ORA-01110: data file 6: '/u01/app/oracle/oradata/T111/tsp1.dbf'&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; SET AUTOTRACE OFF&lt;br /&gt;&lt;/PRE&gt;&lt;br /&gt;&lt;br /&gt;So, even though we know we could actually answer this question accurately, Oracle can't do it as it wants to scan, unnecessarily, the whole table.&lt;br /&gt;&lt;br /&gt;I did find &lt;a href="http://kr.forums.oracle.com/forums/thread.jspa?messageID=3207394"&gt;a thread&lt;/a&gt; which somebody had asked about this on OTN, but all the responses were about workarounds, rather than explaining why this happens (bug/feature) or how it can be made to work in the way I, or the poster of that thread, think it, perhaps, should.&lt;br /&gt;&lt;br /&gt;Can anyone else shed any light on this? If it's a feature, then it seems like something that could be easily coded more efficiently by Oracle. The same issue would affect both MIN and MAX since both could be approached in the same manner.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12193242-1993759673225681513?l=www.oramoss.com%2Fblog'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">10</thr:total></item><item><title>Installing Oracle 11gR1 on a Fedora Core 10 64 bit VM</title><link>http://www.oramoss.com/blog/2009/06/installing-oracle-11gr1-on-fedora-core.html</link><category>VMware</category><category>linux</category><category>guides</category><category>errors</category><category>dba</category><author>noreply@blogger.com (Jeff Moss)</author><pubDate>Wed, 03 Jun 2009 00:40:34 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-12193242.post-2137795424219537424</guid><description>Just a note, to myself more than anything, about what extra packages are required by a 64 bit installation of Fedora Core 10, when trying to install Oracle 11gR1.&lt;br /&gt;&lt;br /&gt;The installation I undertook was on a FC10 64 bit VM running under VMWare Server 2.0 running on top of FC10 64 bit OS.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.oracle-base.com/"&gt;Tim&lt;/a&gt;, as usual, has a &lt;a href="http://www.oracle-base.com/articles/11g/OracleDB11gR1InstallationOnFedora10.php"&gt;lovely guide&lt;/a&gt; which told me almost everything I needed to know, however the guide says "If you are performing the 64-bit installation, make sure both the 32-bit and 64-bit libraries are installed." rather than explicitly stating the packages for a 64 bit install. Until I tried to install Oracle 11gR1, I didn't know what these were. The Oracle installer for 11g soon told me in the pre install checks it does, so I went about installing the following packages, in order:&lt;br /&gt;&lt;br /&gt;glibc-2.9-3.i686.rpm&lt;br /&gt;libaio-0.3.107-4.fc10.i386.rpm&lt;br /&gt;libgcc-4.3.2-7.i386.rpm&lt;br /&gt;glibc-devel-2.9-3.i386.rpm&lt;br /&gt;compat-libstdc++-33-3.2.3-64.x86_64.rpm&lt;br /&gt;compat-libstdc++-33-3.2.3-64.i386.rpm&lt;br /&gt;libstdc++-4.3.2-7.i386.rpm&lt;br /&gt;&lt;br /&gt;That got me past the pre install checks of the Oracle installer and on to a successful install.&lt;br /&gt;&lt;br /&gt;I've added the list to the comments on the guide Tim produced as well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12193242-2137795424219537424?l=www.oramoss.com%2Fblog'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Cursor keys not working in Virtual Server 2 VM</title><link>http://www.oramoss.com/blog/2009/05/cursor-keys-not-working-in-virtual.html</link><category>bugs</category><category>VMware</category><category>linux</category><category>virtualisation</category><author>noreply@blogger.com (Jeff Moss)</author><pubDate>Fri, 22 May 2009 06:12:36 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-12193242.post-6405319341196171407</guid><description>Posted as a reminder to myself about how to fix this issue...&lt;br /&gt;&lt;br /&gt;I couldn't get some of the cursor keys to work properly on my virtual machines running under VMWare Virtual Server 2 on Fedora 10 x86_64. Kept giving funny behaviour like bringing up the screen capture applet!&lt;br /&gt;&lt;br /&gt;A bit of searching the net came up with &lt;a href="http://bias9.blogspot.com/2008/10/keys-not-working-in-vmware.html"&gt;this one&lt;/a&gt;, which although not referring to Virtual Server 2 specifically, seems to work all the same...&lt;br /&gt;&lt;br /&gt;Essentially, adding the line below to the following file fixes the problem&lt;br /&gt;&lt;br /&gt;File (create it, if not already present): &lt;pre&gt;~/.vmware/config&lt;/pre&gt;&lt;br /&gt;Line: &lt;pre&gt;xkeymap.nokeycodeMap = true&lt;/pre&gt;&lt;br /&gt;My thanks to "The Monkey Jungle"!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12193242-6405319341196171407?l=www.oramoss.com%2Fblog'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Disable password ageing on Windows 2008 Server Standard</title><link>http://www.oramoss.com/blog/2009/01/disable-password-ageing-on-windows-2008.html</link><category>os</category><category>virtualisation</category><category>guides</category><author>noreply@blogger.com (Jeff Moss)</author><pubDate>Sun, 11 Jan 2009 13:05:44 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-12193242.post-6365548495840837838</guid><description>Password ageing in Windows 2008 Server Standard edition (the one I generally use) is set to automatically requre passwords to be changed after 42 days...obviously a Douglas Adams fan responsible for that bit of the codebase!&lt;br /&gt;&lt;br /&gt;NOTE - I don't have access to other version of Windows Server (2003 or 2008) so I can't speak for them, but I imagine it's the same on them too.&lt;br /&gt;&lt;br /&gt;That's annoying for home use, where I have tons of VMs for research that I use periodically, so I asked my brother &lt;a href="http://www.mosschops.org.uk/"&gt;Steve&lt;/a&gt; how to stop this happening and he gave me some simple instructions...&lt;br /&gt;&lt;br /&gt;First start the Local Security Policy editor by typing secpol.msc in the start/run box..&lt;br /&gt;&lt;br /&gt;&lt;img alt="secpol.msc" src="http://www.oramoss.com/wiki/uploads/Secpol_msc.jpg" /&gt;&lt;br /&gt;&lt;br /&gt;and then select Account Policies / Password Policy on the nagivation tree on the left. On the right hand side select Maximum Password Age and set this from the default of "42" to "0". You'll notice it now says "Password will not expire" above the value "0".&lt;br /&gt;&lt;br /&gt;&lt;img alt="Set Password Ageing off.msc" src="http://www.oramoss.com/wiki/uploads/SetMaximumPasswordAgeZero.jpg" /&gt;&lt;br /&gt;&lt;br /&gt;Seems to have done the trick.&lt;br /&gt;&lt;br /&gt;Kinda handy having a brother who's an MCSE and a VCP too. Useful when I get stuck with OS or VM stuff for my Oracle research!&lt;br /&gt;&lt;br /&gt;By the way, if anyone happens to be looking for some skilled contract resource in the Virtualisation field (VMWare, ESX Server etc...)  then Steve has just become available...please feel free to contact me, or Steve, via his &lt;a href="http://www.mosschops.org.uk/"&gt;website&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12193242-6365548495840837838?l=www.oramoss.com%2Fblog'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>VM articles on my new Wiki</title><link>http://www.oramoss.com/blog/2008/11/vm-articles-on-my-new-wiki.html</link><category>VMware</category><category>blog</category><category>guides</category><author>noreply@blogger.com (Jeff Moss)</author><pubDate>Fri, 28 Nov 2008 08:32:56 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-12193242.post-2900220466088760140</guid><description>I wanted a place to store notes that I could write up from anywhere...but weren't necessarily relevant to put in a blog, so I now have a Wiki on my website.&lt;br /&gt;&lt;br /&gt;Don't get excited, I'm not planning on hosting a full blown &lt;a href="http://www.oramoss.com/wiki/index.php/Main_Page"&gt;wiki &lt;/a&gt;for open editing - it's just for me.&lt;br /&gt;&lt;br /&gt;Amongst the things on there are some short "How to" &lt;a href="http://www.oramoss.com/wiki/index.php/Articles"&gt;articles&lt;/a&gt; relating to VMWare.&lt;br /&gt;&lt;br /&gt;I'm sure I'll have made mistakes along the way - feel free to point them out via this blog or email me and I'll sort them out. Comments welcome as well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12193242-2900220466088760140?l=www.oramoss.com%2Fblog'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>TPC-H Query 20 and optimizer_dynamic_sampling</title><link>http://www.oramoss.com/blog/2008/10/tpc-h-query-20-and-optimizerdynamicsamp.html</link><category>tuning</category><category>benchmarking</category><category>cbo</category><category>DW</category><author>noreply@blogger.com (Jeff Moss)</author><pubDate>Thu, 30 Oct 2008 16:00:16 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-12193242.post-5120390908752963865</guid><description>I was working with Jason Garforth today on creating a TPC-H benchmark script which we can run on our warehouse to initially get a baseline of performance, and then, from time to time, rerun it to ensure things are still running with a comparable performance level.&lt;br /&gt;&lt;br /&gt;This activity was on our new warehouse platform of an IBM Power 6 p570 with 8 dual core 4.7GHz processors, 128GB RAM and a 1.6GB/Sec SAN.&lt;br /&gt;&lt;br /&gt;Jason created a script to run the QGEN utility to generate the twenty two queries that make up the TPC-H benchmark and also a "run script" to then run those queries against the target schema I had created using some load scripts I &lt;a href="http://www.oramoss.com/blog/2008/07/scripts-for-loading-up-dbgen-tpc-h-data.html"&gt;talked about previously&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The whole process seemed to be running smoothly with queries running through in a matter of seconds, until query twenty went off the scale and started taking ages. Excluding the 20th query, everything else went through in about three to four minutes, but query twenty was going on for hours, with no sign of completing.&lt;br /&gt;&lt;br /&gt;We grabbed the actual execution plan and noticed that all the tables involved had no stats gathered. In such circumstances, Oracle (10.2.0.4 in this instance) uses dynamic sampling to take a quick sample of the table in order to come up with an optimal plan for each query executed.&lt;br /&gt;&lt;br /&gt;The database was running with the default value of 2 for optimizer_dynamic_sampling.&lt;br /&gt;&lt;br /&gt;After reading the &lt;a href="http://www.tpc.org/tpch/spec/tpch2.8.0.pdf"&gt;TPC-H specification&lt;/a&gt;, it doesn't say that stats should or should not be gathered, but obviously in gathering them, there would be a cost to doing so and, depending on the method of gathering and the volume of the database, the cost could be considerable. It would be interesting to hear from someone who actually runs audited TPC-H benchmarks to know whether they gather table stats or whether they use dynamic sampling...&lt;br /&gt;&lt;br /&gt;We decided we would gather the stats, just to see if the plan changed and the query executed any faster...it did, on both counts, with the query finishing very quickly, inline with the other twenty one queries in the suite.&lt;br /&gt;&lt;br /&gt;So, our options then appeared to include, amongst other things:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Gather the table stats. We'd proved this worked.&lt;/li&gt;&lt;li&gt;Change the optimizer_dynamic_sampling level to a higher value and see if it made a difference. &lt;/li&gt;&lt;li&gt;Manually, work out why the plan for the query was wrong, by analysis of the individual plan steps in further detail and then use hints or profiles to force the optimizer to "do the right thing".&lt;/li&gt;&lt;/ol&gt;We decided to read a Full Disclosure report of a TPC-H benchmark for a similar system to see what they did. The FDR included a full listing of the init.ora of the database in that test. The listing showed that the system in question had set optimizer_dyamic_sampling to 3 instead of the default 2...we decided to try that approach and it worked perfectly.&lt;br /&gt;&lt;br /&gt;In the end, given we're not producing actual audited benchmarks then we're free to wait for the gathering of optimizer stats, so we'll go with that method, but it was interesting to see that option 2 above worked as well and illustrates the point that there is a lot of useful information to be gleaned from reading the FDRs of audited benchmarks - whilst, of course, being careful to read them with a pinch of salt, since they are not trying to run &lt;em&gt;your system&lt;/em&gt;.&lt;br /&gt;&lt;br /&gt;Another thing of interest was that in order to get the DBGEN utility to work on AIX 6.1 using the gcc compiler, we had to set an environment variable as follows otherwise we got an error when running DBGEN (also applies to QGEN too):&lt;br /&gt;&lt;br /&gt;Set this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;export &lt;a href="mailto:LDR_CNTRL=MAXDATA=0x80000000@LARGE_PAGE_DATA=Y"&gt;LDR_CNTRL=MAXDATA=0x80000000@LARGE_PAGE_DATA=Y&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;otherwise you may get this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;exec(): 0509-036 Cannot load program dbgen because of the following errors:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;"&gt;        0509-026 System error: There is not enough memory available now.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12193242-5120390908752963865?l=www.oramoss.com%2Fblog'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></item><item><title>Fedora 9 on Hyper V on Windows 2008 Server x64 - Firefox IPv6 DNS issue</title><link>http://www.oramoss.com/blog/2008/08/fedora-9-on-hyper-v-on-windows-2008.html</link><category>virtualisation</category><author>noreply@blogger.com (Jeff Moss)</author><pubDate>Sat, 30 Aug 2008 15:49:56 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-12193242.post-3972011342441527953</guid><description>I've been playing with &lt;a href="http://www.microsoft.com/windowsserver2008/en/us/hyperv-faq.aspx"&gt;Hyper V&lt;/a&gt; this week and came across an issue with Firefox, whereby I thought that the networking setup for &lt;a href="http://fedoraproject.org/"&gt;Fedora 9&lt;/a&gt; on a Hyper V virtual machine wasn't working.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The environment is Windows 2008 Server on x64 with the RTM release of Hyper V. I then created a VM and installed Fedora 9 x64 from a DVD ISO - it took a while as I started with a multiple CPU, standard network adapter approach and it kept crashing during the install; when I changed to single CPU and "Legacy" network adapter it installed cleanly - given that Fedora isn't a "supported" Hyper V OS I can't really complain.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The problem I then came to was that it appeared that DNS wasn't working, i.e. in Firefox, if I stuck in a URL, it came back with an error rather than showing the page. I then proceeded to go off on a wild goose chase checking all the Fedora networking setup and reading about Hyper V and it's "&lt;a href="http://blogs.msdn.com/tvoellm/archive/2008/01/02/hyper-v-integration-components-and-enlightenments.aspx"&gt;synthetic&lt;/a&gt;" network adapter approach, but still couldn't solve it. Everything seemed to be installed and configured exactly as everybody who had written about it had said...so it should be working right?&lt;br /&gt;&lt;br /&gt;It was...but the problem is that Firefox was trying to resolve the name of the URL using IPv6 rather than IPv4...and my network was configured without an IPv6 DNS - I don't need IPv6 and I'm perfectly happy with IPv4 so that's what I use. I only discovered this by chance as I wondered whether it might be a Firefox issue (everything else ruled out kinda thinking), so I used the Konqueror web browser to see if it had the same issue and hey presto it was working fine whilst Firefox wasn't.&lt;br /&gt;&lt;br /&gt;How to fix Firefox? Well, basically as indicated in &lt;a href="http://en.opensuse.org/Disable_IPv6_for_Firefox"&gt;this post&lt;/a&gt; on the OpenSUSE website - essentially, you go to the URL "about:config" in Firefox, filter for "network.disable.IPv6" and set it to TRUE instead of FALSE (double click it to change the value). Then it all works fine.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12193242-3972011342441527953?l=www.oramoss.com%2Fblog'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>OS trials and tribulations</title><link>http://www.oramoss.com/blog/2008/08/os-trials-and-tribulations.html</link><category>os</category><category>virtualisation</category><author>noreply@blogger.com (Jeff Moss)</author><pubDate>Fri, 22 Aug 2008 15:47:44 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-12193242.post-3136732369290767195</guid><description>I got tired of my apps not working on 64 bit Vista so I figured I'd bin the dual boot Vista 64 and Enterprise Linux 5 and just go Linux. EL5 wasn't up to date (kernel wise) and I was unable to easily bring it up to date, without paying Oracle a licence fee, so I figured I'd just used Fedora 9 instead.&lt;br /&gt;&lt;br /&gt;Then I saw &lt;a href="http://www.oracle-base.com/blog/2008/08/21/vmware-esx-and-oracle-rac/"&gt;this&lt;/a&gt; from &lt;a href="http://www.oracle-base.com/blog/"&gt;Tim &lt;/a&gt;on ESX and I figured that sounded like a good idea...so I spent some time trying to get that working...only to realise that ESX needs SCSI for the disks (or one of the very specific SATA interfaces - that I don't have)...so that idea also ground to a halt. ESXi, being more restrictive than ESX on hardware compatability, didn't even install, whilst ESX managed to install after a bit of effort, but I couldn't create any VMFS filesystems - that's when I RTFM'd that it was not going to work without SCSI - even after much surfing travels.&lt;br /&gt;&lt;br /&gt;I do hope that they get ESX to work with more SATA (i.e. mine) so I can use it...seemed like a good idea for my home research requirements. Never mind, will have to manage with Fedora 9 for now.&lt;br /&gt;&lt;br /&gt;I've got Fedora 9 installed now and it was reasonably painless, except that the networking wasn't working when it booted up - no access to the internet. After a bit of surfing, I found the &lt;a href="http://www.mjmwired.net/"&gt;website of Mauriat Miranda&lt;/a&gt;, who seems to have some great stuff, including an &lt;a href="http://www.mjmwired.net/resources/mjm-fedora-f9.html"&gt;installation guide for Fedora 9&lt;/a&gt;, which covers &lt;a href="http://www.mjmwired.net/resources/mjm-fedora-f9.html#network"&gt;the fix to my networking issue&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Big thanks to Mauriat there.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12193242-3136732369290767195?l=www.oramoss.com%2Fblog'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total></item><item><title>Scripts for loading up DBGEN TPC-H data</title><link>http://www.oramoss.com/blog/2008/07/scripts-for-loading-up-dbgen-tpc-h-data.html</link><category>tuning</category><category>benchmarking</category><category>code</category><category>DW</category><category>dba</category><author>noreply@blogger.com (Jeff Moss)</author><pubDate>Wed, 30 Jul 2008 04:06:25 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-12193242.post-2189057868879702224</guid><description>If you're interested in creating a TPC-H schema for testing purposes, then the following scripts may be of use to you:&lt;br /&gt;&lt;br /&gt;Unix Scripts:&lt;br /&gt;&lt;a href="http://www.oramoss.com/wiki/index.php/Multi_load_tpch_sh"&gt;Multi Load TPCH&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.oramoss.com/wiki/index.php/Load_tpch_stream_sh"&gt;Load TPCH Stream&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;SQL*Loader Control files:&lt;br /&gt;&lt;a href="http://www.oramoss.com/wiki/index.php/Region_ctl"&gt;REGION Table&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.oramoss.com/wiki/index.php/Nation_ctl"&gt;NATION Table&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.oramoss.com/wiki/index.php/Supplier_ctl"&gt;SUPPLIER Table&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.oramoss.com/wiki/index.php/Customer_ctl"&gt;CUSTOMER Table&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.oramoss.com/wiki/index.php/Part_ctl"&gt;PART Table&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.oramoss.com/wiki/index.php/Partsupp_ctl"&gt;PARTSUPP Table&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.oramoss.com/wiki/index.php/Orders_ctl"&gt;ORDERS Table&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.oramoss.com/wiki/index.php/Lineitem_ctl"&gt;LINEITEM Table&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You may wish to read and check them before you use them - they're not exactly rocket science but they seem to do the job.&lt;br /&gt;&lt;br /&gt;I have all the files in the same directory for simplicity sake.&lt;br /&gt;&lt;br /&gt;I then use them to create a scale factor 1 target TPC-H schema using the following calls:&lt;br /&gt;&lt;br /&gt;# "l" loads the REGION and NATION tables&lt;br /&gt;./multi_load_tpch.sh 1 l "tpch/tpch@test" 1&lt;br /&gt;&lt;br /&gt;# "s" loads the SUPPLIER table&lt;br /&gt;./multi_load_tpch.sh 1 s "tpch/tpch@test" 10&lt;br /&gt;&lt;br /&gt;# "c" loads the CUSTOMER table&lt;br /&gt;./multi_load_tpch.sh 1 c "tpch/tpch@test" 10&lt;br /&gt;&lt;br /&gt;# "p" loads the PART and PARTSUPP tables&lt;br /&gt;./multi_load_tpch.sh 1 p "tpch/tpch@test" 10&lt;br /&gt;&lt;br /&gt;# "o" loads the ORDERS and LINEITEM tables&lt;br /&gt;./multi_load_tpch.sh 1 o "tpch/tpch@test" 10&lt;br /&gt;&lt;br /&gt;Obviously, you need to change the connection string to match your environment.&lt;br /&gt;&lt;br /&gt;Caveats:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Obviously, they are supplied as is - use at your own discretion and risk.&lt;/li&gt;&lt;li&gt;You need to have created the target schema tables and made sure they are empty as the SQL*Loader control files use APPEND.&lt;/li&gt;&lt;li&gt;Bear in mind that choosing too high a number of parallel streams (the last parameter in the calls) will overload your machine so try and balance it against the available system resources.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Bugs, issues or questions, please get in touch...enjoy.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12193242-2189057868879702224?l=www.oramoss.com%2Fblog'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total></item><item><title>Creating a TPC-H schema with DBGEN on HP-UX</title><link>http://www.oramoss.com/blog/2008/07/creating-tpc-h-schema-with-dbgen-on-hp.html</link><category>tuning</category><category>bugs</category><category>benchmarking</category><category>code</category><category>dba</category><author>noreply@blogger.com (Jeff Moss)</author><pubDate>Tue, 09 Sep 2008 14:25:56 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-12193242.post-5379725482117950397</guid><description>I wanted to try out this &lt;a href="http://hammerora.sourceforge.net/"&gt;HammerOra&lt;/a&gt; product from Steve Shaw, both at work and on my box at home...but after playing with it at home, I realised that it takes quite some time to build even a small (scale factor 1) &lt;a href="http://www.tpc.org/tpch/default.asp"&gt;TPC-H&lt;/a&gt; schema...I know it runs serially, but I'm still not quite sure why it's that slow (on my system that is), but Steve does say it can take a while and that you might wish to consider using the &lt;a href="http://www.tpc.org/"&gt;TPC &lt;/a&gt;utility DBGEN to generate and load the schema quicker...particularly if you use some manual parallelisation.&lt;br /&gt;&lt;br /&gt;Given that I also need to use this tool to help with some benchmarking at work, I decided to try to get DBGEN to run on a HP-UX box today and had one or two problems which I managed to sort out. The machine in question is an RP8420 running HP-UX B.11.11.&lt;br /&gt;&lt;br /&gt;DBGEN is a utility that allows you to create a series of flat files which contain the data for a TPC-H schema. You can then use SQL*Loader to load these into appropriately constructed tables in an Oracle database - any database actually...but I only care about Oracle of course ;-)&lt;br /&gt;&lt;br /&gt;The utility can be called with various parameters including making the target datasets in smaller "child" files which can be created in a manually parallelised fashion to speed the whole process up. You have to download the &lt;a href="http://www.tpc.org/tpch/default.asp"&gt;DBGEN reference data set &lt;/a&gt;from the TPC website (lower right hand side).&lt;br /&gt;&lt;br /&gt;This reference data set contains the ANSI C source code which makes the DBGEN executable (and QGEN also...but more on that another day)...unfortunately it's just the source code, so that means you need to compile it yourself...which of course leads to the first problem...that I know diddly squat about C...yeah I know, not very manly! Luckily I can &lt;span style="FONT-STYLE: italic"&gt;sometimes&lt;/span&gt; follow instructions (which come with the reference data set)...&lt;br /&gt;&lt;br /&gt;1. Copy makefile.suite to makefile&lt;br /&gt;2. Edit makefile and make the following amendments (&lt;span style="COLOR: rgb(255,0,0)"&gt;in red&lt;/span&gt;):&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;################&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;## CHANGE NAME OF ANSI COMPILER HERE&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;################&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,102,102);font-family:courier new;" &gt;CC = gcc&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;# Current values for DATABASE are: INFORMIX, DB2, TDAT (Teradata)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;# SQLSERVER, SYBASE&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;# Current values for MACHINE are: ATT, DOS, HP, IBM, ICL, MVS, &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;# SGI, SUN, U2200, VMS, LINUX, WIN32 &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;# Current values for WORKLOAD are: TPCH&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0);font-family:courier new;" &gt;DATABASE= ORACLE&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0);font-family:courier new;" &gt;MACHINE = HP&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0);font-family:courier new;" &gt;WORKLOAD = TPCH&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;That's it for the makefile.&lt;br /&gt;&lt;br /&gt;Now, as I mentioned, the ORACLE database is not a listed database variant in the DBGEN C code - it's got all the other popular RDBMS which I find quite bizarre...I'm sure there's a reason, but I can't think of one. To get around this, as per&lt;a href="http://books.google.co.uk/books?id=GjYTbJTIr54C&amp;amp;pg=PA95&amp;amp;lpg=PA95&amp;amp;dq=shaw+dyke+tpcd.h&amp;amp;source=web&amp;amp;ots=h9fuA0zW6e&amp;amp;sig=m9B8VWZmUKSamuPY9SBU9tk0BME&amp;amp;hl=en&amp;amp;sa=X&amp;amp;oi=book_result&amp;amp;resnum=1&amp;amp;ct=result"&gt; &lt;/a&gt;&lt;span lang="en-gb"&gt;&lt;a href="http://books.google.co.uk/books?id=GjYTbJTIr54C&amp;amp;pg=PA95&amp;amp;lpg=PA95&amp;amp;dq=shaw+dyke+tpcd.h&amp;amp;source=web&amp;amp;ots=h9fuA0zW6e&amp;amp;sig=m9B8VWZmUKSamuPY9SBU9tk0BME&amp;amp;hl=en&amp;amp;sa=X&amp;amp;oi=book_result&amp;amp;resnum=1&amp;amp;ct=result"&gt;Chapter 5&lt;/a&gt; in “&lt;a href="http://www.amazon.co.uk/Pro-Oracle-Database-Linux-Administration/dp/1590595246/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1216677009&amp;amp;sr=1-1"&gt;Pro Oracle Database 10g RAC on Linux&lt;/a&gt;” by Steve Shaw and &lt;a href="http://www.juliandyke.com/"&gt;Julian Dyke&lt;/a&gt;, I added a section to the tpcd.h for the ORACLE database:&lt;/span&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;#ifdef ORACLE&lt;br /&gt;#define GEN_QUERY_PLAN ""&lt;br /&gt;#define START_TRAN ""&lt;br /&gt;#define END_TRAN ""&lt;br /&gt;#define SET_OUTPUT ""&lt;br /&gt;#define SET_ROWCOUNT ""&lt;br /&gt;#define SET_DBASE ""&lt;br /&gt;#endif&lt;br /&gt;&lt;br /&gt;I thought that was it - but it still would't compile, giving the error:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;config.h:213:2: #error Support for a 64-bit datatype is required in this release&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Looking at the config.h - and bearing in mind I'm no C programmer - it struck me as odd that all bar the HP machine section, had stuff about DSS_HUGE and 64 bits...so I took a punt and copied some lines (&lt;span style="COLOR: rgb(255,0,0)"&gt;in red&lt;/span&gt;) from the IBM section into the HP one to see if it worked...and it did. The HP section now looks like this:&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p dir="ltr"  style="font-family:arial;"&gt;&lt;span style="font-family:courier new;"&gt;#ifdef HP&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;#define _INCLUDE_POSIX_SOURCE&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;#define STDLIB_HAS_GETOPT&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0);font-family:courier new;" &gt;#define DSS_HUGE long long&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0);font-family:courier new;" &gt;#define HUGE_FORMAT "%lld" &lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0);font-family:courier new;" &gt;#define HUGE_DATE_FORMAT "%02lld" &lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0);font-family:courier new;" &gt;#define RNG_A 6364136223846793005ull&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0);font-family:courier new;" &gt;#define RNG_C 1ull&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;#endif /* HP */&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;Typing make at the command prompt then compiles the code and produces the dbgen executable...which I then spent a few hours playing with to create a scale factor 1 TPC-H set of files.&lt;br /&gt;&lt;p&gt;&lt;/p&gt;My next problem was one of my own making really in that I copied the CREATE TABLE statements for the TPC-H target tables from HammerOra' TCL script for TPC-H creation, but unfortunately, the column ordering is slightly different in those DDL statements as compared to the DBGEN output files...which meant that I created the tables OK, but since I'd copied the column ordering to make the SQL*Loader control files, I got errors when I tried to load some of the files as the column order is different in one or two cases.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;I then downloaded the &lt;a href="http://www.tpc.org/tpch/spec/tpch2.7.0.pdf"&gt;TPC-H specification &lt;/a&gt;document which has, amongst other things, the data model, from which I cross checked the column ordering of the data model against the columns in the output files and then managed to rerun the data in without any further issues.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;Tomorrow I'll try running HammerOra against the target TPC-H schema and make some shell scripts to try and automate most of the process so we can build different scale factor schemae and do so in a manually parallelised fashion - scripts the &lt;a href="http://www.oracledoug.com/"&gt;amiable Scotsman &lt;/a&gt;created for his parallel testing a while back should give me a good start with that.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12193242-5379725482117950397?l=www.oramoss.com%2Fblog'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>PC for manly men?</title><link>http://www.oramoss.com/blog/2008/07/pc-for-manly-men.html</link><category>benchmarking</category><author>noreply@blogger.com (Jeff Moss)</author><pubDate>Sat, 12 Jul 2008 13:27:28 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-12193242.post-6239153582383850507</guid><description>So, after suffering a hard disk failure, I figured it was time to buy a new PC for (Oracle) research purposes and the choice seemed to boil down to:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Buy a Dell or HP high end PC from their website and pay serious money for it. &lt;/li&gt;&lt;li&gt;Pick a proper server off &lt;a href="http://cgi.ebay.ph/ws/eBayISAPI.dll?ViewItem&amp;amp;item=180258270261&amp;amp;indexURL="&gt;Ebay&lt;/a&gt; - cheaper but may have pitfalls including warranty, dodgy sellers and delivery. (it was interesting to look for &lt;a href="http://cgi.ebay.ph/Sun-Enterprise-10000-E10K-64x-Processor-64gb-ram-Server_W0QQitemZ160259103819QQihZ006QQcategoryZ1486QQrdZ1QQssPageNameZWD2VQQcmdZViewItemQQ_trksidZp1638Q2em122"&gt;E10K Sun boxes &lt;/a&gt;on there)&lt;/li&gt;&lt;li&gt;Spec a PC myself and get a box shifter to build and ship it.&lt;/li&gt;&lt;li&gt;Upgrade my current PC with a selection of new bits.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;I chose #3 and bought it from a company call &lt;a href="http://www.scan.co.uk/"&gt;Scan&lt;/a&gt;. I'm pretty happy with the result and the service I received although due to some DOA parts it took a little longer than I'd hoped...at least they had the problems to deal with instead of me!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#1 is expensive and you're sort of limited to the options they offer. I costed up something similar to what I've ended up buying and it was nearer 3,000 pounds rather than the 1800 ish that I paid.&lt;br /&gt;&lt;br /&gt;#2 is cheaper than #1 but these type of machines are &lt;a href="http://www.youtube.com/watch?v=3Vl0rb64dLw"&gt;really noisy&lt;/a&gt;, albeit solid pieces of kit and more akin to what I'd work on during my day job.&lt;br /&gt;&lt;br /&gt;#4 and #3 are similar except for who gets the grief of making all the new bits work together, and every time I try to build things myself I get grief with it (usually parts arriving DOA or incompatible with each other). Scan had to deal with a DOA motherboard and CPU amongst other things...rather them than me.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So, #3 it was...and it arrived a few days ago.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Specification is:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.scan.co.uk/Product.aspx?WebProductId=768117"&gt;Tyan S2932 Server motherboard&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.scan.co.uk/Product.aspx?WebProductId=475808"&gt;Two, dual core AMD Opteron 2218 2.6GHz processors&lt;/a&gt;&lt;/li&gt;&lt;li&gt;8Gb of RAM (4 x 2Gb DDR2 667MHz)&lt;/li&gt;&lt;li&gt;Six, &lt;a href="http://www.scan.co.uk/Product.aspx?WebProductId=723884"&gt;1 TB Samsung HD103UJ Spinpoint F1, SATA 300, 7200 rpm, 32MB Cache, 8.9 ms, NCQ drives&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.scan.co.uk/Product.aspx?WebProductId=612132"&gt;Antec P190 midi tower case&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Pictures (Click on them for bigger images) below:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.oramoss.com/images/bigbox_closed.jpg"&gt;&lt;img alt="bigbox_closed_800x600.jpg" src="http://www.oramoss.com/images/bigbox_closed_800x600.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;a href="http://www.oramoss.com/images/bigbox_open.jpg"&gt;&lt;img alt="bigbox_open_800x600.jpg" src="http://www.oramoss.com/images/bigbox_open_800x600.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Not quite an "enterprise server" and I'm sure it pales into insignificance against any of the kit &lt;a href="http://kevinclosson.wordpress.com/"&gt;Kevin&lt;/a&gt; uses, but pretty quick.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I've configured it for dual boot of Vista 64 Ultimate and Oracle Enterprise Linux 5 (using &lt;a href="http://neosmart.net/dl.php?id=1"&gt;EasyBCD&lt;/a&gt;) and I'm about to start doing some installations and benchmarking...should be fun.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I installed VirtualBox on the Vista 64 OS and it's working very nicely...well, it's set up and working...we'll find out how nicely it's working when I install Oracle and HammerOra and give it a bit of a kicking!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Who knows, I might even find time to blog about it!&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12193242-6239153582383850507?l=www.oramoss.com%2Fblog'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">5</thr:total></item><item><title>Oracle Optimized Warehouse Initiative (OWI)</title><link>http://www.oramoss.com/blog/2008/04/oracle-optimized-warehouse-initiative.html</link><category>DW</category><category>RAC</category><category>ASM</category><author>noreply@blogger.com (Jeff Moss)</author><pubDate>Tue, 15 Apr 2008 23:55:00 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-12193242.post-8997214408204395983</guid><description>I enjoyed a trip out of the office today with my manager. We went down to the Oracle Enterprise Technology Centre, in Reading, to hear about the Oracle Optimized Warehouse Initiative. It was basically a half day pitch from Oracle and Sun today, although there are other dates with different hardware vendors (IBM, HP and Dell).&lt;br /&gt;&lt;br /&gt;It was an interesting day, although I didn't really hear anything new, per se. I think the main things I took away from the session were:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The availability of a set of reference configurations providing matrices which cover various permutations of user count, storage cost focus, warehouse size and hardware vendor. &lt;/li&gt;&lt;li&gt;The possibility of using the reference configurations either minimally, to simply cross check a proposed hardware specification for a given workload, to ensure it seems appropriate, or going the whole hog and using an "out of the box" reference configuration, delivered to your office, fully configured with all software installed, in a box, ready to run in your data.&lt;/li&gt;&lt;li&gt;Oracle are pushing RAC and ASM heavily in the DW space - no surprise there.&lt;/li&gt;&lt;li&gt;&lt;a href="http://hammerora.sourceforge.net/"&gt;HammerOra&lt;/a&gt; and &lt;a href="http://www.oracle.com/technology/software/tech/orion/index.html"&gt;ORION&lt;/a&gt; are used by Oracle and the hardware vendors to assess the reference configurations...and there is nothing stopping you using them for your own benchmarking efforts&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;It was interesting to hear about the Proof Of Concept facility that Sun has, in Linlithgow, Scotland. The facility allows Sun (and an Oracle customer) to take a server off the production line and, working with the customer, test &lt;span style="font-style: italic;"&gt;their&lt;/span&gt; workload on &lt;span style="font-style: italic;"&gt;that&lt;/span&gt; machine to see if it's going to work or not. Neat, and since we're going to be using some Sun kit for a DW shortly, it sounds like an opportunity.&lt;br /&gt;&lt;br /&gt;Funniest thing of the day for me, was the last slide in the pitch given by Mike Leigh of Sun which had the title "The Power of 2" and was illustrating the benefits to customers of Oracle and Sun as a united force. I didn't really take much notice, as I was too busy smiling, as I looked at the title and it made me think of &lt;a href="http://oracledoug.com/serendipity/"&gt;Doug&lt;/a&gt; and his &lt;a href="http://oracledoug.com/px_slaves.pdf"&gt;Parallel Execution and the 'Magic of 2'&lt;/a&gt; paper (the &lt;span style="font-style: italic;"&gt;Magic of 2&lt;/span&gt; bit actually being from &lt;a href="http://www.hotsos.com/e-library/abstract.php?id=13"&gt;this paper &lt;/a&gt;by &lt;a href="http://carymillsap.blogspot.com/"&gt;Cary&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;If you're building a warehouse, or just want to get an idea of whether your hardware is appropriate for the job, it's probably worth reading up on the OWI.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12193242-8997214408204395983?l=www.oramoss.com%2Fblog'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Problem with _gby_hash_aggregation_enabled parameter</title><link>http://www.oramoss.com/blog/2008/04/problem-with-gbyhashaggregationenabled.html</link><category>tuning</category><category>bugs</category><category>dba</category><author>noreply@blogger.com (Jeff Moss)</author><pubDate>Thu, 10 Apr 2008 15:50:37 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-12193242.post-2400272171003900972</guid><description>Here's a tale about an Oracle initialisation parameter...and a lesson we should all take note of...&lt;br /&gt;&lt;br /&gt;For three days, my colleagues in the support team on one of the warehouses I'm involved in, were struggling with a piece of code which was exhausting the available temp space and after trying everything they could think of, they asked me to take a look. I must admit I was a little baffled at first because the piece of code in question had been happily running for some time now and every time I'd run it, I'd never noticed that TEMP was anywhere near being exhausted so, whilst I could tell the process had some kind of problem, I was in the dark as to exactly what that problem was.&lt;br /&gt;&lt;br /&gt;After trying to break down the large query into several smaller steps, I realised that it was an early step in the query that was exhibiting the problem of temp exhaustion - the step being a pivot of around 300 million measure rows into a pivot target table.&lt;br /&gt;&lt;br /&gt;This process runs monthly and it had run without issue on all of the previous 20 occurrences and for roughly the same, if not more rows to pivot...so it didn't appear to be the volume that was causing the problem.&lt;br /&gt;&lt;br /&gt;There had been no changes in the code itself for many months and the current version of the code had been run successfully in previous months, so it didn't appear to be a code fault.&lt;br /&gt;&lt;br /&gt;I obtained the actual execution path for the statement whilst it was running and it looked reasonable, although looking at it, triggered a thought in my mind...what if something had changed in the database configuration?&lt;br /&gt;&lt;br /&gt;Why would I get that thought from looking at the execution path?&lt;br /&gt;&lt;br /&gt;Well, a while back, we had received some advice that a line in our init.ora as follows, should be changed to set the feature to TRUE instead of FALSE, so that the feature became active:&lt;br /&gt;&lt;br /&gt;_gby_hash_aggregation_enabled = FALSE&lt;br /&gt;&lt;br /&gt;This results in a line in the plan that reads:&lt;br /&gt;&lt;br /&gt;HASH GROUP BY&lt;br /&gt;&lt;br /&gt;instead of&lt;br /&gt;&lt;br /&gt;SORT GROUP BY&lt;br /&gt;&lt;br /&gt;The parameter was set to FALSE due to a known bug and the issues we'd seen with it, however the recent advice we'd received, indicated that the bug had been resolved at the version level we were on and that by enabling the feature - which enables GROUP BY and Aggregation using a hash scheme - we'd gain a performance boost for certain queries.&lt;br /&gt;&lt;br /&gt;So, the DBA team researched the advice and it appeared to be the case, that the bug (4604970) which led to the disabling of the feature was fixed at our version level (10.2.0.3 on HP-UX). We duly turned on the feature in a pre production environment and ran it for a while without noticing any issues. We then enabled it in production and again, for a while, we've not noticed any issues...until now.&lt;br /&gt;&lt;br /&gt;After a check back through the logs, it appeared that since the parameter was first enabled, the queries which were now failing, had not been run at all...they had only run prior to the parameter change...so with my suspicions aroused further, I disabled the feature at the session level and reran the process. It completed in a normal time frame and used a small amount of TEMP - hooray!&lt;br /&gt;&lt;br /&gt;So, now we have to go back to support to try and understand if the original bug is not quite fixed or whether this is a different scenario...in any event, we're going to disable the feature for now, even though we're only getting problems with the feature on 2 processes out of perhaps thousands.&lt;br /&gt;&lt;br /&gt;So, what's the lesson to learn?&lt;br /&gt;&lt;br /&gt;Well, quite simply, that you need to have a thorough audit of what configuration changes you've made together with a good audit of the processes you've run so that you can work out what has changed since the last time you successfully ran a process. This gives you a fighting chance of spotting things like the above.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12193242-2400272171003900972?l=www.oramoss.com%2Fblog'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Get Human!</title><link>http://www.oramoss.com/blog/2008/04/get-human.html</link><category>social</category><author>noreply@blogger.com (Jeff Moss)</author><pubDate>Mon, 07 Apr 2008 10:44:22 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-12193242.post-8987672615913264792</guid><description>I, for one, can't stand these IVR machines that require me to press millions of menu buttons before I can speak to a human being, so I was really pleased to find this site called &lt;a href="http://gethuman.com/index.asp"&gt;Get Human&lt;/a&gt; today.&lt;br /&gt;&lt;br /&gt;Enjoy.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12193242-8987672615913264792?l=www.oramoss.com%2Fblog'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Tracking TEMP usage throughout the day</title><link>http://www.oramoss.com/blog/2008/02/tracking-temp-usage-throughout-day.html</link><category>awr</category><category>code</category><category>dba</category><author>noreply@blogger.com (Jeff Moss)</author><pubDate>Wed, 27 Feb 2008 03:57:45 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-12193242.post-7735623641351821454</guid><description>I really wanted to do this via AWR, but I've not been able to find out if this kind of information is stored and, if it is, how I'd get access to it...maybe someone else knows...hint hint?!&lt;br /&gt;&lt;br /&gt;I have various queries I run whilst I'm online and processes are running, but what I really wanted, was to know the usage profile throughout the day...so, given that I couldn't find an AWR way of tracking our use of TEMP on a database, I figured I'd use a more klunky method...&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;DROP TABLE mgmt_t_temp_use_history PURGE&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;CREATE TABLE temp_use_history(snap_date      DATE         NOT NULL&lt;br /&gt;                             ,sid            NUMBER       NOT NULL&lt;br /&gt;                             ,segtype        VARCHAR2(9)  NOT NULL&lt;br /&gt;                             ,qcsid          NUMBER       NULL&lt;br /&gt;                             ,username       VARCHAR2(30) NULL&lt;br /&gt;                             ,osuser         VARCHAR2(30) NULL&lt;br /&gt;                             ,contents       VARCHAR2(9)  NULL&lt;br /&gt;                             ,sqlhash        NUMBER       NULL&lt;br /&gt;                             ,sql_id         VARCHAR2(13) NULL&lt;br /&gt;                             ,blocks         NUMBER       NULL&lt;br /&gt;                             )&lt;br /&gt;PCTFREE 0&lt;br /&gt;COMPRESS&lt;br /&gt;NOLOGGING&lt;br /&gt;/&lt;br /&gt;CREATE UNIQUE INDEX tuh_pk ON&lt;br /&gt;temp_use_history(snap_date,sid,segtype)&lt;br /&gt;PCTFREE 0&lt;br /&gt;COMPRESS&lt;br /&gt;NOLOGGING&lt;br /&gt;/&lt;br /&gt;ALTER TABLE temp_use_history ADD CONSTRAINT tuh_pk PRIMARY&lt;br /&gt;KEY(snap_date,sid,segtype)&lt;br /&gt;USING INDEX&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;DECLARE&lt;br /&gt;  l_program_action VARCHAR2(2000);&lt;br /&gt;  l_27477 EXCEPTION;&lt;br /&gt;  PRAGMA EXCEPTION_INIT(l_27477,-27477); BEGIN&lt;br /&gt;  BEGIN&lt;br /&gt;    DBMS_SCHEDULER.CREATE_SCHEDULE(&lt;br /&gt;      schedule_name   =&gt; 'MINUTELY_5M'&lt;br /&gt;     ,start_date      =&gt; SYSDATE&lt;br /&gt;     ,repeat_interval =&gt; 'FREQ=MINUTELY;INTERVAL=5'&lt;br /&gt;     ,comments        =&gt;'Daily schedule to run a job every five minutes.'&lt;br /&gt;                                  );&lt;br /&gt;  EXCEPTION&lt;br /&gt;    WHEN l_27477 THEN&lt;br /&gt;      NULL;  -- Ignore if the schedule exists&lt;br /&gt;  END;&lt;br /&gt;&lt;br /&gt;  l_program_action :=                   'DECLARE';&lt;br /&gt;  l_program_action := l_program_action||'  l_date DATE := SYSDATE; ';&lt;br /&gt;  l_program_action := l_program_action||'BEGIN';&lt;br /&gt;  l_program_action := l_program_action||'  INSERT /*+ APPEND */ INTO temp_use_history(snap_date,sid,qcsid,username,osuser,contents,seg&lt;br /&gt;type,sqlhash,sql_id,blocks)';&lt;br /&gt;  l_program_action := l_program_action||'  SELECT l_date,s.sid,ps.qcsid,s.username,s.osuser,su.contents,su.segtype,su.sqlh&lt;br /&gt;ash,su.sql_id,sum(su.blocks)';&lt;br /&gt;  l_program_action := l_program_action||'  FROM   v$sort_usage su';&lt;br /&gt;  l_program_action := l_program_action||'  ,      v$session s';&lt;br /&gt;  l_program_action := l_program_action||'  ,      v$px_session ps';&lt;br /&gt;  l_program_action := l_program_action||'  WHERE  s.sid=ps.sid(+)';&lt;br /&gt;  l_program_action := l_program_action||'  AND    s.saddr =&lt;br /&gt;su.session_addr';&lt;br /&gt;  l_program_action := l_program_action||'  AND    s.serial# =&lt;br /&gt;su.session_num';&lt;br /&gt;  l_program_action := l_program_action||'  GROUP BY s.sid,ps.qcsid,s.username,s.osuser,su.contents,su.segtype,su.sqladdr,su.&lt;br /&gt;sqlhash,su.sql_id;';&lt;br /&gt;  l_program_action := l_program_action||'  COMMIT; ';&lt;br /&gt;  l_program_action := l_program_action||'END;';&lt;br /&gt;&lt;br /&gt;  BEGIN&lt;br /&gt;    DBMS_SCHEDULER.CREATE_PROGRAM(&lt;br /&gt;      program_name =&gt; 'SNAP_TEMP_USAGE'&lt;br /&gt;     ,program_type =&gt; 'PLSQL_BLOCK'&lt;br /&gt;     ,program_action =&gt; l_program_action&lt;br /&gt;     ,enabled        =&gt; TRUE&lt;br /&gt;     ,comments       =&gt; 'Program to snap the temp usage into TEMP_USE_HISTORY'&lt;br /&gt;                                 );&lt;br /&gt;  EXCEPTION&lt;br /&gt;    WHEN l_27477 THEN&lt;br /&gt;      NULL;  -- Ignore if the program exists&lt;br /&gt;  END;&lt;br /&gt;&lt;br /&gt;  BEGIN&lt;br /&gt;    DBMS_SCHEDULER.CREATE_JOB(&lt;br /&gt;      job_name      =&gt; 'JOB_SNAP_TEMP_USAGE'&lt;br /&gt;     ,program_name  =&gt; 'SNAP_TEMP_USAGE'&lt;br /&gt;     ,schedule_name =&gt; 'MINUTELY_5M'&lt;br /&gt;     ,enabled       =&gt; TRUE&lt;br /&gt;     ,auto_drop     =&gt; FALSE&lt;br /&gt;     ,comments      =&gt; 'Job to snap the temp usage into TEMP_USE_HISTORY'&lt;br /&gt;                             );&lt;br /&gt;  EXCEPTION&lt;br /&gt;    WHEN l_27477 THEN&lt;br /&gt;      NULL;  -- Ignore if the job exists&lt;br /&gt;  END;&lt;br /&gt;END;&lt;br /&gt;/&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I can now run queries against the TEMP_USE_HISTORY table to show how much TEMP has been used, when, by whom and for what use, e.g.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;SQL&gt; ed&lt;br /&gt;Wrote file afiedt.buf&lt;br /&gt;&lt;br /&gt;  1  select snap_date,round(sum(blocks)*32/1024/1024) gb&lt;br /&gt;  2  from temp_use_history&lt;br /&gt;  3  where snap_date &gt; sysdate-1&lt;br /&gt;  4  group by snap_date&lt;br /&gt;  5  having round(sum(blocks)*32/1024/1024) &gt; 50&lt;br /&gt;  6* order by 1&lt;br /&gt;SQL&gt; /&lt;br /&gt;&lt;br /&gt;SNAP_DATE                    GB&lt;br /&gt;-------------------- ----------&lt;br /&gt;26-FEB-2008 16:12:25         57&lt;br /&gt;26-FEB-2008 16:17:25         65&lt;br /&gt;26-FEB-2008 16:22:25         74&lt;br /&gt;26-FEB-2008 16:27:25         86&lt;br /&gt;26-FEB-2008 16:32:25         95&lt;br /&gt;26-FEB-2008 16:37:25        107&lt;br /&gt;26-FEB-2008 16:42:25        121&lt;br /&gt;26-FEB-2008 16:47:25        127&lt;br /&gt;26-FEB-2008 16:52:25        147&lt;br /&gt;26-FEB-2008 16:57:25        160&lt;br /&gt;26-FEB-2008 17:02:25        162&lt;br /&gt;26-FEB-2008 17:07:25        179&lt;br /&gt;26-FEB-2008 17:12:25        196&lt;br /&gt;26-FEB-2008 17:17:25        208&lt;br /&gt;26-FEB-2008 17:22:25        217&lt;br /&gt;26-FEB-2008 17:27:25        233&lt;br /&gt;26-FEB-2008 17:32:25        241&lt;br /&gt;26-FEB-2008 17:37:25        251&lt;br /&gt;26-FEB-2008 17:42:25        257&lt;br /&gt;26-FEB-2008 17:47:25        262&lt;br /&gt;26-FEB-2008 17:52:25        264&lt;br /&gt;26-FEB-2008 17:57:25        267&lt;br /&gt;26-FEB-2008 18:02:25        201&lt;br /&gt;27-FEB-2008 00:27:25         59&lt;br /&gt;27-FEB-2008 00:32:25         60&lt;br /&gt;27-FEB-2008 00:37:25         69&lt;br /&gt;27-FEB-2008 01:12:25         57&lt;br /&gt;27-FEB-2008 02:22:25         53&lt;br /&gt;27-FEB-2008 09:57:25         51&lt;br /&gt;&lt;br /&gt;29 rows selected.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;From the above, I can see that, during the last twenty four hours on the database in question, there was reasonably heavy use of the TEMP area between 4pm and 6pm yesterday, and that the load peaked at approximately 267Gb.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12193242-7735623641351821454?l=www.oramoss.com%2Fblog'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Getting multi row text items from Designer repository</title><link>http://www.oramoss.com/blog/2008/02/getting-multi-row-text-items-from.html</link><category>blog</category><category>designer</category><category>code</category><author>noreply@blogger.com (Jeff Moss)</author><pubDate>Fri, 22 Feb 2008 06:27:44 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-12193242.post-1208421319378098356</guid><description>I've mentioned Lucas Jellema before when talking about Oracle Designer - he's helped me out again today via &lt;a href="http://technology.amis.nl/blog/?p=1060"&gt;this post&lt;/a&gt; on the &lt;a href="http://technology.amis.nl/blog/"&gt;AMIS&lt;/a&gt; blog.&lt;br /&gt;&lt;br /&gt;What I wanted, was to be able to extract, using a SQL query against the designer repository, the "Description" attribute from our Tables so that I could create table comments in the database which had the description from the table in Designer.&lt;br /&gt;&lt;br /&gt;Extracting scalar attributes is simple enough, however, description is a multi row text property so it needed a bit more thought...and rather than reinvent the wheel, I had a look at Lucas' stuff and sure enough found the post above. It was almost what I wanted, only I had to change it to look for table stuff rather than entities and attributes.&lt;br /&gt;&lt;br /&gt;I used the same TYPE and &lt;span style="font-family:courier new;"&gt;sum_string_table&lt;/span&gt; function as Lucas so if you're trying to use this stuff you'll probably need to read Lucas' article first.&lt;br /&gt;&lt;br /&gt;The query I ended up with is below...it's been "sanitized" somewhat, but I'm sure you'd get the picture, if retrieving stuff out of the designer repository is a requirement of yours.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;WITH dsc AS&lt;br /&gt;(&lt;br /&gt;SELECT txt.txt_text&lt;br /&gt;,      txt.txt_ref&lt;br /&gt;FROM   cdi_text txt&lt;br /&gt;WHERE  txt.txt_type = 'CDIDSC'&lt;br /&gt;)&lt;br /&gt;, add_cast AS&lt;br /&gt;(&lt;br /&gt;SELECT appsys.name application_system_name&lt;br /&gt;,      b.name table_name&lt;br /&gt;,      b.alias&lt;br /&gt;,      CAST(COLLECT(dsc.txt_text) AS string_table) tab_description&lt;br /&gt;FROM   dsc&lt;br /&gt;,      designer.ci_application_systems appsys&lt;br /&gt;,      designer.ci_app_sys_tables a&lt;br /&gt;,      designer.ci_table_definitions b&lt;br /&gt;WHERE  dsc.txt_ref = a.table_reference&lt;br /&gt;AND    b.irid = a.table_reference&lt;br /&gt;AND    a.parent_ivid = appsys.ivid&lt;br /&gt;GROUP BY appsys.name &lt;br /&gt;,        b.name&lt;br /&gt;,        b.alias&lt;br /&gt;)&lt;br /&gt;SELECT application_system_name&lt;br /&gt;,      table_name&lt;br /&gt;,      alias&lt;br /&gt;,      sum_string_table(tab_description)&lt;br /&gt;FROM   add_cast&lt;br /&gt;WHERE  application_system_name = 'MY_APP_SYS'&lt;br /&gt;and    table_name = 'MY_TABLE_NAME'&lt;br /&gt;/&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Thanks Lucas!&lt;br /&gt;&lt;br /&gt;On another note, regular visitors may realise I've now got my own oramoss dot com domain and that my blogger blog is published on that domain now.&lt;br /&gt;&lt;br /&gt;Thanks to &lt;a href="http://andreasviklund.com/"&gt;Andreas Viklund&lt;/a&gt; for the template.&lt;br /&gt;&lt;br /&gt;If anyone sees anything untoward with the new site please feel free to drop me a note. It's a bit thin on content but I'll work on that over time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12193242-1208421319378098356?l=www.oramoss.com%2Fblog'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total></item><item><title>Advert: YouGoDo dot com</title><link>http://www.oramoss.com/blog/2008/01/advert-yougodo-dot-com.html</link><category>social</category><author>noreply@blogger.com (Jeff Moss)</author><pubDate>Wed, 23 Jan 2008 02:43:27 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-12193242.post-1141055145394226756</guid><description>Nothing technical here...just a quick advert.&lt;br /&gt;&lt;br /&gt;Some friends of mine have started a new website Called &lt;a href="http://www.yougodo.com/Home.aspx"&gt;YouGoDo&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Billed as "The World's Playground", offering users a quick and simple answer to questions like:&lt;br /&gt;&lt;br /&gt;I'm off to [location], what can I do there?&lt;br /&gt;I want to do [activity], where can I do it?&lt;br /&gt;I want to do [activity] in [location], who provides this service?&lt;br /&gt;&lt;br /&gt;If you're interested, feel free to try them out.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12193242-1141055145394226756?l=www.oramoss.com%2Fblog'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Start the new year with a game of tag!</title><link>http://www.oramoss.com/blog/2008/01/thanks-to-doug-ive-been-tagged-hed.html</link><category>social</category><author>noreply@blogger.com (Jeff Moss)</author><pubDate>Thu, 10 Jan 2008 13:50:55 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-12193242.post-464001843302453246</guid><description>Thanks to &lt;a href="http://oracledoug.com/serendipity/index.php?/archives/1375-I-hate-chain-letters-....html"&gt;Doug&lt;/a&gt;, I've been "tagged" - he'd obviously noticed I'd been sleeping, blog-wise, for some time and decided that I should come out of hibernation!&lt;br /&gt;&lt;br /&gt;The idea behind the tagging being to “learn more about the people you interact with using New Web”.&lt;br /&gt;&lt;br /&gt;So, here are eight pieces of trivia about myself:&lt;br /&gt;&lt;br /&gt;1. I am the son of a couple of &lt;a href="http://en.wikipedia.org/wiki/Geordie"&gt;geordies&lt;/a&gt;. My dad being a miner and my mum being a machinist and taxi driver in her time. Mum and dad were married at &lt;a href="http://en.wikipedia.org/wiki/Gretna_Green"&gt;Gretna Green&lt;/a&gt;. Mum is also fairly rare in that she is a successful heart transplant patient of nearly ten years.&lt;br /&gt;&lt;br /&gt;2. I love animals - all animals really, but in particular dogs, and in particular Boxer dogs, and even more particularly white boxer dogs - and no, to scotch a common myth, not all white boxer dogs are deaf - it's the same percentage as all breeds of dog that are deaf - around 20%.&lt;br /&gt;&lt;br /&gt;3. I'm not a vegetarian, despite my love of animals, however my wife is pretty much a vegetarian...which obviously makes life interesting in the kitchen department.&lt;br /&gt;&lt;br /&gt;4. If I wasn't an Oracle person then I'd be a chef. In all truth, the only reason I haven't switched from being an Oracle person to a chef is that I don't think I could earn as much money in that field. Yes, Gordon Ramsey earns millions but it's taken him decades to get there and I'm not sure I'm as capable in that field as I am in the Oracle one. So the plan will be to work in Oracle until such time as I think I've comfortable and then I'll switch to something in the arena of food and drink.&lt;br /&gt;&lt;br /&gt;5. I love car racing - particularly Formula 1. Some wifes are "Golf Widows" - mine is an "F1 Widow" and calls me a "saddo" whenever I'm surfin' on my laptop in the evening and she spots me looking at the &lt;a href="http://www.itv-f1.com/Home.aspx"&gt;ITV 1 Formula 1 website.&lt;/a&gt; Obviously I think I could go a fast as Lewis Hamilton but I'm all too aware that I'd probably end up looking like &lt;a href="http://www.youtube.com/watch?v=-vRoRz_WWto"&gt;Richard Hammond&lt;/a&gt; if I tried!&lt;br /&gt;&lt;br /&gt;6. I'm addicted to reading - both fiction and non. My ideal holiday being one where I just sit by the pool/on the beach, reading constantly for a fortnight.&lt;br /&gt;&lt;br /&gt;7. Speaking of ideal holiday...my favourite place is the carribean, but then what's not to like there! My favourite island being St Lucia since that's where I got married to Amanda.&lt;br /&gt;&lt;br /&gt;8. I have a burning desire to live in another country - preferably somewhere hot. Whether my desire is fulfilled who knows...watch this space!&lt;br /&gt;&lt;br /&gt;That's my eight things...so over to a new set of people to continue the chain...I've no idea if these folk have been tagged or not yet - apologies if they have and the chain isn't extended but ultimately, isn't that inevitable?&lt;br /&gt;&lt;br /&gt;&lt;a href="http://kevinclosson.wordpress.com/"&gt;Kevin Closson&lt;/a&gt;&lt;br /&gt;&lt;a href="http://blog.tanelpoder.com/"&gt;Tanel Poder&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.nicholasgoodman.com/bt/blog/"&gt;Nicholas Goodman&lt;/a&gt;&lt;br /&gt;&lt;a href="http://wedonotuse.blogspot.com/"&gt;Mogens Nogaard&lt;/a&gt;&lt;br /&gt;&lt;a href="http://oraperf.blogspot.com/"&gt;Anjo Kolk&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.petefinnigan.com/weblog/entries/index.html"&gt;Pete Finnigan&lt;/a&gt; - how ironic with this tagging being effectively a virus!&lt;br /&gt;&lt;a href="http://esemrick.blogspot.com/"&gt;Eric S Emrick&lt;/a&gt;&lt;br /&gt;&lt;a href="http://christianbilien.wordpress.com/all-postings"&gt;Christian Bilien&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12193242-464001843302453246?l=www.oramoss.com%2Fblog'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>CALIBRATE_IO Poll</title><link>http://www.oramoss.com/blog/2007/09/calibrateio-poll.html</link><category>tuning</category><category>poll</category><category>dba</category><author>noreply@blogger.com (Jeff Moss)</author><pubDate>Tue, 25 Sep 2007 15:26:28 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-12193242.post-1196979613510213175</guid><description>After Doug's comment on my &lt;a href="http://oramossoracle.blogspot.com/2007/09/11g-io-calibration-tool.html"&gt;earlier blog on CALIBRATE_IO&lt;/a&gt;, and after seeing &lt;a href="http://kevinclosson.wordpress.com/"&gt;Kevin &lt;/a&gt;using &lt;a href="http://www.misterpoll.com/index.m"&gt;Mr Poll&lt;/a&gt; to do a &lt;a href="http://kevinclosson.wordpress.com/2007/07/09/yap-yet-another-rac-poll/"&gt;RAC poll&lt;/a&gt;, I've now created a poll for the results people are getting from this CALIBRATE_IO routine in 11g.&lt;br /&gt;&lt;br /&gt;If you'd like to contribute please visit using the following link:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.misterpoll.com/2647994314.html"&gt;Oracle 11g CALIBRATE_IO Results&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;No prizes for the "biggest"...Kevin is bound to have &lt;a href="http://kevinclosson.wordpress.com/2007/09/17/two-terabytes-of-flash-ssd-anyone/"&gt;something&lt;/a&gt; in his lab that beats us all! ;-)&lt;br /&gt;&lt;br /&gt;Thanks&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12193242-1196979613510213175?l=www.oramoss.com%2Fblog'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total></item><item><title>11g IO Calibration tool</title><link>http://www.oramoss.com/blog/2007/09/11g-io-calibration-tool.html</link><category>tuning</category><category>errors</category><category>dba</category><author>noreply@blogger.com (Jeff Moss)</author><pubDate>Tue, 25 Sep 2007 15:26:51 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-12193242.post-7849409449143548843</guid><description>After reading &lt;a href="http://oracledoug.com/serendipity/index.php?/archives/1319-Parallel-Query-and-11g.html"&gt;how inadequate&lt;/a&gt; Doug was feeling over his IO subsystem, I decided to see how quick mine was...not that we're getting into a "mine is better than yours" game, but rather to see how mine stacks up against Doug's, bearing in mind his is a 5 disk stripe natively attached to his machine (I'm assuming) and mine is a logical disk attached to a VMWare machine...although admittedly, the PC underneath this logical disk is running, motherboard based, RAID striping, over two physical SATA disks...I just figured it would be interesting to compare.&lt;br /&gt;&lt;br /&gt;Obviously, any experiment that goes flawlessly according to a preconceived plan is:&lt;br /&gt;&lt;br /&gt;1. Boring&lt;br /&gt;2. Less educational&lt;br /&gt;3. Not normally one I've done - mine always have problems it seems!&lt;br /&gt;&lt;br /&gt;I ran the calibration on my VMWare based OpenSuse 10 linux with Oracle 11g and it immediately came up with a problem:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;SQL&gt; @io&lt;br /&gt;SQL&gt; SET SERVEROUTPUT ON&lt;br /&gt;SQL&gt; DECLARE&lt;br /&gt;2    lat  INTEGER;&lt;br /&gt;3    iops INTEGER;&lt;br /&gt;4    mbps INTEGER;&lt;br /&gt;5  BEGIN&lt;br /&gt;6  -- DBMS_RESOURCE_MANAGER.CALIBRATE_IO (&lt;disks&gt;, &lt;max_latency&gt;, iops, mbps, lat);&lt;br /&gt;7     DBMS_RESOURCE_MANAGER.CALIBRATE_IO (2, 10, iops, mbps, lat);&lt;br /&gt;8&lt;br /&gt;9     DBMS_OUTPUT.PUT_LINE ('max_iops = ' || iops);&lt;br /&gt;10     DBMS_OUTPUT.PUT_LINE ('latency  = ' || lat);&lt;br /&gt;11     dbms_output.put_line('max_mbps = ' || mbps);&lt;br /&gt;12  end;&lt;br /&gt;13  /&lt;br /&gt;DECLARE&lt;br /&gt;*&lt;br /&gt;ERROR at line 1:&lt;br /&gt;ORA-56708: Could not find any datafiles with asynchronous i/o capability&lt;br /&gt;ORA-06512: at "SYS.DBMS_RMIN", line 453&lt;br /&gt;ORA-06512: at "SYS.DBMS_RESOURCE_MANAGER", line 1153&lt;br /&gt;ORA-06512: at line 7&lt;br /&gt;&lt;/max_latency&gt;&lt;/disks&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Of course, consulting &lt;a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28419/d_resmgr.htm#sthref7003"&gt;the manual&lt;/a&gt; led me to run this query:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;SELECT name, asynch_io&lt;br /&gt;FROM v$datafile f,v$iostat_file i&lt;br /&gt;WHERE f.file#        = i.file_no&lt;br /&gt;AND   filetype_name  = 'Data File'&lt;br /&gt;/&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;which gave:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;SQL&gt; /&lt;br /&gt;&lt;br /&gt;NAME                                               ASYNCH_IO&lt;br /&gt;-------------------------------------------------- ---------&lt;br /&gt;/home/oracle/oradata/su11/system01.dbf             ASYNC_OFF&lt;br /&gt;/home/oracle/oradata/su11/sysaux01.dbf             ASYNC_OFF&lt;br /&gt;/home/oracle/oradata/su11/undotbs01.dbf            ASYNC_OFF&lt;br /&gt;/home/oracle/oradata/su11/users01.dbf              ASYNC_OFF&lt;br /&gt;/home/oracle/oradata/su11/example01.dbf            ASYNC_OFF&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;...or in other words no asynchronous IO available - as the error message had said.&lt;br /&gt;&lt;br /&gt;After altering the &lt;a href="http://download.oracle.com/docs/cd/B28359_01/server.111/b28320/initparams083.htm#REFRN10061"&gt;filesystemio_options&lt;/a&gt; parameter to "set_all" and bouncing the instance, a second run of the calibration process seemed to work fine...&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;SQL&gt; @io&lt;br /&gt;SQL&gt; SET ECHO ON&lt;br /&gt;SQL&gt; SET SERVEROUTPUT ON&lt;br /&gt;SQL&gt; DECLARE&lt;br /&gt;2    lat  INTEGER;&lt;br /&gt;3    iops INTEGER;&lt;br /&gt;4    mbps INTEGER;&lt;br /&gt;5  BEGIN&lt;br /&gt;6  -- DBMS_RESOURCE_MANAGER.CALIBRATE_IO (&lt;disks&gt;, &lt;max_latency&gt;, iops, mbps, lat);&lt;br /&gt;7     DBMS_RESOURCE_MANAGER.CALIBRATE_IO (2, 10, iops, mbps, lat);&lt;br /&gt;8&lt;br /&gt;9     DBMS_OUTPUT.PUT_LINE ('max_iops = ' || iops);&lt;br /&gt;10     DBMS_OUTPUT.PUT_LINE ('latency  = ' || lat);&lt;br /&gt;11     dbms_output.put_line('max_mbps = ' || mbps);&lt;br /&gt;12  end;&lt;br /&gt;13  /&lt;br /&gt;max_iops = 72&lt;br /&gt;latency  = 13&lt;br /&gt;max_mbps = 26&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;/max_latency&gt;&lt;/disks&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So,my figures are considerably lower than those Doug achieved:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;max_iops = 112&lt;br /&gt;latency  = 8&lt;br /&gt;max_mbps = 32&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;...but not too bad I guess considering the fact that mine is a VM and the hardware I'm running is more humble...no seriously, size does not matter!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12193242-7849409449143548843?l=www.oramoss.com%2Fblog'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">4</thr:total></item><item><title>11g PX tracefiles now have the tracefile identifier on them</title><link>http://www.oramoss.com/blog/2007/09/11g-px-tracefiles-now-have-tracefile.html</link><category>tuning</category><category>dba</category><author>noreply@blogger.com (Jeff Moss)</author><pubDate>Wed, 05 Sep 2007 03:10:30 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-12193242.post-5255794643815649573</guid><description>Now that I've got 11g up and running on OpenSuse 10.2 on a VMWare 6 VM, I've had time to do some playing with the latest and greatest release and the first thing I've noticed, when running some of &lt;a href="http://oracledoug.com/serendipity/"&gt;Doug's&lt;/a&gt; PX test scripts, is that the trace files generated for PX slaves now have the Tracefile Identifier appended to their name, making it easier to see which OS Process (PID) was responsible for the creation of the trace file - makes things a little easier and clearer.&lt;br /&gt;&lt;br /&gt;In 10gR2 (10.2.0.2.0 specifically) the trace files would come out with names in this format:&lt;br /&gt;&lt;br /&gt;&amp;lt;instance name&amp;gt;_&amp;lt;PX Slave identifier&amp;gt;_&amp;lt;background process ID&amp;gt;.trc&lt;br /&gt;&lt;br /&gt;e.g. fred_p001_6789.trc&lt;br /&gt;&lt;br /&gt;In 11gR1 (11.1.0.6.0 specifically) the trace files come out with names in this format:&lt;br /&gt;&lt;br /&gt;&amp;lt;instance name&amp;gt;_&amp;lt;PX Slave identifier&amp;gt;_&amp;lt;background process ID&amp;gt;_&amp;lt;Trace file identifier&amp;gt;.trc&lt;br /&gt;&lt;br /&gt;e.g. fred_p001_5678_jeff.trc&lt;br /&gt;&lt;br /&gt;This assumes you've set the tracefile identifier in the first place, otherwise that bit won't be present. Use the following to set it, choosing whatever identifier you require of course:&lt;br /&gt;&lt;br /&gt;&lt;PRE&gt;alter session set tracefile_identifier='jeff';&lt;/PRE&gt;&lt;br /&gt;&lt;br /&gt;It was interesting that the location of such files has also changed due to the implementation of Automatic Diagnostic Repository (ADR). More information on that &lt;a href="http://download.oracle.com/docs/cd/B28359_01/install.111/b28264/whatsnew.htm#sthref57"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12193242-5255794643815649573?l=www.oramoss.com%2Fblog'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">4</thr:total></item><item><title>ORA-07455 and EXPLAIN PLAN...and statements which, perhaps, shouldn't run</title><link>http://www.oramoss.com/blog/2007/08/ora-07445-and-explain-planand.html</link><category>tuning</category><category>code</category><category>cbo</category><category>errors</category><author>noreply@blogger.com (Jeff Moss)</author><pubDate>Mon, 13 Aug 2007 11:54:52 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-12193242.post-3149247994376582666</guid><description>&lt;p&gt;I encountered a scenario today which I thought was strange in a number of ways...hence, irresistible to a quick blog post.&lt;/p&gt; &lt;p&gt;The scenario started with an end user of my warehouse emailing me a query that was returning an error message dialog box, warning the user before they ran the query, that they had insufficient resources to run said query - &lt;a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14219/e4100.htm#sthref2363"&gt;ORA-07455&lt;/a&gt; to be precise.&lt;/p&gt; &lt;p&gt;I figured, either the query is one requiring significant resources - more resources than the user has access to, or the query has a suboptimal plan, whereby it &lt;em&gt;thinks&lt;/em&gt; it will require more resources than they have access to. &lt;/p&gt; &lt;p&gt;To try and determine which, I logged into the same Oracle user as my end user and tried to get an explain plan of the query - so I could perhaps gauge whether there were any problems with the choice of execution path and whether the query was one which would indeed require significant resources. &lt;/p&gt; &lt;p&gt;The result was that it came back with the same error - which quite surprised me at first. &lt;/p&gt; &lt;p&gt;In using EXPLAIN PLAN, I wasn't asking the database to actually run the query - merely to tell me what the likely execution path was for the query and yet, it appears to still do the checks on resource usage. At first, that seemed strange to me, in the sense that I wouldn't be requiring those resources since, I'm not actually executing the statement, yet perhaps it does makes sense - or at least is consistent, because, for example, you don't need access to all the objects in the query if you're not going to actually execute it, yet quite rightly, the optimizer does checks as to whether you have the appropriate access permissions to each object as part of the EXPLAIN PLAN process.&lt;/p&gt; &lt;p&gt;That was educational point number one for me.&lt;br /&gt;&lt;/p&gt; &lt;p&gt;After logging in as another user with unlimited resource usage, I then reran the EXPLAIN PLAN and the statement was accepted and the plan returned...indicating an unpleasant rewrite of the query, and a very high anticipated cost - in excess of the limit for that end user.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;That explained why the ORA-07455 was appearing for them, but highlighted an altogether different issue which perplexed me further. There follows a simple reconstruction of the query and explain plan results:&lt;/p&gt; &lt;p&gt;First the obligatory test script...&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;SET TIMING OFF&lt;br /&gt;DROP TABLE tab1 PURGE&lt;br /&gt;/&lt;br /&gt;CREATE TABLE tab1&lt;br /&gt;(col1 VARCHAR2(1))&lt;br /&gt;/&lt;br /&gt;DROP TABLE tab2 PURGE&lt;br /&gt;/&lt;br /&gt;CREATE TABLE tab2&lt;br /&gt;(col2 VARCHAR2(1))&lt;br /&gt;/&lt;br /&gt;BEGIN&lt;br /&gt;DBMS_STATS.GATHER_TABLE_STATS(ownname =&amp;gt; USER&lt;br /&gt;                            ,tabname =&amp;gt; 'TAB1'&lt;br /&gt;                            );&lt;br /&gt;DBMS_STATS.GATHER_TABLE_STATS(ownname =&amp;gt; USER&lt;br /&gt;                            ,tabname =&amp;gt; 'TAB2'&lt;br /&gt;                            );&lt;br /&gt;END;&lt;br /&gt;/&lt;br /&gt;INSERT INTO tab1 VALUES('A')&lt;br /&gt;/&lt;br /&gt;INSERT INTO tab1 VALUES('B')&lt;br /&gt;/&lt;br /&gt;INSERT INTO tab1 VALUES('A')&lt;br /&gt;/&lt;br /&gt;INSERT INTO tab1 VALUES('B')&lt;br /&gt;/&lt;br /&gt;INSERT INTO tab2 VALUES('C')&lt;br /&gt;/&lt;br /&gt;INSERT INTO tab2 VALUES('D')&lt;br /&gt;/&lt;br /&gt;COMMIT&lt;br /&gt;/&lt;br /&gt;SET AUTOTRACE ON&lt;br /&gt;SELECT *&lt;br /&gt;FROM tab1&lt;br /&gt;WHERE col1 IN (SELECT col1 FROM tab2)&lt;br /&gt;/&lt;br /&gt;SET AUTOTRACE OFF&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;Now the results...&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Table dropped.&lt;br /&gt;&lt;br /&gt;Connected.&lt;br /&gt;&lt;br /&gt;Table dropped.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Table created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Table dropped.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Table created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1 row created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1 row created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1 row created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1 row created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1 row created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1 row created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Commit complete.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;C&lt;br /&gt;-&lt;br /&gt;A&lt;br /&gt;B&lt;br /&gt;A&lt;br /&gt;B&lt;br /&gt;&lt;br /&gt;4 rows selected.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Execution Plan&lt;br /&gt;----------------------------------------------------------&lt;br /&gt;Plan hash value: 4220095845&lt;br /&gt;&lt;br /&gt;----------------------------------------------------------------------------&lt;br /&gt;| Id  | Operation           | Name | Rows  | Bytes | Cost (%CPU)| Time&lt;br /&gt;|&lt;br /&gt;----------------------------------------------------------------------------&lt;br /&gt;|   0 | SELECT STATEMENT    |      |     1 |     2 |     4   (0)|00:00:01  |&lt;br /&gt;|*  1 |  FILTER             |      |       |       |            |          |&lt;br /&gt;|   2 |   TABLE ACCESS FULL | TAB1 |     1 |     2 |     2   (0)|00:00:01  |&lt;br /&gt;|*  3 |   FILTER            |      |       |       |            |          |&lt;br /&gt;|   4 |    TABLE ACCESS FULL| TAB2 |     1 |       |     2   (0)|00:00:01  |&lt;br /&gt;----------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;Predicate Information (identified by operation id):&lt;br /&gt;---------------------------------------------------&lt;br /&gt;&lt;br /&gt;1 - filter( EXISTS (SELECT /*+ */ 0 FROM "TAB2" "TAB2" WHERE&lt;br /&gt;           :B1=:B2))&lt;br /&gt;3 - filter(:B1=:B2)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Statistics&lt;br /&gt;----------------------------------------------------------&lt;br /&gt;       1  recursive calls&lt;br /&gt;       0  db block gets&lt;br /&gt;      18  consistent gets&lt;br /&gt;       0  physical reads&lt;br /&gt;       0  redo size&lt;br /&gt;     458  bytes sent via SQL*Net to client&lt;br /&gt;     381  bytes received via SQL*Net from client&lt;br /&gt;       2  SQL*Net roundtrips to/from client&lt;br /&gt;       0  sorts (memory)&lt;br /&gt;       0  sorts (disk)&lt;br /&gt;       4  rows processed&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;Now, when I first saw the query I thought, hang on a minute, COL1 does not exist in table TAB2 so this query should not even execute...but it does! I don't think it should execute personally but according to the &lt;a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries007.htm#sthref3193"&gt;documentation&lt;/a&gt;, "&lt;em&gt;Oracle resolves unqualified columns in the subquery by looking in the tables named in the subquery and then in the tables named in the parent statement.&lt;/em&gt;", so it is operating as described in the manuals- even if, in my view, it's a little odd since without a rewrite, the query is incapable of executing.&lt;/p&gt; &lt;p&gt;The query has been rewritten with an EXISTS approach - note the first FILTER statement in the "Predicate Information" section of the autotrace output. A bit like this:&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;SELECT a.*&lt;br /&gt;FROM   tab1 a&lt;br /&gt;WHERE EXISTS (SELECT 0&lt;br /&gt;           FROM   tab2 b&lt;br /&gt;           WHERE  a.col1 = a.col1&lt;br /&gt;          )&lt;br /&gt;/&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;The subquery is always going to return a row, hence, for any row we select in the containing query, we will always get that row back, because the EXISTS will always find a match - it's a bit like saying "WHERE TRUE" I guess.&lt;/p&gt; &lt;p&gt;Interestingly, my friend Jon first brought this scenario to my attention last week in various discussions with him and another of my colleagues, who is far more experienced than myself. To be fair, the experienced colleague is the source of a number of my blogging posts, but he's painfully shy and will therefore remain nameless. &lt;/p&gt; &lt;p&gt;I was educated during that discussion, that this functionality is as advertised in the manuals - even if it doesn't sit well with me. My closing line to my fellow debaters at the time, was that nobody would ever write SQL like that and if they did I'd tell them to rewrite it using aliases and so that it made sense - as is often the case in life though, the very next week, a real life user comes up with exactly that scenario - at least I was prepared!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12193242-3149247994376582666?l=www.oramoss.com%2Fblog'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Fifteen Minutes of fame as an animal welfare supporter</title><link>http://www.oramoss.com/blog/2007/08/fifteen-minutes-of-fame-as-animal.html</link><category>social</category><author>noreply@blogger.com (Jeff Moss)</author><pubDate>Sat, 04 Aug 2007 02:23:51 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-12193242.post-2553529395688212239</guid><description>&lt;p&gt;My wife and I were happy to receive a call from &lt;a href="http://www.respectforanimals.co.uk/home.php"&gt;Respect For Animals&lt;/a&gt; the other day, to inform us that our names would appear on a two page advert in the August issue of the &lt;a href="http://www.bbcwildlifemagazine.com/magazine.asp"&gt;BBC Wildlife magazine&lt;/a&gt;, in support of the campaign to stop the seal cull in Canada.&lt;/p&gt; &lt;p&gt;I'd never read the magazine before, but after buying it to see the advert, I was quite pleased that it was a really good read for those of us interested in the animal kingdom.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12193242-2553529395688212239?l=www.oramoss.com%2Fblog'/&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item></channel></rss>
