Tuesday, February 02, 2016

initialiszing model Database of sql server to minimize fragmentation of new databases / ändern der model Datenbank des SQL Servers um fragmentierung niedriger als mit den default werten zu halten

--init Sql Server
use model;
IF (8192>(select size from sys.database_files where file_id=1)) ALTER DATABASE model MODIFY FILE (NAME = [modeldev], SIZE=64MB);
ALTER DATABASE model MODIFY FILE (NAME = [modeldev], FILEGROWTH = 10%, MAXSIZE = UNLIMITED);
IF (8192>(select size from sys.database_files where file_id=2)) ALTER DATABASE model MODIFY FILE (NAME = [modellog], SIZE=64MB);
ALTER DATABASE model MODIFY FILE (NAME = [modellog], FILEGROWTH = 64MB, MAXSIZE = UNLIMITED);

No comments: