在sql server 2008中执行特定行数的备份 [英] perform backup of particular number of rows in sql server 2008

查看:69
本文介绍了在sql server 2008中执行特定行数的备份的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是SQL的新手,我只知道基本的查询。我使用sql server 2008作为我的后端,存储学生的出勤细节。在一天内存储了近10,000条记录。,我学会了查询进行备份:



备份数据库dbname到disk = E:\\sqlbackup.bak with init,stats = 10



并恢复:



USE master ALTER DATABASE dbname SET Single_User WITH Rollback Immediate

RESTORE DATABASE dbname FROM DISK = E:\\sqlbackup.bak WITH RECOVERY,REPLACE

ALTER DATABASE dbname SET Multi_User



我想做的是,在每个学期结束后,我想备份最后一个学期的记录,然后从表中截断它们(为了提高效率)。所以如果管理员想要检查学生的最后一个学期的出勤率,他们可以从备份恢复并检查。,(应该确保,当前数据也没有超过写入)

我怎么能穿孔这个?我读过有关部分备份的文章。但是,我没有明确的想法。请帮助。

提前感谢..

I'm new to SQL,i know only the basic queries.,i use sql server 2008 as my back end,to store the student attendance details.,in a day nearly 10,000 records are stored.,i learnt the query for taking a backup:

backup database dbname to disk =E:\\sqlbackup.bak with init,stats=10

and restore:

USE master ALTER DATABASE dbname SET Single_User WITH Rollback Immediate
RESTORE DATABASE dbname FROM DISK =E:\\sqlbackup.bak WITH RECOVERY, REPLACE
ALTER DATABASE dbname SET Multi_User

what i want to do is,after every semester is over,i want to take a backup of the last semester records and then truncate them from the table(for efficiency purposes).,so that in case the admin wants to check the last semester attendance of a student,they can restore from the backup and check.,(which should ensure,the current datas are also not over writed)
how can i perform this? i read articles about partial backup.,but,im not having a clear idea.,pls help.
thanks in advance..

推荐答案

我会把它们留在数据库中。与卸载,等待重新加载,重新加载数据然后再次卸载的人工(和风险)相比,存储成本低廉。将来管理层永远不需要查看旧数据。到那时,旧数据可以永久删除。
I would leave them in the database. Storage is inexpensive compared to the labor (and risk) to unload, wait for reloads, reload data and then unload again. There will be some point in the future where the administration will never need to look at old data. When that time comes, old data can then be permanently deleted.


我尝试了分区表,谢谢@Mike Meinz:)
I tried partioned tables,thank you @Mike Meinz :)


这篇关于在sql server 2008中执行特定行数的备份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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