资料封存 [英] Data Archiving

查看:136
本文介绍了资料封存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何制作用于数据归档实用程序的工具.

我有一个连续的数据流,并且不断地将数据保存在数据库中.数据库的大小当然是不断增长的.根据我们的数据保留政策,我们必须存档数据,并且仅将最近6个月的数据保留在服务器上.

请告诉我创建数据归档实用程序/过程的最佳方法.

另外,如果将来在当前/活动数据库中需要归档数据,该如何将其取回.

请指导我.

How do make a tool for Data Archiving Utility.

I have a continuous data stream and constantly saving the data in a database. The Database size is of course continuously growing. As per our data retention policy, we have to archive data and only keep the last 6 months of data on the server.

Kindly, tell me best way to create a utility / procedure for data archival.

Also, if archive data is required in the future in current/live database how do I bring it back.

Please guide me.

推荐答案

取决于您打算如何存储存档数据以及在何处存储存档数据,但是假设您拥有存档"服务器.您可以创建一个作业,该作业定期查看主服务器并运行一个存储过程,该过程将获取所有需要存档的数据并将其放入存档服务器的表中.

或者,您可以设置一个执行相同操作但将bcps数据输出并将其作为文件存储在另一台服务器上或认为适当的位置上的作业.

然后,无论哪种方式(或您选择的任何方法)都需要删除主数据库中的所有存档记录.这意味着该存储过程应该是事务性的,并且,如果有大量数据并且归档需要花费一些时间,则它将需要在一天(或晚上)的某个时间运行,这对任何应用程序或依赖于数据库的进程.
Depends on how and where you intend to store the archived data but let''s assume that you have an ''archive'' server. You could create a job that looks at the main server at regular intervals and runs a stored procedure that grabs all of the data that needs to be archived and places it into tables in the archive server.

Or you could have a job set up that does the same thing but bcps the data out and stores it as files on another server or wherever is considered appropriate.

Either way (or with whatever method you choose) you then need to delete all of the archived records form the main database. That means the stored procedure should be transactional and, if there is a lot of data and the archive takes some time, it will need to be run at a time of the day (or night) that will have the least impact on any applications or processes that rely on the database.


添加Digital Man所说的内容之后,您可能需要考虑创建一个存档数据库,然后定期安装该数据库,将要存档的数据传递到管道中.然后将其卸载.同样,根据数据量,这可能很耗时.尝试在周末开始的晚上每周安排一次工作.
Adding on to what Digital Man said, you might want to consider creating an archive database and then periodically, mounting said database, piping the data to be archived into it and then unmounting it. Again, depending on the amount of data this can be quite a time consuming thing. Try to schedule the jobs on a weekly basis, in the evening of the start of the weekend.


这篇关于资料封存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆