-
Access the database management tools.
For SQL Server, the database collation should be set to determine case sensitivity and
sort order. The recommendation is to choose a case-insensitive collation. For instance:
CREATE DATABASE database_name COLLATE Latin1_General_100_CI_AS;
Note:
If you choose a CS collation, a ‘BIN2’ is recommended for a slightly better
performance.
The ‘UTF8’ collations are not supported.
-
Create a directory for data files, customize the database and user names as required,
then execute the following script:
USE master;
-- Create database and assosiated file groups
CREATE DATABASE [spacedb] ON PRIMARY (NAME=[spacedb],
FILENAME='C:\DassaultSystemes\3DEXP_DB\spacedb.mdf',SIZE=500MB, FILEGROWTH=10MB) ,
FILEGROUP [I1_DATA] (NAME=[I1_DATA] , FILENAME='C:\DassaultSystemes\3DEXP_DB\I1_DATA.mdf',SIZE=500MB,FILEGROWTH=10MB) ,
FILEGROUP [I1_INDEX] (NAME=[I1_INDEX] , FILENAME='C:\DassaultSystemes\3DEXP_DB\I1_INDEX.mdf',SIZE=500MB,FILEGROWTH=10MB),
FILEGROUP [M1_DATA] (NAME=[M1_DATA] , FILENAME='C:\DassaultSystemes\3DEXP_DB\M1_DATA.mdf',SIZE=500MB,FILEGROWTH=10MB),
FILEGROUP [M1_INDEX] (NAME=[M1_INDEX] , FILENAME='C:\DassaultSystemes\3DEXP_DB\M1_INDEX.mdf',SIZE=500MB,FILEGROWTH=10MB),
FILEGROUP [V1_DATA] (NAME=[V1_DATA] , FILENAME='C:\DassaultSystemes\3DEXP_DB\V1_DATA.mdf',SIZE=500MB,FILEGROWTH=10MB),
FILEGROUP [V1_INDEX] (NAME=[V1_INDEX] , FILENAME='C:\DassaultSystemes\3DEXP_DB\V1_INDEX.mdf',SIZE=500MB,FILEGROWTH=10MB)
LOG ON (NAME=[spacedb_log] ,FILENAME='C:\DassaultSystemes\3DEXP_DB\spacedb.ldf',SIZE=100MB)
COLLATE Latin1_General_100_CI_AS;
ALTER DATABASE [spacedb] SET AUTO_CLOSE OFF ;
ALTER DATABASE [spacedb] SET READ_COMMITTED_SNAPSHOT ON;
ALTER DATABASE [spacedb] SET AUTO_CREATE_STATISTICS ON;
ALTER DATABASE [spacedb] SET AUTO_UPDATE_STATISTICS ON;
ALTER DATABASE [spacedb] SET AUTO_UPDATE_STATISTICS_ASYNC ON;
-- Create logins
CREATE LOGIN m1 WITH PASSWORD = 'Passport#1';
USE spacedb;
-- Create user on correct DATABASE (after use) and with correct schema
CREATE USER m1 FOR LOGIN m1 WITH DEFAULT_SCHEMA = spacedb;
-- Create schema
CREATE SCHEMA spacedb AUTHORIZATION m1;
-- Grant access
GRANT CREATE TABLE, ALTER, SELECT, INSERT, UPDATE, DELETE ON DATABASE::spacedb TO m1;
|