SQL Server2000 Database Separation and append

Source: Internet
Author: User
Tags copy log microsoft sql server
server| Data | database

If your database system is installed on a system disk (such as C disk), because C disk is vulnerable to viruses, you may want your data to be stored on a non-system disk (such as D disk), which is very simple, you do not need to reload the database, just "detach" the data, and then copy the relevant files to a directory in D disk, and then "append" Database can be.

SQL Server 2000 allows you to detach data and transaction log files from a database and then reattach it to the same or another server. Detaching a database deletes the database from SQL Server, but remains intact in the data and transaction log files that make up the database. These data and transaction log files can then be used to attach the database to any instance of SQL Server, which makes the database's usage state exactly the same as it was when it was detached.

Database separation and attach is actually very simple, even if you are first contact with the database, it is easy to do.

Separation of databases

1, click "Program"Microsoft SQL Server Enterprise Management", open Enterprise Manager

2, expand the server group, and then expand the server, select the database to detach

3, click the right mouse button "All Tasks" separate the database, the following window appears

4, click OK, the selected database is separated.

It should be noted that the database can be detached only if the "connections using this database" number is 0 o'clock. So detach the database as much as possible disconnect all the connection to detach the database operation, if there is a program to connect the database, there will be the Database Connection Status window, showing the machine and name connecting this database, click the Clear button will forcibly disconnect the existing connection from the server.

Second, additional database

1, copy Mobile database files

Before attaching a database, you must associate a database with the. MDF (master data file). LDF (transaction log files) These two files are copied to the destination server or to a different file directory on the same server. These two files are typically located in the C:\Program Files\Microsoft SQL Server\MSSQL\Data directory.

2, click "Program"Microsoft SQL Server Enterprise Management", open Enterprise Manager

3, expand the server group, and then expand the server

4, right click on "Database" and then select "All Tasks" additional database, pop-up window

5, enter the MDF name of the database you want to attach. If you are unsure where the file is located, click Browse (...) Search To make sure that the MDF file you specified is correct, click Verify. In the Attach as box, enter a name for the database. The database name cannot be the same as any existing database name. Specify the owner of the database

6, click "OK" button. The database node for the newly attached database is created in the database folder.



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.