SQL SERVER 2000 database backup and restore

Source: Internet
Author: User
Tags backup
server| Backup | data | database

Back up the database, for example:

BACKUP DATABASE Northwind
to DISK = ' C:\Northwind.bak '

Restore the database, for example:

--Returns a result set consisting of a list of databases and log files contained in the backup set
RESTORE filelistonly
From DISK = ' C:\Northwind.bak '

--Restore a database backed up by backup
RESTORE DATABASE Northwind
From DISK = ' C:\Northwind.bak '

--Specify the database physical file name and path after restore
RESTORE DATABASE TestDB
From DISK = ' C:\Northwind.bak '
With
Move ' Northwind ' to ' c:\test\testdb.mdf ',
Move ' northwind_log ' to ' c:\test\testdb.ldf '

Move ' logical_file_name ' to ' operating_system_file_name '
Specifies that the given logical_file_name should be moved to Operating_system_file_name.
By default, Logical_file_name is restored to its original location. If you use the RESTORE
Statement to copy the database to the same or different server, you may need to use the move option to
New locate database files to avoid conflicts with existing files. Can be specified in a different move statement.
Each logical file within the database.

--Force restore, plus the REPLACE parameter, to force the restore on an existing database basis.
RESTORE DATABASE TestDB
From DISK = ' C:\Northwind.bak '
with REPLACE,
Move ' Northwind ' to ' c:\test\testdb.mdf ',
Move ' northwind_log ' to ' c:\test\testdb.ldf '



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.