Creating data files (Production Mapping)
Create new FileGroups to store the product library feature classes and tables.
FILEGROUP | ArcSDE_PARAMETER |
---|---|
PRODLIB_BDATA | Business table |
PRODLIB_BINDEX | Business table index |
PRODLIB_FDATA | Feature table |
PRODLIB_FINDEX | Feature table index |
PRODLIB_SDATA | Spatial Index table |
PRODLIB_SINDEX | Spatial Index table index |
PRODLIB_ADATA | Adds table (versioned) |
PRODLIB_AINDEX | Adds table index |
PRODLIB_DDATA | Deletes table (versioned) |
PRODLIB_DINDEX | Deletes table index |
The following script can be run in SQL Management Studio to add FileGroups.
USE MASTER
GO
ALTER DATABASE [PRODLIBDB] ADD FILEGROUP [PRODLIB_BDATA]
GO
ALTER DATABASE [PRODLIBDB] ADD FILE (NAME = N'prodlib_Bdata01', FILENAME = N'C:\mssql\data\prodlibdb\prodlib_Bdata01.NDF' , SIZE = 1, MAXSIZE = 800, FILEGROWTH = 1) TO FILEGROUP [PRODLIB_BDATA]
GO
ALTER DATABASE [PRODLIBDB] ADD FILEGROUP [PRODLIB_BINDEX]
GO
ALTER DATABASE [PRODLIBDB] ADD FILE (NAME = N'prodlib_Bindex01', FILENAME = N'C:\mssql\data\prodlibdb\prodlib_Bindex01.NDF' , SIZE = 1, MAXSIZE = 800, FILEGROWTH = 1) TO FILEGROUP [PRODLIB_BINDEX]
GO
ALTER DATABASE [PRODLIBDB] ADD FILEGROUP [PRODLIB_FDATA]
GO
ALTER DATABASE [PRODLIBDB] ADD FILE (NAME = N'prodlib_Fdata01', FILENAME = N'C:\mssql\data\prodlibdb\prodlib_Fdata01.NDF' , SIZE = 1, MAXSIZE = 800, FILEGROWTH = 1) TO FILEGROUP [PRODLIB_FDATA]
GO
ALTER DATABASE [PRODLIBDB] ADD FILEGROUP [PRODLIB_FINDEX]
GO
ALTER DATABASE [PRODLIBDB] ADD FILE (NAME = N'prodlib_Findex01', FILENAME = N'C:\mssql\data\prodlibdb\prodlib_Findex01.NDF' , SIZE = 1, MAXSIZE = 800, FILEGROWTH = 1) TO FILEGROUP [PRODLIB_FINDEX]
GO
ALTER DATABASE [PRODLIBDB] ADD FILEGROUP [PRODLIB_SDATA]
GO
ALTER DATABASE [PRODLIBDB] ADD FILE (NAME = N'prodlib_Sdata01', FILENAME = N'C:\mssql\data\prodlibdb\prodlib_Sdata01.NDF' , SIZE = 1, MAXSIZE = 800, FILEGROWTH = 1) TO FILEGROUP [PRODLIB_SDATA]
GO
ALTER DATABASE [PRODLIBDB] ADD FILEGROUP [PRODLIB_SINDEX]
GO
ALTER DATABASE [PRODLIBDB] ADD FILE (NAME = N'prodlib_Sindex01', FILENAME = N'C:\mssql\data\prodlibdb\prodlib_Sindex01.NDF' , SIZE = 1, MAXSIZE = 800, FILEGROWTH = 1) TO FILEGROUP [PRODLIB_SINDEX]
GO
ALTER DATABASE [PRODLIBDB] ADD FILEGROUP [PRODLIB_ADATA]
GO
ALTER DATABASE [PRODLIBDB] ADD FILE (NAME = N'prodlib_Adata01', FILENAME = N'C:\mssql\data\prodlibdb\prodlib_Adata01.NDF' , SIZE = 1, MAXSIZE = 800, FILEGROWTH = 1) TO FILEGROUP [PRODLIB_ADATA]
GO
ALTER DATABASE [PRODLIBDB] ADD FILEGROUP [PRODLIB_AINDEX]
GO
ALTER DATABASE [PRODLIBDB] ADD FILE (NAME = N'prodlib_Aindex01', FILENAME = N'C:\mssql\data\prodlibdb\prodlib_Aindex01.NDF' , SIZE = 1, MAXSIZE = 800, FILEGROWTH = 1) TO FILEGROUP [PRODLIB_AINDEX]
GO
ALTER DATABASE [PRODLIBDB] ADD FILEGROUP [PRODLIB_DDATA]
GO
ALTER DATABASE [PRODLIBDB] ADD FILE (NAME = N'prodlib_Ddata01', FILENAME = N'C:\mssql\data\prodlibdb\prodlib_Ddata01.NDF' , SIZE = 1, MAXSIZE = 800, FILEGROWTH = 1) TO FILEGROUP [PRODLIB_DDATA]
GO
ALTER DATABASE [PRODLIBDB] ADD FILEGROUP [PRODLIB_DINDEX]
GO
ALTER DATABASE [PRODLIBDB] ADD FILE (NAME = N'prodlib_Dindex01', FILENAME = N'C:\mssql\data\prodlibdb\prodlib_Dindex01.NDF' , SIZE = 1, MAXSIZE = 800, FILEGROWTH = 1) TO FILEGROUP [PRODLIB_DINDEX]
GO
By setting the data files’ initial size to 1 MB, there is no delay in the creation of the FileGroups. You can then resize the data files to avoid fragmentation.
ALTER DATABASE [PRODLIBDB] MODIFY FILE ( NAME = N'prodlib_Bdata01', SIZE = 400MB )
ALTER DATABASE [PRODLIBDB] MODIFY FILE ( NAME = N'prodlib_Bindex01', SIZE = 400MB )
ALTER DATABASE [PRODLIBDB] MODIFY FILE ( NAME = N'prodlib_Fdata01', SIZE = 400MB )
ALTER DATABASE [PRODLIBDB] MODIFY FILE ( NAME = N'prodlib_Findex01', SIZE = 400MB )
ALTER DATABASE [PRODLIBDB] MODIFY FILE ( NAME = N'prodlib_Sdata01', SIZE = 400MB )
ALTER DATABASE [PRODLIBDB] MODIFY FILE ( NAME = N'prodlib_Sindex01', SIZE = 400MB )
ALTER DATABASE [PRODLIBDB] MODIFY FILE ( NAME = N'prodlib_Adata01', SIZE = 400MB )
ALTER DATABASE [PRODLIBDB] MODIFY FILE ( NAME = N'prodlib_Aindex01', SIZE = 400MB )
ALTER DATABASE [PRODLIBDB] MODIFY FILE ( NAME = N'prodlib_Ddata01', SIZE = 400MB )
ALTER DATABASE [PRODLIBDB] MODIFY FILE ( NAME = N'prodlib_Dindex01', SIZE = 400MB )
Use the following to verify FileGroups and data files:
EXEC sp_helpdb prodlibdb
GO
Copying and pasting the examples may cause syntax errors.