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

How to make data(.mdf) to equal size slices! Expand / Collapse
Author
Message
Posted Wednesday, November 17, 2010 4:03 PM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Yesterday @ 6:36 PM
Points: 465, Visits: 1,034
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
Post #1022530
Posted Wednesday, November 17, 2010 4:42 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 7:56 PM
Points: 6,250, Visits: 7,408
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
Post #1022541
Posted Wednesday, November 17, 2010 5:21 PM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Yesterday @ 6:36 PM
Points: 465, Visits: 1,034
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
Post #1022551
Posted Wednesday, November 17, 2010 5:43 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 7:56 PM
Points: 6,250, Visits: 7,408
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.


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
Post #1022556
Posted Wednesday, November 17, 2010 6:14 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Today @ 12:21 PM
Points: 33,202, Visits: 15,350
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
Post #1022567
Posted Wednesday, November 17, 2010 10: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 @ 9:44 AM
Points: 42,822, Visits: 35,953
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 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 #1022628
Posted Thursday, November 18, 2010 11:21 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Yesterday @ 6:36 PM
Points: 465, Visits: 1,034
@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
Post #1023073
Posted Thursday, November 18, 2010 11:30 AM


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 @ 9:44 AM
Points: 42,822, Visits: 35,953
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 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 #1023078
Posted Thursday, November 18, 2010 11:30 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Yesterday @ 6:36 PM
Points: 465, Visits: 1,034
@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
Post #1023079
Posted Thursday, November 18, 2010 11:33 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Yesterday @ 6:36 PM
Points: 465, Visits: 1,034
the DDL is select * into table and then drop table commands

But there are several queries like that



--SQLFRNDZ
Post #1023082
« Prev Topic | Next Topic »

Add to briefcase 123»»»

Permissions Expand / Collapse