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


How to make data(.mdf) to equal size slices!


How to make data(.mdf) to equal size slices!

Author
Message
@SQLFRNDZ
@SQLFRNDZ
SSC Eights!
SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)

Group: General Forum Members
Points: 889 Visits: 1217
In my prod I have 50gb data file,

Now,

I need to divide it into 5 equal sizes(i.e 10GB each) without loosing data and less downtime


Can I do this?


--SQLFRNDZ

Evil Kraig F
Evil Kraig F
SSCrazy Eights
SSCrazy Eights (8.5K reputation)SSCrazy Eights (8.5K reputation)SSCrazy Eights (8.5K reputation)SSCrazy Eights (8.5K reputation)SSCrazy Eights (8.5K reputation)SSCrazy Eights (8.5K reputation)SSCrazy Eights (8.5K reputation)SSCrazy Eights (8.5K reputation)

Group: General Forum Members
Points: 8545 Visits: 7660
Ermm Yeah, you caaaannnn.... but why would you want an additional 4 .ndf files with no other purpose to them? Just splitting the files without a purpose for filegroups and spindle control doesn't gain you anything.

Well, except on TempDB, but that's a different discussion altogether from what you're asking.


- Craig Farrell

Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

For better assistance in answering your questions | Forum Netiquette
For index/tuning help, follow these directions. |Tally Tables

Twitter: @AnyWayDBA
@SQLFRNDZ
@SQLFRNDZ
SSC Eights!
SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)

Group: General Forum Members
Points: 889 Visits: 1217
Yes exactly its a contention on my datafile SGAM pages

But not in tempdb its on user db.


How I do this in prod.
Dividing into equal no of files and into different file groups if possible.


--SQLFRNDZ

Evil Kraig F
Evil Kraig F
SSCrazy Eights
SSCrazy Eights (8.5K reputation)SSCrazy Eights (8.5K reputation)SSCrazy Eights (8.5K reputation)SSCrazy Eights (8.5K reputation)SSCrazy Eights (8.5K reputation)SSCrazy Eights (8.5K reputation)SSCrazy Eights (8.5K reputation)SSCrazy Eights (8.5K reputation)

Group: General Forum Members
Points: 8545 Visits: 7660
pavan_srirangam (11/17/2010)
Yes exactly its a contention on my datafile SGAM pages

But not in tempdb its on user db.


How I do this in prod.
Dividing into equal no of files and into different file groups if possible.


Blink How many schema changes are you making per second?! DAAaaang. Alrighty then. The technique is simple enough, but it will require some time. You must have some incredibly serious allocation contention though before this is worthwhile, and you're not doing physical spindle splits...

In general, you do:
ALTER DATABASE <db> ADD FILE (name = <db>2, filename = <path/filename>2.ndf, size = 10485760kb, maxsize = 10485760KB, FILEGROWTH = 0KB), (name = <db>3, filename = <path/filename>3.ndf, size = 10485760kb, maxsize = 10485760KB, FILEGROWTH = 0KB), ... (repeat as necessary) ... to filegroup [PRIMARY]

Please note you have no control without filegroups to what ends up in which file. SQL Server will eventually level them out for you across the files, if memory serves correctly.

I still don't recommend this. I cannot emphasize this enough even though I'm showing you the methodology, you're the only one who can see your actual server and know your local politics. The only reason for a single filegroup like this is on tempdb where the concurrency for create/drop/alters hits a per procedure call level and you can hit contention in allocation. Under incredibly rare to never circumstances should procedures be creating actual local physical tables, nevermind at the volume needed to cause this.


- Craig Farrell

Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

For better assistance in answering your questions | Forum Netiquette
For index/tuning help, follow these directions. |Tally Tables

Twitter: @AnyWayDBA
Steve Jones
Steve Jones
SSC Guru
SSC Guru (61K reputation)SSC Guru (61K reputation)SSC Guru (61K reputation)SSC Guru (61K reputation)SSC Guru (61K reputation)SSC Guru (61K reputation)SSC Guru (61K reputation)SSC Guru (61K reputation)

Group: Administrators
Points: 61547 Visits: 19099
I agree with Craig. I think you might be misinterpreting what is happening here.

Filegroups will let you control the objects, and if you have enterprise editions, you can move tables w/o blobs in them online.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
GilaMonster
GilaMonster
SSC Guru
SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)

Group: General Forum Members
Points: 86240 Visits: 45232
pavan_srirangam (11/17/2010)
Yes exactly its a contention on my datafile SGAM pages


In a user database?

What's the wait type you're predominantly seeing? What's the wait resource? What has led you to the conclusion that you have contention on the SGAM in your user database?

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


@SQLFRNDZ
@SQLFRNDZ
SSC Eights!
SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)

Group: General Forum Members
Points: 889 Visits: 1217
@Gila

Wait type is pagelatch_up and wait resource is 5:1:3

5 is my database id 1 is the file group and 3 is the page id

when you see in sys.dm_os_buffer_descriptors it says SGAM Page and there are lot of waits


--SQLFRNDZ

GilaMonster
GilaMonster
SSC Guru
SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)

Group: General Forum Members
Points: 86240 Visits: 45232
What kind of DDL are you doing in that DB (table create/drop) that has that kind of effect on the allocation pages?

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


@SQLFRNDZ
@SQLFRNDZ
SSC Eights!
SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)

Group: General Forum Members
Points: 889 Visits: 1217
@Craig

Yes there is scenario where local physical tables were creating and dropping in the user database not in temp db.

There are lot waits with wait types pagelatch_up

and the wait resource is 5:1:3(db_id:FG:pageid)


page id 3 is SGAM I went through most of the stuff

including adding files and enabling trace flag 1118 globally.

I don't want move files to other drives because all of them are raid 5 drives so not helpful.

Recommend suggetions

and also get e script to divide the .mdf to equal no.of .ndf files.


Right now .mdf(50GB) ---existing and FG 1

.ndf(5GB)----I created and FG 1


.ndf(5GB)---I craeted and FG2


--SQLFRNDZ

@SQLFRNDZ
@SQLFRNDZ
SSC Eights!
SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)

Group: General Forum Members
Points: 889 Visits: 1217
the DDL is select * into table and then drop table commands

But there are several queries like that


--SQLFRNDZ

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