learn about sqlserver partitition and partition table --- add or remove table partitions addition more
Yes . In the previous. chapter , we see how to generate "partition function" "parttiton schema" and "parttiton table"
what can we do if we need to add or drop an table partition ?
Here is exist status:
/* add partition (oracle)== split partition (oracle,mssql) */
/* drop parttiton (oracle) == merge partition (mssql) */
and
Here we go
/* add partitions */
alter database test add filegroup TESTFG_201602;
alter database test add file (name = TESTFG_201602,filename = "C:\var\opt\mssql\data\TESTFG_201602.ndf",size = 1MB,maxsize = unlimited,filegrowth = 1MB) to filegroup TESTFG_201602;
go
alter partition scheme PS_DATETIME_M_TEST NEXT USED TESTFG_201601;
alter partition function PF_DATETIME_M_TEST() split range ( N'2016-01-02T00:00:00.000');
go
That script has an error. you would see if I execute it
However, It is right about "less than", because we use range right --- it will be talk about it in detail
Let get into bussiness, hot to fix that ?
Yes, we merge it
/* drop partitions */
alter partition function PF_DATETIME_M_TEST() merge range (N'2016-01-02T00:00:00.000');
--alter database test remove file TESTFG_201602;
--alter database test remove filegroup TESTFG_201602;
then we can see that return
and we can make it right
alter partition scheme PS_DATETIME_M_TEST NEXT USED TESTFG_201602;
alter partition function PF_DATETIME_M_TEST() split range ( N'2016-02-01T00:00:00.000');
go
Yes. we did it
learn about sqlserver partitition and partition table --- add or remove table partitions addition more的更多相关文章
- learn about sqlserver partitition and partition table --- add or remove table partitions
demo/* add partitions */ alter database xxx add filegroup FG_=fff_201708;alter database xxx add file ...
- learn about sqlserver partitition and partition table 1
Dear all, Let get into business, the partitions on sql server is very different with that on oracle. ...
- 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 ...
- 实战:sqlserver 2008 扩展事件-XML转换为标准的table格式
--假设已经存在Event Session删除 IF EXISTS (SELECT * FROM sys.server_event_sessions WHERE name='MonitorLongQu ...
- 【待整理】MySQL alter table modify vs alter table add产生state不一样
MySQL:5.6.35 OS:redhat5.8 今天更新数据库某些表字段,有如下两SQL: ①alter table xx modify xxxx;(表大概是77w) ②alter table s ...
- faster alter table add column
Create a new table (using the structure of the current table) with the new column(s) included. execu ...
- How to add EDT relation table[AX2012]
setp 1. First create New Edit. setp 2.Create New Table First Table Name is NParentRel then drag and ...
- How to Remove Table Partitioning in SQL Server
In this article we will see how we can remove partitions from a table in a database in SQL server. I ...
- refresh table tablename ;MSCK REPAIR TABLE table_name;
在更改分区内的文件后刷新表 refresh table tablename ; 我们平时通常是通过alter table add partition方式增加Hive的分区的,但有时候会通过HDFS p ...
随机推荐
- 【FAR 方云研发绩效】助力于解决管理难题
方云研发绩效(farcloud.com)自发布以来,助力多家企业完成研发管理数字化转型,并有效解决产研绩效这一普遍存在的管理难题. 研发管理是许多企业面临的管理难题,首先,技术构成的信息壁垒,让内部沟 ...
- 查找2-n之间素数的个数
题目描述 查找2-n之间素数的个数.n为用户输入值.素数:一个大于1的正整数,如果除了1和它本身以外,不能被其他正整数整除,就叫素数.如2,3,5,7,11,13,17…. 输入 整数n 输出 2-n ...
- 【转】Java面试题:多继承
招聘和面试对开发经理来说是一个无尽头的工作,虽然有时你可以从HR这边获得一些帮助,但是最后还是得由你来拍板,或者就像另一篇文章“Java 面试题:写一个字符串的反转”所说: 面试开发人员不仅辛苦而且乏 ...
- python打印图形
i = 0 while i < 5: # print('*****') 效果与下行相同 print('*'*5) i+=1 print('\n\n') i = 1 while i < 6: ...
- Java 基础(三)| IO流之使用 File 类的正确姿势
为跳槽面试做准备,今天开始进入 Java 基础的复习.希望基础不好的同学看完这篇文章,能掌握泛型,而基础好的同学权当复习,希望看完这篇文章能够起一点你的青涩记忆. 一.什么是 File 类? java ...
- 使用log4j把日志写到mysql数据库
log4j可以支持将log输出到文件,数据库,甚至远程服务器,本教程以mysql数据库为例来讲解: 作者:Jesai 没有伞的孩子,只能光脚奔跑! 1.数据库设计 数据库表 表4-1日志表(log) ...
- Docker + node(koa) + nginx + mysql 开发环境搭建
什么是Docker Docker 是一个开源的应用容器引擎,基于 Go 语言 并遵从 Apache2.0 协议开源. Docker 可以让开发者打包他们的应用以及依赖包到一个轻量级.可移植的容器中,然 ...
- python 进程事件
1.作用 通过信号量,控制全部进程进入阻塞状态,也可以通过控制信号量,解除全部进程的阻塞 注意:定义的事件对象,默认状态是阻塞 2.常用方法 """ 对象.set() 作 ...
- mysql本地连接远程连接不上
首先测试linux下的端口有没有开通 /etc/init.d/iptables status 查看3306端口没有开通 使用以下命令开通 /sbin/iptables -I INPUT -p tcp ...
- PythonI/O进阶学习笔记_11.python的多进程
content: 1. 为什么要多进程编程?和多线程有什么区别? 2. python 多进程编程 3. 进程间通信 ======================================= ...