日志文件大小不会减少 [英] Log file size not reduce

查看:80
本文介绍了日志文件大小不会减少的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的数据库的数据库日志大约是2GB。

数据库正在使用完全恢复选项。


我想减少日志的文件大小因为它占用了很多空间。


我会做一个完整的数据库备份,然后备份事务日志

....这两个备份都是通过检查选项明确无效

来自交易日志的条目执行的。


但是我之后备份,数据库日志仍然是2GB。


我应该怎么做才能减少数据库日志文件的大小?

我应该使用吗?:

==============================

使用no_log转储Tran databaseName

DBCC shrinkdatabase(databaseName,30)

==============================


在生产服务器中使用是否安全?


Peter CCH

Database log of my DB is around 2GB.
The database is using FULL recovery option.

I want to reduce the file size of the log cause it takes up a lot of
space.

I''d do a full database backup, then backup the transaction log as well
.... both backup performed with a check on the option "clear inactive
entries from transaction log".

But after I backup, the database log is still 2GB.

What should I do to reduce the database log file size?
Should I use?:
==============================
Dump Tran databaseName with no_log
DBCC shrinkdatabase(databaseName, 30)
==============================

Is that safe to be used in production server?

Peter CCH

推荐答案

[发布并邮寄,请在新闻中回复]


Peter CCH (pe************@gmail.com)写道:
[posted and mailed, please reply in news]

Peter CCH (pe************@gmail.com) writes:
我的数据库的数据库日志大约是2GB。
数据库正在使用FULL恢复选项。

我想减少日志的文件大小,因为它占用了大量的空间。

我会做一个完整的数据库备份,然后同时备份事务日志
...通过检查选项清除事务日志中的非活动状态来执行备份。

但是在备份之后,数据库日志仍然是2GB。

我该怎么做才能减少数据库日志文件的大小?
我应该使用吗?:
=========== ===================
使用no_log转储Tran databaseName
DBCC shrinkdatabase(databaseName,30)
======= =======================

在生产服务器中使用是否安全?
Database log of my DB is around 2GB.
The database is using FULL recovery option.

I want to reduce the file size of the log cause it takes up a lot of
space.

I''d do a full database backup, then backup the transaction log as well
... both backup performed with a check on the option "clear inactive
entries from transaction log".

But after I backup, the database log is still 2GB.

What should I do to reduce the database log file size?
Should I use?:
==============================
Dump Tran databaseName with no_log
DBCC shrinkdatabase(databaseName, 30)
==============================

Is that safe to be used in production server?




首先,在开始收缩文件之前请三思而后。

如果你知道你的数据库经历过沉重的一次性问题蓝色 -

月亮更新,那么收缩日志就有意义了。但是如果由于日常操作而导致

日志为2GB,则日志将再次增长。并且当日志增长时你会损失服务器上的性能。
并且

日志文件可能在文件系统级别上碎片化。)


如果您使用NO_LOG,则必须进行完整备份,否则您将没有

很长时间从那时起开始有任何最新的恢复选项。


DBCC SHRINKFILE比DBCC更好地缩小日志文件SHRINKDATABASE

也将对数据文件进行操作。

-

Erland Sommarskog,SQL Server MVP, es **** @ sommarskog.se


SQL Server SP3的联机书籍
http://www.microsoft.com/sql/techinf .. .2000 / books.asp




hi


你可以使用DBCC SHRINKFILE为此目的

最好问候,

Chandra
http://groups.msn.com/SQLResource/
http://chanduas.blogspot.com/

---------------------------------------


***通过开发人员指南 http://www.developersdex.com ***

hi

you can use DBCC SHRINKFILE for this purpose
best Regards,
Chandra
http://groups.msn.com/SQLResource/
http://chanduas.blogspot.com/
---------------------------------------

*** Sent via Developersdex http://www.developersdex.com ***


我使用以下语句。 它只会再次增长/ b $ b的概念是虚假的。如果你不缩小它,它最终会占用

整个硬盘(至少在我们的经验中)并且我们有

没有经历过性能将它每天缩小到一个的问题

兆字节。


使用DBTest

go


DBCC SHRINKFILE(DBTest_log,1)

BACKUP LOG DBTest WITH TRUNCATE_ONLY

DBCC SHRINKFILE(DBTest_log,1)

go

I use the below statement. The concept of "it is just going to grow
again" is bogus. If you don''t shrink it, it will eventually take up the
entire hard drive it is on (at least in our experience) and we have
experienced no performance problems with shrinking it every day to one
megabyte.

use DBTest
go

DBCC SHRINKFILE(DBTest_log, 1)
BACKUP LOG DBTest WITH TRUNCATE_ONLY
DBCC SHRINKFILE(DBTest_log, 1)
go


这篇关于日志文件大小不会减少的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆