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.