Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: TEMPORARY TABLE

Re: TEMPORARY TABLE

From: zhu chao <zhuchao_at_gmail.com>
Date: Thu, 28 Oct 2004 13:13:11 +0800
Message-ID: <962cf44b0410272213f9beebb@mail.gmail.com>


Seems not exactly what you said. Normal table won't allow such operation,while GTT can.
>Beware, GTT and Truncates do not go together.. Currently we do not
>differntiate the GTT DDLs and Normal DDLs. Which means
>the TRUNCATE on the temporary (Session) table locks the entire structure
>(all-sessions-temp-tables) and all other sessions have
>to wait for library cache/pin waits.

12:04:17 SESSION1>truncate table gtt;

Table truncated.

12:04:23 SESSION1>insert into gtt select object_id,object_name from dba_objects;

3086 rows created.

12:04:28 SESSION1>--no commit here.
12:04:32 SESSION1>
12:04:32 SESSION1>select count(*) from gtt; 

  COUNT(*)


      3086

12:04:13 SESSION2>select * from gtt;

no rows selected

12:04:37 SESSION2>truncate table gtt;

Table truncated.

12:04:42 SESSION2>select * from gtt;

> This is not quite true. GTT truncate has no relation with Shared pool
> latch and it is not dead lock sensitive. Truncating a temporary table
> will require a X lock and X pin for the object (to update the object
> definition in the dictionary cache and library cache) and may be to
> update the TAB$ entry. Shared pool latch has no role in truncates.
>

-- 
Regards
Zhu Chao
www.cnoug.org
--
http://www.freelists.org/webpage/oracle-l
Received on Thu Oct 28 2004 - 00:08:47 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US