The view SYS. dba_free_space and SYS. dba_data_files must be granted the query permission on these two view objects.
-- Connect as sysdba
Grant select on SYS. dba_free_space to Forrest;
Grant select on SYS. dba_data_files to Forrest;
View Oracle tablespace usage
-- Connect as Forrest
Select upper (F. tablespace_name) "tablespace name", D. tot_grootte_mb "tablespace size (m)", D. tot_grootte_mb-f. total_bytes "used space (m)", to_char (round (D. tot_grootte_mb-f. total_bytes)/d. tot_grootte_mb * 100, 2), '2017. 99 ') "usage ratio", F. total_bytes "Free Space (m)", F. max_bytes "maximum block (m)" from (select tablespace_name, round (sum (bytes)/(1024*1024), 2) total_bytes, round (max (bytes) // (1024*1024), 2) max_bytes from sys. dba_free_space group by tablespace_name) F, (select DD. tablespace_name, round (sum (DD. bytes)/(1024*1024), 2) tot_grootte_mb from sys. dba_data_files DD group by DD. tablespace_name) d Where D. tablespace_name = f. tablespace_name order by F. tablespace_name;