??????SQL Server?У????Create Database????????????Alter Database?????????????????????????????????
????????????????
????1???????????????????????
???????????????????飬??????????????
?????????????е??????????CPU???????????????? ??????????????????????????IO??????????????????????
?????????????????С?????????????С??????£???????????????????IO???????????
????????????????????????????????д????????????????????????????
???????????????????????????????????????????????size??????
?????????????????:
create database newdb
on primary
(name='newdb'??  filename='D:MSSQLServer ewdb.mdf'??  size=1GB??maxsize=10GB??filegrowth=1GB)??
(name='newdb_1'??filename='D:MSSQLServer ewdb_1.ndf'??size=1GB??maxsize=10GB??filegrowth=1GB)??
(name='newdb_2'??filename='D:MSSQLServer ewdb_2.ndf'??size=1GB??maxsize=10GB??filegrowth=1GB)??
(name='newdb_3'??filename='D:MSSQLServer ewdb_3.ndf'??size=1GB??maxsize=10GB??filegrowth=1GB)??
(name='newdb_4'??filename='D:MSSQLServer ewdb_4.ndf'??size=1GB??maxsize=10GB??filegrowth=1GB)
log on
(name='newdb_log'??filename='D:MSSQLServer ewdb_log.ldf'??size=1GB??maxsize=10GB??filegrowth=1GB)
go
????????name?????????????logical_file_name????????FileName??????????????SQL Server????????????????????????????????
????2????????????????
use newdb
go
select df.file_id??
df.type??
df.type_desc??
df.name??
df.physical_name??
df.state??
df.state_desc??
df.size*8/1024/1024 as size_gb??
df.max_size*8/1024/1024 as max_size_gb??
df.growth??
df.is_percent_growth??
fg.name as filegroup_name??
fg.is_default
from sys.database_files df
inner join sys.filegroups fg
on df.data_space_id=fg.data_space_id
????3?????????????????
select
DB_NAME(mf.database_id) as dbname??
mf.file_id??
mf.type as file_type??
mf.type_desc??
mf.data_space_id as file_group??
mf.name as logical_file_name??
mf.physical_name??
mf.state_desc??
mf.size*8/1024/1024 as size_gb??
mf.max_size*8/1024/1024 as max_size_gb??
mf.growth??
mf.is_percent_growth
from sys.master_files mf
--where database_id=db_id('newdb')
????????????????/??????
????1??????????饗File Group??
????use master
????go
????alter database newdb
????add filegroup fg_newdb1;
????2????fg_newdb1????饗File Group???????????????
????alter database newdb
????add file
????(name=fg_newdb1_1??filename ='d:MSSQLServerfg_newdb1_1.ndf'??size=1GB??maxsize=10GB??filegrowth=1GB)
????to filegroup fg_newdb1;
????3????????????
????alter database newdb
????add log file
????(name=newdb_log_1??filename ='d:MSSQLServer ewdb_log_1.ldf'??size=1GB??maxsize=10GB??filegrowth=1GB);