Please follow these steps. Do not take the following steps if the previous steps are not performed to avoid damage to your database. generally, steps 4 and 6 are not recommended. Steps 4 are not secure and may damage the database or cause data loss. If the log reaches the upper limit in step 1, subsequent database processing will fail and the log can be restored after being cleared. 1. Clear the log DUMPTRANSACTION Database Name
Please follow these steps. Do not take the following steps if the previous steps are not performed to avoid damage to your database. generally, steps 4 and 6 are not recommended. Steps 4 are not secure and may damage the database or cause data loss. If the log reaches the upper limit in step 1, the subsequent database processing will fail and the log can be restored after being cleared. 1. Clear the log dump transaction database name
Please follow these steps. Do not take the following steps if the previous steps are not performed to avoid damage to your database.
Generally, steps 4 and 6 are not recommended. Steps 4 are not secure and may damage the database or cause data loss. If the log reaches the upper limit in step 1, the subsequent database processing will fail and the log can be restored after being cleared.
1. Clear logs
Dump transaction database name WITH NO_LOG
2. truncate transaction logs
Backup log database name WITH NO_LOG
3. Compress database files (if not compressed, the database files will not be reduced
Enterprise Manager -- Right-click the database you want to compress -- all tasks -- contract database -- contract file
-- Select log file -- select to shrink to XXM in the contraction mode. Here, a minimum number of MB allowed to be shrunk is displayed. Enter this number directly and click OK.
-- Select data file -- select to shrink to XXM in the contraction mode. Here, a minimum number of MB allowed to be shrunk is displayed. Enter this number directly and click OK.
You can also use SQL statements to complete
-- Shrink Database
Dbcc shrinkdatabase (customer profile)
-- Contract the specified data file. 1 indicates the file number. You can use this statement to query:
Select * from sysfiles
Dbcc shrinkfile (1)
4. To minimize log files (for SQL 7.0, this step can only be performed in the query analyzer)
A. Separate the database:
Enterprise Manager -- server -- database -- Right-click -- detach Database
B. Delete LOG files in my computer