笔记170 使用DBCC IND([GPOSDB],systempara,-1) 找到数据表所使用的数据页编号和信息
1 --使用DBCC IND([GPOSDB],systempara,-1) 找到数据表所使用的数据页编号和信息 -1: 显示全部IAM页,数据页, 索引页 也包括 LOB 和row-overflow 数据页。 2013-1-18
2 --.DBCC IND命令来找到数据页id,找到数据页id:219,
3 --这个数据页存放了test_del的数据
4 --dbcc ind(repl_test,test_del,-1)go
5
6 --http://www.cnblogs.com/SQLServer2012/archive/2013/01/17/2864880.html#2602483
7 --DBCC IND (db_name,table_name,index_id)
8 --查看某个索引使用的页面信息
9 --IndexId=0 堆 数据页
10 --IndexId=1 聚集索引 索引页
11 --IndexId>1 非聚集索引 索引页
12
13 DBCC IND([GPOSDB],systempara,-1)
14
15
16 第三个参数是一个非聚集索引ID或者 1, 0, -1, -2. 值的含义:
17 0: 只显示对象的in-row data页和 in-row IAM 页。
18 1: 显示对象的全部页, 包含IAM 页, in-row数据页, LOB 数据页row-overflow 数据页 . 如果请求的对象含有聚集索引则索引页也包括。
19 -1: 显示全部IAM页,数据页, 索引页 也包括 LOB 和row-overflow 数据页。
20 -2: 显示全部IAM页。
21
22 -----------------------------------------------------------------------------------------
23 http://www.cnblogs.com/trams/archive/2010/09/11/1823727.html
24 --查询该表的IAM页面地址和首页地址
25 SELECT total_pages,used_pages,data_pages,
26 --first_page,root_page,first_iam_page,
27 testdb.dbo.f_get_page(first_page) first_page_address,
28 testdb.dbo.f_get_page(root_page) root_address,
29 testdb.dbo.f_get_page(first_iam_page) IAM_address
30 FROM sys.system_internals_allocation_units
31 WHERE container_id IN (SELECT partition_id FROM sys.partitions
32 WHERE object_id in (SELECT object_id FROM sys.objects
33 WHERE name IN ('testheap')))