Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
CraigL77
Starting Member
4 Posts |
Posted - 2009-10-22 : 18:48:58
|
SQL2000 Enterprise Edition here...I have a situation where we have a 600GB database in production. In development we only need the database structure and a few tables in full. There is about 300GB of data that we don't care about for development, but currently we just backup the whole database and ship it over to another box. Obviously this takes up tons of space when you consider we have the database copied 2 or 3 times in DEV and at least 2 times in QA.I am looking for a minimal impact solution that will allow me to backup the database but have it not include those tables we don't care about (logging tables). I have messed around with storing those unneeded tables in a different filegroup, but I cant get a restore to work when I just back up the PRIMARY filegroup. The database always says its in the middle of a restore.Other than copying the data/objects off individually to a blank database I cant think of any other solutions that would work on SQL 2000.Does anyone have any other approaches that would work here?Here are the scripts I have tried in regards to filegroups:CREATE DATABASE MOVETABLETOFILEGROUPGOUSE MOVETABLETOFILEGROUPGO--DROP TABLE xyzCREATE TABLE xyz( ID int IDENTITY(1,1) , v varchar(500), x varchar(500)) ON [PRIMARY]CREATE UNIQUE CLUSTERED INDEX PK_ID ON xyz (id) ON [PRIMARY]DECLARE @i intSET @i = 0WHILE @i < 10000BEGIN INSERT INTO xyz SELECT REPLICATE('a', 500), REPLICATE( 'b', 500) SET @i = @i + 1 ENDGOALTER DATABASE [MoveTableToFileGroup] ADD FILEGROUP [SECONDARY]ALTER DATABASE [MoveTableToFileGroup] ADD FILE ( NAME = N'Test2', FILENAME = N'c:\Test2.ndf' , SIZE = 1024KB , FILEGROWTH = 10%) TO FILEGROUP [SECONDARY]GOCREATE UNIQUE CLUSTERED INDEX PK_ID ON xyz (id) WITH DROP_EXISTING ON [SECONDARY]DBCC SHRINKFILE(1)GOBACKUP DATABASE MoveTableToFileGroupFILEGROUP = 'PRIMARY'TO DISK = 'c:\Primary.bak'WITH FORMAT,NO_LOG,COMPRESSIONGORESTORE DATABASE [MoveTableToFileGroup2] FILE = N'MoveTableToFileGroup' FROM DISK = N'c:\Primary.bak' WITH FILE = 1, MOVE N'MoveTableToFileGroup' TO N'c:\MoveTableToFileGroup2.mdf',MOVE N'MoveTableToFileGroup_log' TO N'c:\MoveTableToFileGroup_log2.ldf',NOUNLOAD, REPLACE, STATS = 10GOUSE MoveTableToFileGroup2GOResults:Msg 927, Level 14, State 2, Line 1Database 'MoveTableToFileGroup2' cannot be opened. It is in the middle of a restore. |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
CraigL77
Starting Member
4 Posts |
Posted - 2009-10-23 : 12:58:32
|
I was kinda looking for something that would backup everything *but* a few tables |
|
|
|
|
|
|
|