Data in temporary tables is stored in temp segments in the temp tablespace.
![global temporary table in oracle 10g global temporary table in oracle 10g](https://blogs.sap.com/wp-content/uploads/2018/12/se11_mdua.png)
There is no affect on the data of other sessions. If the TRUNCATE statement is issued against a temporary table, only the session specific data is trucated.CREATE GLOBAL TEMPORARY TABLE my_temp_table ( In contrast, the ON COMMIT PRESERVE ROWS clause indicates that rows should be preserved until the end of the session. Although indexes add overhead to the process of filling a temporary table, it can be a strong argument in favour of using a temporary table when processes would benefit from an index that cannot be added to the original table(s) (either because of schema mismatches, for instance a join that must use a complex, non-deterministic result, or because data comes from a schema you only have select access to, or because data comes from an external table). The most significant advantage of temporary tables over other solutions is that they can be indexed.When the additional cost of populating them is dwarfed by the performance improvement of further operations compared to alternative solutions.When the result set they contain is required by several queries that cannot be combined (updates of distinct tables).They are filled only once in the session, or with data sets of comparable size and properties (distribution of data, etc.), in which case dynamic sampling can benefit statements.As shown above temporary tables don't make life easy for the optimizer, which can lead to wrong choices on its part - and when the optimizer is wrong, it can be very wrong. There are some cases when using a temporary table is justifiable, but those cases are probably less frequent than commonly thought. Better avoided isn't exactly the same as completely banished.