Showing posts with label datafiles. Show all posts
Showing posts with label datafiles. Show all posts

Thursday, March 8, 2012

Datafiles placement in filegroup

I'm working with a production database connecting remotely. All the datafile
s, index files and log is placed on the same disk but in different filegroup
names based on separate physical files. But I expect if I place the index f
iles or/add log files sep
arate from the datafiles I mean in different disk it will improve the perfor
mance.
If my expectation is correct then can I change the place of the index and lo
g files in separate location while the database is on-line yes the database
is implemented with log-shipping too.
Please evaluate my query and do give a proper suggestion.
Thanks in advance
Sunilsurely it will improve the performance if the log files are placed seperate
from the data files (different disks).
for the indexes u can delete the existing index and recreate it specifying
the new location.
"Sunil" <anonymous@.discussions.microsoft.com> wrote in message
news:4690C174-4988-4737-82D9-7C0ED08FDF5D@.microsoft.com...
quote:

> I'm working with a production database connecting remotely. All the

datafiles, index files and log is placed on the same disk but in different
filegroup names based on separate physical files. But I expect if I place
the index files or/add log files separate from the datafiles I mean in
different disk it will improve the performance.
quote:

> If my expectation is correct then can I change the place of the index and

log files in separate location while the database is on-line yes the
database is implemented with log-shipping too.
quote:

>
> Please evaluate my query and do give a proper suggestion.
>
> Thanks in advance
> Sunil
>

Datafiles placement in filegroup

I'm working with a production database connecting remotely. All the datafiles, index files and log is placed on the same disk but in different filegroup names based on separate physical files. But I expect if I place the index files or/add log files separate from the datafiles I mean in different disk it will improve the performance.
If my expectation is correct then can I change the place of the index and log files in separate location while the database is on-line yes the database is implemented with log-shipping too.
Please evaluate my query and do give a proper suggestion.
Thanks in advance
Sunilsurely it will improve the performance if the log files are placed seperate
from the data files (different disks).
for the indexes u can delete the existing index and recreate it specifying
the new location.
"Sunil" <anonymous@.discussions.microsoft.com> wrote in message
news:4690C174-4988-4737-82D9-7C0ED08FDF5D@.microsoft.com...
> I'm working with a production database connecting remotely. All the
datafiles, index files and log is placed on the same disk but in different
filegroup names based on separate physical files. But I expect if I place
the index files or/add log files separate from the datafiles I mean in
different disk it will improve the performance.
> If my expectation is correct then can I change the place of the index and
log files in separate location while the database is on-line yes the
database is implemented with log-shipping too.
>
> Please evaluate my query and do give a proper suggestion.
>
> Thanks in advance
> Sunil
>|||You are mostly correct.
Creating new files doesn't automatically improve
performace, it also depends upon the raid configuration of
the disk its going on.
For instance putting a log file on a RAID 0 disk will make
it faster than putting it on a raid 5 disk.
Although its different for every type of application a
normal implementation with cost constraints its to put the
log files on a raid 0 or raid 0+1 with the data files on
raid 5.
J
>--Original Message--
>I'm working with a production database connecting
remotely. All the datafiles, index files and log is placed
on the same disk but in different filegroup names based on
separate physical files. But I expect if I place the index
files or/add log files separate from the datafiles I
mean in different disk it will improve the performance.
>If my expectation is correct then can I change the place
of the index and log files in separate location while the
database is on-line yes the database is implemented with
log-shipping too.
>
>Please evaluate my query and do give a proper suggestion.
>
>Thanks in advance
>Sunil
>.
>

Datafiles

I am having trouble moving BLOBs (text fields).
I have a 200Gb database in a single data file and want to split it into 4
even sized files (I have my reasons). To achieve this I plan on adding 3 data
files to the Primary filegroup. From there I will issue a DBCC dbreindex on
all my tables, which effectively recreates the index (or table if its a
clustered index) across all datafiles and I get my even distribution.
My plan comes unstuck when I encounter text fields and other BLOBs (as the
clustered index just contains pointers doesnt it'). How can I move them? Do
I have to do a select into or bcp? Can I just issue a shrink file on the
oringal large file or does that just push pages from the end of that data
file to the beginning and not to other datafiles'
Any suggestions would be great, I don't really want to create another
filegroup just yet.
Thanks :)"Malarb" <Malarb@.discussions.microsoft.com> wrote in message
news:BA0A6D10-4377-4247-A2A3-195FB60B308B@.microsoft.com...
>I am having trouble moving BLOBs (text fields).
> I have a 200Gb database in a single data file and want to split it into 4
> even sized files (I have my reasons). To achieve this I plan on adding 3
> data
> files to the Primary filegroup. From there I will issue a DBCC dbreindex
> on
> all my tables, which effectively recreates the index (or table if its a
> clustered index) across all datafiles and I get my even distribution.
> My plan comes unstuck when I encounter text fields and other BLOBs (as the
> clustered index just contains pointers doesnt it'). How can I move them?
> Do
> I have to do a select into or bcp? Can I just issue a shrink file on the
> oringal large file or does that just push pages from the end of that data
> file to the beginning and not to other datafiles'
> Any suggestions would be great, I don't really want to create another
> filegroup just yet.
I would create a new filegroup with the desired number and layout of files,
mark it as primary, and move all your objects there. Then drop the old
filegroup.
David|||You will need to create a new filegroup so you can create a new table on
this filegroup. Copy the old data to the new table. Drop the old table.
Rename the new tb to the old name. And then shrink the db to reclaim the
space.
--
-oj
"Malarb" <Malarb@.discussions.microsoft.com> wrote in message
news:BA0A6D10-4377-4247-A2A3-195FB60B308B@.microsoft.com...
>I am having trouble moving BLOBs (text fields).
> I have a 200Gb database in a single data file and want to split it into 4
> even sized files (I have my reasons). To achieve this I plan on adding 3
> data
> files to the Primary filegroup. From there I will issue a DBCC dbreindex
> on
> all my tables, which effectively recreates the index (or table if its a
> clustered index) across all datafiles and I get my even distribution.
> My plan comes unstuck when I encounter text fields and other BLOBs (as the
> clustered index just contains pointers doesnt it'). How can I move them?
> Do
> I have to do a select into or bcp? Can I just issue a shrink file on the
> oringal large file or does that just push pages from the end of that data
> file to the beginning and not to other datafiles'
> Any suggestions would be great, I don't really want to create another
> filegroup just yet.
> Thanks :)|||Hi,
I have the same problem, but i´m not a dba expert. How is sintaxe to create
a new table and accurate the it´s will in the new files group.
Could use the following command to creat a copy table'
select * into COPY_TABLE
from SOURCE_TABLE
WHERE 1=0
Thanks
"oj" wrote:
> You will need to create a new filegroup so you can create a new table on
> this filegroup. Copy the old data to the new table. Drop the old table.
> Rename the new tb to the old name. And then shrink the db to reclaim the
> space.
> --
> -oj
>
> "Malarb" <Malarb@.discussions.microsoft.com> wrote in message
> news:BA0A6D10-4377-4247-A2A3-195FB60B308B@.microsoft.com...
> >I am having trouble moving BLOBs (text fields).
> >
> > I have a 200Gb database in a single data file and want to split it into 4
> > even sized files (I have my reasons). To achieve this I plan on adding 3
> > data
> > files to the Primary filegroup. From there I will issue a DBCC dbreindex
> > on
> > all my tables, which effectively recreates the index (or table if its a
> > clustered index) across all datafiles and I get my even distribution.
> >
> > My plan comes unstuck when I encounter text fields and other BLOBs (as the
> > clustered index just contains pointers doesnt it'). How can I move them?
> > Do
> > I have to do a select into or bcp? Can I just issue a shrink file on the
> > oringal large file or does that just push pages from the end of that data
> > file to the beginning and not to other datafiles'
> >
> > Any suggestions would be great, I don't really want to create another
> > filegroup just yet.
> >
> > Thanks :)
>
>|||select/into does not allow you to specify the filegroup. You will need to
create a new table then do update.
e.g.
create table newtab(...) on filegroup
update newtab
set ...= old...
from newtab,old
where newtab.pk=old.pk
-oj
"Fabio Rebelo" <FabioRebelo@.discussions.microsoft.com> wrote in message
news:07896DF0-B18B-4ACB-A854-EFBEE387E32D@.microsoft.com...
> Hi,
> I have the same problem, but i´m not a dba expert. How is sintaxe to
> create
> a new table and accurate the it´s will in the new files group.
> Could use the following command to creat a copy table'
> select * into COPY_TABLE
> from SOURCE_TABLE
> WHERE 1=0
> Thanks
>
> "oj" wrote:
>> You will need to create a new filegroup so you can create a new table on
>> this filegroup. Copy the old data to the new table. Drop the old table.
>> Rename the new tb to the old name. And then shrink the db to reclaim the
>> space.
>> --
>> -oj
>>
>> "Malarb" <Malarb@.discussions.microsoft.com> wrote in message
>> news:BA0A6D10-4377-4247-A2A3-195FB60B308B@.microsoft.com...
>> >I am having trouble moving BLOBs (text fields).
>> >
>> > I have a 200Gb database in a single data file and want to split it into
>> > 4
>> > even sized files (I have my reasons). To achieve this I plan on adding
>> > 3
>> > data
>> > files to the Primary filegroup. From there I will issue a DBCC
>> > dbreindex
>> > on
>> > all my tables, which effectively recreates the index (or table if its a
>> > clustered index) across all datafiles and I get my even distribution.
>> >
>> > My plan comes unstuck when I encounter text fields and other BLOBs (as
>> > the
>> > clustered index just contains pointers doesnt it'). How can I move
>> > them?
>> > Do
>> > I have to do a select into or bcp? Can I just issue a shrink file on
>> > the
>> > oringal large file or does that just push pages from the end of that
>> > data
>> > file to the beginning and not to other datafiles'
>> >
>> > Any suggestions would be great, I don't really want to create another
>> > filegroup just yet.
>> >
>> > Thanks :)
>>

Datafiles

I am having trouble moving BLOBs (text fields).
I have a 200Gb database in a single data file and want to split it into 4
even sized files (I have my reasons). To achieve this I plan on adding 3 dat
a
files to the Primary filegroup. From there I will issue a DBCC dbreindex on
all my tables, which effectively recreates the index (or table if its a
clustered index) across all datafiles and I get my even distribution.
My plan comes unstuck when I encounter text fields and other BLOBs (as the
clustered index just contains pointers doesnt it'). How can I move them? Do
I have to do a select into or bcp? Can I just issue a shrink file on the
oringal large file or does that just push pages from the end of that data
file to the beginning and not to other datafiles'
Any suggestions would be great, I don't really want to create another
filegroup just yet.
Thanks "Malarb" <Malarb@.discussions.microsoft.com> wrote in message
news:BA0A6D10-4377-4247-A2A3-195FB60B308B@.microsoft.com...
>I am having trouble moving BLOBs (text fields).
> I have a 200Gb database in a single data file and want to split it into 4
> even sized files (I have my reasons). To achieve this I plan on adding 3
> data
> files to the Primary filegroup. From there I will issue a DBCC dbreindex
> on
> all my tables, which effectively recreates the index (or table if its a
> clustered index) across all datafiles and I get my even distribution.
> My plan comes unstuck when I encounter text fields and other BLOBs (as the
> clustered index just contains pointers doesnt it'). How can I move them?
> Do
> I have to do a select into or bcp? Can I just issue a shrink file on the
> oringal large file or does that just push pages from the end of that data
> file to the beginning and not to other datafiles'
> Any suggestions would be great, I don't really want to create another
> filegroup just yet.
I would create a new filegroup with the desired number and layout of files,
mark it as primary, and move all your objects there. Then drop the old
filegroup.
David|||You will need to create a new filegroup so you can create a new table on
this filegroup. Copy the old data to the new table. Drop the old table.
Rename the new tb to the old name. And then shrink the db to reclaim the
space.
-oj
"Malarb" <Malarb@.discussions.microsoft.com> wrote in message
news:BA0A6D10-4377-4247-A2A3-195FB60B308B@.microsoft.com...
>I am having trouble moving BLOBs (text fields).
> I have a 200Gb database in a single data file and want to split it into 4
> even sized files (I have my reasons). To achieve this I plan on adding 3
> data
> files to the Primary filegroup. From there I will issue a DBCC dbreindex
> on
> all my tables, which effectively recreates the index (or table if its a
> clustered index) across all datafiles and I get my even distribution.
> My plan comes unstuck when I encounter text fields and other BLOBs (as the
> clustered index just contains pointers doesnt it'). How can I move them?
> Do
> I have to do a select into or bcp? Can I just issue a shrink file on the
> oringal large file or does that just push pages from the end of that data
> file to the beginning and not to other datafiles'
> Any suggestions would be great, I don't really want to create another
> filegroup just yet.
> Thanks |||Hi,
I have the same problem, but i′m not a dba expert. How is sintaxe to create
a new table and accurate the it′s will in the new files group.
Could use the following command to creat a copy table'
select * into COPY_TABLE
from SOURCE_TABLE
WHERE 1=0
Thanks
"oj" wrote:

> You will need to create a new filegroup so you can create a new table on
> this filegroup. Copy the old data to the new table. Drop the old table.
> Rename the new tb to the old name. And then shrink the db to reclaim the
> space.
> --
> -oj
>
> "Malarb" <Malarb@.discussions.microsoft.com> wrote in message
> news:BA0A6D10-4377-4247-A2A3-195FB60B308B@.microsoft.com...
>
>|||select/into does not allow you to specify the filegroup. You will need to
create a new table then do update.
e.g.
create table newtab(...) on filegroup
update newtab
set ...= old...
from newtab,old
where newtab.pk=old.pk
-oj
"Fabio Rebelo" <FabioRebelo@.discussions.microsoft.com> wrote in message
news:07896DF0-B18B-4ACB-A854-EFBEE387E32D@.microsoft.com...[vbcol=seagreen]
> Hi,
> I have the same problem, but im not a dba expert. How is sintaxe to
> create
> a new table and accurate the its will in the new files group.
> Could use the following command to creat a copy table'
> select * into COPY_TABLE
> from SOURCE_TABLE
> WHERE 1=0
> Thanks
>
> "oj" wrote:
>

datafile usage

If a database consists of more than one datafile, how does SQL Server use the space in these datafiles ?, does it fill up the first one then move to the next and so forth, or does it use up pages across all the files evenly ?.In a group, the files are all filled proportionnally to their size.

For example : a group with file1 = 100 MB and file2 = 200 MB
If you add 3 MB, 1 MB is added to file1, and 2 MB to file2.|||Thanks for the information|||You're welcome ! :)

Sunday, February 19, 2012

database with two data files

I only need short description or even link about database with two data
files and/or two log files. How does it work,...?
thanks
Hi
In BOL, look up the keyword "filegroups, described". Gives a perfect
description and examples.
Regards
Mike
"Lugos" wrote:

> I only need short description or even link about database with two data
> files and/or two log files. How does it work,...?
> thanks
>
|||Thanks. That's what I am looking for. Shame is i did not find it myself.
Mike Epprecht (SQL MVP) wrote:[vbcol=seagreen]
> Hi
> In BOL, look up the keyword "filegroups, described". Gives a perfect
> description and examples.
> Regards
> Mike
> "Lugos" wrote:
>

database with two data files

I only need short description or even link about database with two data
files and/or two log files. How does it work,...?
thanksHi
In BOL, look up the keyword "filegroups, described". Gives a perfect
description and examples.
Regards
Mike
"Lugos" wrote:

> I only need short description or even link about database with two data
> files and/or two log files. How does it work,...?
> thanks
>|||Thanks. That's what I am looking for. Shame is i did not find it myself.
Mike Epprecht (SQL MVP) wrote:[vbcol=seagreen]
> Hi
> In BOL, look up the keyword "filegroups, described". Gives a perfect
> description and examples.
> Regards
> Mike
> "Lugos" wrote:
>