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



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

Answer / 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

More SQL PLSQL Interview Questions

What are primary key and foreign key and how they work?

0 Answers  


how does a local variable is defined using t-sql? : Transact sql

0 Answers  


Explain about various levels of constraint.

0 Answers  


What is sql used for?

0 Answers  


What is structural independence and why is it important?

0 Answers  






What is mutating sql table?

0 Answers  


What are the two different parts of the pl/sql packages?

0 Answers  


Wat is SGA ?

3 Answers   ABB,


Do triggers have restrictions on the usage of large datatypes, such as long and long raw?

0 Answers  


write a pl/sql function if enter a value=0 then output value=1 and vise verse with out using if and case statements.

3 Answers   Zensar,


What does count (*) mean?

0 Answers  


Can you skip header records while loading? : aql loader

0 Answers  


Categories