The log file in the SAP SQLServer database is too large.

Source: Internet
Author: User

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.

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.