Transaction Log Truncation

--method 1--
ALTER DATABASE KIS_Sample3 SET RECOVERY SIMPLE
 DBCC SHRINKFILE (KISPro100_log, 1)
 ALTER DATABASE KIS_Sample3 SET RECOVERY full
  go

 --metohd 2--
 use KIS_Sample
 go
 BACKUP DATABASE KIS_Sample TO DISK = N‘C:\aa.bak‘
 --BACKUP LOG KIS_Sample TO DISK = ‘nul:‘ WITH STATS = 10
 DBCC SHRINKFILE (KISPro100_log, 1)
时间: 2024-10-06 12:11:44

Transaction Log Truncation的相关文章

About Transaction Log

Q1.Why the log space cannot grow even if the recovery mode is full-recovery? A: This is because that the full-recovery mode takes effect only when the user set the full-recovery mode and do the full-backup operation.  This means that, when user creat

[转]How expensive are page splits in terms of transaction log?

How expensive are page splits in terms of transaction log? By: Paul Randal Page splits are always thought of as expensive, but just how bad are they? In this post I want to create an example to show how much more transaction log is created when a pag

The transaction log for database 'XXX' is full due to 'ACTIVE_TRANSACTION'.

Msg 9002, Level 17, State 4, Line 4The transaction log for database 'Test' is full due to 'ACTIVE_TRANSACTION'. 本定一个测试库错误,由于此库的LOG文件被设置成不允许自动增长,而在大量输入数据的时候报出此错.此库已经使SIMPLE恢复模式. --数据库当前LOG状态 select log_reuse_wait_desc from sys.databaseswhere name = 'T

The transaction log for database 'xxxx' is full due to 'ACTIVE_TRANSACTION'

今天查看Job的History,发现Job 运行失败,错误信息是:“The transaction log for database 'xxxx' is full due to 'ACTIVE_TRANSACTION'.” 错误消息表明:数据库的事务日志文件空间耗尽,log 文件不能再存储新的transaction log. SQL Server将事务日志文件在逻辑上划分为多个VLF(Virtual Log Files),将这些VLF组成一个的环形结构,以VLF为重用单元.如果一个VLF 中存在

DB2 “The transaction log for the database is full” 问题及解决办法

DB2在执行一个大的insert/update操作的时候报"The transaction log for the database is full.. "错误,查了一下文档是DB2的日志文件满了的缘故. 首先运行下面命令来查看DB2的日志配置信息 $ db2 get db cfg | grep LOG 注意其中的下面配置项 Log file size (4KB) (LOGFILSIZ) = 1024 Number of primary log files (LOGPRIMARY) =

通过Transaction Log(fn_dblog)取回被删除的数据

最近跟 James 讨论为何「ApexSQL Log」这个工具可以读到被删除的数据呢? 原来它是透过 Transaction Log 来读取数据的! 于是透过 Transaction Log 到网络上有找到「SQL Server – How to find Who Deleted What records at What Time」直接透过 Transaction Log 来把被删除的数据给找回来! 蛮神奇的,只是Run在我的区分大小写的DB中会发生错误,因为有些字段名称大小写没有一致,于是就调

SQL Server Transaction Log Truncate && Shrink

目录 什么是事务日志 事务日志的组成 事务日志大小维护方法 Truncate Shrink 索引碎片 总结 什么是事务日志 Transaction log   是对数据库管理系统执行的一系列动作的记录,并利用这些记录来保证在遭遇硬件故障,灾难情况下ACID的可用性.从物理上来说,事务日志就是一个记录对数据库更新操作的文件. 事务日志的组成 SQL Server 数据库引擎在内部将每个物理文件分为多个虚拟日志文件.虚拟日志文件没有固定大小和固定数量,这两个值是由数据库引擎动态决定的. 事务日志是一

The transaction log for database 'xx' is full,Error: 9002, Severity: 17, State: 2

检查数据库日志,有如下报错信息: Error: 9002, Severity: 17, State: 4. The transaction log for database 'SharedServices1_Search_DB' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases 查看当前日志的使用情况: 这里日志并没有完全满

测试用的数据库Transaction Log太大, 用于缩减它的脚本

记在这里, 备用. select name, recovery_model_desc from sys.databases where name = 'WSS_Content_1000' USE WSS_Content_1000 ; ALTER DATABASE WSS_Content_1000 SET RECOVERY Simple; go use WSS_Content_1000 go checkpoint go checkpoint go dbcc shrinkfile(WSS_Conte