Adding Files To A Filegroup

Jul 25, 2001

Problem: I need to build several databases on a quarterly basis. The databases range in size from 30 GB to 250 GB. I want to keep each dtabase file <= 20 GB so my databases contain from 2 to 13 database files (I put these all in one filegroup. the filegroup is separate from the PRIMARY filegroup which contains only the system tables in my databases).

I would like to create the files for the databases asynchronously (I have four physical drive letters on which to create the files and would like to be building one file on each drive simultaneosly). I can acheive the asynchronous operation by creating a separate job for each of the drive letters and then callin sp_start_job for each of the jobs.

The problem is that the ALTER DATABASE command apparently locks the sysfiles table and three of the four processes are always blocked and I therfore end up build the files serially instaed of in parallel.

Is there a way to make these processes work in parallel?

View 1 Replies


ADVERTISEMENT

SQL Server Admin 2014 :: Adding New Partition To Filegroup

Nov 28, 2014

I work for a 24/7 shop. We currently have a table that is partition on monthly. I have to created a script that will add a new file group, add the new file to the group, and alter the the partition scheme and function. However, I need for this process to not cause a lock on the table. Typically I get the locking and issues when I am run the split command. Is there a way to prevent this from happening?

View 4 Replies View Related

Filegroup %f Has No Files Assigned To It.

Nov 20, 2007

I'm tryin to copy information from a fact table from one server to another server but when try using a DTS package to do this, an error pops up that says "the Filegroup <filegroup_name> has no files assigned to it."

what am i missing here?

View 4 Replies View Related

Balancing Size Of Data Files In Filegroup

Apr 26, 2008

Due to SQL's proportional fill algorithm I'd like to have the amount of data in my data files as close to equal as possible.

File sizes before:
dat 482,895 MB 0% free
2dat 436,927 MB 3% free

I made the max size of each file 600,000 MB and added a third file 3dat also 600,000 MB. I rebuilt all the clustered indexes (and nonclustered for good measure) and unfortunately the re-balancing wasn't quite right.

File sizes after:
dat 464,761 MB 77% free
2dat 443,234 MB 73% free
3dat 309,568 MB 51% free

I only have a handful of heap tables that take up <100MB total so they're not the issue. I did do an ONLINE index rebuild. I'm not sure if an offline rebuild would have been better. I will not be able to try and offline for a few weeks though as it's time consuming and I have other tasks I need to run on this test server now.

I did a FULLSCAN rebuild on any column statistics not updated by the index rebuild but that didn't help either.

View 3 Replies View Related

SQL Server Admin 2014 :: How Data Writes In Multiple Secondary Files If There Is No Filegroup Created

Nov 12, 2014

I read , When sql server Database having multiple data files within single filegroup then sql server writes data in multiple proportional file algorithm where the amount of data written to a file is proportionate to the amount of free space in that file, compared to other files in the filegroup.

so if there is no filegroups created and multiple secondary files are attached in databse , is there same way data stored and writes data in multiple files by the same algorithm or any different way.

View 2 Replies View Related

Adding Log Files

Oct 14, 2007

i am trying to add a transaction log file which is the same size and characteristics as the existing log file in sql sserver

would this be correct?
im not sure what would be the maxsize or the filgrowth of an existing log file.

Alter database db1
Add log file
( Name = db1
Filename = db1.log
Size = 1MB,
Maxsize = ,
Filegrowth = %)

View 4 Replies View Related

Adding Data Files On Database

Jan 24, 2008

We have 1 TB database and we recently got space so
1) can i add data files and put in different disk in production hours
2) what are the effects of doing this.
JUst want to get expert advise

View 1 Replies View Related

Adding Precedence To Multiple Files

Jun 15, 2007

hi all,

i have a package here which updates a DB from a flat file source.now the problem is i may get multiple files.i have used a for each loop to handle this. it takes files based on the files name9(file names has a timestamp in it).but i want to give files in order of its Creation time.

Please help me on this.i have written a script task before the for each loop and i have got the minimum creation date from all the files,i am not able to going forward from here.

does any body has an idea!!

View 4 Replies View Related

DB Engine :: Auto Adding New Files?

Jul 2, 2015

I use management studio on the sql server. Each time i want to run scripts over new data, i have to delete the old files in a database and import new ones (from csv files to .dbo). These are the same files everytime except that the data change. Is it possible to make an automated proces for this import?

View 2 Replies View Related

Adding Misc Files To Solution Explorer

Dec 12, 2005

I assume this is the best forum for this quesiton; if not, please direct me.

View 3 Replies View Related

TempDb - Moving / Adding Files And Resizing

Oct 23, 2015

Have a SQL2008R2 instance on a VM where the single .mdf for the tempDb database is located on a high contention disk.  I've managed to get another 60GB disk and thought it would be a good time to move the .mdf and also increase it's size and number of files. 

The server has 12 cores and after a bit of reading I've decided that it would be best just to have four files for this database as the 1 file per core (-1) seems to be disputed.  

-- Move the existing file to the new disk and rename it.
ALTER DATABASE tempdb MODIFY FILE (NAME='tempdev', FILENAME='E:SQLData empdb0.mdf');

-- Change the size to 1GB
ALTER DATABASE tempdb MODIFY FILE (NAME='tempdev', SIZE= 1048576KB, FILEGROWTH=5%);

-- Add three new files, all with the same size & growth
ALTER DATABASE [tempdb] ADD FILE ( NAME = N'tempdev1', FILENAME = N'E:SQLData empdb1.mdf' , SIZE = 1048576KB , FILEGROWTH = 5%)
ALTER DATABASE [tempdb] ADD FILE ( NAME = N'tempdev2', FILENAME = N'E:SQLData empdb2.mdf' , SIZE = 1048576KB , FILEGROWTH = 5%)
ALTER DATABASE [tempdb] ADD FILE ( NAME = N'tempdev3', FILENAME = N'E:SQLData empdb3.mdf' , SIZE = 1048576KB , FILEGROWTH = 5%)

-- Now restart the instance.
 
Also, what are peoples thoughts on percentage growth for tempDb?  I've read that it's not recommend and yet it seems to be the norm.

View 4 Replies View Related

SQL 2012 :: Any Variation While Adding File Groups And Files?

Sep 17, 2014

When the database is configured for mirroring and you want to do partitioning on that database, How can we do? Is this similar process or any variation there while adding file groups and files? The partition will reflect in the mirroring database also?

View 1 Replies View Related

Reporting Services :: Adding All Columns To Table Without Adding One By One

Sep 3, 2015

Is there any way or option to get the all columns of dataset added to table when we add a table in data region. It will take lot of time to add one by one and also there are chances to add one column ore than once.

View 7 Replies View Related

Filegroup

Feb 22, 2001

hello,
ihave atablelike this -
z uniqueidentifier
a varchar(40)
b varchar(40)
c varchar(40)
d varchar(40)
e varchar(40)
f text
g image

I am asked to split this table into 2 filegroups and move text and images on to one and other stuff on one.
I am new to MS-SQL 7.0.
Can anyone suggest me how to go for it.
Thanking you.

View 2 Replies View Related

FileGroup

Jun 5, 2006

i understand that the filegroup for a table can be specified in the CREATE Table statement. just out of curiosity, is there any way to move a table to a different filegroup, that too, if the table contains data.

View 2 Replies View Related

FileGroup

Aug 14, 2006

Hi,
There is a table which is about 50GB is size.
I am thinking of placing the database of this table into a separate .ndf on a separate drive on the server.
Is it possible to place this particular table into a searate drive to increase the performance even more?
Basically my question is: is it possible to place tables into separate .ndf files?
Thanks

View 4 Replies View Related

Filegroup

Aug 6, 2007

Hi,
I have created a database with two filegroups called FG_GroupData, FG_GroupHistory.
FG_GroupData is set as default.
FG_GroupData contains two secondary data files i.e. GroupData1.ndf and GroupData2.ndf
I can create a table so that it is stored in FG_GroupHistory. i.e.
CREATE TABLE dbo.OrdersHistory
(
OrderID int NOT NULL,
ProductID int NOT NULL,
CustomerID int NOT NULL,
UnitPrice money NOT NULL,
OrderQty smallint NOT NULL
)
ON FG_GroupHistory
Questions:
1)
How do I add tables to each .ndf file inside a group i.e. FG_GroupData
For example, how do I add a table to GroupData1.ndf and one to GroupData2.ndf ?
2)
I guess there is no need to place the file name i.e. .ndf inside the select query
Thanks

View 3 Replies View Related

Filegroup

Aug 14, 2007

What is the advantage of having two secondary files inside a filegroup.
For example, I can create a table and place it inside a filegroup which obviously will use the secondary files.
Not sure why some DBAs create just one but otherscreate more than one secondar files in a filegroup.
I have read the booksonline but can not figure out the advantages.
Thanks

View 1 Replies View Related

Filegroup Monitoring

Jun 21, 2002

Can anyone show me in SQL7 how to obtain Available Space on a particular filegroup in a database (not the database or datafile).
I am trying to include this in a script to monitor my database which uses Filegroups and I have every other info that I need (from the sysfiles table) except the available space. Thanks in advance!

View 1 Replies View Related

What Do You Think About This(filegroup & Perfermance)

May 8, 2001

hi...
I don't know well this statement...


1. from Transcender
.....
One file for each filegroup is sufficient because creating multiple files for the same filegroup on the same disk does not provide any performance gain

2. from bol
....
Therefore, creating more files per filegroup can help increase performance because a separate thread is used to scan each file in parallel

what is correct ?
thanks !!

View 1 Replies View Related

Restore To Filegroup

Jul 21, 2000

Hi ,
I am restoring a VLDB from a Standby server which has just .mdf and .ldf to my production server which has .mdf and a file group with a single .ndf
file, i want to restore the databse on to the Secondary file(is this possible) i checked the BOl but could not figure out of what command is to be given


Any hhelp will be greatly appreciated..


Thanks in advance
Jane

View 1 Replies View Related

Filegroup Backup

Jul 21, 2000

Is it possible to back up one filegroup independently from the second when tables
in one group have foreign key relationships with tables in the second group?

View 1 Replies View Related

Remove FileGroup (what&#39;s On It?)

Mar 14, 2000

I want to remove a filegroup.

ALTER DATABASE MyDBName
REMOVE FILEGROUP MyFileGroupName


It says:
Server: Msg 5042, Level 16, State 7, Line 1
The filegroup 'MyFileGroupName' cannot be removed because it is not empty.

Question: How can I tell what is on this filegroup.
<Forgive me if it is a simple BOL answer, but I'm having trouble finding it>

View 4 Replies View Related

Removing A Filegroup

Apr 25, 2000

Hello,

A few days ago one our database's default filegroup filled up. To solve the problem one of my colleagues created a new filegroup. This didn't solve the problem as no objects were placed on this filegroup and the initial one is still full. The idea was to expand the original filegroup over a new physical disk, not to create a new filegroup on that disk. Unfortunately, this is what happened.
To solve this I want to delete the new filegroup, but when I issue the command 'alter database PvgOmcsOds remove filegroup ternary' I get the message 'Server: Msg 5042, Level 16, State 7, Line 1 The filegroup 'ternary' cannot be removed because it is not empty.' Yet there're no objects placed on this filegroup.
How can I get rid of this filegroup?

Stef

View 2 Replies View Related

How To Drop A Filegroup

Oct 19, 1999

I am managing 120 gb SQL7 database. The 120 GB is in a RAID5 (Hardware RAID). At begining, I think I should create a user defined filegroup besides Primary filegroup, as BOL suggested.

After I read some discussions here, It appears I cannot gain any performance by adding second filegroups. Now I want to drop the filegroup I created. The Question is How?. If I do alter database, move all files from userdefined filegroup, does this mean my userdefined filegroup has gone?

Someone can help me on this!

Thanks a lot.

View 1 Replies View Related

FileGroup Structures

Apr 14, 1999

I have 2 test database identical in size and table structure, only one resides on filegroups and one resides on a single file.
From everything I have heard filegroups are suppose to improve performance. I stop and start the server before each test to clean out
cache. When I run the filegroup test initially the first run averages 20 seconds slower then the database sitting on the single file. However
on consective runs there is a significant improvement in performance with filegroups verses single files. I have
the indexes sitting on a separate filegroup and 2 additional filegroups to spread the tables across. Does any one know what would be causing
the performance to degrade on the initial run of the test. (The test by the way is a stored procedure that runs a select statement against each table).

Any Info Will help Thanks
Barb

View 3 Replies View Related

Removing Filegroup

Mar 8, 2001

Hi all,

I am trying to remove one of the filegroups in the development database to shrink its size down. I started with emptying and removing its files and ran:
dbcc shrinkfile
(pubs_data_1,emptyfile)
go

and it ran fine, with 'DBCC execution completed' message

but when I tried :

alter database pubs
remove file pubs_data_1
go

I got 'pubs_data_1 cannot be removed because it is not empty'.
I even tried to go to each of the tables and delete from them first which didn't work, then drop all tables in that filegroup (I knew which tables are located on that filegroup), that didn't work either.

Any ideas? Is there a way to check what else sits on that filegroup?

Thanks

View 2 Replies View Related

New Filegroup And Log Shipping

Jan 10, 2007

We have sql 2000 server at a remote site that log ships to a standby server at the site, and back here to corporate. For performance we are adding a new RAID array to the remote servers along with a new file group for indexes. The server back here is older and we can't add this RAID. For log shipping purposes, what if anything might happen to this server when the filegroup is added. We are going to be using this filegroup for indexes

View 1 Replies View Related

How Go Relocate A Filegroup?

Sep 17, 2001

Hi, I am running out of space on one of the local drive, and I would like to move a filegroup from one
drive to another. Does anyone know how to do it?

View 1 Replies View Related

Filegroup Recommendation

Jan 15, 2004

Are there any general recommendations concerning filegroups? My personal point of view is to place large tables in their own filegroups and group smaller, more static, tables in a single filegroup. Is it also good practice to group small and large index in two separate filegroups or should each large index have their own filegroup? Are there any useful links out there concerning filegroups and configuration?

View 1 Replies View Related

Filegroup Rename?

Sep 10, 2007

Hi,

Is there a way to rename a Filegroup "FG1" to "FG2"?

For those interested, I'm trying to script a sliding window procedure for my partitioned table and rather than use dynamic SQL I'd like to always refer to the same Filegroup name (ie. "FG1").

Many thanks,
Richard.

View 1 Replies View Related

Filegroup Is Full

Feb 12, 2008

WHERE DO I FOUND THE FILEGROUP?
WHEN THIS ERROR OCCURED

Could not allocate space for object '<temporary system object: 431024047390720>' in database 'tempdb' 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.

View 1 Replies View Related

C#, SQL-DMO, Add FileGroup Issue.

Jul 23, 2005

Greetings All, I was hoping that someone might be able to shed somelight on this issue. I am trying to add a FileGroup/Datafile to anexisting SQL database. The code below compile and it runs in .NETStudio, however nothing happens? The form closes, no error messagesare thrown, there is no sign of any type of error taking place. Theend result (assuming the code is correct) is tha there should be a newFileGroup with a datafile in it, here is the code:************************************************** ******************private void AddFileGroup(frmMyForm f){SQLMy.SQLServer MySQLServerName = new SQLMy.SQLServer();SQLMy.Database MyDBDbName = new SQLMy.Database();SQLMy.FileGroup MyDBDataGroup = new SQLMy.FileGroup();SQLMy.DBFile MyDBDataFile = new SQLMy.DBFile();try{MySQLServerName.ConnectmyGetConfigData.OlapServerName*,myGetConfigData.Ol apUserLogin*,myGetConfigData.OlapUserPassw*ord);MyDBDbName.Name =myConnectionData.OlapDatabaseN*ame.ToString().Trim ();MyDBDataGroup.Name = "DBDataGroup";MyDBDbName.FileGroups.Add (MyDBDataGroup);MyDBDataFile.Name = "DBData";MyDBDataFile.PhysicalName =myConnectionData.OlapDBDataPat*h.ToString().Trim() + @"DBData.ndf";MyDBDataFile.Size = 50;MyDBDataFile.MaximumSize = -1;MyDBDataFile.FileGrowth = 5;MyDBDataFile.FileGrowthType = 0;MyDBDataFile.PrimaryFile = false;MyDBDbName.FileGroups.Item("DB*DataGroup").DBFiles.Ad (MyDBDataFile);this.Close();MySQLServerName.DisConnect();}catch (Exception e){MessageBox.Show(e.Message);}finally{MySQLServerName.DisConnect();}}************************************************** ******************Note: myGetConfigData: This is a class that reads in the values for thedb connection from an XML file. This class has been tested extensivelyand the data values are being populated into the variables.I would appreciate any help that anyone might be able to provide to me.Regards, TFD.

View 14 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved