欢迎光临
我们一直在努力

sql server2000实验-数据库专栏,SQL Server

建站超值云服务器,限时71元/月

今天做sql server 2000的一个实验,比较简单的那种,新建数据库,修改日志文件的大小等等吧,恩,应该还是比较简单的了。下面还是记录一下啦~都这么就没有来过了的。

/*
**  creabase.sql
**
**  drop and rereate the credit database.  record the time required.
*/

print begin creabase.sql
go

use master
set nocount on
go

if db_id(credit) is not null
   drop database credit
go

create database [credit] 
   on primary (name = ncredit_data,
      filename = nc:\program files\microsoft sql server\mssql\data\credit_data.mdf,
               size = 50,
               filegrowth = 10%)
   log on (name = ncredit_log,
      filename = nc:\program files\microsoft sql server\mssql\data\credit_log.ldf,
           size = 1,
           filegrowth = 10%)
go

alter database credit
   add filegroup credittablesfg
go
alter database credit
   add filegroup creditindexesfg
go
alter database credit
   add file (
      name = credittables,
      filename = c:\program files\microsoft sql server\mssql\data\credittables.ndf,
      size = 8mb,
      maxsize = unlimited,
      filegrowth = 50mb )
   to filegroup credittablesfg
alter database credit
   add file (
      name = creditindexes,
      filename = c:\program files\microsoft sql server\mssql\data\creditindexes.ndf,
      size = 8mb,
      maxsize = unlimited,
      filegrowth = 50mb )
   to filegroup creditindexesfg
go

print
if db_id(credit) is not null
   print created database “credit”
else
   print create database “credit” failed
print
go

 

/*
**  this script sets the database recovery model to simple
**  for the classnorthwind database. simple recovery allows
**  the database to be recovered to the most recent backup.
**
**  look under the status column of your sp_helpdb results to
**  view the recovery model that has been set for a database.
*/

use classnorthwind

alter database classnorthwind set recovery simple

exec sp_helpdb classnorthwind
go

/*
this script modifies the maximum size of the classnorthwind transaction log file
and increases its current size.
*/

use master
go

alter database classnorthwind
  modify file (name=classnorthwind_log,
        maxsize=50mb)
go

alter database classnorthwind
  modify file (name=classnorthwind_log,
        size=25mb)
go
alter database classnorthwind
  modify file (name=classnorthwind_log,
        filegrowth=20%)
go

exec sp_helpdb classnorthwind
go

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » sql server2000实验-数据库专栏,SQL Server
分享到: 更多 (0)

相关推荐

  • 暂无文章