Links
Home
Oracle DBA Forum
Frequent Oracle Errors
TNS:could not resolve the connect identifier specified
Backtrace message unwound by exceptions
invalid identifier
PL/SQL compilation error
internal error
missing expression
table or view does not exist
end-of-file on communication channel
TNS:listener unknown in connect descriptor
insufficient privileges
PL/SQL: numeric or value error string
TNS:protocol adapter error
ORACLE not available
target host or object does not exist
invalid number
unable to allocate string bytes of shared memory
resource busy and acquire with NOWAIT specified
error occurred at recursive SQL level string
ORACLE initialization or shutdown in progress
archiver error. Connect internal only, until freed
snapshot too old
unable to extend temp segment by string in tablespace
Credential retrieval failed
missing or invalid option
invalid username/password; logon denied
unable to create INITIAL extent for segment
out of process memory when trying to allocate string bytes
shared memory realm does not exist
cannot insert NULL
TNS:unable to connect to destination
remote database not found'>ora-02019
exception encountered: core dump
inconsistent datatypes
no data found
TNS:operation timed out
PL/SQL: could not find program
existing state of packages has been discarded
maximum number of processes exceeded
error signaled in parallel query server
ORACLE instance terminated. Disconnection forced
TNS:packet writer failure
see ORA-12699
missing right parenthesis
name is already used by an existing object
cannot identify/lock data file
invalid file operation
quoted string not properly terminated
dropping global temp tables

dropping global temp tables

2004-07-29       - By David Kurtz

Reply:     1     2     3     4     5     6     7     8     9     10     >>  

If table physically exists (you can see it in v$sort_usage) in the temporary
segment because one or more session has put something into it, then you
can 't drop it.

If the GTT is on commit delete rows (the default), then when you commit or
rollback the table is physically delete, and disappears from v$sort_usage.
Then you can drop it (if nobody else is using it too).

If the GTT is on commit preseve, then the session that referenced it must be
terminated to get Oracle to physically delete the segment.

regards
__ ____ ____ ____ ____ __
David Kurtz
Go-Faster Consultancy Ltd.
tel: +44 (0)7771 760660
fax: +44 (0)7092 348865
web: www.go-faster.co.uk
mailto:david.kurtz@(protected)
Book: PeopleSoft for the Oracle DBA: http://www.psftdba.com
PeopleSoft DBA Forum: http://groups.yahoo.com/group/psftdba


> -- --Original Message-- --
> From: oracle-l-bounce@(protected)
> [mailto:oracle-l-bounce@(protected)]On Behalf Of Daniel Fink
> Sent: 29 July 2004 21:13
> To: oracle-l@(protected)
> Subject: Re: dropping global temp tables
>
>
> Jonathan,
>
> Do you receive an error? Depending on how the table is created, I
> cannot drop the
> table if there are rows in it.
>
> Regards,
> Daniel Fink
>
> Example:
> SQL > create global temporary table gtt_1 (gtt_col number);
>
> Table created.
>
> SQL > desc gtt_1
> Name
> Null? Type
>
>
> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---
> -- -- -----
> -- ---- ---- ------
> GTT_COL
> NUMBER
>
> SQL > drop table gtt_1;
>
> Table dropped.
>
> SQL > desc gtt_1
> ERROR:
> ORA-04043 (See ORA-04043.ora-code.com): object gtt_1 does not exist
>
>
> SQL > create global temporary table gtt_1 (gtt_col number);
>
> Table created.
>
> SQL > insert into gtt_1 values (1);
>
> 1 row created.
>
> SQL > select * from gtt_1;
>
> GTT_COL
> -- ---- --
> 1
>
> SQL > drop table gtt_1;
>
> Table dropped.
>
> SQL > desc gtt_1;
> ERROR:
> ORA-04043 (See ORA-04043.ora-code.com): object gtt_1 does not exist
>
>
> SQL > create global temporary table gtt_1 (gtt_col number) on
> commit preserve rows;
>
> Table created.
>
> SQL > insert into gtt_1 values (1);
>
> 1 row created.
>
> SQL > select * from gtt_1;
>
> GTT_COL
> -- ---- --
> 1
>
> SQL > commit;
>
> Commit complete.
>
> SQL > select * from gtt_1;
>
> GTT_COL
> -- ---- --
> 1
>
> SQL > drop table gtt_1;
> drop table gtt_1
> *
> ERROR at line 1:
> ORA-14452 (See ORA-14452.ora-code.com): attempt to create, alter or drop an index on temporary
> table already in
> use
>
>
> SQL > truncate table gtt_1;
>
> Table truncated.
>
> SQL > drop table gtt_1;
>
> Table dropped.
>
> SQL > desc gtt_1
> ERROR:
> ORA-04043 (See ORA-04043.ora-code.com): object gtt_1 does not exist
>
> SQL >
>
>
> Jonathan Gennick wrote:
>
> > Sorry if this is the dumb question for the day, but how does
> > one go about dropping the definition for a global temp
> > table? DROP TABLE doesn 't do the job for me.
> >
> > Best regards,
> >
> > Jonathan Gennick --- Brighten the corner where you are
> > http://Gennick.com * 906.387.1698 * mailto:jonathan@(protected)
> >
> > Join the Oracle-article list and receive one
> > article on Oracle technologies per month by
> > email. To join, visit
http://five.pairlist.net/mailman/listinfo/oracle-article,
> or send email to Oracle-article-request@(protected) and
> include the word "subscribe " in either the subject or body.
>
> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
> To unsubscribe send email to: oracle-l-request@(protected)
> put 'unsubscribe ' in the subject line.
> --
> Archives are at http://www.freelists.org/archives/oracle-l/
> FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --


-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To unsubscribe send email to: oracle-l-request@(protected)
put 'unsubscribe ' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --


-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To unsubscribe send email to: oracle-l-request@(protected)
put 'unsubscribe ' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --