Username: Password:

sql server2000实验-数据库专栏,SQL Server
来源:作者: 发布时间:2007-12-25 13:52:37


今天做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

喜欢本文,那就收藏到:

    Del.icio.us Google书签 Digg Live Bookmark Technorati Furl Yahoo书签 Facebook 百度搜藏 新浪ViVi 365Key网摘 天极网摘 和讯网摘 博拉网 POCO网摘 添加到饭否 QQ书签 Digbuzz我挖网
相关评论  我也要评论
还没有关于此文章的相关评论!
  • 昵称: (为空则显示guest)
  • 评论分数: ★ ★ ★★★ ★★★★ ★★★★★
  • 评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
  • 导航
    赞助商
    文章类别
    订阅