首页 | 注册 | 登陆
首页 >> 技术专栏 >> java文章 >> java其它 

命令分割分区的方法


作者sql server 来源sql server 加入时间:2006年04月09日
摘要:
命令分割分区的方法


SQL> select PARTITIONED from dba_tables where table_name=LYTUSAGE;

PAR
---
YES


SQL> select PARTITION_NAME,HIGH_VALUE from dba_tab_partitions where TABLE_NAME=LYTUSAGE…

转载:转载请保留本信息,本文来自
http://www.51dibs.com
/html/2006/article/info17/a_0eccaaf949d18d16.htm




命令分割分区的方法


站点:爱心种子小博士 关键字:命令分割分区的方法




命令分割分区的方法

SQL> select PARTITIONED from dba_tables where table_name=LYTUSAGE;

PAR
---
YES


SQL> select PARTITION_NAME,HIGH_VALUE from dba_tab_partitions where TABLE_NAME=LYTUSAGE;

PARTITION_NAME                 HIGH_VALUE
------------------------------ --------------------------------------------------------------------------------
LYTUSAGE_200401                TO_DATE( 2004-02-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200402                TO_DATE( 2004-03-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200403                TO_DATE( 2004-04-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200404                TO_DATE( 2004-05-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200405                TO_DATE( 2004-06-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200406                TO_DATE( 2004-07-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200407                TO_DATE( 2004-08-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200408                TO_DATE( 2004-09-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200409                TO_DATE( 2004-10-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200410                TO_DATE( 2004-11-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200411                TO_DATE( 2004-12-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200412                TO_DATE( 2005-01-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200501                TO_DATE( 2005-02-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200502                TO_DATE( 2005-03-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200503                TO_DATE( 2005-04-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200504                TO_DATE( 2005-05-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200505                TO_DATE( 2005-06-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200506                TO_DATE( 2005-07-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200507                TO_DATE( 2005-08-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200508                TO_DATE( 2005-09-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200509                TO_DATE( 2005-10-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200510                TO_DATE( 2005-11-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200511                TO_DATE( 2005-12-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200512                TO_DATE( 2006-01-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA

24 rows selected.

删除2005年1月和2月的分区:
SQL> alter table lytusage drop partition LYTUSAGE_200501;

Table altered.

SQL> alter table lytusage drop partition LYTUSAGE_200502;

Table altered.

SQL> select PARTITION_NAME,HIGH_VALUE,TABLESPACE_NAME from dba_tab_partitions where table_name=LYTUSAGE;

PARTITION_NAME                 HIGH_VALUE
------------------------------ --------------------------------------------------------------------------------
TABLESPACE_NAME
------------------------------

LYTUSAGE_200401                TO_DATE( 2004-02-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
WACOS

LYTUSAGE_200402                TO_DATE( 2004-03-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
WACOS

LYTUSAGE_200403                TO_DATE( 2004-04-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
WACOS

LYTUSAGE_200404                TO_DATE( 2004-05-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
WACOS

LYTUSAGE_200405                TO_DATE( 2004-06-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
WACOS

LYTUSAGE_200406                TO_DATE( 2004-07-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
WACOS

LYTUSAGE_200407                TO_DATE( 2004-08-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
WACOS

LYTUSAGE_200408                TO_DATE( 2004-09-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
WACOS

LYTUSAGE_200409                TO_DATE( 2004-10-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
WACOS

LYTUSAGE_200410                TO_DATE( 2004-11-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
WACOS

LYTUSAGE_200411                TO_DATE( 2004-12-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
WACOS

LYTUSAGE_200412                TO_DATE( 2005-01-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
WACOS

LYTUSAGE_200503                TO_DATE( 2005-04-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
WACOS

LYTUSAGE_200504                TO_DATE( 2005-05-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
WACOS

LYTUSAGE_200505                TO_DATE( 2005-06-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
WACOS

LYTUSAGE_200506                TO_DATE( 2005-07-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
WACOS

LYTUSAGE_200507                TO_DATE( 2005-08-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
WACOS

LYTUSAGE_200508                TO_DATE( 2005-09-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
WACOS

LYTUSAGE_200509                TO_DATE( 2005-10-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
WACOS

LYTUSAGE_200510                TO_DATE( 2005-11-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
WACOS

LYTUSAGE_200511                TO_DATE( 2005-12-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
WACOS

LYTUSAGE_200512                TO_DATE( 2006-01-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
WACOS


22 rows selected.


SQL> ALTER TABLE LYTUSAGE
SPLIT PARTITION LYTUSAGE_200503 AT (TO_DATE(2005-03-01 00:00:00,SYYYY-MM-DD HH24:MI:SS))
INTO (partition LYTUSAGE_200502 tablespace wacos,partition LYTUSAGE_200503 tablespace wacos) UPDATE GLOBAL INDEXES;

Table altered.

SQL> ALTER TABLE LYTUSAGE
SPLIT PARTITION LYTUSAGE_200502 AT (TO_DATE(2005-02-01 00:00:00,SYYYY-MM-DD HH24:MI:SS))
INTO (partition LYTUSAGE_200501 tablespace wacos,partition LYTUSAGE_200502 tablespace wacos) UPDATE GLOBAL INDEXES;

Table altered.

PARTITION_NAME                 HIGH_VALUE
------------------------------ --------------------------------------------------------------------------------
LYTUSAGE_200412                TO_DATE( 2005-01-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200401                TO_DATE( 2004-02-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200402                TO_DATE( 2004-03-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200403                TO_DATE( 2004-04-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200404                TO_DATE( 2004-05-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200405                TO_DATE( 2004-06-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200406                TO_DATE( 2004-07-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200407                TO_DATE( 2004-08-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200408                TO_DATE( 2004-09-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200409                TO_DATE( 2004-10-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200410                TO_DATE( 2004-11-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200411                TO_DATE( 2004-12-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200503                TO_DATE( 2005-04-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200504                TO_DATE( 2005-05-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200505                TO_DATE( 2005-06-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200506                TO_DATE( 2005-07-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200507                TO_DATE( 2005-08-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200508                TO_DATE( 2005-09-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200509                TO_DATE( 2005-10-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200510                TO_DATE( 2005-11-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200511                TO_DATE( 2005-12-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200512                TO_DATE( 2006-01-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200501                TO_DATE( 2005-02-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA
LYTUSAGE_200502                TO_DATE( 2005-03-01 00:00:00, SYYYY-MM-DD HH24:MI:SS, NLS_CALENDAR=GREGORIA

24 rows selected.

SQL> alter table lytusage drop partition LYTUSAGE_200511;

Table altered.

SQL> alter table lytusage drop partition LYTUSAGE_200512;

Table altered.

SQL> ALTER TABLE LYTUSAGE ADD PARTITION LYTUSAGE_200511
VALUES LESS THAN (TO_DATE(2005-12-01 00:00:00,SYYYY-MM-DD HH24:MI:SS))
TABLESPACE wacos 
STORAGE(
 INITIAL 1M
 NEXT 10M
 MINEXTENTS 1
 MAXEXTENTS unlimited
 PCTINCREASE 0 )
 PCTFREE 5
 PCTUSED 95
 NOLOGGING;

Table altered.

ALTER TABLE LYTUSAGE ADD PARTITION LYTUSAGE_200512
VALUES LESS THAN (TO_DATE(2006-01-01 00:00:00,SYYYY-MM-DD HH24:MI:SS))
TABLESPACE wacos 
STORAGE(
 INITIAL 1M
 NEXT 10M
 MINEXTENTS 1
 MAXEXTENTS unlimited
 PCTINCREASE 0 )
 PCTFREE 5
 PCTUSED 95
 NOLOGGING;

Table altered.




发布人:sql server
→ 推荐给我的好友 → 报告错误链接
上篇文章:Linux下安装nvidia显卡驱动
下篇文章:(四)——虚拟机的历史
〖文章打印〗
〖关闭窗口〗
发表评论
查看评论
中“命令分割分区的方法”相关内容 中“命令分割分区的方法”相关内容
中“命令分割分区的方法”相关内容 中“命令分割分区的方法”相关内容
中“命令分割分区的方法”相关内容 中“命令分割分区的方法”相关内容

关于我们网站留言友情链接与我在线与我聊天领取红包管理TOP