查看SQLSERVER内部数据页面的小插件Internals Viewer
查看 SQLSERVER 内部 数据 页面 的小插件Internals Viewer 感觉internals viewer这个名字起得很好, 内部 查看 。 文章地址: SQL Server2008存储结构之堆表、行溢出 http://www.cnblogs.com/trams/archive/2010/09/11/1823727.html 这几天研究了一下这个小
查看SQLSERVER内部数据页面的小插件Internals Viewer
感觉internals viewer这个名字起得很好,内部查看。
文章地址:
SQL Server2008存储结构之堆表、行溢出
http://www.cnblogs.com/trams/archive/2010/09/11/1823727.html
这几天研究了一下这个小工具,发现挺好用的,对入想深入研究或者刚刚学SQLSERVER但是想对SQL有更深入了解的朋友们特别有用
先给出下载地址,这个是codeplex上的一个项目:
http://internalsviewer.codeplex.com/
我也上传到了自己的网盘,大家也可以到我的网盘下载:http://www.kuaipan.cn/file/id_4401224786924003.htm
InternalsViewerInstaller.msi 安装就不说了,直接双击安装,安装前最好先关闭SSMS
官方上说:可以用在SQL2005 SQL2008 ,我自己的电脑是SQL2005 Windows7可以使用
下载安装好之后,再打开SSMS,会看到SSMS的菜单增加了一个
点击Internals Viewer会有两个菜单:display transaction log 和Allocation Map
不知道为什么display transaction log用不了,本人非常想知道display transaction log是什么功能
只好点击“Allocation Map” ,点击之后会弹出 连接对话框,大家选择验证方式连接就可以了不多说了
打开之后会看到如下图
上面几个按钮
选择要查看的数据库
PFS:查看数据库的空闲页面情况
buffer pool:看下图
small:调整小方格的大小
key:是否显示数据库的表,如果不点击key下面不会显示表的
File Details:看上面那个图
小方格颜色的含义
点击某个小方格就会显示那个小方格的信息,每个小方格代表一个页面
小方格的颜色是跟下面表格的颜色是一一对应的,表示这些表格数据在数据库中的分布情况
鼠标在小方格上移动会看到这个小方格属于哪个表
鼠标左键单击某个小方格会显示这个页面的信息
如果你想看某个表的数据,你可以点击那个表,然后就会显示出那个表的数据分布情况,你点击某个小方格就可以看到那个表的数据了~
先从数据库的开头几个页面说起吧
数据库第1页:file header page
数据库第2页:PFS (Page Free Space) ,也叫页面自由空间,该页面用来跟踪一个文件中每一个特定页面的利用率情况
数据库第3页:GAM 全局分配映射(Global Allocation Map,GAM)页面 这些页面记录了哪些区已经被分配并用作何种用途
数据库第4页:SGAM 共享全局分配映射(Shared Global Allocation Map,SGAM)页面 这些页面记录了哪些区当前被用作混合类型的区,并且这些区需含有至少一个未使用的页面
第5页没有数据
第6页没有数据
数据库第7页:DCM 差异变更(Differential Changed Map,DCM)页面 他跟踪一个文件中的哪一个区在最新一次完整数据库备份之后被修改过。SQLSERVER
用在增量备份时只对已发生数据变更的分区进行增量备份即可
资料:SQL Server 2008 存储结构之DCM、BCM
数据库第8页:BCM 批量更改映射(Bulk Changed Map)页面,该页面当文件中的一个区在最小量或批量日志操作中被
使用时用到。
数据库第9页:sys.sysqnames 存在于每个数据库中。
4 字节 ID 标记的每个命名空间或限定名均存在对应的一行。
像dbcc checkprimaryfile命令的信息应该就存储于这个页面中
数据库第10页:boot page 数据库根据这个页面的信息来启动的
IAM页面
下面那里写错了,应该是堆表才有
具体页面信息
每个小方格代表一个页面,左边这些信息估计是使用了这两条语句:DBCC IND() DBCC PAGE()
下方显示对应的表数据
左上角显示了这个页面是数据页还是IAM页
数据行的结构
关于数据行的结构,大家可以看文章最开始给出的
文章地址: SQL Server2008存储结构之堆表、行溢出
http://www.cnblogs.com/trams/archive/2010/09/11/1823727.html
我摘抄一部分
其中状态A为如下说明:
bit0:版本信息,在SQL Server 2005/08总是为0
bit1-3: 0=(primary record);1=(forwarded record);2=(forwarding stud);3=(index record);4=(溢出数据);5=(ghost索引记录);6=(ghost数据记录)
bit4:表示存在NULL位图(在数据行里SQL2005/08总存在NULL位图)
bit5:表示存在变长列
bit6:未启用
bit7:表示存在幽灵记录
本例中30->00110000 它是一个行属性的位图 从高位存到低位(右边第一位是bit0),bit4为1即存在变长列的字段,因为在SQLServer2005/2008中总存在NULL位图,所以bit5也为1。
状态位B在SQLServer2005//2008中未启用,所以为00
IAM页和数据页的差别
堆表只依靠表里的IAM页(索引分配映射页)将堆的页面联系在一起,IAM里记录了页面编号,页面位置
红色的小方格就是记录了sys.syscolpars这张表他的数据页面在数据库中的分布情况
关于这个软件
我点击了一下IAM页面下方的小方格就报错了,然后弹出一个对话框,原来这个软件使用.NET来编写的
我们国人什么时候也能够写一个呢?
----------------------------------------------------------------------------------------------------
最后附上各个系统页面的作用和详细介绍地址
PFS页面介绍: http://dev.21tx.com/2011/11/24/11378.html
DCM BCM页面介绍: http://tech.it168.com/a2010/0921/1106/000001106857.shtml
GAM SGAM页面介绍:http://www.efficient-it.com.cn/space/78/viewspace/itemid/6756.html

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

For objects with the same name that already exist in the SQL Server database, the following steps need to be taken: Confirm the object type (table, view, stored procedure). IF NOT EXISTS can be used to skip creation if the object is empty. If the object has data, use a different name or modify the structure. Use DROP to delete existing objects (use caution, backup recommended). Check for schema changes to make sure there are no references to deleted or renamed objects.

The import steps are as follows: Copy the MDF file to SQL Server's data directory (usually C:\Program Files\Microsoft SQL Server\MSSQL\DATA). In SQL Server Management Studio (SSMS), open the database and select Attach. Click the Add button and select the MDF file. Confirm the database name and click the OK button.

When the SQL Server service fails to start, here are some steps to resolve: Check the error log to determine the root cause. Make sure the service account has permission to start the service. Check whether dependency services are running. Disable antivirus software. Repair SQL Server installation. If the repair does not work, reinstall SQL Server.

To view the SQL Server port number: Open SSMS and connect to the server. Find the server name in Object Explorer, right-click it and select Properties. In the Connection tab, view the TCP Port field.

If you accidentally delete a SQL Server database, you can take the following steps to recover: stop database activity; back up log files; check database logs; recovery options: restore from backup; restore from transaction log; use DBCC CHECKDB; use third-party tools. Please back up your database regularly and enable transaction logging to prevent data loss.

SQL Server database files are usually stored in the following default location: Windows: C:\Program Files\Microsoft SQL Server\MSSQL\DATALinux: /var/opt/mssql/data The database file location can be customized by modifying the database file path setting.

I cry to death. The world is madly building big models. The data on the Internet is not enough. It is not enough at all. The training model looks like "The Hunger Games", and AI researchers around the world are worrying about how to feed these data voracious eaters. This problem is particularly prominent in multi-modal tasks. At a time when nothing could be done, a start-up team from the Department of Renmin University of China used its own new model to become the first in China to make "model-generated data feed itself" a reality. Moreover, it is a two-pronged approach on the understanding side and the generation side. Both sides can generate high-quality, multi-modal new data and provide data feedback to the model itself. What is a model? Awaker 1.0, a large multi-modal model that just appeared on the Zhongguancun Forum. Who is the team? Sophon engine. Founded by Gao Yizhao, a doctoral student at Renmin University’s Hillhouse School of Artificial Intelligence.

If the SQL Server installation fails, you can clean it up by following these steps: Uninstall SQL Server Delete registry keys Delete files and folders Restart the computer
