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.