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 |
what is a trigger in mysql? Define different types of trigger. : Sql dba
how many values can the set function of mysql take? : Sql dba
What are triggers in sql?
what are all the common sql function? : Sql dba
what is top in tsql? : Transact sql
How can use stored procedures in sql?
Which is better trigger or stored procedure?
i have some prob lem to tell me about my self in interview first round ...
What are the types of index in sql?
What is substitution variable in pl sql?
What is bulk collect in pl sql?
What is sqlite format?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)