Home > Database > Mysql Tutorial > body text

在SQLServer中怎么样恢复数据的存储?

WBOY
Release: 2016-06-07 17:46:40
Original
1170 people have browsed it

在SQL Server中提供了这种恢复方式的存储过程。
一个数据库包括两个文件,mdf数据库文件和ldf日志文件
    1.sp_attach_db [@dbname =] 'dbname',[@filename1 =] 'filename_n'
     给系统添加一个数据库,在dbname指定数据库名称,filename_n指定数据库的文件和日志文件。比如我有一个ji的库,停止SQL Server服务备份ji_data.mdf,ji_log.ldf,启动SQL server,删除掉这个库,然后再把这两上文件拷到sql server DATA目录中,在Query Analyzer中执行如下语句:
    EXEC sp_attach_db @dbname = N'ji',
    @filename1 = N'd:mssql7dataji_data.mdf',
    @filename2 = N'd:mssql7dataji_log.ldf'
就会把这个库加入到SQL Server Group中

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template