Hi,
Could you please explain how to reduce file system size when its 100% full.
1.Like what are the files and folders can be deleted in order to reduce file system size.
2.How much space we can request to Linux team if we are not able to do housekeeping in the file system.
Oracle -- 12c,19c,21c
OS -- Linux
Regards,
Balaji.C
Hi Balaji,
You can use below command to find the
# disk usage
df -h
# find out who is taking too much place
du -hsx /* | sort -rh
You can repeat this above command just by changing the directory and remove which is not required.
Check the growth of the database using the script mentioned below and as per the forecast ask the LINUX team to add the disk.
SET LINESIZE 200 SET PAGESIZE 200 COL "Database Size" FORMAT a13 COL "Used Space" FORMAT a11 COL "Used in %" FORMAT a11 COL "Free in %" FORMAT a11 COL "Database Name" FORMAT a13 COL "Free Space" FORMAT a12 COL "Growth DAY" FORMAT a11 COL "Growth WEEK" FORMAT a12 COL "Growth DAY in %" FORMAT a16 COL "Growth WEEK in %" FORMAT a16 SELECT (select min(creation_time) from v$datafile) "Create Time", (select name from v$database) "Database Name", ROUND((SUM(USED.BYTES) / 1024 / 1024 ),2) || ' MB' "Database Size", ROUND((SUM(USED.BYTES) / 1024 / 1024 ) - ROUND(FREE.P / 1024 / 1024 ),2) || ' MB' "Used Space", ROUND(((SUM(USED.BYTES) / 1024 / 1024 ) - (FREE.P / 1024 / 1024 )) / ROUND(SUM(USED.BYTES) / 1024 / 1024 ,2)*100,2) || '% MB' "Used in %", ROUND((FREE.P / 1024 / 1024 ),2) || ' MB' "Free Space", ROUND(((SUM(USED.BYTES) / 1024 / 1024 ) - ((SUM(USED.BYTES) / 1024 / 1024 ) - ROUND(FREE.P / 1024 / 1024 )))/ROUND(SUM(USED.BYTES) / 1024 / 1024,2 )*100,2) || '% MB' "Free in %", ROUND(((SUM(USED.BYTES) / 1024 / 1024 ) - (FREE.P / 1024 / 1024 ))/(select sysdate-min(creation_time) from v$datafile),2) || ' MB' "Growth DAY", ROUND(((SUM(USED.BYTES) / 1024 / 1024 ) - (FREE.P / 1024 / 1024 ))/(select sysdate-min(creation_time) from v$datafile)/ROUND((SUM(USED.BYTES) / 1024 / 1024 ),2)*100,3) || '% MB' "Growth DAY in %", ROUND(((SUM(USED.BYTES) / 1024 / 1024 ) - (FREE.P / 1024 / 1024 ))/(select sysdate-min(creation_time) from v$datafile)*7,2) || ' MB' "Growth WEEK", ROUND((((SUM(USED.BYTES) / 1024 / 1024 ) - (FREE.P / 1024 / 1024 ))/(select sysdate-min(creation_time) from v$datafile)/ROUND((SUM(USED.BYTES) / 1024 / 1024 ),2)*100)*7,3) || '% MB' "Growth WEEK in %" FROM (SELECT BYTES FROM V$DATAFILE UNION ALL SELECT BYTES FROM V$TEMPFILE UNION ALL SELECT BYTES FROM V$LOG) USED, (SELECT SUM(BYTES) AS P FROM DBA_FREE_SPACE) FREE GROUP BY FREE.P;