SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 copy all objects to shrink and scrub
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

influent
Constraint Violating Yak Guru

USA
361 Posts

Posted - 06/12/2012 :  17:48:02  Show Profile  Reply with Quote
I currently have a nightly process that backs up a database, restores it with a different name, then scrubs out some of the data and backs up the scrubbed database. The problem with this is that the database has gotten too large for the development environments so I need to take a subset of the data. Deleting data from the tables and using SHRINKFILE takes too long (an hour or two), even if I only shrink by 100 MB at a time. I tried following what some people suggested and creating an SSIS package with the Transfer SQL Server Objects task, but it fails because there are a couple views that reference a different database on the server. I've set everything in the task to True and nothing helps. What can I do?

yosiasz
Flowing Fount of Yak Knowledge

USA
1608 Posts

Posted - 06/12/2012 :  18:03:11  Show Profile  Click to see yosiasz's MSN Messenger address  Reply with Quote
how many tables worth of data are we talking about here?

<><><><><><><><><><><><><><><><><>
If you don't have the passion to help people, you have no passion
Go to Top of Page

influent
Constraint Violating Yak Guru

USA
361 Posts

Posted - 06/12/2012 :  19:20:47  Show Profile  Reply with Quote
Around 25 right now, why? I don't want to have to update the job every time the schema changes if that's what you're getting at.
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
35007 Posts

Posted - 06/12/2012 :  19:54:25  Show Profile  Visit tkizer's Homepage  Reply with Quote
Add more storage so that your current backup/restore/scrub/backup process is okay?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

influent
Constraint Violating Yak Guru

USA
361 Posts

Posted - 06/12/2012 :  20:28:13  Show Profile  Reply with Quote
It's not just space that's the issue, it's time as well. Adding storage is a last resort. Isn't there anything else I can do?
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
35007 Posts

Posted - 06/12/2012 :  20:31:22  Show Profile  Visit tkizer's Homepage  Reply with Quote
Add the other database, just a shell with the right name, and include the view and table DDL if needed.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

influent
Constraint Violating Yak Guru

USA
361 Posts

Posted - 06/12/2012 :  20:41:05  Show Profile  Reply with Quote
That seems reasonable. I'll try that, thanks.
Go to Top of Page

yosiasz
Flowing Fount of Yak Knowledge

USA
1608 Posts

Posted - 06/13/2012 :  09:57:29  Show Profile  Click to see yosiasz's MSN Messenger address  Reply with Quote
Tara's approach sounds reasonable. I was thinking some sort of replication,subscription thing

<><><><><><><><><><><><><><><><><>
If you don't have the passion to help people, you have no passion
Go to Top of Page

influent
Constraint Violating Yak Guru

USA
361 Posts

Posted - 06/13/2012 :  15:57:19  Show Profile  Reply with Quote
Wait, maybe that doesn't help. If I have a task that copies over the objects that have external dependencies first, how do I tell the Transfer Objects task to then copy all the other objects without specifying each object? The goal is to not have to modify the job every time the schema is changed.
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
35007 Posts

Posted - 06/13/2012 :  15:58:25  Show Profile  Visit tkizer's Homepage  Reply with Quote
Well if new tables are added, you'll need to modify it unless you really add some fancy logic to it. I don't know how to do it.



Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

yosiasz
Flowing Fount of Yak Knowledge

USA
1608 Posts

Posted - 06/13/2012 :  17:12:03  Show Profile  Click to see yosiasz's MSN Messenger address  Reply with Quote
you can use sys views to dump to a tableList then you process uses that. this makes it dynamic

<><><><><><><><><><><><><><><><><>
If you don't have the passion to help people, you have no passion
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000