I am working on a PL/SQL package to manage and free up space utilzed by extending Tablespaces when disk space reaches 85% (to send a warning message) and when it reaches 95% ( then start deleting records from the oldest partitions of the data tables).
We have an OLAP DB, where we have setup partitions of tables in each TableSpace. When the disk utilization reaches 85% then I should raise a warning (inserting a record to the SysMonitoring table) and when it reaches 95% ( then start deleting the oldest partition of the table in that TableSpace until the disk utlization falls below 85%). I have a mechanism to select the oldest partition table which I will use in there. But the rest of the functionality is needed. I am using DBA_SEGMENTS and DBA_DATA_FILES as a resource but can't build an effective logic yet. Would greatly appreciate any insight or help.