在 SQL Server 中为检查器工作空间创建数据文件
标准 GIS 存储建议倾向于将索引和日志文件与矢量和表格业务表分开保存。出于性能方面的考虑,最好分开放置业务、要素和空间索引表,并根据文件组数据文件的使用模式对其进行放置。对于多版本化且非常活跃的编辑地理数据库,VERSIONS 文件组的数据库文件可能是分开的并分布于各个可用磁盘中,从而避免出现输入/输出争用情况。
下表含有一些建议创建以存储“检查器”要素类和表的 FileGroup。
FILEGROUP | ArcSDE_PARAMETER |
---|---|
REV_BDATA | 业务表 |
REV_BINDEX | 业务表索引 |
REV_FDATA | 要素表 |
REV_FINDEX | 要素表索引 |
REV_SDATA | 空间索引表 |
REV_SINDEX | 空间索引表索引 |
REV_ADATA | 添加表(版本化) |
REV_AINDEX | 添加表索引 |
REV_DDATA | 删除表(版本化) |
REV_DINDEX | 删除表索引 |
以下脚本可用于通过 SQL Server Management Studio 添加 FileGroup。
USE MASTER
GO
ALTER DATABASE [REVDB] ADD FILEGROUP [REV_BDATA]
GO
ALTER DATABASE [REVDB] ADD FILE(NAME = N'rev_Bdata01', FILENAME = N'C:\mssql\data\revdb\rev_Bdata01.NDF' , SIZE = 1, MAXSIZE = 800, FILEGROWTH = 1) TO FILEGROUP [REV_BDATA]
GO
ALTER DATABASE [REVDB] ADD FILEGROUP [REV_BINDEX]
GO
ALTER DATABASE [REVDB] ADD FILE(NAME = N'rev_Bindex01', FILENAME = N'C:\mssql\data\revdb\rev_Bindex01.NDF' , SIZE = 1, MAXSIZE = 800, FILEGROWTH = 1) TO FILEGROUP [REV_BINDEX]
GO
ALTER DATABASE [REVDB] ADD FILEGROUP [REV_FDATA]
GO
ALTER DATABASE [REVDB] ADD FILE(NAME = N'rev_Fdata01', FILENAME = N'C:\mssql\data\revdb\rev_Fdata01.NDF' , SIZE = 1, MAXSIZE = 800, FILEGROWTH = 1) TO FILEGROUP [REV_FDATA]
GO
ALTER DATABASE [REVDB] ADD FILEGROUP [REV_FINDEX]
GO
ALTER DATABASE [REVDB] ADD FILE(NAME = N'rev_Findex01', FILENAME = N'C:\mssql\data\revdb\rev_Findex01.NDF' , SIZE = 1, MAXSIZE = 800, FILEGROWTH = 1) TO FILEGROUP [REV_FINDEX]
GO
ALTER DATABASE [REVDB] ADD FILEGROUP [REV_SDATA]
GO
ALTER DATABASE [REVDB] ADD FILE(NAME = N'rev_Sdata01', FILENAME = N'C:\mssql\data\revdb\rev_Sdata01.NDF' , SIZE = 1, MAXSIZE = 800, FILEGROWTH = 1) TO FILEGROUP [REV_SDATA]
GO
ALTER DATABASE [REVDB] ADD FILEGROUP [REV_SINDEX]
GO
ALTER DATABASE [REVDB] ADD FILE(NAME = N'rev_Sindex01', FILENAME = N'C:\mssql\data\revdb\rev_Sindex01.NDF' , SIZE = 1, MAXSIZE = 800, FILEGROWTH = 1) TO FILEGROUP [REV_SINDEX]
GO
ALTER DATABASE [REVDB] ADD FILEGROUP [REV_ADATA]
GO
ALTER DATABASE [REVDB] ADD FILE(NAME = N'rev_Adata01', FILENAME = N'C:\mssql\data\revdb\rev_Adata01.NDF' , SIZE = 1, MAXSIZE = 800, FILEGROWTH = 1) TO FILEGROUP [REV_ADATA]
GO
ALTER DATABASE [REVDB] ADD FILEGROUP [REV_AINDEX]
GO
ALTER DATABASE [REVDB] ADD FILE(NAME = N'rev_Aindex01', FILENAME = N'C:\mssql\data\revdb\rev_Aindex01.NDF' , SIZE = 1, MAXSIZE = 800, FILEGROWTH = 1) TO FILEGROUP [REV_AINDEX]
GO
ALTER DATABASE [REVDB] ADD FILEGROUP [REV_DDATA]
GO
ALTER DATABASE [REVDB] ADD FILE(NAME = N'rev_Ddata01', FILENAME = N'C:\mssql\data\revdb\rev_Ddata01.NDF' , SIZE = 1, MAXSIZE = 800, FILEGROWTH = 1) TO FILEGROUP [REV_DDATA]
GO
ALTER DATABASE [REVDB] ADD FILEGROUP [REV_DINDEX]
GO
ALTER DATABASE [REVDB] ADD FILE(NAME = N'rev_Dindex01', FILENAME = N'C:\mssql\data\revdb\rev_Dindex01.NDF' , SIZE = 1, MAXSIZE = 800, FILEGROWTH = 1) TO FILEGROUP [REV_DINDEX]
GO
通过将数据文件的初始大小设置为 1 MB,以避免在创建文件组时发生延迟。然后,可以重新调整数据文件的大小以避免产生碎片。
ALTER DATABASE [REVDB] MODIFY FILE ( NAME = N’rev_Bdata01’, SIZE = 400MB )
ALTER DATABASE [REVDB] MODIFY FILE ( NAME = N’rev_Bindex01’, SIZE = 400MB )
ALTER DATABASE [REVDB] MODIFY FILE ( NAME = N’rev_Fdata01’, SIZE = 400MB )
ALTER DATABASE [REVDB] MODIFY FILE ( NAME = N’rev_Findex01’, SIZE = 400MB )
ALTER DATABASE [REVDB] MODIFY FILE ( NAME = N’rev_Sdata01’, SIZE = 400MB )
ALTER DATABASE [REVDB] MODIFY FILE ( NAME = N’rev_Sindex01’, SIZE = 400MB )
ALTER DATABASE [REVDB] MODIFY FILE ( NAME = N’rev_Adata01’, SIZE = 400MB )
ALTER DATABASE [REVDB] MODIFY FILE ( NAME = N’rev_Aindex01’, SIZE = 400MB )
ALTER DATABASE [REVDB] MODIFY FILE ( NAME = N’rev_Ddata01’, SIZE = 400MB )
ALTER DATABASE [REVDB] MODIFY FILE ( NAME = N’rev_Dindex01’, SIZE = 400MB )
使用以下内容验证 FileGroup 和数据文件:
EXEC sp_helpdb revdb
GO
9/9/2014