SQLSERVERS data sorting method

Source: Internet
Author: User

On Sunday, because the database was too slow, I decided to reorganize the database.
(Assume the database name is DB_ste)
1. Create a script file (FILENAME: DB_ste. SQL) based on the current database script)
2. Create a new database DB_ste2. If a database has a file group, create the same file group. (DB_ste_Group)
3. Run the data file (DB_ste) in the new database DB_ste2. (Note: because some processes depend on the databases of other servers, the servers must be connected to the network and there will be some warnings during creation. In addition, the names of PRIMARY and CHECK in the new database are different from those in the old one. Ignore this .)
4. Use the DTS tool provided by MSSQL to import data from DB_ste to DB_ste2.
5. Change sp_renamedb 'db _ ste 'and 'db _ test '.
Sp_renamedb 'db _ ste2', 'db _ ste'
6. You can use the database.
Summary:
Although this method helps the database speed a lot, it does not fundamentally solve the problem of database slowness.
Because the database is not found for the final reason of slowness, the database will also slow in the next six months.
It will never be so organized at that time. We often walk by the river, and there will be wet shoes. When the data goes wrong, it will be troublesome.

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.