partition_show , a new version to check partition table status in sqlserver
Dear all:
I had put "partition_show" before . but this time it makes faster.
partition_show:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create view [dbo].[partition_show]
as
WITH tobjectid AS
(
select t.object_id from sys.tables as t inner join sys.indexes
as i on t.object_id=i.object_id and i.type in (0,1) inner join sys.partition_schemes ps
on i.data_space_id=ps.data_space_id
)
SELECT distinct OBJECT_NAME(T2.object_id) TABLE_NAME
,T1.partition_number
,T4.name as "function_name"
,T3.name as "schema_name"
,T7.name File_group_name
,T1.rows
,CASE boundary_value_on_right
WHEN 1 THEN 'less than'
ELSE 'less than or equal to ' END as 'comparision'
--,CONVERT(varchar(100), T5.value, 112) value
,T5.value value
FROM sys.partitions T1
INNER JOIN sys.indexes T2
ON T1.object_id = T2.object_id
INNER JOIN sys.partition_schemes T3
ON T2.data_space_id = T3.data_space_id
INNER JOIN sys.partition_functions T4
ON T3.function_id = T4.function_id
LEFT JOIN sys.partition_range_values T5
ON T4.function_id = T5.function_id
AND T1.partition_number = T5.boundary_id
INNER JOIN sys.destination_data_spaces T6
ON T6.partition_scheme_id = T3.data_space_id
AND T6.destination_id = T1.partition_number
INNER JOIN sys.filegroups T7
ON T6.data_space_id = T7.data_space_id
/*where T2.object_id in (select OBJECT_ID(t.name) from sys.tables as t inner join sys.indexes as i on t.object_id=i.object_id and i.type in (0,1) inner join sys.partition_schemes ps on i.data_space_id=ps.data_space_id) */
where T2.object_id in (select object_id from tobjectid)
AND T1.index_id<=1
GO
partition_show , a new version to check partition table status in sqlserver的更多相关文章
- sqlserver partitition and partition table --- partition show
I can not believe that I had done this about two years Now we know there is totally different betwee ...
- Mycat+Mysql 插入数据报错 i[Err] 1064 - partition table, insert must provide ColumnList
使用Navicat连接Mycat 8066 成功插入了分库表和全局表 1.全局表 sql如下: '); '); '); 插入成功! 2.分库表 sql如下: ', null, null, null, ...
- WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
在 mkfs.ext4 /dev/sda2 格式化硬盘空间时,可能出现这种错误. had this situation at office where I was told to re-partiti ...
- WARNING: Re-reading the partition table failed with error 22: Invalid argument
在划分磁盘分区时,遇到错误"WARNING: Re-reading the partition table failed with error 22: Invalid argument&qu ...
- 【问题解决方案】之 jmeter启动报错:Not able to find Java executable or version. Please check your Java installation
故事发生在云计算实验课上-- ** 故事发生在云计算实验课上-- Step 1 在Xshell中登录自己的cloud虚拟机后,<sudo su ->切换到root用户 Step 2 < ...
- oracle partition table 分区表详解
Oracle partition table 分区表详解 分区表就是通过使用分区技术,将一张大表,拆分成多个表分区(独立的segment),从而提升数据访问的性能,以及日常的可维护性.分区表中,每个分 ...
- 计算机启动出现 Invalid Partition Table
计算机启动出现 Invalid Partition Table 解决办法 使用大白菜启动盘进入临时系统,打开程序DiskGenius 如果系统盘(一般为 C 盘)非活动状态,先激活 如果装系统的硬盘不 ...
- 小米2s线刷出现remote: partition table doesn't exist
=================问题============ 小米2s线刷出现remote: partition table doesn't exist =================解决方案= ...
- GUID Partition Table (GPT)
https://en.wikipedia.org/wiki/GUID_Partition_Table https://zh.wikipedia.org/wiki/全局唯一标识分区表 GUID Part ...
随机推荐
- idea左侧出现日期和文件大小怎么关闭
shift+alt+\
- github初使
怎么说那,全英文,对于我这个英文水平不是很高的人来说有一定的影响,但是这也促使了我学习英语,而且里面一些大牛的发表也不少的是英文版的,我感觉我在英语方面的需求,由github来提升了,早就注册好了账号 ...
- codeforces-Three Friends
Three Friends Three friends are going to meet each other. Initially, the first friend stays at the ...
- R语言 plot()函数
语法: plot(x, y, ...) x,y分别是两个向量,x为横轴坐标,y为纵轴坐标 其他参数: type= "p" for points, 散点图 默认 "l&qu ...
- Centos610 Oracle 监听文件配置参考
lister.ora配置参考 # listener.ora Network Configuration File: /home/oracle/app/oracle/product//dbhome_1/ ...
- Oracle 设置NLS_CHARACTERSET字符集
Oracle 设置NLS_CHARACTERSET字符集 sqlplus "/ as sysdba"SQL> SHUTDOWN IMMEDIATE;SQL> START ...
- arc066E - Addition and Subtraction Hard
题目链接 题目大意 给定一个只含加减和数字的表达式,在其中添加括号,使其值最大. 解题思路 显然,只有减号后面的括号会使其中表达式的值取反. 然后只有已经有左括号时才能加入右括号. 所以用\(f_0\ ...
- 解决 IDEA 下 struts.xml 中 extends="struts-default" 报红的问题
现象 在IDEA中配置struts.xml时 extends="struts-default" 报红,配置拦截器时属性无预选项提示,也爆红. struts.xml本身的配置并没有错 ...
- WinForm开发(1)——DataGridView控件(1)——C# DataGridView控件用法介绍
DataGridView控件在实际应用中非常实用,特别需要表格显示数据时.可以静态绑定数据源,这样就自动为DataGridView控件添加相应的行.假如需要动态为DataGridView控件添加新行, ...
- linux文本处理工具-1
文件内容: cat ,more,less 文件截取:head,tail 按列抽取:cut 排序和统计:sort,wc ----------------------------------------- ...