Quick Recovery and backup of SQL Server databases
This article provides two methods for restoring the backup of SQL Server database for your reference. The specific content is as follows:
Method 1:We usually adopt the Backup recovery method, select the target database, and select the Source Device for recovery.
As follows:
Method 2:This method is sometimes inconvenient, and the script method is more convenient. The script method is as follows.
/* Back up the data DB to The. bak file. Then, use the bak file to restore a new database DBTest. */USE masterBACKUP database db to disk = 'e: \ DBTest. bak 'Restore filelistonly from disk = 'e: \ DBTest. bak 'Restore DATABASE DBTest from disk = 'e: \ DBTest. bak 'with move 'dbtest' TO 'e: \ Program Files \ Microsoft SQL Server2005 \ Data \ DBTest. mdf ', MOVE 'dbtest _ log' TO 'e: \ Program Files \ Microsoft SQL Server2005 \ Data \ DBTest_log.ldf', STATS = 10, REPLACEGO
Note:
STATS = 10One record is displayed for every 10% completed
REPLACEUse bak to restore the database and force restore
DBTestAndDBTest_logIs the logical file in g: \ back. Bak above.
The above is the SQL Server Database Backup recovery method, hope to help you learn.