sqlserver2000实验

来源:互联网 发布:js预加载页面动画 编辑:程序博客网 时间:2024/05/21 18:42
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>

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

/*
** CREABASE.SQL
**
** DropandRereatethecreditdatabase. Recordthetimerequired.
*/

PRINT'BeginCREABASE.SQL'
GO

USEmaster
SETnocountON
GO

IFdb_id('credit')ISNOTNULL
  DROPDATABASEcredit
GO

CREATEDATABASE[credit] 
  ONPRIMARY(NAME=N'credit_Data',
     FILENAME=N'C:/ProgramFiles/Microsoft//Data/credit_Data.MDF',
              SIZE=50,
              FILEGROWTH=10%)
  LOGON(NAME=N'credit_Log',
     FILENAME=N'C:/ProgramFiles/Microsoftsqlserver/MSSQL/Data/credit_Log.LDF',
          SIZE=1,
          FILEGROWTH=10%)
GO

ALTERDATABASEcredit
  ADDFILEGROUPCreditTablesFG
GO
ALTERDATABASEcredit
  ADDFILEGROUPCreditIndexesFG
GO
ALTERDATABASEcredit
  ADDFILE(
     NAME=CreditTables,
     FILENAME='C:/ProgramFiles/Microsoftsqlserver/MSSQL/Data/CreditTables.ndf',
     SIZE=8MB,
     MAXSIZE=UNLIMITED,
     FILEGROWTH=50MB)
  TOFILEGROUPCreditTablesFG
ALTERDATABASEcredit
  ADDFILE(
     NAME=CreditIndexes,
     FILENAME='C:/ProgramFiles/Microsoftsqlserver/MSSQL/Data/CreditIndexes.ndf',
     SIZE=8MB,
     MAXSIZE=UNLIMITED,
     FILEGROWTH=50MB)
  TOFILEGROUPCreditIndexesFG
GO

PRINT''
IFdb_id('credit')ISNOTNULL
  PRINT'CREATEDDATABASE"credit"'
ELSE
  PRINT'CREATEDATABASE"credit"FAILED'
PRINT''
GO

 

/*
** ThisscriptsetsthedatabaserecoverymodeltoSIMPLE
** fortheClassNorthwinddatabase.SimpleRecoveryallows
** thedatabasetoberecoveredtothemostrecentbackup.
**
** Lookunderthestatuscolumnofyoursp_helpdbresultsto
** viewtherecoverymodelthathasbeensetforadatabase.
*/

USEClassNorthwind

ALTERDATABASEClassNorthwindSETRECOVERYSIMPLE

EXECsp_helpdbClassNorthwind
GO


/*
ThisscriptmodifiesthemaximumsizeoftheClassNorthwindtransactionlogfile
andincreasesitscurrentsize.
*/

USEmaster
GO

ALTERDATABASEClassNorthwind
 MODIFYFILE(NAME='ClassNorthwind_Log',
       MAXSIZE=50MB)
GO

ALTERDATABASEClassNorthwind
 MODIFYFILE(NAME='ClassNorthwind_Log',
       SIZE=25MB)
GO
ALTERDATABASEClassNorthwind
 MODIFYFILE(NAME='ClassNorthwind_Log',1<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
原创粉丝点击