数据库是在完整恢复模式下 (简单恢复模式没有问题)
==============================
就是程序里有两个按钮点备分就备分 还原就还原
===========================
在帮助里查到的是
USE master;
GO
ALTER DATABASE AdventureWorks SET RECOVERY FULL;
GO
-- Create a logical backup device for the full AdventureWorks backup.
EXEC sp_addumpdevice 'disk', 'MyAdvWorks_FullRM',
'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\BACKUP\MyAdvWorks_FullRM.bak';
GO-- Back up the full AdventureWorks database:
BACKUP DATABASE AdventureWorks
TO MyAdvWorks_FullRM WITH FORMAT;
GO
--Create a pure log backup:
BACKUP LOG AdventureWorks TO MyAdvWorks_FullRM;
GO
--Create tail-log backup:
BACKUP LOG AdventureWorks TO MyAdvWorks_FullRM
WITH NORECOVERY;
GO
--Restore the full backup (from backup set 1):
RESTORE DATABASE AdventureWorks FROM MyAdvWorks_FullRM WITH NORECOVERY;
--Restore the pure log backup (from backup set 2):
RESTORE LOG AdventureWorks FROM MyAdvWorks_FullRM WITH FILE=2, NORECOVERY;
--restore the tail-log backup (from backup set 3):
RESTORE LOG AdventureWorks FROM MyAdvWorks_FullRM WITH FILE=3, NORECOVERY;
GO
--recover the database:
RESTORE DATABASE AdventureWorks WITH RECOVERY;
GO
=====================================================
这上面是备份与恢复合在一起的,
把备份与恢复拆开问题就出来了
不知道为什么,而且只能恢复一次, 第2次在企业管理器里还原 就会提示尚未备份数据库日志的尾部什么什么的.... 记得2000的时候没这么多问题啊..要昏了
==============================
就是程序里有两个按钮点备分就备分 还原就还原
===========================
在帮助里查到的是
USE master;
GO
ALTER DATABASE AdventureWorks SET RECOVERY FULL;
GO
-- Create a logical backup device for the full AdventureWorks backup.
EXEC sp_addumpdevice 'disk', 'MyAdvWorks_FullRM',
'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\BACKUP\MyAdvWorks_FullRM.bak';
GO-- Back up the full AdventureWorks database:
BACKUP DATABASE AdventureWorks
TO MyAdvWorks_FullRM WITH FORMAT;
GO
--Create a pure log backup:
BACKUP LOG AdventureWorks TO MyAdvWorks_FullRM;
GO
--Create tail-log backup:
BACKUP LOG AdventureWorks TO MyAdvWorks_FullRM
WITH NORECOVERY;
GO
--Restore the full backup (from backup set 1):
RESTORE DATABASE AdventureWorks FROM MyAdvWorks_FullRM WITH NORECOVERY;
--Restore the pure log backup (from backup set 2):
RESTORE LOG AdventureWorks FROM MyAdvWorks_FullRM WITH FILE=2, NORECOVERY;
--restore the tail-log backup (from backup set 3):
RESTORE LOG AdventureWorks FROM MyAdvWorks_FullRM WITH FILE=3, NORECOVERY;
GO
--recover the database:
RESTORE DATABASE AdventureWorks WITH RECOVERY;
GO
=====================================================
这上面是备份与恢复合在一起的,
把备份与恢复拆开问题就出来了
不知道为什么,而且只能恢复一次, 第2次在企业管理器里还原 就会提示尚未备份数据库日志的尾部什么什么的.... 记得2000的时候没这么多问题啊..要昏了
解决方案 »
- select * from usr where user_type='1'和select * from usr where user_type=1的差别
- 求修改条SQL语句,谢谢-就这么多分了,呜呜
- 急救!!!MSSQL DTS导入数据提示找不到指定模块
- 一条简单的触发器?
- 如何更新数据库当中某个表某个字段的所有值
- 这个数据库中的表该怎么设计比较合理?
- 同志们,这个触发器怎么做?
- 查询的条件语句中判断字符为空和为null的问题
- 大家一起做个数据库开发的网站如何?
- where xxx in(xxx)如何按照in里面的字符串顺序排序
- 【请高手进,SQL2005 提示列"A"不属于表】在线等
- SQL 查询 报 查询表名过多 最大256 有什么好的解决方法吗??
==============================怎么解决啊
System.Data.SqlClient.SqlError: 尚未备份数据库 "test" 的日志尾部。如果该日志包含您不希望丢失的工作,请使用 BACKUP LOG WITH NORECOVERY 备份该日志。请使用 RESTORE 语句的 WITH REPLACE 或 WITH STOPAT 子句来只覆盖该日志的内容。 (Microsoft.SqlServer.Smo)
http://msdn2.microsoft.com/zh-cn/library/ms179314(SQL.90).aspx
restore headeronly from bak1
restore database d1 from bak1 with file=2 --从完全备份中恢复
----------------------------------------------------------------------
restore headeronly from bak2 --从差异备份中恢复
restore database d2 from bak2 with file=1,norecovery
restore database d2 from bak2 with file=5,recovery
----------------------------------------------------------------------
restore headeronly from bak3 --从日志备份中恢复
restore database d3 from bak3 with file=1,norecovery
restore log d3 from bak3 with file=2,norecovery
restore log d3 from bak3 with file=3,norecovery
restore log d3 from bak3 with file=4,norecovery
restore log d3 from bak3 with file=5,recovery
----------------------------------------------------------------------
restore database d3 from bak3 with file=1,norecovery --恢复到指定时间
restore log d3 from bak3 with file=2,norecovery
restore log d3 from bak3 with file=3,norecovery
restore log d3 from bak3 with file=4,recovery,stopat='2003-08-15 11:29:00.000'
----------------------------------------------------------------------
restore database d5 filegroup='FG2' from bak5 with file=4,norecovery --还原文件组备份
restore log d5 from bak5 with file=5,norecovery
restore log d5 from bak5 with file=7,recovery
----------------------------------------------------------------------
restore headeronly from bak6 --还原文件备份
restore database d5 file='d5_data3' from bak6 with file=6,norecovery
restore log d5 from bak6 with file=7,norecovery
restore log d5 from bak6 with file=9,recovery
----------------------------------------------------------------------
restore database d5 from bak6 with replace --删除现有数据库,从备份中重建数据库