The log file in the SAP SQLServer database is too large.
The server is a windows server 2008 R2 64-bit English version, and the database is an SQL server 2008 English version. The sap dev (SAP Test System) and its database are installed on the server. Because my colleagues copied six groups to test the system, client 6 wants to delete the group and release some disk space. After I delete client 6, I find that the remaining disk space is getting smaller and smaller, and there are more than 20 GB before the disk is deleted. As a result, the remaining space is only 7 MB after the deletion, at that time, there was a strange feeling. But immediately calm down and think about the reason. Then I checked the files on the disk where the SAP database is located and suddenly found that a log file is very large, with more than 140 GB, in addition, the original database file is more than 140 GB, which quickly occupies my entire disk space (300 GB). Now I finally find out the approximate cause. Now the white poison and dog are both very clever. Baidu immediately went down, and there was a way to release the space. After several twists and turns, I tried a method that I thought was feasible. Before trying, we recommend that you develop a good habit: backup, immediately back up all database files and database log files, and then contract the database log files. The procedure is as follows: Step 1: Find the SQL database manager Step 2: connect to your database. If it is a remote server, in the local area, enter the remote database name or IP address. Step 3: connect to the database, find the database name corresponding to your application system, and right-click the database and select Properties. Step 4: in the displayed dialog box, select options and change the recovery model to full. OK.
Step 5: Right-click the database you want to operate on, select shrink in tasks, and click files
Step 1: Change the default data in the file type in the figure to log, select the second project in shrink action, and change the contraction size to 0.
When you finish all this, you will be surprised to find that the data log shrinking function is so powerful that you can shrink the log data of more than 100 GB to more than 200 MB. Is it too exaggerated? haha !!Note: At last, change the recovery model in Step 4 to the original full. Remember!
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.