0% found this document useful (0 votes)
34 views1 page

Size Check

The document contains an SQL query that selects and calculates information about tablespaces such as size, free space, and percentage used from dba_free_space and dba_data_files. It unions this with a similar query on temporary tablespaces from dba_temp_files and v$temp_space_header, ordering the results by percentage free descending.

Uploaded by

sasidhar.new
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views1 page

Size Check

The document contains an SQL query that selects and calculates information about tablespaces such as size, free space, and percentage used from dba_free_space and dba_data_files. It unions this with a similar query on temporary tablespaces from dba_temp_files and v$temp_space_header, ordering the results by percentage free descending.

Uploaded by

sasidhar.new
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

SELECT /* + RULE */ df.

tablespace_name "Tablespace",
df.bytes / (1024 * 1024) "Size (MB)",
SUM(fs.bytes) / (1024 * 1024) "Free (MB)",
Nvl(Round(SUM(fs.bytes) * 100 / df.bytes),1) "% Free",
Round((df.bytes - SUM(fs.bytes)) * 100 / df.bytes) "% Used"
FROM dba_free_space fs,
(SELECT tablespace_name,SUM(bytes) bytes
FROM dba_data_files
GROUP BY tablespace_name) df
WHERE fs.tablespace_name (+) = df.tablespace_name
GROUP BY df.tablespace_name,df.bytes
UNION ALL
SELECT /* + RULE */ df.tablespace_name tspace,
fs.bytes / (1024 * 1024),
SUM(df.bytes_free) / (1024 * 1024),
Nvl(Round((SUM(fs.bytes) - df.bytes_used) * 100 / fs.bytes), 1),
Round((SUM(fs.bytes) - df.bytes_free) * 100 / fs.bytes)
FROM dba_temp_files fs,
(SELECT tablespace_name,bytes_free,bytes_used
FROM v$temp_space_header
GROUP BY tablespace_name,bytes_free,bytes_used) df
WHERE fs.tablespace_name (+) = df.tablespace_name
GROUP BY df.tablespace_name,fs.bytes,df.bytes_free,df.bytes_used
ORDER BY 4 DESC;
ELECT name, value FROM v$parameter WHERE name IN ( undo_management , undo_tablespace );

8291A1

9619149959

SELECT tablespace_name, file_name, bytes FROM dba_temp_files WHERE tablespace_n


ame = 'TEMP';

You might also like