SQL Server2000: separate databases and additional databases

Source: Internet
Author: User
  • Detaching a database

Database separation refers to the separation of databases from the server.

When the SQL server is running, it maintains information about all databases, including the databases that are currently not used. If these databases are not used for the time being, running them will only increase the burden on the server, so we need to separate these databases that are not used for the time being.

Implementation of database separation:

Right-click the database you want to detach and select the "detach Database" option in the "all tasks" list:

The following dialog box is displayed:

The status of the selected database is displayed. In "database status", "connection using this database" is 0, indicating that this database is not currently in use, if you do not manage the database for the time being, you can separate it.

You can select "separation options" based on your needs.

Click OK:

The database is detached successfully.

In another case, if the database to be detached is in use, the following dialog box will pop up when performing the above operation:

In "database status", "Use the connection of this database" is 1. Different from the above, it indicates that a connection is currently in use for this database.

If you want to detach the database, click "clear" to bring up the following dialog box:

Click OK. A prompt dialog box is displayed:

If yes is selected, the server sends a message to the user who uses the database to remind the user that the current database is to be stopped. Otherwise, the user is not notified, the preceding dialog box is in the following status:

The number of connections is 0. We need to wait for the user to stop using the database before selecting the "OK" button to detach the database. Otherwise, if the user does not stop using the database, we click "OK", the following error Prompt window will pop up:

If you do not stop the server, we only have to wait for the user to respond.

Only when the user stops using the database to be detached can the database be detached.

After the database is detached, the database is not displayed on the console ,:

Obviously. Our teacher database is separated and the server no longer manages its information.

  • Additional database
  • Attaching a database refers to re-adding the detached database to the server.

    Implementation of attaching a database:

    Right-click the "Database" in the "Enterprise Manager" directory tree window, and select the "Additional database" option in the "all tasks" list:

    The following window is displayed:

    Click Browse (the one before the "verify" button ):

    You can find the database you want to attach in the local disk directory (usually under the Microsoft SQL Server/MSSQL/Data Directory:

    Click OK:

    The attached database is successfully attached. You can view the attached database in the window on the right of the console.

    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.