?
Solved

Automated Archive and Purge Tool for a data logging application.

Posted on 2004-09-23
2
Medium Priority
?
400 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 500 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Suggested Courses

777 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