代码如下 | 复制代码 |
ALTER DATABASE CenterMy
ADD FILEGROUP FGSP1
GO
ALTER DATABASE CenterMy
ADD FILE
(
NAME = 'SPTestLevel1',
FILENAME = 'D:SPPartitionFirstPartSPTestLevel1.ndf',
SIZE = 5120 KB,
MAXSIZE = UNLIMITED,
FILEGROWTH = 5120 KB
) TO FILEGROUP FGSP1
GO
|
代码如下 | 复制代码 |
ALTER DATABASE CenterMy
ADD FILEGROUP FGSP2
GO
ALTER DATABASE CenterMy
ADD FILE
(
NAME = 'SPTestLevel2',
FILENAME = 'D:SPPartitionSecondPartSPTestLevel2.ndf',
SIZE = 5120 KB,
MAXSIZE = UNLIMITED,
FILEGROWTH = 5120 KB
) TO FILEGROUP FGSP2
GO
|
代码如下 | 复制代码 |
ALTER DATABASE CenterMy
ADD FILEGROUP FGSP3
GO
ALTER DATABASE CenterMy
ADD FILE
(
NAME = 'SPTestLevel3',
FILENAME = 'D:SPPartitionThirdPartSPTestLevel3.ndf',
SIZE = 5120 KB,
MAXSIZE = UNLIMITED,
FILEGROWTH = 5120 KB
) TO FILEGROUP FGSP3
GO
|
代码如下 | 复制代码 |
SELECT *
FROM sys.filegroups
|
代码如下 | 复制代码 |
SELECT *
FROM sys.database_files
|
代码如下 | 复制代码 |
CREATE PARTITION FUNCTION TestSPFunction (INT)
AS RANGE RIGHT FOR VALUES ( 500, 1000,1300)
GO
|
代码如下 | 复制代码 |
CREATE PARTITION SCHEME TestSPScheme
AS PARTITION TestSPFunction
TO ([PRIMARY], FGSP1, FGSP2,FGSP3 )
GO
|