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

  • SEARCH
  • Home
  • 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 436993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:32:01+00:00 2026-05-12T20:32:01+00:00

I have an application that records activity in a table (Oracle 10g). The logging

  • 0

I have an application that records activity in a table (Oracle 10g). The logging records should be kept for at least 30 days. I expect about 20 million rows to be added to this table every month.

The DBA suggested that the table be split in partitions containing one week of data. The weekly maintenance script would then delete the oldest partition (leaving only 4 weeks of data in the table).

What would be the best way of partitioning this logging table?

  • 1 1 Answer
  • 0 Views
  • 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. Editorial Team
    Editorial Team
    2026-05-12T20:32:01+00:00Added an answer on May 12, 2026 at 8:32 pm

    Partitioning a table isn’t hard – it appears that you will be removing the data on a weekly basis, so the partition clauses will look like

    PARTITION "P2009_45"  VALUES LESS THAN 
    (TO_DATE(' 2009-11-02 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
     PARTITION "P2009_46"  VALUES LESS THAN 
    (TO_DATE(' 2009-11-09 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    ... etc
    

    where your partitioning column is your date column of interest in the table.

    Additional comments:

    • If you can upgrade to 11g you can
      take advantage of interval
      partitioning, which is similar to
      this range partitioning, but Oracle
      will manage creating new partitions
      for you.
    • If you’re going to routinely drop off
      partitions, I would advise making all
      indexes on the table
      locally-partitioned to avoid the
      rebuilds that would be necessary with
      global partitions after partition
      operations.
    • If you have a good idea of the number
      of log entries per month, and it
      stays relatively constant, you might
      consider using a sequence (as a primary key) that is
      capped at this number and then
      recycles back to 0. Then your
      logging statements must become “MERGE
      INTO… ” statements that either
      create a new row or overwrite the row
      if it exists. This only guarantees
      that you’ll retain the number of rows
      allowed by the sequence max value and
      NOT a certain time interval, but this
      might be an alternative to
      partitioning (which as DvE points
      out, is an extra-expense option)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Electronic Workforce (EWF) application that records the caller speaking. The system
I have a .NET application that processes around 300,000 records in a batch import,
I use SQL Server 2005. I have a simple logging table that my web
I have developed an application that pulls X amount of records from my database
I have an application that uses WebServices to send database records (as an array)
I have an application that reads records from the database and exports it out
I have an application that writes several billion records into Cassandra and removes duplicates
I have a data-mining application that accesses a web-site to retrieve records on an
I have an application that sends messages to an external web service. I build
I have an application that displays an image inside of a Windows Forms PictureBox

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.