Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 59617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:02:00+00:00 2026-05-10T18:02:00+00:00

I have an Oracle table which contains event log messages for an application. We

  • 0

I have an Oracle table which contains event log messages for an application. We don’t want this table to grow out of control and eat up too much space, so we’d like to set a cap on the number of rows that it can contain to some big number like one million.

So we’d like to tell Oracle that when the table grows too large, it should delete the oldest rows to make space for new rows.

Is there any way to do this? I imagine we could do this with a trigger or by making all inserts with a stored procedure, but is there anything simpler?

EDIT: A couple of answers have suggested solutions that involve partitions. We do not currently partition this table, although we have the ability to do so if necessary. However, from looking into the matter, it seems that even if we partition the table, we’d still need for some kind of a scheduled job to drop the old partitions, etc. So we’ve decided to forgo partitions in favor of a scheduled job to check the row count and delete old rows as necessary once per day.

Thanks for the help, everyone.

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T18:02:01+00:00Added an answer on May 10, 2026 at 6:02 pm

    Depending on your definition of simpler…

    My bias would be to schedule a job that runs periodically (say, nightly) in order to delete the oldest rows. If you expect that you could generate a million event logs in a single day, you may want the job to run more frequently, but nightly is generally sufficient for most people. This has the advantage of being asynchronous so that you’re not incurring the overhead of counting a million rows every time you do an insert to find out if you have to purge some data. On the other hand, it does potentially require some administration to set up the job.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Access 2002 application which links an Oracle table via ODBC with
I have this table in an Oracle DB which has a primary key defined
we have a table in an Oracle Database which contains a column with the
I have a oracle table which contains char(n) type for several columns. I use
I have an entity that maps to an external oracle table which is one
I have a table like this (Oracle, 10) Account Bookdate Amount 1 20080101 100
I have a field in a table which contains bitwise flags. Let's say for
I have a query which retrieves the data from Oracle DB. The table which
We have data stored in oracle 10g db which contains french character set. The
I have rows in an Oracle database table which should be unique for a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.