<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Select statement causing ORA-1652 in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/select-statement-causing-ora-1652/m-p/3241802#M891900</link>
    <description>Hi all&lt;BR /&gt;This is the result of the SQL Explain plan statement&lt;BR /&gt;&lt;BR /&gt;0  SELECT STATEMENT     Cost =  1  &lt;BR /&gt;1 1   SORT UNIQUE     2  &lt;BR /&gt;2 1     NESTED LOOPS      3  &lt;BR /&gt;3 1       NESTED LOOPS      4  &lt;BR /&gt;4 1         NESTED LOOPS      5  &lt;BR /&gt;5 1           TABLE ACCESS BY INDEX ROWID LOT_DATA  2  6  &lt;BR /&gt;6 1             INDEX RANGE SCAN LOT_DATA_PRD_INDEX NON-UNIQUE   7  &lt;BR /&gt;7 2           TABLE ACCESS BY INDEX ROWID WIP_DATA  1  6  &lt;BR /&gt;8 1             INDEX RANGE SCAN WIP_DATA_WIP_LOT NON-UNIQUE   7  &lt;BR /&gt;9 2         TABLE ACCESS BY INDEX ROWID EQ_DATA  3  5  &lt;BR /&gt;10 1           INDEX UNIQUE SCAN EQ_DATA UNIQUE   6  &lt;BR /&gt;11 2       INDEX RANGE SCAN WTEST_DATA UNIQUE   4</description>
    <pubDate>Thu, 08 Apr 2004 00:24:52 GMT</pubDate>
    <dc:creator>kenny chia</dc:creator>
    <dc:date>2004-04-08T00:24:52Z</dc:date>
    <item>
      <title>Select statement causing ORA-1652</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/select-statement-causing-ora-1652/m-p/3241795#M891893</link>
      <description>Hi&lt;BR /&gt;When I ran a select statement that returns alot of data (300825 rows), &lt;BR /&gt;There is no sorting in the select statement (eg order by)&lt;BR /&gt;the following oracle error is logged into the alert file&lt;BR /&gt;&lt;BR /&gt;ORA-1652: unable to extend temp segment by 256000 in tablespace                 TAB1&lt;BR /&gt;&lt;BR /&gt;Why is there a temp segment in the tablespace TAB1? Will a select statement create temp segments in a tablespace? &lt;BR /&gt;The tablespace TAB1 is used to store tables only&lt;BR /&gt;Oracle 8 is used&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Apr 2004 20:12:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/select-statement-causing-ora-1652/m-p/3241795#M891893</guid>
      <dc:creator>kenny chia</dc:creator>
      <dc:date>2004-04-06T20:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement causing ORA-1652</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/select-statement-causing-ora-1652/m-p/3241796#M891894</link>
      <description>&lt;BR /&gt;You don't give us much to go on.&lt;BR /&gt;&lt;BR /&gt;Why not include the select statement in question.  I suspect that the oracle optimizer decided it needed a 'merge join'.&lt;BR /&gt;I'm sure that is described in many places, including the Oracle doc. &lt;BR /&gt;&lt;BR /&gt;Google pointed me to &lt;A href="http://www.adp-gmbh.ch/ora/explainplan.html" target="_blank"&gt;http://www.adp-gmbh.ch/ora/explainplan.html&lt;/A&gt;&lt;BR /&gt;Which reads "MERGE JOIN&lt;BR /&gt;Usually, you want to select data across multiple table which is referred to as to join the tables. MERGE JOIN is just one possible method of joining the data (the others are HASH JOIN, NESTED LOOPS and CLUSTER JOIN). A Sort Merge Join basically sorts all relevant rows in the first table by the join key (ba), and also sorts the relevant rows in the second table by the join key (aa), and then merges these sorted rows."&lt;BR /&gt;&lt;BR /&gt;You can verify whether this is happening through EXPLAIN PLAN.&lt;BR /&gt;&lt;BR /&gt;An other possible reason is that one of the (secondary) tables used in the select is not a base table but a VIEW.&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Apr 2004 21:32:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/select-statement-causing-ora-1652/m-p/3241796#M891894</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2004-04-06T21:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement causing ORA-1652</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/select-statement-causing-ora-1652/m-p/3241797#M891895</link>
      <description>Hi,&lt;BR /&gt; &lt;BR /&gt;when appropriate indexes are not available temporary segments will also be used.&lt;BR /&gt; &lt;BR /&gt;regards,&lt;BR /&gt;Thierry.</description>
      <pubDate>Tue, 06 Apr 2004 23:08:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/select-statement-causing-ora-1652/m-p/3241797#M891895</guid>
      <dc:creator>Thierry Poels_1</dc:creator>
      <dc:date>2004-04-06T23:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement causing ORA-1652</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/select-statement-causing-ora-1652/m-p/3241798#M891896</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;two things may be occuring.&lt;BR /&gt;&lt;BR /&gt;1. The tablespace TAB1 has very little space left.&lt;BR /&gt;2. The default temporary tablespace of this user is TAB1.&lt;BR /&gt;&lt;BR /&gt;Please post the output of this SQL command:&lt;BR /&gt;===========================================&lt;BR /&gt;select temporary_tablespace&lt;BR /&gt;from dba_users&lt;BR /&gt;where username='&lt;USERID that="" you="" are="" using=""&gt;'&lt;BR /&gt;===========================================&lt;BR /&gt;&lt;BR /&gt;You may also have to review your query by analysing your execution plan and add an index on that table accordingly.&lt;BR /&gt;&lt;BR /&gt;You might also be using PERMANENT tablespace for temporary use. how was your temporary tablespace created?&lt;BR /&gt;&lt;BR /&gt;I usually create all my temporary tablespaces as follows (example):&lt;BR /&gt;============================================&lt;BR /&gt;create temporary tablespace test_temp&lt;BR /&gt;tempfile '/tmp/test_temp.dbf' size 512k reuse&lt;BR /&gt;extent management local&lt;BR /&gt;uniform size 64k&lt;BR /&gt;/&lt;BR /&gt;============================================&lt;BR /&gt;&lt;BR /&gt;best regards&lt;BR /&gt;Yogeeraj&lt;/USERID&gt;</description>
      <pubDate>Tue, 06 Apr 2004 23:11:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/select-statement-causing-ora-1652/m-p/3241798#M891896</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2004-04-06T23:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement causing ORA-1652</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/select-statement-causing-ora-1652/m-p/3241799#M891897</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;check again to make sure that default temp tablespace for user not TAB1.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Apr 2004 23:30:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/select-statement-causing-ora-1652/m-p/3241799#M891897</guid>
      <dc:creator>Printaporn_1</dc:creator>
      <dc:date>2004-04-06T23:30:51Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement causing ORA-1652</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/select-statement-causing-ora-1652/m-p/3241800#M891898</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;You refer to the alertSID.log, but don't you have the same error in SQL*Plus ? &lt;BR /&gt;&lt;BR /&gt;To get the explain plan for the SELECT statement :&lt;BR /&gt;&lt;BR /&gt;SET ECHO OFF&lt;BR /&gt;SET LINESIZE 120&lt;BR /&gt;COLUMN PDEB FORMAT A4&lt;BR /&gt;COLUMN PFIN FORMAT A4&lt;BR /&gt;COLUMN QUERY_PLAN FORMAT A60&lt;BR /&gt;COLUMN PLAN FORMAT A80&lt;BR /&gt;SET ECHO ON&lt;BR /&gt;  &lt;BR /&gt;explain plan&lt;BR /&gt;for&lt;BR /&gt;---------------------&lt;BR /&gt;YOUR SELECT STATEMENT&lt;BR /&gt;---------------------&lt;BR /&gt;SET ECHO OFF&lt;BR /&gt;SELECT  &lt;BR /&gt; id,&lt;BR /&gt; position,&lt;BR /&gt; lpad(' ',2*(level-1))|| operation || ' ' || options || ' ' || object_name || ' ' || object_type || ' ' ||&lt;BR /&gt; object_instance || ' ' || decode(id,0, 'Cost = ' || position) Query_Plan,&lt;BR /&gt; level,&lt;BR /&gt; PARTITION_START PDEB,&lt;BR /&gt; PARTITION_STOP  PFIN&lt;BR /&gt;FROM    &lt;BR /&gt; plan_table         &lt;BR /&gt;START WITH &lt;BR /&gt; id = 0 &lt;BR /&gt;CONNECT BY PRIOR &lt;BR /&gt; id = parent_id&lt;BR /&gt;; &lt;BR /&gt;-- Or the Oracle script&lt;BR /&gt;@?/rdbms/admin/utlxpls&lt;BR /&gt;rollback;&lt;BR /&gt;SET ECHO ON&lt;BR /&gt;&lt;BR /&gt;Nicolas</description>
      <pubDate>Wed, 07 Apr 2004 00:29:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/select-statement-causing-ora-1652/m-p/3241800#M891898</guid>
      <dc:creator>Nicolas Dumeige</dc:creator>
      <dc:date>2004-04-07T00:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement causing ORA-1652</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/select-statement-causing-ora-1652/m-p/3241801#M891899</link>
      <description>1.  Check your user temporary tablespace setting.  It is possible that it is set to this tablespace. &lt;BR /&gt;&lt;BR /&gt;2.  Check your object's PARALLEL settings.  It could be using a parallel query to pull data from the table, which means that 4 queries are pulling data, and the information is stored in a temporary segment.  &lt;BR /&gt;&lt;BR /&gt;Even though you don't have an order by, any join is still going to need temporary space to hold data from the join so that it can select the rows needed.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Brian</description>
      <pubDate>Wed, 07 Apr 2004 20:50:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/select-statement-causing-ora-1652/m-p/3241801#M891899</guid>
      <dc:creator>Brian Crabtree</dc:creator>
      <dc:date>2004-04-07T20:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement causing ORA-1652</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/select-statement-causing-ora-1652/m-p/3241802#M891900</link>
      <description>Hi all&lt;BR /&gt;This is the result of the SQL Explain plan statement&lt;BR /&gt;&lt;BR /&gt;0  SELECT STATEMENT     Cost =  1  &lt;BR /&gt;1 1   SORT UNIQUE     2  &lt;BR /&gt;2 1     NESTED LOOPS      3  &lt;BR /&gt;3 1       NESTED LOOPS      4  &lt;BR /&gt;4 1         NESTED LOOPS      5  &lt;BR /&gt;5 1           TABLE ACCESS BY INDEX ROWID LOT_DATA  2  6  &lt;BR /&gt;6 1             INDEX RANGE SCAN LOT_DATA_PRD_INDEX NON-UNIQUE   7  &lt;BR /&gt;7 2           TABLE ACCESS BY INDEX ROWID WIP_DATA  1  6  &lt;BR /&gt;8 1             INDEX RANGE SCAN WIP_DATA_WIP_LOT NON-UNIQUE   7  &lt;BR /&gt;9 2         TABLE ACCESS BY INDEX ROWID EQ_DATA  3  5  &lt;BR /&gt;10 1           INDEX UNIQUE SCAN EQ_DATA UNIQUE   6  &lt;BR /&gt;11 2       INDEX RANGE SCAN WTEST_DATA UNIQUE   4</description>
      <pubDate>Thu, 08 Apr 2004 00:24:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/select-statement-causing-ora-1652/m-p/3241802#M891900</guid>
      <dc:creator>kenny chia</dc:creator>
      <dc:date>2004-04-08T00:24:52Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement causing ORA-1652</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/select-statement-causing-ora-1652/m-p/3241803#M891901</link>
      <description>So there is a sort right there in the explain plan to accomplish a unique (or group by?) clause in the select.&lt;BR /&gt;Now we know why the temp segment may needed as well as to hold the collecttion.&lt;BR /&gt;&lt;BR /&gt;Now check the temp dataspace for the user as requested. Just do a select * from dba_users where username = 'xxx';&lt;BR /&gt;&lt;BR /&gt;Btw... 256000 is not too much. If it is just sort, can you not avoid the disk sort by increasing sort_area_size and sort_area_retained_size? (sqlplus&amp;gt; show parameter sort )&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Apr 2004 00:44:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/select-statement-causing-ora-1652/m-p/3241803#M891901</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2004-04-08T00:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement causing ORA-1652</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/select-statement-causing-ora-1652/m-p/3241804#M891902</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;important that you post the output of the following:&lt;BR /&gt;===========================================&lt;BR /&gt;select temporary_tablespace&lt;BR /&gt;from dba_users&lt;BR /&gt;where username='&lt;USERID that="" you="" are="" using=""&gt;'&lt;BR /&gt;===========================================&lt;BR /&gt;&lt;BR /&gt;Also, post a more complete trace statistics of the SQL command:&lt;BR /&gt;============================================&lt;BR /&gt;e.g.&lt;BR /&gt;SQL&amp;gt; set autotrace traceonly&lt;BR /&gt;SQL&amp;gt; select sysdate from dual;&lt;BR /&gt;Execution Plan&lt;BR /&gt;----------------------------------------------------------&lt;BR /&gt;   0      SELECT STATEMENT Optimizer=CHOOSE&lt;BR /&gt;   1    0   TABLE ACCESS (FULL) OF 'DUAL'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Statistics&lt;BR /&gt;----------------------------------------------------------&lt;BR /&gt;          0  recursive calls&lt;BR /&gt;          4  db block gets&lt;BR /&gt;          1  consistent gets&lt;BR /&gt;          0  physical reads&lt;BR /&gt;          0  redo size&lt;BR /&gt;        299  bytes sent via SQL*Net to client&lt;BR /&gt;        359  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&amp;gt;&lt;BR /&gt;============================================&lt;BR /&gt;&lt;BR /&gt;These statistics will shed some more light on the problem that you are encountering.&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;Yogeeraj&lt;BR /&gt;&lt;/USERID&gt;</description>
      <pubDate>Thu, 08 Apr 2004 02:45:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/select-statement-causing-ora-1652/m-p/3241804#M891902</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2004-04-08T02:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement causing ORA-1652</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/select-statement-causing-ora-1652/m-p/3241805#M891903</link>
      <description>Hi all&lt;BR /&gt;This is the SQL&lt;BR /&gt;&lt;BR /&gt;select distinct l.box_no, l.box_prd, l.box_mfno, l.box_cno, l.wtest_date, l.pts_date, w.wip_date, w.wip_route || '/' || w.wip_oper step_name, w.wip_opcode, eq.eq_name ||'/'||eq.eq_code eqp, wt.wtest_waf disk from wip_data w, box_data l, eq_data eq, wtest_data wt where l.box_prd in ('255') AND l.wtest_date &amp;lt;= to_date '4/6/04 4:16:04&lt;BR /&gt; PM', 'MM/DD/RR HH:MI:SS AM') AND  l.wtest_date &amp;gt;= to_date('3/24/04 4:16:04 PM', 'MM/DD/RR HH:MI:SS AM') AND w.wip_box = l.box_no AND w.wip_eqcode = eq.eq_code AND l.box_no = wt.wtest_box&lt;BR /&gt;&lt;BR /&gt;when I remove the distinct keyword, the SQL returned &amp;gt; 1 million lines. &lt;BR /&gt;If I put the distinct keyword, Oracle will have to sort &amp;gt; 1 million lines&lt;BR /&gt;I have already set the sort area to 750MB. The server has 1.5G RAM&lt;BR /&gt;&lt;BR /&gt;The tablespace TAB1 still has 900MB free space</description>
      <pubDate>Thu, 08 Apr 2004 04:49:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/select-statement-causing-ora-1652/m-p/3241805#M891903</guid>
      <dc:creator>kenny chia</dc:creator>
      <dc:date>2004-04-08T04:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement causing ORA-1652</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/select-statement-causing-ora-1652/m-p/3241806#M891904</link>
      <description>Kenny,&lt;BR /&gt;&lt;BR /&gt;To get the actual size of the sort operation, you can use this rq :&lt;BR /&gt;&lt;BR /&gt;select&lt;BR /&gt;        SID                    ,&lt;BR /&gt;        OPERATION_TYPE         ,&lt;BR /&gt;        POLICY                 ,&lt;BR /&gt;        SUM(ROUND(WORK_AREA_SIZE/1024/1024)) WA_SIZE_MO,&lt;BR /&gt;        SUM(ROUND(ACTUAL_MEM_USED        /1024/1024))   ACTUAL_MEM_USED_MO      ,&lt;BR /&gt;        SUM(ROUND(MAX_MEM_USED           /1024/1024))   MAX_MEM_USED_MO         ,&lt;BR /&gt;        SUM(NUMBER_PASSES) PASSES,&lt;BR /&gt;        SUM(ROUND(TEMPSEG_SIZE          /1024/1024))    DISQUE_MO&lt;BR /&gt;FROM&lt;BR /&gt;        v$sql_workarea_active&lt;BR /&gt;GROUP BY&lt;BR /&gt;        SID  ,&lt;BR /&gt;        OPERATION_TYPE,&lt;BR /&gt;        POLICY&lt;BR /&gt;ORDER BY&lt;BR /&gt;        OPERATION_TYPE,&lt;BR /&gt;        SID&lt;BR /&gt;/&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;BUT YOU DID NOT ANSWER THE FISRT QUESTION :&lt;BR /&gt;Have you check your user temporary tablespace setting ?&lt;BR /&gt;It not normal that for a select statement you get ORA-1652 on the user TS.&lt;BR /&gt;&lt;BR /&gt;Cheers &lt;BR /&gt;&lt;BR /&gt;Nicolas&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Apr 2004 05:12:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/select-statement-causing-ora-1652/m-p/3241806#M891904</guid>
      <dc:creator>Nicolas Dumeige</dc:creator>
      <dc:date>2004-04-08T05:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement causing ORA-1652</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/select-statement-causing-ora-1652/m-p/3241807#M891905</link>
      <description>Ah, now we are talking. Real data to work with! You still need to check out the temporary_tablespace assignment for the user/session though!&lt;BR /&gt;&lt;BR /&gt;&amp;gt; when I remove the distinct keyword, the SQL returned &amp;gt; 1 million lines. &lt;BR /&gt;&amp;gt; If I put the distinct keyword, Oracle will have to sort &amp;gt; 1 million lines&lt;BR /&gt;&amp;gt; I have already set the sort area to 750MB. The server has 1.5G RAM&lt;BR /&gt;&lt;BR /&gt;Sounds like indeed you have to be serious about the sort setup.&lt;BR /&gt;&lt;BR /&gt;And sounds like you basically did all you could for trying to stick to a memory sort.&lt;BR /&gt;Btw... I believe that once you are forced to go to disk you might as well trim back the sort_size dramatically to a couple of MB or whatever the rest of the application tends to be happy with.&lt;BR /&gt;&lt;BR /&gt;Do you suppose you could come up with a nested query where the distinct becomes a much earlier filter, reducing the number of rows to work on earlier? You would have to poke at rowcounts to see if this makes sense.&lt;BR /&gt;&lt;BR /&gt;Almost there....&lt;BR /&gt;&lt;BR /&gt;Good luck,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Apr 2004 08:42:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/select-statement-causing-ora-1652/m-p/3241807#M891905</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2004-04-08T08:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement causing ORA-1652</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/select-statement-causing-ora-1652/m-p/3241808#M891906</link>
      <description>Thanks for all the feedback!&lt;BR /&gt;&lt;BR /&gt;Anyway, the query&lt;BR /&gt;&lt;BR /&gt;select temporary_tablespace&lt;BR /&gt;from dba_users&lt;BR /&gt;where username=&lt;USERNAME&gt;&lt;BR /&gt;&lt;BR /&gt;TEMPORARY_TABLESPACE&lt;BR /&gt;------------------------------&lt;BR /&gt;TAB1_TEMP&lt;BR /&gt;&lt;BR /&gt;That is the temporary tablespace for the instance&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Do you suppose you could come up with a &amp;gt;nested query where the distinct becomes a &amp;gt;much earlier filter, reducing the number of &amp;gt;rows to work on earlier? You would have to &amp;gt;poke at rowcounts to see if this makes sense.&lt;BR /&gt;&lt;BR /&gt;-&amp;gt;nested query&lt;BR /&gt;You mean a select distinct statement inside a select statement? The query will then have small and multiple sorts, compared to now which is one big sort. I will look into this..&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/USERNAME&gt;</description>
      <pubDate>Sun, 11 Apr 2004 20:12:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/select-statement-causing-ora-1652/m-p/3241808#M891906</guid>
      <dc:creator>kenny chia</dc:creator>
      <dc:date>2004-04-11T20:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement causing ORA-1652</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/select-statement-causing-ora-1652/m-p/3241809#M891907</link>
      <description>In some case, a hint to force the Oracle optimizer to do an hash join instead of a nested loop will provide better performance. &lt;BR /&gt;&lt;BR /&gt;ex :&lt;BR /&gt;SELECT  /*+ ordered use_hash(TSLDMRST) parallel(TSLDMRST,4) */&lt;BR /&gt;...fields...&lt;BR /&gt;FROM TSLDMRST;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Beware that hints can provide immediate imporvement but DO REMEMBER that it is also dangerous to have many because when the time goes by, the condition may be very different and the improvement hints become a stupid directive. Bypass Oracle optimizer is not alway a good idea.&lt;BR /&gt;&lt;BR /&gt;Another option is to look why Oracle choose this explanation plan and what you can do to correct it if don't feel that's the best way to procede.&lt;BR /&gt;&lt;BR /&gt;- create index&lt;BR /&gt;- build and maintain statistics and historgram &lt;BR /&gt;- use materialized view if applicable&lt;BR /&gt;- ...&lt;BR /&gt;&lt;BR /&gt;Check DBMS_STATS standard package :&lt;BR /&gt;PROCEDURE GATHER_TABLE_STATS&lt;BR /&gt;     ownname VARCHAR2, &lt;BR /&gt;     tabname VARCHAR2, &lt;BR /&gt;     partname VARCHAR2 DEFAULT NULL,&lt;BR /&gt;     estimate_percent NUMBER DEFAULT NULL, &lt;BR /&gt;     block_sample BOOLEAN DEFAULT FALSE,&lt;BR /&gt;     method_opt VARCHAR2 DEFAULT `FOR ALL COLUMNS SIZE 1',&lt;BR /&gt;     degree NUMBER DEFAULT NULL,&lt;BR /&gt;     granularity VARCHAR2 DEFAULT `DEFAULT', &lt;BR /&gt;     cascade BOOLEAN DEFAULT FALSE,&lt;BR /&gt;     stattab VARCHAR2 DEFAULT NULL,&lt;BR /&gt;     statid VARCHAR2 DEFAULT NULL,&lt;BR /&gt;     statown VARCHAR2 DEFAULT NULL);&lt;BR /&gt;&lt;BR /&gt;PROCEDURE GATHER_INDEX_STATS(&lt;BR /&gt;     ownname VARCHAR2, &lt;BR /&gt;     indname VARCHAR2, &lt;BR /&gt;     partname VARCHAR2 DEFAULT NULL,&lt;BR /&gt;     estimate_percent NUMBER DEFAULT NULL,&lt;BR /&gt;     stattab VARCHAR2 DEFAULT NULL,&lt;BR /&gt;     statid VARCHAR2 DEFAULT NULL,&lt;BR /&gt;     statown VARCHAR2 DEFAULT NULL);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Cheers &lt;BR /&gt;&lt;BR /&gt;Nicolas</description>
      <pubDate>Wed, 14 Apr 2004 04:21:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/select-statement-causing-ora-1652/m-p/3241809#M891907</guid>
      <dc:creator>Nicolas Dumeige</dc:creator>
      <dc:date>2004-04-14T04:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement causing ORA-1652</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/select-statement-causing-ora-1652/m-p/3241810#M891908</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;sort_area_size is 750 MB ????&lt;BR /&gt;&lt;BR /&gt;I doubt that. Check V$PARAMETER, if it really has taken this value after the instance has started! &lt;BR /&gt;This is a PGA parameter in Oracle 8 ! &lt;BR /&gt;Each server process needs to allocate it's own (private) sort area. So if you have i.e. 10 server-processes, you will have 7,5GB of sort-memory....&lt;BR /&gt;&lt;BR /&gt;65K to 256K will be a reasonable sort_area_size.&lt;BR /&gt;If you really have 750MB to sort, go for an Index to support the sort and "hint" the statement.&lt;BR /&gt;&lt;BR /&gt;Hope this helps &lt;BR /&gt;Volker</description>
      <pubDate>Fri, 16 Apr 2004 16:58:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/select-statement-causing-ora-1652/m-p/3241810#M891908</guid>
      <dc:creator>Volker Borowski</dc:creator>
      <dc:date>2004-04-16T16:58:27Z</dc:date>
    </item>
  </channel>
</rss>

