SQLSERVER 2012
来源:互联网 发布:电脑上的健身软件 编辑:程序博客网 时间:2024/06/06 04:55
1.Ghost Cleanup 进程功能
Deletes operations from a table or update operations that cause a row to move can immediately free up space on a page by removing references to the row. However, under certain circumstances, the row can physically remain on the data page as a ghost record. Ghost records are periodically removed by a background process. This residual data is not returned by the Database Engine in response to queries.
Ghost Cleanup 进程通常在服务重启后运行的,主要作用:
1)清理在聚集表下,记录被删除后形成的ghost记录。
当在聚集索引下删除记录,并没有真正的删除只是标记为ghost记录,这样删除会变得更快,回滚只需要撤销标记。当事务提交后后台有ghost清理程序来清理这些被标记为ghost记录。并且会保留最后一个数据页的最有一条ghost记录以免页没释放。
当记录被删除会在pfs上标记ghost,在数据页头上也会标记。但是pfs上的标记并不会通知处理程序处理。只有到下一次扫描到这个页时才会处理,或者等到每5秒一次的清理进程激活,清理进程就会扫描pfs页,并对ghost页处理。若没有需要清理的了就跳入下一个数据库。若这次扫描没有发现有ghost记录,那么会设置上一个标记,下5秒唤醒就跳过这个数据库。
Reference:https://www.sqlskills.com/blogs/paul/inside-the-storage-engine-ghost-cleanup-in-depth/
2.Ghost Cleanup 进程如何屏蔽
在 MSSQL 的启动服务中增加 -t 6651 trace可以临时终止GHOST Cleanup的对日志文件的读取和清理操作。
或者: DBCC TRACEOFF(661,-1) --在全局范围关闭ghost清理工具
3.Ghost Cleanup 进程处理案例
....
page (1:2287922) does not match the previous page (1:226625) that the parent (4:1312990),
DBCC results for 'LOG'.
There are 42547680 rows in 4391675 pages for object "LOG".
CHECKDB found 0 allocation errors and 38 consistency errors in table 'LOG' (object ID 2021582240).
- SQLSERVER 2012
- SQLServer 2012 字符串函数
- SqlServer 2012 服务器角色
- SqlServer 2012 序列号
- Java 连接SQLServer 2012
- sqlserver 2012 序列号
- sqlserver
- SQLServer
- sqlserver
- sqlserver
- SqlServer
- sqlserver
- sqlserver
- sqlserver
- SQLServer
- SQLServer
- sqlserver
- sqlserver
- Centos 软件防护DDOS攻击
- KVO 正确使用姿势进阶及底层实现
- android recyclerView简单使用
- vuejs核心概念简析
- Protocol与Delegate 使用方法详解
- SQLSERVER 2012
- vscode终端很乱,已解决
- 企业运维监控平台架构设计与实现
- WebStorm使用 webstorm快捷键
- redis安装与测试
- NSNotificationCenter 通知使用方法详解
- linux下Vi/Vim编辑器高级操作
- Python 爬虫统计影评,超详细(按照步骤弄不出来杀楼主祭天)
- KVO、Delegate、Notification 区别及相关使用场景