SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


How to Add Datafile.ndf in Production database ?


How to Add Datafile.ndf in Production database ?

Author
Message
ichbinraj
ichbinraj
Old Hand
Old Hand (361 reputation)Old Hand (361 reputation)Old Hand (361 reputation)Old Hand (361 reputation)Old Hand (361 reputation)Old Hand (361 reputation)Old Hand (361 reputation)Old Hand (361 reputation)

Group: General Forum Members
Points: 361 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
GilaMonster
GilaMonster
SSC Guru
SSC Guru (220K reputation)SSC Guru (220K reputation)SSC Guru (220K reputation)SSC Guru (220K reputation)SSC Guru (220K reputation)SSC Guru (220K reputation)SSC Guru (220K reputation)SSC Guru (220K reputation)

Group: General Forum Members
Points: 220121 Visits: 46279
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, MVP, M.Sc (Comp Sci)
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


The_SQL_DBA
The_SQL_DBA
SSCrazy
SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)

Group: General Forum Members
Points: 2592 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."
ichbinraj
ichbinraj
Old Hand
Old Hand (361 reputation)Old Hand (361 reputation)Old Hand (361 reputation)Old Hand (361 reputation)Old Hand (361 reputation)Old Hand (361 reputation)Old Hand (361 reputation)Old Hand (361 reputation)

Group: General Forum Members
Points: 361 Visits: 329
We have recommendations from team- lead to increase the datafiles in db ...he suggested us to maintain ratio 2:1 (datafiles Tonguerocessors ). thats what I am planning to do ?

if I add file according to your specification do I need to restart the MS SQL server ?
The_SQL_DBA
The_SQL_DBA
SSCrazy
SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)

Group: General Forum Members
Points: 2592 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."
noeld
noeld
SSC-Insane
SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)

Group: General Forum Members
Points: 22354 Visits: 2048
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 Tonguerocessors ). 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
The_SQL_DBA
The_SQL_DBA
SSCrazy
SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)

Group: General Forum Members
Points: 2592 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 Tonguerocessors )


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."
ichbinraj
ichbinraj
Old Hand
Old Hand (361 reputation)Old Hand (361 reputation)Old Hand (361 reputation)Old Hand (361 reputation)Old Hand (361 reputation)Old Hand (361 reputation)Old Hand (361 reputation)Old Hand (361 reputation)

Group: General Forum Members
Points: 361 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
GilaMonster
GilaMonster
SSC Guru
SSC Guru (220K reputation)SSC Guru (220K reputation)SSC Guru (220K reputation)SSC Guru (220K reputation)SSC Guru (220K reputation)SSC Guru (220K reputation)SSC Guru (220K reputation)SSC Guru (220K reputation)

Group: General Forum Members
Points: 220121 Visits: 46279
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, MVP, M.Sc (Comp Sci)
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


AAkula
AAkula
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1316 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?
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search