简体   繁体   English

具有巨大的日志文件的完全恢复

[英]full recovery with huge log file

In a sql server database with a full model backup with tran logs backed up every 15 minutes, but ,still, the log file is huge. 在具有完整模型备份且每15分钟备份一次tran日志的sql服务器数据库中,但是,日志文件仍然很大。 I suspect I should act on the target recovery time parameter (60 sec actually) perhaps .. 我怀疑我应该对目标恢复时间参数(实际上是60秒)采取行动。

LOGSPACE logspace2 [ [ logspace_vlfstatus [3] recently I found a method to shrink it : 最近我找到了一种缩小它的方法:

shrink the DB after doing the following task : 完成以下任务后,收缩数据库:

/* Perform a full backup of your database. / *执行数据库的完整备份。

Change the backup method of your database to "Simple" 将数据库的备份方法更改为“简单”

Open a query window and enter "checkpoint" and execute 打开查询窗口并输入“检查点”并执行

Perform another backup of the database 执行数据库的另一个备份

Perform a final full backup of the database. 对数据库执行最终的完整备份。 */ * /

The transaction log backup will not shrink the files. 事务日志备份不会缩小文件。 If they grew, after backup the space will be marked as available and reused, but the file size will not be reduced. 如果它们增大了,则备份后该空间将被标记为可用并可以重复使用,但是文件大小不会减小。 However, if you tried to shrink it and it didn't, then probably the log is still in use. 但是,如果您尝试缩小它而没有缩小它,则该日志可能仍在使用中。 Is anything else that uses the transaction log, which prevents if from truncating? 还有其他使用事务日志的东西,可以防止被截断吗? Check the result of this command: 检查此命令的结果:

SELECT log_reuse_wait_desc FROM sys.databases where name = N'<database_name>';

It it shows anything other than NOTHING or LOG_BACKUP, you can't shrink it, because something else is using it. 它显示除NOTHING或LOG_BACKUP之外的任何内容,您无法缩小它,因为其他东西正在使用它。

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

相关问题 日志文件很大 - Log file size is huge 在完全恢复模式下进行备份时,事务日志是否被截断了? - Is The Transaction Log Truncated When Doing a Backup In Full Recovery Mode? 由于事务日志文件已满,无法删除记录 - Unable to delete records as the transaction log file is full 可以在Sql Server中从完全恢复更改为简单恢复 - Is it ok to change from full recovery to simple recovery in Sql Server 将恢复设置为简单仍然会导致日志文件使用CREATE和INSERT INTO SQL而不是SELECT INTO导致计算机内存不足 - Setting recovery to simple still results in Log File running computer out of memory with CREATE and INSERT INTO SQL but not SELECT INTO 将恢复设置为SIMPLE然后恢复为FULL是否有害? - Is it harmful to set recovery to SIMPLE and then back to FULL? 为什么我得到“数据库&#39;tempdb的日志文件&#39;已满” - Why do I get “The log file for database 'tempdb' is full” 如何在不使日志文件失控的情况下从大表中删除过期数据? - How can I delete expired data from a huge table without having the log file grow out of control? 从完全恢复数据库中选择时,简单恢复数据库是否记录事务日志? - does a simple-recovery database records transaction logs when selected from a full-recovery database? 数据库的事务日志已满 - The transaction log for the database is full
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM