USE sto_db
GO
DBCC SHRINKFILE ('stdata5', EMPTYFILE )
DBCC SHRINKFILE ('stdata6', EMPTYFILE )
ALTER DATABASE sto_db REMOVE FILE stdata5
ALTER DATABASE sto_db REMOVE FILE stdata6
*--- configure SQL tempdb
ALTER DATABASE tempdb MODIFY FILE
(
NAME ='tempdev',
FILENAME = 'G:\Temp01\tempdb.mdf',
SIZE = 5GB,
MAXSIZE = UNLIMITED,
FILEGROWTH = 512 MB
)
GO
ALTER DATABASE tempdb ADD FILE
(
NAME ='tempdev_2',
FILENAME = 'G:\Temp02\tempdb2.ndf',
SIZE = 5GB,
MAXSIZE = UNLIMITED,
FILEGROWTH = 512 MB
)
GO
ALTER DATABASE tempdb ADD FILE
(
NAME ='tempdev_3',
FILENAME = 'G:\Temp03\tempdb3.ndf',
SIZE = 5GB,
MAXSIZE = UNLIMITED,
FILEGROWTH = 512 MB
)
GO
ALTER DATABASE tempdb ADD FILE
(
NAME ='tempdev_4',
FILENAME = 'G:\Temp04\tempdb4.ndf',
SIZE = 5GB,
MAXSIZE = UNLIMITED,
FILEGROWTH = 512 MB
)
GO
ALTER DATABASE tempdb ADD FILE
(
NAME ='tempdev_5',
FILENAME = 'G:\Temp05\tempdb5.ndf',
SIZE = 5GB,
MAXSIZE = UNLIMITED,
FILEGROWTH = 512 MB
)
GO
ALTER DATABASE tempdb ADD FILE
(
NAME ='tempdev_6',
FILENAME = 'G:\Temp06\tempdb6.ndf',
SIZE = 5GB,
MAXSIZE = UNLIMITED,
FILEGROWTH = 512 MB
)
GO
ALTER DATABASE tempdb ADD FILE
(
NAME ='tempdev_7',
FILENAME = 'G:\Temp07\tempdb7.ndf',
SIZE = 5GB,
MAXSIZE = UNLIMITED,
FILEGROWTH = 512 MB
)
GO
ALTER DATABASE tempdb ADD FILE
(
NAME ='tempdev_8',
FILENAME = 'G:\Temp08\tempdb8.ndf',
SIZE = 5GB,
MAXSIZE = UNLIMITED,
FILEGROWTH = 512 MB
)
GO
ALTER DATABASE tempdb MODIFY FILE
(
NAME ='templog',
FILENAME = 'G:\templog.ldf',
SIZE = 5GB,
MAXSIZE = UNLIMITED,
FILEGROWTH = 512 MB
)
GO
*--- Delete Log Full SQL-2005
BACKUP LOG [DBNAME] WITH TRUNCATE_ONLY
DBCC SHRINKFILE([LOGFILENAME],0)
*--- Delete Log Full SQL-2008
USE
[master]
GO
ALTER DATABASE
[TestDb]
SET
RECOVERY SIMPLE
WITH
NO_WAIT
DBCC
SHRINKFILE(TestDbLog,
1)
ALTER DATABASE
[TestDb]
SET
RECOVERY
FULL WITH
NO_WAIT
GO
No comments:
Post a Comment