简体   繁体   中英

Shrink Database Log file for Microsoft Dynamics CRM

I have Microsoft Dynamics CRM 2015 and the database file (.mdf) is around 20 Gb and the Log file (.ldf) is about 550 Gb. I tried shrinking ldf file as discussed in this link

However, after the database log file was shrink, CRM stopped working. Can anyone advise.

CRM stopped working

What error messages do your receive?

Just based on my assumptions:

Obviously that database is not in a SIMPLE recovery mode and no scheduled backup of the transaction log configured.

  1. First of all, make sense to check why you cannot shrink the log:
 SELECT name, log_reuse_wait_desc, recovery_model_desc FROM sys.databases WHERE name = 'yourDB'
  1. Then, you may set the database to a SIMPLE recovery:

ALTER DATABASE [yourDB] SET RECOVERY SIMPLE

OR, fix your backup of transaction log if, this is a reason

  1. then you have to shrink the log:

USE [yourDB] DBCC SHRINKFILE (2, 256)

When your database back to the operational state you have to decide what kind of backup scheme do you want yo have:

  • Full/diff backups per day every night
  • Full/diffs overnigt and Transactional backups every n minutes.

Depends on a choice, you will have to stay with SIMPLE recovery or switch back to FULL, but add missing scheduled backups of your transaction log

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM