存储细节的表包括:
backupset
backupfile
backupfilegroup (SQL Server 2005 upwards)
backupmediaset
backupmediafamily
restorehistory
restorefile
restorefilegroup
logmarkhistory
suspect_pages (SQL Server 2005 upwards)
你可以在Books Online里面找到上面这些表的具体说明。
下面这个脚本可以帮你找出每个数据库近期的备份信息:
SELECT b.name, a.type, MAX(a.backup_finish_date) lastbackup
FROM msdb..backupset a
INNER JOIN master..sysdatabases b ON a.database_name COLLATE DATABASE_DEFAULT = b.name COLLATE DATABASE_DEFAULT
GROUP BY b.name, a.type
ORDER BY b.name, a.type
指定数据库最后20条事务日志备份信息:
SELECT TOP 20 b.physical_device_name, a.backup_start_date, a.first_lsn, a.user_name FROM msdb..backupset a
INNER JOIN msdb..backupmediafamily b ON a.media_set_id = b.media_set_id
WHERE a.type = 'L'
ORDER BY a.backup_finish_date DESC
指定时间段的事务日志备份信息:
SELECT b.physical_device_name, a.backup_set_id, b.family_sequence_number, a.position, a.backup_start_date, a.backup_finish_date
FROM msdb..backupset a
INNER JOIN msdb..backupmediafamily b ON a.media_set_id = b.media_set_id
WHERE a.database_name = 'AdventureWorks'
AND a.type = 'L'
AND a.backup_start_date >'10-Jan-2007'
AND a.backup_finish_date <'16-Jan-2009 3:30'
ORDER BY a.backup_start_date, b.family_sequence_number
删除备份日志的两个存储过程:
EXEC msdb..sp_delete_backuphistory '1-Jan-2005'
EXEC msdb..sp_delete_database_backuphistory 'AdventureWorks'
方法一:如果你使用的是虚拟主机,可以用使用phpmyadmin来备份数据库。1、登陆phpmyadmin。登陆后左边会出现数据库列表,单击要备份的数据库。
2、在d出的页面中,右侧上部单击“导出”按钮,一般保持默认选项,最下面“另存为文件”,选择“ZIP压缩”,最后单击执行按钮。
3、d出保存文件后,保存文件即可。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)