[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

SQL Server files & filegroups

Posted on 2013-02-07
8
Medium Priority
?
246 Views
Last Modified: 2013-02-07
Hi

We have a database that is growing quite large with legacy data, we are archiving the old data into archive tabes within the same database. The data has to be available for reporting.

It has been suggested that these archive tables can point to different files than the main database.

How is this done - I can create a new file, but how do I get the data from the archive tales to use it.

Andy
0
Comment
Question by:Andy Green
  • 4
  • 4
8 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 total points
ID: 38863894
steps:
1) create a new filegroup
2) create a new file into this filegroup
3) move the table to the new filegroup
  => to perform that step, you use the "clustered index trick"
  a) if the table has already a clustered index: drop it, and recreate it and specify the new filegroup
  b) if the table does not have a clustered index, create a clustered index on the filegroup
0
 
LVL 3

Author Comment

by:Andy Green
ID: 38863926
I have done as you suggest, yet when I do a properties on the table, the storage still says Primary not Archive as I'd expect.

If I look at the properties for the index that too says Primary.

Andy
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 38863942
then you did not create the clustered index correctly.
please show how you created the index
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
LVL 3

Author Comment

by:Andy Green
ID: 38863964
Opened the table in design mode
Clicked TableDesigner
Clicked Index Keys

from the pop up I clicked Add
In the section Data Space Specification I selected Archive.

If I go back into this it says Archive, its just the properties that report wrong.

I have refreshed.

Andy
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 38863989
you have to "SAVE" those changes, otherwise it will not be effective.
0
 
LVL 3

Author Comment

by:Andy Green
ID: 38864039
Sorted it, rather than open the table in Design, I added the index by opening the table dropdown | Indexes | Add.

Andy
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 38864061
good :)
glad I could help
0
 
LVL 3

Author Closing Comment

by:Andy Green
ID: 38864078
Thanks for your help

Andy
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ready to get certified? Check out some courses that help you prepare for third-party exams.
This shares a stored procedure to retrieve permissions for a given user on the current database or across all databases on a server.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question