TA的每日心情 | 慵懒 7 天前 |
---|
签到天数: 55 天 [LV.5]常住居民I
|
发表于 2024-7-14 20:59:26
|
显示全部楼层
u8cloud 建表语句:
- USE master;
- go
- IF DB_ID (N'U8CLOUD') IS NOT NULL
- DROP DATABASE [U8CLOUD];
- go
- CREATE DATABASE [U8CLOUD]
- go
- ALTER DATABASE [U8CLOUD] ADD FILEGROUP [NNC_DATA01]
- go
- ALTER DATABASE [U8CLOUD] ADD FILEGROUP [NNC_DATA02]
- go
- ALTER DATABASE [U8CLOUD] ADD FILEGROUP [NNC_DATA03]
- go
- ALTER DATABASE [U8CLOUD] ADD FILEGROUP [NNC_INDEX01]
- go
- ALTER DATABASE [U8CLOUD] ADD FILEGROUP [NNC_INDEX02]
- go
- ALTER DATABASE [U8CLOUD] ADD FILEGROUP [NNC_INDEX03]
- go
- ALTER DATABASE [U8CLOUD] ADD FILE(NAME = N'nnc_data01', FILENAME = N'D:\DATA\nnc_data01_Data.NDF' , SIZE = 500, FILEGROWTH = 200) TO FILEGROUP [NNC_DATA01]
- go
- ALTER DATABASE [U8CLOUD] ADD FILE(NAME = N'nnc_data02', FILENAME = N'D:\DATA\nnc_data02_Data.NDF' , SIZE = 500, FILEGROWTH = 200) TO FILEGROUP [NNC_DATA02]
- go
- ALTER DATABASE [U8CLOUD] ADD FILE(NAME = N'nnc_data03', FILENAME = N'D:\DATA\nnc_data03_Data.NDF' , SIZE = 500, FILEGROWTH = 200) TO FILEGROUP [NNC_DATA03]
- go
- ALTER DATABASE [U8CLOUD] ADD FILE(NAME = N'nnc_index01', FILENAME = N'D:\DATA\nnc_index01_Data.NDF' , SIZE = 200, FILEGROWTH = 100) TO FILEGROUP [NNC_INDEX01]
- go
- ALTER DATABASE [U8CLOUD] ADD FILE(NAME = N'nnc_index02', FILENAME = N'D:\DATA\nnc_index02_Data.NDF' , SIZE = 200, FILEGROWTH = 100) TO FILEGROUP [NNC_INDEX02]
- go
- ALTER DATABASE [U8CLOUD] ADD FILE(NAME = N'nnc_index03', FILENAME = N'D:\DATA\nnc_index03_Data.NDF' , SIZE = 200, FILEGROWTH = 100) TO FILEGROUP [NNC_INDEX03]
- go
-
- -- 调整临时表空间
- declare @name char(50)
- declare @sql nvarchar(500)
- select @name=rtrim(name) from tempdb.dbo.sysfiles where status & 0x40 != 0x40
- set @sql='alter database tempdb modify file ( name='+@name+',size=500mb,filegrowth=10mb)'
- exec master.dbo.sp_executesql @sql
- --切换数据库
- use U8CLOUD
- go
- --启用快照隔离
- declare @exec_stmt nvarchar(4000) select @exec_stmt='ALTER DATABASE '+db_name()+' set read_committed_snapshot ON ' exec (@exec_stmt)
- --禁用并行
- sp_configure 'show advanced options',1
- go
- reconfigure with override
- go
- sp_configure 'max degree of parallelism',1
- go
- reconfigure with override
- go
复制代码 |
|