Showing posts with label datafile. Show all posts
Showing posts with label datafile. Show all posts

Wednesday, March 28, 2012

Moving a Large Table into New datafile vs. New database

Hi,
We have a production database of size 40GB and growing at the rate 1.5
GB/month and one table is occupying about 20GB and all other tables are of
normal size. Till now every table is in the PRIMARY group and it has only on
e
datafile. Now we would like to split that database by moving that large
table out.
I was wondering if anyone could tell me what would be the best option in
terms of performance of SQLServer of the following options:
1. Create a new Filegroup and move the table into the newfile group.
2. Simply add a new datafile to existing PRIMARY group and do nothing.
3. Create a new database and move the table to the new database, and create
a view of the table in the first database pointing to the table in the new
database (Assuming the foreign key constraints are taken care with in
application).
Thankyou,
VMVM wrote:
> Hi,
> We have a production database of size 40GB and growing at the rate 1.5
> GB/month and one table is occupying about 20GB and all other tables
> are of normal size. Till now every table is in the PRIMARY group and
> it has only one datafile. Now we would like to split that database
> by moving that large table out.
> I was wondering if anyone could tell me what would be the best option
> in terms of performance of SQLServer of the following options:
> 1. Create a new Filegroup and move the table into the newfile group.
> 2. Simply add a new datafile to existing PRIMARY group and do nothing.
> 3. Create a new database and move the table to the new database, and
> create a view of the table in the first database pointing to the
> table in the new database (Assuming the foreign key constraints are
> taken care with in application).
> Thankyou,
> VM
First we would want to understand why you feel you need to move this
table out of the primary filegroup. The size is not a concern for me,
but it may be for you. Are you having backup issues? Also, if you create
a second filegroup, it would really need to be on a different array to
provide performance benefits. If the new filegroup is on the same drive
array, it will not help (backup flexibility aside).
If you do decide to move the table to another filegroup, the easiest way
to do this is to recreate the clustered index for the table on the new
filegroup (off hours). That will cause the table to move to the new
location. Non-clustered indexes will stay put, however. You can move
them as well by manually recreating them, but having the non-clustered
indexes on a separate array can help performance if the table is
accessed/updated frequently.
David Gugick
Quest Software
www.quest.com|||Hi David,
Thankyou for the reply. We have been observing some performace degradation
of our database recently including full database backup time taken. After
brainstorming the ways we can split one large database file into multiple
physical files and we came up with below given options.
I think we might create a new filegroup (as you said on a different array)
and move some of the data. Either we would move all the indexes on to the
new group, or, Since one of our table is half of the size of total database
and is frequently inserted and updated, we may move that one table onto new
filegroup. Creation of clustered index is also a great idea.
Thanks again,
VM
"David Gugick" wrote:

> VM wrote:
> First we would want to understand why you feel you need to move this
> table out of the primary filegroup. The size is not a concern for me,
> but it may be for you. Are you having backup issues? Also, if you create
> a second filegroup, it would really need to be on a different array to
> provide performance benefits. If the new filegroup is on the same drive
> array, it will not help (backup flexibility aside).
> If you do decide to move the table to another filegroup, the easiest way
> to do this is to recreate the clustered index for the table on the new
> filegroup (off hours). That will cause the table to move to the new
> location. Non-clustered indexes will stay put, however. You can move
> them as well by manually recreating them, but having the non-clustered
> indexes on a separate array can help performance if the table is
> accessed/updated frequently.
>
> --
> David Gugick
> Quest Software
> www.quest.com
>

Moving a Large Table into New datafile vs. New database

Hi,
We have a production database of size 40GB and growing at the rate 1.5
GB/month and one table is occupying about 20GB and all other tables are of
normal size. Till now every table is in the PRIMARY group and it has only one
datafile. Now we would like to split that database by moving that large
table out.
I was wondering if anyone could tell me what would be the best option in
terms of performance of SQLServer of the following options:
1. Create a new Filegroup and move the table into the newfile group.
2. Simply add a new datafile to existing PRIMARY group and do nothing.
3. Create a new database and move the table to the new database, and create
a view of the table in the first database pointing to the table in the new
database (Assuming the foreign key constraints are taken care with in
application).
Thankyou,
VMVM wrote:
> Hi,
> We have a production database of size 40GB and growing at the rate 1.5
> GB/month and one table is occupying about 20GB and all other tables
> are of normal size. Till now every table is in the PRIMARY group and
> it has only one datafile. Now we would like to split that database
> by moving that large table out.
> I was wondering if anyone could tell me what would be the best option
> in terms of performance of SQLServer of the following options:
> 1. Create a new Filegroup and move the table into the newfile group.
> 2. Simply add a new datafile to existing PRIMARY group and do nothing.
> 3. Create a new database and move the table to the new database, and
> create a view of the table in the first database pointing to the
> table in the new database (Assuming the foreign key constraints are
> taken care with in application).
> Thankyou,
> VM
First we would want to understand why you feel you need to move this
table out of the primary filegroup. The size is not a concern for me,
but it may be for you. Are you having backup issues? Also, if you create
a second filegroup, it would really need to be on a different array to
provide performance benefits. If the new filegroup is on the same drive
array, it will not help (backup flexibility aside).
If you do decide to move the table to another filegroup, the easiest way
to do this is to recreate the clustered index for the table on the new
filegroup (off hours). That will cause the table to move to the new
location. Non-clustered indexes will stay put, however. You can move
them as well by manually recreating them, but having the non-clustered
indexes on a separate array can help performance if the table is
accessed/updated frequently.
David Gugick
Quest Software
www.quest.com|||Hi David,
Thankyou for the reply. We have been observing some performace degradation
of our database recently including full database backup time taken. After
brainstorming the ways we can split one large database file into multiple
physical files and we came up with below given options.
I think we might create a new filegroup (as you said on a different array)
and move some of the data. Either we would move all the indexes on to the
new group, or, Since one of our table is half of the size of total database
and is frequently inserted and updated, we may move that one table onto new
filegroup. Creation of clustered index is also a great idea.
Thanks again,
VM
"David Gugick" wrote:
> VM wrote:
> > Hi,
> >
> > We have a production database of size 40GB and growing at the rate 1.5
> > GB/month and one table is occupying about 20GB and all other tables
> > are of normal size. Till now every table is in the PRIMARY group and
> > it has only one datafile. Now we would like to split that database
> > by moving that large table out.
> >
> > I was wondering if anyone could tell me what would be the best option
> > in terms of performance of SQLServer of the following options:
> >
> > 1. Create a new Filegroup and move the table into the newfile group.
> > 2. Simply add a new datafile to existing PRIMARY group and do nothing.
> > 3. Create a new database and move the table to the new database, and
> > create a view of the table in the first database pointing to the
> > table in the new database (Assuming the foreign key constraints are
> > taken care with in application).
> >
> > Thankyou,
> > VM
> First we would want to understand why you feel you need to move this
> table out of the primary filegroup. The size is not a concern for me,
> but it may be for you. Are you having backup issues? Also, if you create
> a second filegroup, it would really need to be on a different array to
> provide performance benefits. If the new filegroup is on the same drive
> array, it will not help (backup flexibility aside).
> If you do decide to move the table to another filegroup, the easiest way
> to do this is to recreate the clustered index for the table on the new
> filegroup (off hours). That will cause the table to move to the new
> location. Non-clustered indexes will stay put, however. You can move
> them as well by manually recreating them, but having the non-clustered
> indexes on a separate array can help performance if the table is
> accessed/updated frequently.
>
> --
> David Gugick
> Quest Software
> www.quest.com
>

Moving a Large Table into New datafile vs. New database

Hi,
We have a production database of size 40GB and growing at the rate 1.5
GB/month and one table is occupying about 20GB and all other tables are of
normal size. Till now every table is in the PRIMARY group and it has only one
datafile. Now we would like to split that database by moving that large
table out.
I was wondering if anyone could tell me what would be the best option in
terms of performance of SQLServer of the following options:
1. Create a new Filegroup and move the table into the newfile group.
2. Simply add a new datafile to existing PRIMARY group and do nothing.
3. Create a new database and move the table to the new database, and create
a view of the table in the first database pointing to the table in the new
database (Assuming the foreign key constraints are taken care with in
application).
Thankyou,
VM
VM wrote:
> Hi,
> We have a production database of size 40GB and growing at the rate 1.5
> GB/month and one table is occupying about 20GB and all other tables
> are of normal size. Till now every table is in the PRIMARY group and
> it has only one datafile. Now we would like to split that database
> by moving that large table out.
> I was wondering if anyone could tell me what would be the best option
> in terms of performance of SQLServer of the following options:
> 1. Create a new Filegroup and move the table into the newfile group.
> 2. Simply add a new datafile to existing PRIMARY group and do nothing.
> 3. Create a new database and move the table to the new database, and
> create a view of the table in the first database pointing to the
> table in the new database (Assuming the foreign key constraints are
> taken care with in application).
> Thankyou,
> VM
First we would want to understand why you feel you need to move this
table out of the primary filegroup. The size is not a concern for me,
but it may be for you. Are you having backup issues? Also, if you create
a second filegroup, it would really need to be on a different array to
provide performance benefits. If the new filegroup is on the same drive
array, it will not help (backup flexibility aside).
If you do decide to move the table to another filegroup, the easiest way
to do this is to recreate the clustered index for the table on the new
filegroup (off hours). That will cause the table to move to the new
location. Non-clustered indexes will stay put, however. You can move
them as well by manually recreating them, but having the non-clustered
indexes on a separate array can help performance if the table is
accessed/updated frequently.
David Gugick
Quest Software
www.quest.com
|||Hi David,
Thankyou for the reply. We have been observing some performace degradation
of our database recently including full database backup time taken. After
brainstorming the ways we can split one large database file into multiple
physical files and we came up with below given options.
I think we might create a new filegroup (as you said on a different array)
and move some of the data. Either we would move all the indexes on to the
new group, or, Since one of our table is half of the size of total database
and is frequently inserted and updated, we may move that one table onto new
filegroup. Creation of clustered index is also a great idea.
Thanks again,
VM
"David Gugick" wrote:

> VM wrote:
> First we would want to understand why you feel you need to move this
> table out of the primary filegroup. The size is not a concern for me,
> but it may be for you. Are you having backup issues? Also, if you create
> a second filegroup, it would really need to be on a different array to
> provide performance benefits. If the new filegroup is on the same drive
> array, it will not help (backup flexibility aside).
> If you do decide to move the table to another filegroup, the easiest way
> to do this is to recreate the clustered index for the table on the new
> filegroup (off hours). That will cause the table to move to the new
> location. Non-clustered indexes will stay put, however. You can move
> them as well by manually recreating them, but having the non-clustered
> indexes on a separate array can help performance if the table is
> accessed/updated frequently.
>
> --
> David Gugick
> Quest Software
> www.quest.com
>

Monday, March 26, 2012

moving a database to a different drive

Hi,
You could do a backup and restore using the 'WITH MOVE'
OPTION or you could (better use) detach the database, copy
the datafile to new location and attach the database files.
You can look at sp_detach_db and sp_attach_db procedures
in BOL.
hth
DeeJay
>--Original Message--
>what is the reccomended method for moving a database to a
different drive on
>the same computer? Just a backup and restore?
>
>.
>
ok. I'll check out those procedures in Books Online. Thanks for the input.
"DeeJay Puar" <deejaypuar@.yahoo.com> wrote in message
news:1cc9b01c45309$967fde70$a101280a@.phx.gbl...[vbcol=seagreen]
> Hi,
> You could do a backup and restore using the 'WITH MOVE'
> OPTION or you could (better use) detach the database, copy
> the datafile to new location and attach the database files.
> You can look at sp_detach_db and sp_attach_db procedures
> in BOL.
> hth
> DeeJay
> different drive on
|||Hi,
I will use the detatch/attatch method to move but your reply brings another
question to me. I did not see an option to restore 'WITH MOVE' in enterprise
manager GUI restore... is it only available when using TSQL? The reason I
ask is I had previously done a backup and restore to new database name and
new location in order to quickly create a 'staging' or 'testing' version of
a production database and want to be sure that was ok... meaning I wanted to
verify that I had NOT chosen the 'WITH MOVE' option... I didn't know if it
was a default option. Because, in that case, I wanted the database to be
different... not a move of the real database..
If I actually got a clear question out of that (doubtful ;) ) any info would
be appreciated... I think I'm just being overly paranoid.
"DeeJay Puar" <deejaypuar@.yahoo.com> wrote in message
news:1cc9b01c45309$967fde70$a101280a@.phx.gbl...[vbcol=seagreen]
> Hi,
> You could do a backup and restore using the 'WITH MOVE'
> OPTION or you could (better use) detach the database, copy
> the datafile to new location and attach the database files.
> You can look at sp_detach_db and sp_attach_db procedures
> in BOL.
> hth
> DeeJay
> different drive on
|||The move option is exposed on the right-most tab, where EM specifies the physical file names. In the right
part, just type the desired file name.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"djc" <noone@.nowhere.com> wrote in message news:%23Cj8oj5UEHA.2668@.TK2MSFTNGP10.phx.gbl...
> Hi,
> I will use the detatch/attatch method to move but your reply brings another
> question to me. I did not see an option to restore 'WITH MOVE' in enterprise
> manager GUI restore... is it only available when using TSQL? The reason I
> ask is I had previously done a backup and restore to new database name and
> new location in order to quickly create a 'staging' or 'testing' version of
> a production database and want to be sure that was ok... meaning I wanted to
> verify that I had NOT chosen the 'WITH MOVE' option... I didn't know if it
> was a default option. Because, in that case, I wanted the database to be
> different... not a move of the real database..
> If I actually got a clear question out of that (doubtful ;) ) any info would
> be appreciated... I think I'm just being overly paranoid.
>
> "DeeJay Puar" <deejaypuar@.yahoo.com> wrote in message
> news:1cc9b01c45309$967fde70$a101280a@.phx.gbl...
>

moving a database to a different drive

Hi,
You could do a backup and restore using the 'WITH MOVE'
OPTION or you could (better use) detach the database, copy
the datafile to new location and attach the database files.
You can look at sp_detach_db and sp_attach_db procedures
in BOL.
hth
DeeJay
>--Original Message--
>what is the reccomended method for moving a database to a
different drive on
>the same computer? Just a backup and restore?
>
>.
>ok. I'll check out those procedures in Books Online. Thanks for the input.
"DeeJay Puar" <deejaypuar@.yahoo.com> wrote in message
news:1cc9b01c45309$967fde70$a101280a@.phx
.gbl...[vbcol=seagreen]
> Hi,
> You could do a backup and restore using the 'WITH MOVE'
> OPTION or you could (better use) detach the database, copy
> the datafile to new location and attach the database files.
> You can look at sp_detach_db and sp_attach_db procedures
> in BOL.
> hth
> DeeJay
> different drive on|||Hi,
I will use the detatch/attatch method to move but your reply brings another
question to me. I did not see an option to restore 'WITH MOVE' in enterprise
manager GUI restore... is it only available when using TSQL? The reason I
ask is I had previously done a backup and restore to new database name and
new location in order to quickly create a 'staging' or 'testing' version of
a production database and want to be sure that was ok... meaning I wanted to
verify that I had NOT chosen the 'WITH MOVE' option... I didn't know if it
was a default option. Because, in that case, I wanted the database to be
different... not a move of the real database..
If I actually got a clear question out of that (doubtful ;) ) any info would
be appreciated... I think I'm just being overly paranoid.
"DeeJay Puar" <deejaypuar@.yahoo.com> wrote in message
news:1cc9b01c45309$967fde70$a101280a@.phx
.gbl...[vbcol=seagreen]
> Hi,
> You could do a backup and restore using the 'WITH MOVE'
> OPTION or you could (better use) detach the database, copy
> the datafile to new location and attach the database files.
> You can look at sp_detach_db and sp_attach_db procedures
> in BOL.
> hth
> DeeJay
> different drive on|||The move option is exposed on the right-most tab, where EM specifies the phy
sical file names. In the right
part, just type the desired file name.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"djc" <noone@.nowhere.com> wrote in message news:%23Cj8oj5UEHA.2668@.TK2MSFTNGP10.phx.gbl...[v
bcol=seagreen]
> Hi,
> I will use the detatch/attatch method to move but your reply brings anothe
r
> question to me. I did not see an option to restore 'WITH MOVE' in enterpri
se
> manager GUI restore... is it only available when using TSQL? The reason I
> ask is I had previously done a backup and restore to new database name and
> new location in order to quickly create a 'staging' or 'testing' version
of
> a production database and want to be sure that was ok... meaning I wanted
to
> verify that I had NOT chosen the 'WITH MOVE' option... I didn't know if it
> was a default option. Because, in that case, I wanted the database to be
> different... not a move of the real database..
> If I actually got a clear question out of that (doubtful ;) ) any info wou
ld
> be appreciated... I think I'm just being overly paranoid.
>
> "DeeJay Puar" <deejaypuar@.yahoo.com> wrote in message
> news:1cc9b01c45309$967fde70$a101280a@.phx
.gbl...
>[/vbcol]sql

Saturday, February 25, 2012

Move datafile

Hi,

I need to move some datafiles from E to F. These datafiles are into of the filegroups.

i.e:
Actual
FILEGROUP: CDL_DATA e CDL_IDX
DATAFILE'S: e:\data\Cdl_data.NDF e e:\data\Cdl_idx_data.NDF

Changed
FILEGROUP: CDL_DATA e CDL_IDX
DATAFILE'S: F:\data\Cdl_data.NDF e F:\data\Cdl_idx_data.NDF


Is there a easy way by Enterprise Manager that I can do this job?

Thank you by atentionHi,
You can move datafiles of a DB using Detach & Attach procs..
Search for 'sp_detachdb' eg in BOL.. its straightforward mate..

cheers
ganesh