+ Reply to Thread + Post New Thread
Results 1 to 2 of 2
  1. #1
    sree0213's Avatar
    sree0213 is offline Junior Member
    Join Date
    10 Jan 2010
    Posts
    1
    Say Thanks
    0
    Thanked 0 Times in 0 Posts
    Documents
    0
    Uploads
    0

    Default partition table on daily basis and delete old partitions on weekly basis

    Please let me know how we can partition on day basis. And delete partition on daily basis.

    1) We have one current old data base which has 59 un-partitioned Tables with 300 days of data.
    Now we need write a script to make a new Database oracle 10g with same table definition but Portioned on txn_date(one partition a day) and load the data from current DB.
    We have txn_date field as date field in all tables.
    We are starting from txn_date from 01 Aug 2009 to create partitions on each day and name the partition as partition_MMDDYY to till today.
    So that we will have almost 180 partitions by the end of January 2010.
    2) After that we need to create 4 weeks of empty partitions i.e. 28 partitions from February 1st 2010 onwards.
    Same name standard: partition_MMDDYY.

    3) After one week we need to delete and drop all the partitions that are older than 180 days. (partion_MMDDYY) and REUSE the table space
    And we need to create one week of daily partitions.



    Thanks

  2.    Club-Oracle Complementary E-Books and Magazines
    Get your free Complementary Copy of Oracle Magazine

    You can also browse the Free Magazines and E-Books section to see the complete list of free magazines, e-books and Whitepapers.

  3. #2
    zargon's Avatar
    zargon is offline Forum Genius
    Join Date
    22 Oct 2008
    Location
    Here, or maybe there, or ...
    Posts
    473
    Say Thanks
    0
    Thanked 38 Times in 37 Posts
    Documents
    0
    Uploads
    0

    Default Re: partition table on daily basis and delete old partitions on weekly basis

    Quote Originally Posted by sree0213 View Post
    Please let me know how we can partition on day basis. And delete partition on daily basis.

    1) We have one current old data base which has 59 un-partitioned Tables with 300 days of data.
    Now we need write a script to make a new Database oracle 10g with same table definition but Portioned on txn_date(one partition a day) and load the data from current DB.
    We have txn_date field as date field in all tables.
    We are starting from txn_date from 01 Aug 2009 to create partitions on each day and name the partition as partition_MMDDYY to till today.
    So that we will have almost 180 partitions by the end of January 2010.
    2) After that we need to create 4 weeks of empty partitions i.e. 28 partitions from February 1st 2010 onwards.
    Same name standard: partition_MMDDYY.

    3) After one week we need to delete and drop all the partitions that are older than 180 days. (partion_MMDDYY) and REUSE the table space
    And we need to create one week of daily partitions.



    Thanks
    Google is your friend:

    http://www.google.com/search?hl=en&s...tition+&aqi=g7


    In particular start with this example:

    http://www.oracle-base.com/articles/...AndIndexes.php

Similar Threads

  1. How to Delete Work Orders ?
    By Aymn in forum Oracle SCM
    Replies: 2
    Last Post: 11-30-2009, 07:50 AM
  2. how to delete record
    By laxman in forum SQL PL/SQL
    Replies: 8
    Last Post: 11-11-2009, 04:19 PM
  3. ORA-14074: partition bound must collate higher than that of the last partition
    By goodarzi121 in forum Oracle Developer Suite and Tools
    Replies: 2
    Last Post: 05-12-2009, 03:51 AM
  4. Simple query to delete rows from table
    By simona007 in forum SQL PL/SQL
    Replies: 3
    Last Post: 01-28-2009, 09:09 AM

Tags for this Thread