views:

86

answers:

1

Is there a way in MS SQL Server 2005 to take a partition / file groups / files offline?

I have a lot of data in certain tables and would like to use the sliding window Scenario: http://msdn.microsoft.com/en-us/library/ms345146%28SQL.90%29.aspx#sql2k5parti%5Ftopic24

Instead of keeping all the data in the first partition, I would like to take the partition (or files or file group if possible) offline and make it unavailable for my queries.

Thanks for any help / ideas,

Patrick

+1  A: 

You can start from here: How to Implement an Automatic Sliding Window in a Partitioned Table on SQL Server 2005.

But i would recommend against putting old partitions offline, a much better approach is to have two tables with identical structure, Current and Archive, and use the sliding widnow partitioning to move the old partitions from Current to Archive, see Transferring Data Efficiently by Using Partition Switching.

Remus Rusanu
What about disk I/O in this case? Will anything be written or is this kind of switching a pointer?
Patto
I think what I really want is this: I want the old data to slide out and back it up, then delete the old data after a while.When it slides out, it should not lock any tables and should not have a large effect on performance.
Patto
Switch partition is a pointer switch. Something is writtent o disk in the table metata, but no dta is moved.
Remus Rusanu