Follow the steps to avoid damaging your database if you do not follow the previous steps.
Generally do not recommend to do 4th, 62 steps, 4th step unsafe, it is possible to damage the database or loss of data. 6th step if the log reaches the upper limit, subsequent database processing will fail, and the log will not be restored until it is cleaned.
1. Empty log
DUMP TRANSACTION Library name with NO_LOG
2. Truncate the transaction log
BACKUP LOG database name with NO_LOG
3. Shrink the database file (if not compressed, the database file will not be reduced
Enterprise Manager--right--the database you want to compress--all tasks--shrink the database--Shrink the file
--Select Log file--in the shrinkage method to choose to shrink to XXM, here will give a allow to shrink to the minimum m number, directly enter this number, you can determine
--Select the data file--in the contraction way to choose to shrink to XXM, here will give a allow to shrink to the minimum m number, directly enter this number, OK
You can also use SQL statements to complete
--Shrinking the database
DBCC shrinkdatabase (Customer information)
--Shrink the specified data file, 1 is the file number, you can query through this statement:
SELECT * FROM Sysfiles
DBCC Shrinkfile (1)
4. In order to maximize the reduction of log files (if it is SQL 7.0, this step can only be done in Query Analyzer)
A. Detaching a database:
Enterprise Manager--server--database--right key--detach database
B. Delete log files on my Computer