Oracle Global Temp table - data is truncated but the table remains in the DB ! is this an expected behavior or a configuration?

dba.stackexchange https://dba.stackexchange.com/questions/242775

Frage

We are trying to create global temp table using

    Create global Temporary table t1 ( id NUMBER, description VARCHAR2(20) ) 
ON COMMIT Delete Rows;

and trying to drop it at the end manually but the temp table created cannot be dropped by after but the session the data is truncated at the end.

  1. Not able to drop it - is this how oracle works with GTT ?
  2. What are the alternatives ??
War es hilfreich?

Lösung

As the comments indicate Oracle Global temporary tables work differently than some might expect. They are intended to be permanent structures. The settings allow for data to be retained when a session is closed or deleted.

The key reason to use them is that each user can only access data for that user.

Your developers can all use the same table and insert/update/delete without interfering with other users.

There is no need to drop a GTT after using it.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit dba.stackexchange
scroll top