Solved

Automated Archive and Purge Tool for a data logging application.

Posted on 2004-09-23
2
396 Views
Last Modified: 2006-11-17
I need to be able to archive all records older than a year, but be able to restore the archived records if required for inspection at a later date.
(The records are a history of alarms, and plant values form a production process)
The logging application uses MS SQL as the database.

Aged 'archived blocks' should be organised in 1 year chunks for easy selection.
What would be the best (and easiest way to implement this). This includes any special applications already available for this type of task.

Thanks fo now,

Jas
0
Comment
Question by:i2rjames
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Expert Comment

by:RoyJGeorge
ID: 12131546
I think the easiet way to do this is as follows
Use a DTS Package to export all records from the tables into flat  files (text file) comma delimeted. using the win zip command line utility zip the text files and move them into an archive folder.

to re import them just use another DTS package to import the unziped comma delimited files back into the database

This way the archive files are portable and not part of sql server and can be moved off site for safe keeping

Hope this helps
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 125 total points
ID: 12132844
I would suggest the following:
For each Year, create a table (maybe in another dedicated database), with the name of the (new) table having the year postfixed. If you later decided to have chunks of 1 month, the process will not change that much

To "archive" to that table, you simply insert all the relevant records to that table, and then delete them in the actual table, both instructions in a proper transaction with error-checking/handling...

Once you have the records in a table, you can do with that table whatever you want, for example DTS as indicated already above. The advantage of having 1 dedicated table is the fact that you can playback the records to this table instead directly to the main table, thus avoiding to clutter the main table unnecessary.

To automate this process, it will be a bit more tricky, but if you are used to DTS, you know for sure how to work with dynamic properties. The years, tablenames and filenames should be configured dynamically, so you can call the DTS package(s) with the Year as parameter and don't need to reconfigure it every year...

Cheers
0

Featured Post

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have a large data set and a SSIS package. How can I load this file in multi threading?
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question