what is global temporary tables and how use that tables in
pl/sql packages

Answer Posted / sreemanth reddy

hi
You can not specify a tablespace with global temporary
tables. GTT's are built in the TEMP tablespace.
Global temporary tables have three major benefits:

1. Non-interference between private sets of data.

2. Ease of getting rid of 'scratch' data. In a heap table
you either rollback, or delete it. But in a GTT, you can
truncate explicitly, without affecting anyone else (or allow
the implicit "truncate on commit / exit" effect to do
the same thing).

3. Decreased redo generation as, by definition, they are
non-logging.

However:

Mixing temporary tables (GTTs) with permanent tables usually
causes some grief to the CBO. It has no information
about the number of rows in the GTT, and therefore guesses
(badly).

Even if you analyze table .. or
dbms_stats.gather_table_stats() you don't get stats on the
temporary table.

Set the init parameter dynamic_sampling to at least 2 for
GTTs to be sampled at run-time.

Note: All DDL includes two implicit commits so any rows in a
GTT specified with ON COMMIT DELETE ROWS will empty the
table.

Is This Answer Correct ?    0 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why query optimization is needed?

507


What is the use of triggers?

534


Name some usages of database trigger?

552


how to include numeric values in sql statements? : Sql dba

552


how to analyze tables with 'mysqlcheck'? : Sql dba

538






How to set up sql*plus output format in oracle?

587


What is set serveroutput on?

635


How to select all records from the table?

599


Explian rowid, rownum? What are the psoducolumns we have?

555


What is error ora-01000: maximum open cursors exceeded

598


What are the types of triggers in sql?

489


What are triggers in sql?

574


what is the use of set statement in tsql? : Transact sql

523


Is primary key always clustered index?

531


What are the different types of tables in sql?

476