none
关于对同一表的再分区?? RRS feed

  • 问题


  • use test
    create table TT(AUTIID INT IDENTITY(1,1) PRIMARY KEY,ID numeric(10),name char(20),Englist numeric(5,2),physics numeric(5,2));

    GO
    use TEST;

    ALTER DATABASE TEST ADD FILEGROUP GA;
    ALTER DATABASE TEST ADD FILEGROUP GB;
    ALTER DATABASE TEST ADD FILEGROUP GC;
    ALTER DATABASE TEST ADD FILEGROUP GD;
    ALTER DATABASE TEST ADD FILE(NAME=N'A',FILENAME=N'D:\A.NDF') TO FILEGROUP GA;
    ALTER DATABASE TEST ADD FILE(NAME=N'B',FILENAME=N'D:\B.NDF') TO FILEGROUP GB;
    ALTER DATABASE TEST ADD FILE(NAME=N'C',FILENAME=N'D:\C.NDF') TO FILEGROUP GC;
    ALTER DATABASE TEST ADD FILE(NAME=N'D',FILENAME=N'D:\D.NDF') TO FILEGROUP GD;
    CREATE PARTITION FUNCTION PARA(INT) AS RANGE LEFT FOR VALUES(20000,40000,60000);--标记一下.**********60000
    CREATE PARTITION SCHEME SCH AS PARTITION PARA TO ([GA], GB, GC, GD)

     GO
     
     use TEST;
    --再来分加入一个分区
    ALTER DATABASE TEST ADD FILEGROUP GE;--改名
    ALTER DATABASE TEST ADD FILEGROUP GF;--改名
    ALTER DATABASE TEST ADD FILEGROUP GG;--改名

    ALTER DATABASE TEST ADD FILE(NAME=N'E',FILENAME=N'D:\E.NDF') TO FILEGROUP GE;--改名E,GE
    ALTER DATABASE TEST ADD FILE(NAME=N'F',FILENAME=N'D:\F.NDF') TO FILEGROUP GF;--改名F,GF
    ALTER DATABASE TEST ADD FILE(NAME=N'G',FILENAME=N'D:\G.NDF') TO FILEGROUP GG;--改名G,GG

    CREATE PARTITION FUNCTION PARB(INT) AS RANGE LEFT FOR VALUES(8000000,10000000);--改名PARB--分区数小于文件组数.标识一下*****8000000

    CREATE PARTITION SCHEME SCHB AS PARTITION PARB TO ([GE], GF, GG);--改名SCHB,PARB,GE,GF,GG

     GO
    我的问题是,第二次分,是不是TT表从600000到800000再往下分呢???
    2009年9月26日 14:55

答案