Can i delete ldf files




















I copied this example from MSDN:. Do not risk deleting your LDF files manually! If you do not need transaction files or wish to reduce them to any size you choose, follow these steps: Note this will affect your backups so be sure before doing so. As you can read comments, it is not good solution to remove log. But if you are sure that you do not lose anything, you can just change your DB recovery mode to simple and then use. The worst thing that you can do is to delete log file from disk. If your server had unfinished transactions at moment of server stop, those transactions will not roll back after restart and you will get corrupted data.

You should back up your transaction log, then there will be free space to shrink it. Changing to simple mode then shrinking means you will lose all the transaction data which would be useful in the event of a restore.

Especially when we backup data or server daily and daytime changes are not critical from a security point of view. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. How to delete. Ask Question.

Asked 10 years, 6 months ago. Active 4 years, 1 month ago. Viewed 77k times. Improve this question. Why would you want to delete the transaction log? It's an integral part of your database! Read this; stackoverflow. Add a comment. Deleting your LDF files specially on production server might cause your databases to be corrupted. You can execute below script to know your file ID for your database log file, normally ldf's file ID is 2 if you are not using filegroups to split those.

Not considered as best practice to use DBCC ShrinkFile often but as the need arise you just have to perform full backup before doing so. To continue this discussion, please ask a new question. Spiceworks Help Desk. The help desk software for IT. Track users' IT needs, easily, and with only the features you need.

Learn More ». Get answers from your peers along with millions of IT pros who visit Spiceworks. Best Answer. Ghost Chili. Bottman Nov 19, at UTC. View this "Best Answer" in the replies below ».

In your case I would suggest shrinking to 50GB. Ensure that the scheduled Transaction log backup has the option 'Truncate Transaction Log' set. For a very active installation, consider adding two or more daily Differential backups. Ensure the backup files are labelled so that you can rapidly identify the most recent files.

Ensure that the backups are held on a different physical disk to the active database files and that they are staged to external media and copied off-site. Monitor the transaction log size daily for the next fortnight and then check it monthly. You should see it stabilise at a more manageable level.

Skip to main content Press Enter. Sign in. Skip auxiliary navigation Press Enter. Skip main navigation Press Enter. Toggle navigation. Search Options. CA Service Management. Private Community. Expand all Collapse all sort by most recent sort by thread. Now need to free the After searc One can review the following for suggestions Shrinking a log file should be considered as a 'first-aid' measure and needs to be followed by es Hi, please see the images below.



0コメント

  • 1000 / 1000