on 2011 Dec 12 6:57 AM
I have millions of old measurement records in my database, which has now grown to 20GB. I would like to move records older than two years to another database and do so on a monthly basis. It seems silly to unload the database to a new database and the delete all records younger than two years from than (newly-created) database. Is there another way to do this?
Request clarification before answering.
If you created a second database, and set that as a Remote Server on your original database, you could then create an event in your original database to copy all the old rows into the second database, perhaps check that the same number have arrived(!) and then delete those from the original. That process could be completely automatic if you wanted.
Look at the "Working with Remote Servers" and "Automating Tasks Using Schedules and Events" topics in the help.
NB the term "Remote Server" can be confusing, it can be another database on the same server!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I fully agree with Justin's suggestion.
It should be noted that deleting old data won't reduce the database's file size - it will simply use the free pages for the coming inserts (which is a reasonable thing IMHO).
Therefore, in case you would like to reduce the file size and would like to rely on a regular facility to move old data to a second database, you will have to unload/reload the database once after you have done the first "move operation".
User | Count |
---|---|
75 | |
30 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.