Trimming a schema


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Trimming a schema

  1. #1
    G. Levine Guest

    Trimming a schema


    Hello gurus.

    I have a schema with some tables which can grow very large--lots of rows
    into the millions. My desire is to create a way (SQL query, procedure, trigger,
    etc.) that will act on these tables once a row in a table reaches a certain
    date--for example I want to remove all rows greater than 18 months old in
    a given table.

    What is the best way to proceed?

    Any assistance would be greatly appreciated.

    Best regards,

    G.


    Share on Google+

  2. #2
    Larry Miller Guest

    Re: Trimming a schema

    G.,
    My advice would be to create an SP or package procedure that either deleted
    the appropriate rows or archived them to another table with the same
    structure. It could use SYSDATE to determine what rows it needed to
    delete/move.

    You could then use DBMS_JOBS (one of the system packages) to schedule the
    procedure to run nightly.

    HTH.

    --
    Larry Miller
    MCSD, Microsoft MVP Visual FoxPro
    Bifrost Solutions

    "G. Levine" <glevine@serviceware.com> wrote in message
    news:3cc83164$1@10.1.10.29...
    >
    > Hello gurus.
    >
    > I have a schema with some tables which can grow very large--lots of rows
    > into the millions. My desire is to create a way (SQL query, procedure,

    trigger,
    > etc.) that will act on these tables once a row in a table reaches a

    certain
    > date--for example I want to remove all rows greater than 18 months old in
    > a given table.
    >
    > What is the best way to proceed?
    >
    > Any assistance would be greatly appreciated.
    >
    > Best regards,
    >
    > G.
    >
    >



    Share on Google+

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center