본문 바로가기
MS-SQL/Query

데이터베이스 생성 스크립트

by Hwoarang757 2014. 1. 7.

 

 

 

CREATE DATABASE TEST_CRDB -- 데이터베이스명

ON PRIMARY

(

NAME = N'TEST_CRDB_DAT' -- 논리적이름

,FILENAME = 'S:\TEST_CRDB\TEST_CRDB.mdf' -- 물리적파일생성경로.

,SIZE = 4096MB --초기파일크기

,MAXSIZE = UNLIMITED -- 파일용량무제한증가

,FILEGROWTH = 1MB -- 자동증가크기

)

LOG ON -- 트랜잭션로그설정

(

NAME = N'TEST_CRDB_LOG' -- 논리적이름

,FILENAME = 'S:\TEST_CRDB\TEST_CRDB_log.ldf' -- 물리적파일생성경로.

,SIZE = 3000MB -- 초기파일크기

,MAXSIZE = UNLIMITED -- 파일용량무제한증가

,FILEGROWTH = 10% -- 자동증가크기

)

GO



EXEC DBO.SP_DBCMPTLEVEL @DBNAME = N'TEST_CRDB' ,@NEW_CMPTLEVEL = 90

GO

 

-- FullTextSearch 모드 disabled설정

IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))

begin

EXEC [TEST_CRDB].[dbo].[sp_fulltext_database] @action = 'disable'

end

GO


ALTER DATABASE [TEST_CRDB] SET ANSI_NULL_DEFAULT OFF

GO


ALTER DATABASE [TEST_CRDB] SET ANSI_NULLS OFF

GO


ALTER DATABASE [TEST_CRDB] SET ANSI_PADDING OFF

GO


ALTER DATABASE [TEST_CRDB] SET ANSI_WARNINGS OFF

GO


ALTER DATABASE [TEST_CRDB] SET ARITHABORT OFF

GO


ALTER DATABASE [TEST_CRDB] SET AUTO_CLOSE OFF

GO


ALTER DATABASE [TEST_CRDB] SET AUTO_CREATE_STATISTICS ON

GO


ALTER DATABASE [TEST_CRDB] SET AUTO_SHRINK OFF

GO


ALTER DATABASE [TEST_CRDB] SET AUTO_UPDATE_STATISTICS ON

GO


ALTER DATABASE [TEST_CRDB] SET CURSOR_CLOSE_ON_COMMIT OFF

GO


ALTER DATABASE [TEST_CRDB] SET CURSOR_DEFAULT GLOBAL

GO


ALTER DATABASE [TEST_CRDB] SET CONCAT_NULL_YIELDS_NULL OFF

GO


ALTER DATABASE [TEST_CRDB] SET NUMERIC_ROUNDABORT OFF

GO


ALTER DATABASE [TEST_CRDB] SET QUOTED_IDENTIFIER OFF

GO


ALTER DATABASE [TEST_CRDB] SET RECURSIVE_TRIGGERS OFF

GO


ALTER DATABASE [TEST_CRDB] SET DISABLE_BROKER

GO


ALTER DATABASE [TEST_CRDB] SET AUTO_UPDATE_STATISTICS_ASYNC ON

GO


ALTER DATABASE [TEST_CRDB] SET DATE_CORRELATION_OPTIMIZATION OFF

GO


ALTER DATABASE [TEST_CRDB] SET TRUSTWORTHY ON

GO


ALTER DATABASE [TEST_CRDB] SET ALLOW_SNAPSHOT_ISOLATION OFF

GO


ALTER DATABASE [TEST_CRDB] SET PARAMETERIZATION SIMPLE

GO


ALTER DATABASE [TEST_CRDB] SET READ_COMMITTED_SNAPSHOT OFF

GO



ALTER DATABASE [TEST_CRDB] SET HONOR_BROKER_PRIORITY OFF

GO


ALTER DATABASE [TEST_CRDB] SET READ_WRITE

GO

--복원모드FULL

ALTER DATABASE [TEST_CRDB] SET RECOVERY FULL

GO

-- 접속모드멀티유저

ALTER DATABASE [TEST_CRDB] SET MULTI_USER

GO





ALTER DATABASE [TEST_CRDB] SET PAGE_VERIFY CHECKSUM

GO


ALTER DATABASE [TEST_CRDB] SET DB_CHAINING OFF

GO