In #Oracle SQL Developer, the small gray cross on a table name typically indicates that the table is a temporary table. Temporary tables are used to store data temporarily for the duration of a session or transaction, depending on how they are defined.

!image
There are two types of temporary tables in Oracle:

1. Global Temporary Tables (GTTs):
- These tables are defined with the CREATE GLOBAL TEMPORARY TABLE statement.
- The data in these tables is session-specific or transaction-specific, depending on the ON COMMIT clause:
- ON COMMIT DELETE ROWS: Data is removed after each transaction (commit).
- ON COMMIT PRESERVE ROWS: Data persists for the duration of the session.

2. Private Temporary Tables (PTTs) (introduced in Oracle 18c):
- These tables are defined with the CREATE PRIVATE TEMPORARY TABLE statement.
- They are visible only to the session that created them and are automatically dropped at the end of the session or transaction, depending on the ON COMMIT clause.

The small gray cross is a visual indicator in SQL Developer to help you quickly identify that the table is temporary and not a permanent table. This can be useful when managing or querying databases with many tables.

Yes, in Oracle, there is a column in the ALL_TABLES data dictionary view that indicates whether a table is a temporary table. The column is called TEMPORARY.

Here’s how you can use it:

SELECT TABLE_NAME, TEMPORARY
FROM ALL_TABLES
WHERE OWNER = 'YOUR_SCHEMA_NAME';


- The TEMPORARY column will have the value:
- Y: If the table is a temporary table (Global Temporary Table or Private Temporary Table).
- N: If the table is a permanent table.

### Example:
If you want to check if a specific table is temporary, you can run:

SELECT TABLE_NAME, TEMPORARY
FROM ALL_TABLES
WHERE TABLE_NAME = 'YOUR_TABLE_NAME'
AND OWNER = 'YOUR_SCHEMA_NAME';


This will tell you whether the table is temporary or not. Keep in mind that for Private Temporary Tables (PTTs), they are not listed in ALL_TABLES because they are session-specific and not stored in the data dictionary like regular tables. Instead, PTTs are managed dynamically within the session.
 
 
Back to Top