You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

DBMS_SCHEDULER

Hi,

I have a requirement where a table needs to be truncated periodically. Before truncating the table, I want to preserve the last 7 days of data in a separate history table.

My proposed approach is:

  1. Create a history table with the same/similar structure as the output table.
  2. Before truncating the output table, insert the required 7 days of data into the history table.
  3. Truncate the output table.
  4. Restore/reinsert the required records back into the output table from the history table.
  5. Automate this entire process as a scheduled job that runs once every week.

Is it possible to implement this using an Oracle scheduled job (DBMS_SCHEDULER)?

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!