Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Secondary data files

Author  Topic 

thaniparthi.rao
Yak Posting Veteran

96 Posts

Posted - 2009-12-01 : 06:53:06


Hello,

I have a DB with 50 GB contains one data file and one log file on separate disks.

Due to new project implementations I want to dump around 20- 25 GB of data and planning to add one more data file .


My question is if I add the secondary data file on the same disk where the primary resides , while dumping the data where does this data stores (Primary file or secondary file)

Basically my question if I add secondary data files how the data is stored in the files ( primary/secondary is there any priority of filling the data in the files.)


Best Regards,
Rao

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-12-01 : 10:54:55
It depends if you are using filegroups or not. Let us know.

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

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

thaniparthi.rao
Yak Posting Veteran

96 Posts

Posted - 2009-12-01 : 23:51:29

Thanks for the reply.

We are not using the file groups .

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-12-02 : 00:03:54
Then SQL Server will use a proportional fill algorithm to ensure that data gets spread across all files and will have approximately the same free space in each of the files. When you create the new secondary files, it takes a while before the files even out with the same free space. To speed up the process, rebuild all of your indexes.

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

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

thaniparthi.rao
Yak Posting Veteran

96 Posts

Posted - 2009-12-03 : 11:21:31


Thanks for the reply.

I have added a new filegroup secondary and set as a default one in the same drive as the primarydatafile.

when im inserting the data into DB insteading of using the secondary filegroup it is using the primary file group and erroring out.

Could not allocate space for object 'dbo.item' in database 'Datawarehouse' because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.

As i created a secondary filegroup and set it as a default one , still the DB is using the primary filegroup only :(


Any suggestions .




Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-12-03 : 12:21:36
You have to place objects in the filegroup. You do this on the CREATE statements. Once the objects have been moved to the filegroup, then the data will be put into those filegroups.

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

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page
   

- Advertisement -