Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2007
    Posts
    4

    Unanswered: purge older records

    hi all

    i am completely new to DB admin tasks as well as sybase.
    we have some tables which grow freuquently in size.
    i wanted to know how we can purge the data from these tables which are
    say like older than 2 months.

    can we identify whats the size of each table ? can we purge few
    records once the size of the table grows than specified limit say 1
    GB ?
    are there any utils ? are there common pitfalls like db file growing
    instead of reducing ?

    thanks & regards
    amey

  2. #2
    Join Date
    Mar 2007
    Posts
    72

    purging old data

    Hi,
    One way of easily identifying and purging old data in a table would be to add a column like date_inserted which will be populated with the system date during inserts / updates, using this column you may easily identify those rows that are older than your criteria and delete them (perhaps a cron job running may be once a day depending on the table usage)

  3. #3
    Join Date
    Mar 2007
    Posts
    72
    sp_spaceused <objeect name> would give you the space used by object.

  4. #4
    Join Date
    Mar 2007
    Posts
    4
    thanks
    can we provide purge option based on the size of the table ?
    say if the table size goes beyond 1 GB ... purge data

  5. #5
    Join Date
    Mar 2007
    Posts
    4
    thanks
    that was a race condition
    should have waited lil longer

  6. #6
    Join Date
    Mar 2007
    Posts
    4
    oops i got an error for sp_spaceused.
    it says
    Procedure sp_spaceused not found
    SQLCODE=-265 ODBC 3 state="42502"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •