5

Is there way to list only temp tablespaces in Oracle? I found following query which is listing all the tablespaces, I just need only temp tablespaces.

SQL> select tablespace_name from dba_tablespaces;

TABLESPACE_NAME
------------------------------
SYSTEM
SYSAUX
UNDOTBS1
TEMP
USERS
Mureinik
  • 297,002
  • 52
  • 306
  • 350
Malatesh
  • 1,944
  • 6
  • 26
  • 39

2 Answers2

15

You can filter the list by the contents column:

SELECT tablespace_name FROM dba_tablespaces WHERE contents = 'TEMPORARY'

As described in the Oracle Database Online Documentation for dba_tablespaces.

Mureinik
  • 297,002
  • 52
  • 306
  • 350
  • Thanks it worked. SQL> SELECT tablespace_name FROM dba_tablespaces WHERE contents = 'TEMPORARY'; TABLESPACE_NAME ------------------------------ TEMP TEMPRM – Malatesh Jan 29 '19 at 16:10
1

You can the dba_temp_files, that has tablespace_name column

select distinct (TABLESPACE_NAME) from dba_temp_files;
Zain Elabidine
  • 349
  • 5
  • 16