|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Monday, May 13, 2013 8:55 AM
Points: 307,
Visits: 743
|
|
We have an 600gb database as a single mdf and ldf. Due to various reasons, we are planning to split them into multiple files (4) as, Database_Data.mdf Database_1.ndf Database_2.ndf Database_3.ndf Database_4.ndf Database_log.ldf
I have decided on adding new NDF files and moving data into it and keeping each ndf file in a drive. I was wondering if this is same as creating filegroups and whether filegroups option woud suit me.
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 2:07 PM
Points: 6,715,
Visits: 11,751
|
|
It depends on whether you want to control what goes in each physical file or whether you want to let SQL Server control that. If you add more files into the PRIMARY filegroup then SQL Server will start putting data into those files using its proportional fill algorithm. If you create new filegroups to go along with your new files then you will have to manually move tables or indexes into the new filegroups to get data into the new files.
What are you trying to accomplish with creating more data files?
__________________________________________________________________________________________________ There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Believe you can and you're halfway there. --Theodore Roosevelt
Everything Should Be Made as Simple as Possible, But Not Simpler --Albert Einstein
The significant problems we face cannot be solved at the same level of thinking we were at when we created them. --Albert Einstein
1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples. --Giordy
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 10:29 AM
Points: 5,201,
Visits: 11,154
|
|
balasach82 (2/12/2013) We have an 600gb database as a single mdf and ldf. Due to various reasons, we are planning to split them into multiple files (4) as, Database_Data.mdf Database_1.ndf Database_2.ndf Database_3.ndf Database_4.ndf Database_log.ldf
I have decided on adding new NDF files and moving data into it and keeping each ndf file in a drive. I was wondering if this is same as creating filegroups and whether filegroups option woud suit me. Creating the files on their own without doing anything else will just put them into the default PRIMARY filegroup.
Create filegroups first and then create the files into the filegroups. You would then need to move objects between the filegroups as already mentioned by OPC
Transaction log files have no concept of filegroups.
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs"
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Monday, May 13, 2013 8:55 AM
Points: 307,
Visits: 743
|
|
My database files are in 1 drive. My database has grown huge andwill keep on increasing in size. To better utilise the disk space and to manage the db, we areadding new files.
Its clear that i have to create filegroups and add file\files to the new filegroups, then move the data into these filegroups
Am assuming that adding files ot primary group keeps it in a single drive. Is my assumption correct?
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 2:07 PM
Points: 6,715,
Visits: 11,751
|
|
balasach82 (2/13/2013) My database files are in 1 drive. My database has grown huge andwill keep on increasing in size. To better utilise the disk space and to manage the db, we areadding new files.
Its clear that i have to create filegroups and add file\files to the new filegroups, then move the data into these filegroups
Am assuming that adding files ot primary group keeps it in a single drive. Is my assumption correct?
No. You can have files on different drives participate in the same filegroup. That is actually how I would recommend you moving as a first step. Let SQL Server manage where to store the data based on the proportional fill algorithm. Just make sure your data files are all the same size.
__________________________________________________________________________________________________ There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Believe you can and you're halfway there. --Theodore Roosevelt
Everything Should Be Made as Simple as Possible, But Not Simpler --Albert Einstein
The significant problems we face cannot be solved at the same level of thinking we were at when we created them. --Albert Einstein
1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples. --Giordy
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 10:29 AM
Points: 5,201,
Visits: 11,154
|
|
balasach82 (2/13/2013) My database files are in 1 drive. My database has grown huge andwill keep on increasing in size. To better utilise the disk space and to manage the db, we areadding new files.
Its clear that i have to create filegroups and add file\files to the new filegroups, then move the data into these filegroups
Am assuming that adding files ot primary group keeps it in a single drive. Is my assumption correct?
I'm guessing your database already has objects created and data loaded? At this point adding files to the primary file group will just destroy the proportional fill algorithm. Quite honestly if you only have 1 drive I wouldn't even bother with the extra files, just extend the primary file.
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs"
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 2:07 PM
Points: 6,715,
Visits: 11,751
|
|
Agreed if you only have one drive. I got the impression more drives were available or were being introduced.
__________________________________________________________________________________________________ There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Believe you can and you're halfway there. --Theodore Roosevelt
Everything Should Be Made as Simple as Possible, But Not Simpler --Albert Einstein
The significant problems we face cannot be solved at the same level of thinking we were at when we created them. --Albert Einstein
1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples. --Giordy
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Monday, May 13, 2013 8:55 AM
Points: 307,
Visits: 743
|
|
Perry, OPC,
now the db is in one drive. We do have 4 drives. My database is already populate, its 523gb now.
1. Can I create new files in new drive but in Primary filegroup 2. since i have 5 drives, am planning to add 5 filegroups, with one NDF file in each filegroup. So, i have to move tables or indexes into new filegroups. correct? 3. Basic Steps to move tables from primary to new filegroups.
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Friday, April 12, 2013 3:51 AM
Points: 5,075,
Visits: 4,831
|
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 10:29 AM
Points: 5,201,
Visits: 11,154
|
|
balasach82 (2/14/2013) My database is already populate, its 523gb now.
1. Can I create new files in new drive but in Primary filegroup If the database and its primary filegroup is already at the size above then I don't recommend addin new files to the primary filegroup. The proportional fill algorithm is shot at this point
balasach82 (2/14/2013) 2. since i have 5 drives, am planning to add 5 filegroups, with one NDF file in each filegroup. So, i have to move tables or indexes into new filegroups. correct? Yes, that is correct.
balasach82 (2/14/2013)
3. Basic Steps to move tables from primary to new filegroups.
Do the table objects you are moving have clustered indexes upon them?
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs"
|
|
|
|