sql server2005恢复只有mdf文件的数据库
[ 2008-10-28 23:06:29 | 作者: progame ]
sp_attach_single_file will only work if the file was unattached cleanly.
Steps in the case when this hasn't happened are
1) Move your mdf to safe location.
2) Create new databse of same name, same files, same file location and same file size.
3) Stop SQL server.
4) Swap mdf file of just created DB to your save one.
5) Start SQL. DB will go suspect.
6) ALTER DATABASE <your db> SET EMERGENCY
ALTER DATABASE <your db> SET SINGLE_USER
7) DBCC CHECKDB (<your db>, REPAIR_ALLOW_DATA_LOSS)
8) ALTER DATABASE <your db> SET MULTI_USER
ALTER DATABSE <your db> SET ONLINE
2000下的设置紧急模式的方法不行了, sql 2005是无论如何不允许直接修改系统表, 但是它提供了相关的命令
评论Feed: /feed.asp?q=comment&id=1983
Steps in the case when this hasn't happened are
1) Move your mdf to safe location.
2) Create new databse of same name, same files, same file location and same file size.
3) Stop SQL server.
4) Swap mdf file of just created DB to your save one.
5) Start SQL. DB will go suspect.
6) ALTER DATABASE <your db> SET EMERGENCY
ALTER DATABASE <your db> SET SINGLE_USER
7) DBCC CHECKDB (<your db>, REPAIR_ALLOW_DATA_LOSS)
8) ALTER DATABASE <your db> SET MULTI_USER
ALTER DATABSE <your db> SET ONLINE
2000下的设置紧急模式的方法不行了, sql 2005是无论如何不允许直接修改系统表, 但是它提供了相关的命令
评论Feed: /feed.asp?q=comment&id=1983
标签:
Sql Server
数据恢复
mdf
单文件
您可能感兴趣的文章:
没有日志,只有MDF文件如何恢复数据库(转) (progame at 2006-10-17)
Sql Server 自动查询优化有时候也是靠不住的 (progame at 2006-10-19)
Sql Server 2005 还真是聪明了很多 (progame at 2007-06-25)
关于分页这点破事 -- 如何才能分得准 (progame at 2007-07-03)
Only text pointers are allowed in work tables (progame at 2008-06-24)
SQL SERVER 2000中如何让union all构造出来的视图(view)利用到索引 (progame at 2006-04-28)
聚集索引和uniqueidentifier (guid) 不得不说的故事 (progame at 2006-08-03)
sql server 2000的一个bug (progame at 2006-09-23)
这篇日志没有评论.

