An enhance script to check partition tables under all schemas in sqlserver
Simple step for EMC NW & NMM
(1) disable WINDOWS UAC (reboot)
(2) SET windows domain user AS sysadmin
(3) modify hosts
(4) install software (NW , NMM) (reboot)
(5) CONFIG NWDROP VIEW [partition_show]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE view [partition_show]
as
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
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 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)
AND T1.index_id<=1
-----------------------------------------------------------------------------------------------------------------------------
Difference
------------------------------------------------------------------------------------------------------------------------------
original part:
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
new part
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
An enhance script to check partition tables under all schemas in sqlserver的更多相关文章
- (copy) Shell Script to Check Linux System Health
source: http://linoxide.com/linux-shell-script/shell-script-check-linux-system-health/ This article ...
- java中用activiti插件连接mysql数据库,自动建表过程中,在配置mysql架包路径“org.activiti.engine.ActivitiException: couldn't check if tables “
java中用activiti插件连接mysql数据库,出现错误: org.activiti.engine.ActivitiException: couldn't check if tables are ...
- A python script to check NE syncfail and get log from CIPS
#! /usr/bin/env python # -*- coding: UTF-8 -*- """The script is to check whether NE i ...
- 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_sho ...
- Write a script to check an interesting game 6174
# -*- coding: utf-8 -*-#from ftplib import FTPimport osdef sort_reverse(x,y): if x>y: return -1 i ...
- DB count check for TABLES VIEWS PROCEDURES TRIGGERS
SELECT DISTINCT(TABLESPACE_NAME) FROM ALL_TABLES; SELECT COUNT(*) FROM ALL_TABLES where TABLESPACE_N ...
- check all tables rows
select TABLE_NAME,NUM_ROWS from all_tables where OWNER='xx' order by NUM_ROWS desc;
- Partitioning & Archiving tables in SQL Server (Part 1: The basics)
Reference: http://blogs.msdn.com/b/felixmar/archive/2011/02/14/partitioning-amp-archiving-tables-in- ...
- Mysql Partition 理论知识总结
简述: 本文内容主要 Giuseppe Maxia 曾在Mysql Conference & Expo 2010发表关于 <Mysql Partition in Mysql 5.1 &a ...
随机推荐
- Spring是什么,Spring容器提供了那些功能,Spring的工作机制
spring是什么 spring 是一个轻型的容器,是J2EE规范的轻量级实现,可以一站式开发,其中提供了,bean工厂,用以构造我们需要的Model ,spring 是非侵入式的,spring应用中 ...
- 【转】利用Eclipse编辑中文资源文件(application_zh_CN.properties )
既然生为中国人,就没有什么好抱怨的了,遇到编码的问题,那只有解决它了. 如果经常使用Struts,并做过国际化操作的人来说,对于中文资源文件的处理应该不会感到陌生的.比如下面两个文件,一个是英文的,一 ...
- 【转】HTML5+WebGL:构建 3D 网页新世界
今年下半年, HTML5 和 WebGL 变成极热门词语,3D 网页来势汹汹.主流的浏览器 Google Chrome 以及 Mozilla Firefox 均致力于 HTML5+WebGL 的 3D ...
- Java 中级 学习笔记 2 JVM GC 垃圾回收与算法
前言 在上一节的学习中,已经了解到了关于JVM 内存相关的内容,比如JVM 内存的划分,以及JDK8当中对于元空间的定义,最后就是字符串常量池等基本概念以及容易混淆的内容,我们都已经做过一次总结了.不 ...
- 图解kubernetes scheduler基于map/reduce无锁设计的优选计算
优选阶段通过分离计算对象来实现多个node和多种算法的并行计算,并且通过基于二级索引来设计最终的存储结果,从而达到整个计算过程中的无锁设计,同时为了保证分配的随机性,针对同等优先级的采用了随机的方式来 ...
- 一个DNS数据包的惊险之旅
踏上旅程 “小子,快去查一下www.paypal.com的IP地址,我急用,晚了我弄你!”,暴躁老哥一把关上了门,留我一个DNS数据包在冷冰冰的房间. 过了一会儿,一位大叔打开了门,带着我来到了一座叫 ...
- 数学基础系列(六)----特征值分解和奇异值分解(SVD)
一.介绍 特征值和奇异值在大部分人的印象中,往往是停留在纯粹的数学计算中.而且线性代数或者矩阵论里面,也很少讲任何跟特征值与奇异值有关的应用背景. 奇异值分解是一个有着很明显的物理意义的一种方法,它可 ...
- Java入门 - 高级教程 - 03.泛型
原文地址:http://www.work100.net/training/java-generic.html 更多教程:光束云 - 免费课程 泛型 序号 文内章节 视频 1 概述 2 泛型方法 3 泛 ...
- 异数OS TCP协议栈测试(五)--关于QOS与延迟
. 异数OS TCP协议栈测试(五)–关于QOS与延迟 ##本文来自异数OS社区 github: https://github.com/yds086/HereticOS 异数OS社区QQ群: 6524 ...
- 替代 Hystrix,Spring Cloud Alibaba Sentinel 快速入门
提起 Spring Cloud 的限流降级组件,一般首先想到的是 Netflix 的 Hystrix. 不过就在2018年底,Netflix 宣布不再积极开发 Hystrix,该项目将处于维护模式.官 ...