Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Rebalancing blob and lob data in multiple files on primary file group Expand / Collapse
Author
Message
Posted Wednesday, May 7, 2014 7:30 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Sunday, August 24, 2014 6:58 AM
Points: 61, Visits: 280
Hi all,

A little background on what I am trying to achieve first. We are moving to Azure virtual machines and we will have 8 disks on the SQL Server box. I am adding more files to the primary file group and each file will go on its own drive. I am then rebalancing data across these files by rebuilding all of the indexes on the tables which is working fine. No problems so far all is good.

I now have an additional problem. If there is a lob or blob column on the table, rebuilding the clustered index and all the non clustered indexes doesn't rebalance the blob or lob data across the disks such as it does with in row data.

I cannot find any articles on rebalancing lob or blob data because all the articles say to move to a new file group. I do not want a new file group, I just want to use the primary file group where the data already resides, and just redistribute it evenly in the same way that I can in row data which is working fine.

One solution I thought about was to BCP data out of the table, truncate the table and then BCP back into the table which I imagine would have the desired effect of distributing the data evenly over the files, however this seems a little long winded in my mind.

Just wondering if anybody else had a more elegant solution than this?
Post #1568466
Posted Wednesday, May 7, 2014 9:48 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: 2 days ago @ 8:24 AM
Points: 462, Visits: 1,506
Why not to select * into table_having_blob_1 from table_having_blob, then drop table_having_blob and rename table_having_blob_1 to table_having_blob.
Post #1568557
Posted Wednesday, May 7, 2014 9:59 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Sunday, August 24, 2014 6:58 AM
Points: 61, Visits: 280
I could but selecting all that data out twice is very slow. The table is 12GB so it would probably take at least a few hours this way. That is why I was thinking about using the same concept but with BCP as it is built to deal with large datasets. I did a test run to copy data out and even with BCP it took 1h 40m to copy all the data out to a file. That doesn't include truncating the table and then reinserting the data.

The issue is we don't really have many windows to run things like this and I'm looking for the fastest way possible really. If there are any options I can add to an index rebuild command or something along those lines?

Do you have any other ideas?
Post #1568567
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse