简体   繁体   English

Microsoft Dynamics CRM 的收缩数据库日志文件

[英]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.我有 Microsoft Dynamics CRM 2015,数据库文件 (.mdf) 大约 20 Gb,日志文件 (.ldf) 大约 550 Gb。 I tried shrinking ldf file as discussed in this link我尝试按照此链接中的讨论缩小 ldf 文件

However, after the database log file was shrink, CRM stopped working.但是,在数据库日志文件缩小后,CRM 停止工作。 Can anyone advise.任何人都可以建议。

CRM stopped working CRM 停止工作

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.显然,该数据库未处于 SIMPLE 恢复模式且未配置事务日志的计划备份。

  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:然后,您可以将数据库设置为 SIMPLE 恢复:

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.每 n 分钟进行一次完整/差异 overnigt 和事务性备份。

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取决于选择,您将不得不继续使用简单恢复或切换回完整恢复,但添加丢失的事务日志计划备份

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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