初级问题:请问如何处置.mdf及.ldf(100分)

  • 主题发起人 主题发起人 小天
  • 开始时间 开始时间

小天

Unregistered / Unconfirmed
GUEST, unregistred user!
朋友不小心删除了sql7,只备份了data目录,有什么办法恢复其中的.mdf及.ldf文件吗?
 
没有安全属性文件,不能恢复
 
可能不行
 
.mdf和.ldf还在的话
用sp_attach_db 恢复

sp_attach_db [@dbname =] 'dbname',
[@filename1 =] 'filename_n' [,...16]

Arguments
[@dbname =] 'dbname'
Is the name of the database to be attached to the server. The name must be unique. dbname is sysname, with a default of NULL.
[@filename1 =] 'filename_n'
Is the physical name, including path, of a database file. filename_n is nvarchar(260), with a default of NULL. There can be up to 16 file names specified. The parameter names start at @filename1 and increment to @filename16. The file name list must include at least the primary file, which contains the system tables that point to other files in the database. The list must also include any files that were moved after the database was detached.
Return Code Values
0 (success) or 1 (failure)


注意打全路径

 
接受答案了.
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
D
回复
0
查看
1K
DelphiTeacher的专栏
D
D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
2K
DelphiTeacher的专栏
D
后退
顶部