b1nary0mega
1/12/2015 - 4:02 PM

Get available space and look/clear out recyclebin

Get available space and look/clear out recyclebin

--GET FREE SPACE
select tablespace_name, sum(bytes) free FROM
DBA_FREE_SPACE
group by tablespace_name;
/*
USERS	    3866624
SYSTEM	  7208960
SYSAUX	  77922304
UNDOTBS1	397148160
NPD_DATA	474546176
*/

select sum(space) from recyclebin;
/*
31608
*/

select sum(space) from user_recyclebin;
/*
31608
*/

purge recyclebin;
purge user_recyclebin;
--done

--GET FREE SPACE
select tablespace_name, sum(bytes) free FROM
DBA_FREE_SPACE
group by tablespace_name;
/*
SYSAUX	77922304
UNDOTBS1	396099584
USERS	3866624
SYSTEM	7208960
NPD_DATA	474546176
*/

select sum(space) from recyclebin;
/*
NULL
*/

select sum(space) from user_recyclebin;
/*
NULL
*/