日期:2014-05-18  浏览次数:20488 次

sqlserver2000数据库的 事务日志 文件限制在5M以内,有什么不妥吗?
如题:
    常见有好多讨论,怎么压缩事务日子的空间问题,还列举了好几种方法。
    现在我想把刚建立的数据库文件的事务日志   文件限制在5M以内,,会有什么不好的影响吗??
    请高手指教


------解决方案--------------------
设置成简单就可以了,何必限制?
否则天天不断的蹦错误提示,无法插入数据?

或者干脆,每天截断日志好了
------解决方案--------------------
SQL Server transaction log is very important and helpful for SQL Server transactions and database recovery. If your database recovery mode is FULL, you can restore your database to any timepoint before with the latest full database backup file and transaction log files. If your transaction log file grows too large or if you have no needs for restoring your database to any timepoint before, please follow the process as follows:
1. Perform a full database backup;
2. Run BACKUP LOG... WITH TRUNCATE_ONLY
3. Run DBCC SHRINKFILE(logfilename, 5)

Anyway, please note that scheduling to backup your database is very important to keep your database safety.



------解决方案--------------------
(1)出日志满的错误,动不动就不能用了,很烦。
(2)不记日志,你数据被破坏后找谁去?数据破坏包括硬盘故障,恶意修改,事务故障等。
------解决方案--------------------
可以用“作业” 来定时截断无用的日志信息,如果可以的话,应该经常进行备份数据库
这样比较保险一些
------解决方案--------------------
要不要日志是无所谓的,

只要你每天备份数据库就OK了。

大不了丢掉一天的数据。
------解决方案--------------------
要不要日志是无所谓的,

只要你每天备份数据库就OK了。

大不了丢掉一天的数据 。。。。这个说法是可取的。。
------解决方案--------------------
Timely checking your database data file and transaction log file size is a responsibility of a DBA. As I have mentioned, you can schdule a job to backup your database and truncate and shrink your transaction log file to keep its size under your control.This operation is safe.
If your database recovery mode is SIMPLE and if you frequently backup your database, the transaction file size will not be large. However in critical production environment, it is recommended to have your database run under FULL recovery mode.



------解决方案--------------------
事务日志 文件限制在5M以内,有什么不妥吗?

------------------------------------------------------
我可以很明确的告诉你如果你的数据库始终只要5M或者10M没有任何不妥

但是你要知道,事务日志是做什么用的,它为什么要增长?
保存完好的事务日志可以把你的数据库恢复到以前的任意时间。

你必须要给事务日志留一定的空间,抱错好说,清空了重新写好了,可是你的数据库要因此而停止服务,你的客户要投诉你

清空或者截断后如果误删了数据,或者那里坏了你的数据如何恢复,当然这些问题你一个人学习的时候是永远不会体会到的

关于数据库文件的压缩写了个blog写了点心得
http://blog.csdn.net/hb_gx/archive/2007/05/19/1616550.aspx

不看也可以
主要是你的日志大小要根据你的数据库增长来决定。

以后千万不要小看事务日志的作用。