Hello everybody

My problem is that I'm quite new in oracle admin/dev so I need some help pointing me how to limit the number of days of data stored in a table.
I have some datasources that come in files periodically. I'd like to limit the days stored for each table.

My system is Oracle 10g over Solaris 10.

I though in partitions, but I don't know how to refresh date in them to limit data to 'last 5 days' for example.

Please, if you have some link, example or doc it would be great. I don't know what to search in google to solve this... :S

Thanks in advance.

The simplest method will be create a view based on the table with last five days record. That will be always refreshed every time you run any query on the view.

But that doesn't limit the amount of space occupied by the main table. I'd like the disk space remain limited by the number of days and avoiding reject records by not enough space error.

Thanks!!

then you need to populate records from the source to a staging (intermediate) table before actually inserting them to your main table.

so with each load you need to truncate your table and load only the required records.

Thanks for the quick response. I'm developing a PL/SQL for doing that over a staging table.

I think is the best way to control the data loaded and del the old data.

Thanks!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.