实验一:建立数据库
1
(1)CREATE DATABASE test1 ON
(NAME=test,
FILENAME=‘D:\数据库\数据\test.mdf’,
SIZE=10,
MAXSIZE=50,
FILEGROWTH=5)
LOG ON
(NAME=test_log,
FILENAME=‘D:\数据库\日志\test.ldf’,
SIZE=5MB,
MAXSIZE=25MB,
FILEGROWTH=5MB)
(2)
CREATE DATABASE test2 ON
PRIMARY
(NAME=t1,FILENAME=‘D:\数据库\数据\A1.mdf’,SIZE=10,MAXSIZE=50,FILEGROWTH=5),
(NAME=t2,FILENAME=‘D:\数据库\数据\A2.ndf’,SIZE=10,MAXSIZE=50,FILEGROWTH=5),
(NAME=t3,FILENAME=‘D:\数据库\数据\A3.ndf’,SIZE=10,MAXSIZE=50,FILEGROWTH=5)
LOG ON
(NAME=t1_log,FILENAME=‘D:\数据库\日志\A1.ldf’,SIZE=5MB,MAXSIZE=25MB,FILEGROWTH=5MB),
(NAME=t2_log,FILENAME=‘D:\数据库\日志\A2.ldf’,SIZE=5MB,MAXSIZE=25MB,FILEGROWTH=5MB)
(3)
CREATE DATABASE test3 ON
PRIMARY
(NAME=T0,FILENAME=‘d:\数据库\数据\b0.mdf’,SIZE=10,MAXSIZE=50,FILEGROWTH=5),
FILEGROUP G1
(NAME=G11,FILENAME=‘d:\数据库\数据\b1.mdf’,SIZE=10,MAXSIZE=50,FILEGROWTH=5),
(NAME=G12,FILENAME=‘D:\数据库\数据\b2.ndf’,SIZE=10,MAXSIZE=50,FILEGROWTH=5),
FILEGROUP G2
(NAME=G21,FILENAME=‘d:\数据库\数据\b3.mdf’,SIZE=10,MAXSIZE=50,FILEGROWTH=5),
(NAME=G22,FILENAME=‘D:\数据库\数据\b4.ndf’,SIZE=10,MAXSIZE=50,FILEGROWTH=5),
FILEGROUP G3
(NAME=G31,FILENAME=‘d:\数据库\数据\b5.mdf’,SIZE=10,MAXSIZE=50,FILEGROWTH=5),
(NAME=G32,FILENAME=‘D:\数据库\数据\b6.ndf’,SIZE=10,MAXSIZE=50,FILEGROWTH=5)
2
ALTER DATABASE test1
ADD FILE
(NAME=test1,
FILENAME=‘D:\数据库\数据\test1.mdf’,
SIZE=10,
MAXSIZE=50,
FILEGROWTH=5)
ALTER DATABASE test2
MODIFY FILE
(NAME=t1,FILENAME=‘D:\数据库\数据\A1.mdf’,SIZE=15,MAXSIZE=55,FILEGROWTH=10)
DROP DATABASE test1
更多答案,请点击此链接看吴创鹏的博客