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 12»»

How to Add Datafile.ndf in Production database ? Expand / Collapse
Author
Message
Posted Tuesday, February 10, 2009 1:40 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Friday, August 15, 2014 12:33 PM
Points: 71, Visits: 329
Hi ,

I have 2TB database in production which has 1 MDF file ,2NDF files i am Planning to add one more datafile with out any down time in production ? Can I add file directly to DB right click and add file ?
appreciate your comments and suggestion.

Thanks
Ichbin
Post #654188
Posted Tuesday, February 10, 2009 1:50 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 5:50 AM
Points: 40,209, Visits: 36,618
Look up ALTER DATABASE in Books Online. The options to add files are well described.

Why a new file? What are you trying to achieve?



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #654205
Posted Tuesday, February 10, 2009 1:56 PM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Friday, March 14, 2014 3:15 PM
Points: 802, Visits: 935
ichbinraj (2/10/2009)
Hi ,

I have 2TB database in production which has 1 MDF file ,2NDF files i am Planning to add one more datafile with out any down time in production ? Can I add file directly to DB right click and add file ?
appreciate your comments and suggestion.

Thanks
Ichbin


Is your existing ndf file taking all the space on the disk, if so are you creating a new ndf file on a new drive with enough space. Only in this case you need to add a new ndf file.

However, you can right click database, go to properties and then go to Files tab in the Select a page section.
On the bottom click on add and name the file and specify the location. I assume this is a SQL 2005 database

Also, as Gail suggested you can use the ALTER DATABASE command too.

Thanks!!


The_SQL_DBA
MCTS

"Quality is never an accident; it is always the result of high intention, sincere effort, intelligent direction and skillful execution; it represents the wise choice of many alternatives."
Post #654209
Posted Tuesday, February 10, 2009 2:10 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Friday, August 15, 2014 12:33 PM
Points: 71, Visits: 329

We have recommendations from team- lead to increase the datafiles in db ...he suggested us to maintain ratio 2:1 (datafiles :Processors ). thats what I am planning to do ?

if I add file according to your specification do I need to restart the MS SQL server ?
Post #654225
Posted Tuesday, February 10, 2009 2:16 PM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Friday, March 14, 2014 3:15 PM
Points: 802, Visits: 935
ichbinraj (2/10/2009)

if I add file according to your specification do I need to restart the MS SQL server ?


As a DBA always learn to say No and please Question as many things as you can.

However, for a large database having more than a couple data files is recommended.

ADDING A FILE DOES NOT NEED REBOOT, you can add as many files as you want but don't have too many files too.

Also place the new ndf file on a better RAID like RAID 10 or RAID 1..

Thanks!!


The_SQL_DBA
MCTS

"Quality is never an accident; it is always the result of high intention, sincere effort, intelligent direction and skillful execution; it represents the wise choice of many alternatives."
Post #654228
Posted Tuesday, February 10, 2009 2:18 PM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Thursday, October 16, 2014 6:06 AM
Points: 6,259, Visits: 2,030
ichbinraj (2/10/2009)

We have recommendations from team- lead to increase the datafiles in db ...he suggested us to maintain ratio 2:1 (datafiles :Processors ). thats what I am planning to do ?

if I add file according to your specification do I need to restart the MS SQL server ?


No need to reboot or anything like that. 2:1 flies/cpu ratio, seems a bit excessive.



* Noel
Post #654231
Posted Tuesday, February 10, 2009 2:19 PM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Friday, March 14, 2014 3:15 PM
Points: 802, Visits: 935
ichbinraj (2/10/2009)

We have recommendations from team- lead to increase the datafiles in db ...he suggested us to maintain ratio 2:1 (datafiles :Processors )


Does he intend to mean that 2:1 ratio of Data files to Processors?

If so is it for this 2TB database or for all of them?

In that case as a production would most of the times be a 8 CPU machine does that mean we need to have 16 data files..
I don't buy this recommendation..

What if my database size is 100Gb do I still need 2:1 ration..I DON'T think so..

That's why I said QUESTION EVERYTHING you possibly could like Is it the right thing to do?

Thanks!!


The_SQL_DBA
MCTS

"Quality is never an accident; it is always the result of high intention, sincere effort, intelligent direction and skillful execution; it represents the wise choice of many alternatives."
Post #654234
Posted Tuesday, February 10, 2009 2:28 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Friday, August 15, 2014 12:33 PM
Points: 71, Visits: 329

Yes, its processor and datafile ration.

Server has only 1 Database size 2 tb. I have completed adding ndf file successfully.

Thanks
ichbin
Post #654241
Posted Tuesday, February 10, 2009 2:39 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 5:50 AM
Points: 40,209, Visits: 36,618
ichbinraj (2/10/2009)

We have recommendations from team- lead to increase the datafiles in db ...he suggested us to maintain ratio 2:1 (datafiles : Processors ).


Tell your team lead that the recommendation he's talking about is only for TempDB and not for user databases. Even for tempDB, it's only for cases there are bottlenecks on the allocation pages. User databases do not get new tables added fast enough (many per second) to need such treatment

The only reasons you would add files to a user database are:
1) IO performance. In this case, the files must be on separate physical drives to see any gain at all
2) Faster backups and piecemeal restores. Requires filegroups and a careful design



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #654253
Posted Tuesday, February 10, 2009 10:05 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Friday, May 8, 2009 9:58 AM
Points: 216, Visits: 674
If we add new secondary datafile to existing production database, how the data will be shared between mdf and newly created ndf file? do we need to move data from mdf to ndf or the database itself take care of that?

Post #654403
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse