Showing posts with label cand. Show all posts
Showing posts with label cand. Show all posts

Friday, March 9, 2012

filegroup

currently we have a lot of filegroup and i would like reduce this filegroup
to 4 filegroup how cand move data from one to other and how delete dis
filegroup when is empty.
thnks
Alf
You can move data to a different filegroup by rebuilding the clustered index
on a new filegroup, or if you dont have a clustered index, you can build one
and then drop it just to move the data.
Alternatively you can use the design table option in Enterprise manager Open
the database you are using, click on tables in the left paine. Right click on
the table you want and choose design table. Open the table and index
properties. You can change the file group the table is a part of from here.
When you close the window it will move the table, if it's a large table it
may take a while.
When you have moved all your tables you can use the 'Alter database' command
to remove the filegroup. there is a parameter 'remove filegroup'
As you noted the filegroup must be empty first.
You can also use Enterprise Manager, right click the database and go to
properties. there is an option on the filegroups window to delete filegroups.
Again it must be empty.
Hope this helps
John
"alf" wrote:

> currently we have a lot of filegroup and i would like reduce this filegroup
> to 4 filegroup how cand move data from one to other and how delete dis
> filegroup when is empty.
> thnks
>
>
|||"alf" <em_alf@.hotmail.com> wrote in message
news:%23saTLW29EHA.2608@.TK2MSFTNGP10.phx.gbl...
> currently we have a lot of filegroup and i would like reduce this
> filegroup to 4 filegroup how cand move data from one to other and how
> delete dis filegroup when is empty.
> thnks
>
Read up on filegroups in the Books Online.
I think you can do this by using the DBCC SHRINKFILE commands with the
EMPTYFILE switch turned on. This should move data to other files in the
filegroup. Once the file has been emptied and marked as empty, you can
remove it.
You may need to run ALTER TABLE commands to move affected tables off of the
filegroup to somewhere else. Once your filegroup's files are completely
empty, you can use ALTER DATABASE ... REMOVEFILEGROUP to remove the
filegroup.
HTH
Rick Sawtell
MCT, MCSD, MCDBA

filegroup

currently we have a lot of filegroup and i would like reduce this filegroup
to 4 filegroup how cand move data from one to other and how delete dis
filegroup when is empty.
thnksAlf
You can move data to a different filegroup by rebuilding the clustered index
on a new filegroup, or if you dont have a clustered index, you can build one
and then drop it just to move the data.
Alternatively you can use the design table option in Enterprise manager Open
the database you are using, click on tables in the left paine. Right click on
the table you want and choose design table. Open the table and index
properties. You can change the file group the table is a part of from here.
When you close the window it will move the table, if it's a large table it
may take a while.
When you have moved all your tables you can use the 'Alter database' command
to remove the filegroup. there is a parameter 'remove filegroup'
As you noted the filegroup must be empty first.
You can also use Enterprise Manager, right click the database and go to
properties. there is an option on the filegroups window to delete filegroups.
Again it must be empty.
Hope this helps
John
"alf" wrote:
> currently we have a lot of filegroup and i would like reduce this filegroup
> to 4 filegroup how cand move data from one to other and how delete dis
> filegroup when is empty.
> thnks
>
>|||"alf" <em_alf@.hotmail.com> wrote in message
news:%23saTLW29EHA.2608@.TK2MSFTNGP10.phx.gbl...
> currently we have a lot of filegroup and i would like reduce this
> filegroup to 4 filegroup how cand move data from one to other and how
> delete dis filegroup when is empty.
> thnks
>
Read up on filegroups in the Books Online.
I think you can do this by using the DBCC SHRINKFILE commands with the
EMPTYFILE switch turned on. This should move data to other files in the
filegroup. Once the file has been emptied and marked as empty, you can
remove it.
You may need to run ALTER TABLE commands to move affected tables off of the
filegroup to somewhere else. Once your filegroup's files are completely
empty, you can use ALTER DATABASE ... REMOVEFILEGROUP to remove the
filegroup.
HTH
Rick Sawtell
MCT, MCSD, MCDBA

filegroup

currently we have a lot of filegroup and i would like reduce this filegroup
to 4 filegroup how cand move data from one to other and how delete dis
filegroup when is empty.
thnksAlf
You can move data to a different filegroup by rebuilding the clustered index
on a new filegroup, or if you dont have a clustered index, you can build one
and then drop it just to move the data.
Alternatively you can use the design table option in Enterprise manager Open
the database you are using, click on tables in the left paine. Right click o
n
the table you want and choose design table. Open the table and index
properties. You can change the file group the table is a part of from here.
When you close the window it will move the table, if it's a large table it
may take a while.
When you have moved all your tables you can use the 'Alter database' command
to remove the filegroup. there is a parameter 'remove filegroup'
As you noted the filegroup must be empty first.
You can also use Enterprise Manager, right click the database and go to
properties. there is an option on the filegroups window to delete filegroups
.
Again it must be empty.
Hope this helps
John
"alf" wrote:

> currently we have a lot of filegroup and i would like reduce this filegrou
p
> to 4 filegroup how cand move data from one to other and how delete dis
> filegroup when is empty.
> thnks
>
>|||"alf" <em_alf@.hotmail.com> wrote in message
news:%23saTLW29EHA.2608@.TK2MSFTNGP10.phx.gbl...
> currently we have a lot of filegroup and i would like reduce this
> filegroup to 4 filegroup how cand move data from one to other and how
> delete dis filegroup when is empty.
> thnks
>
Read up on filegroups in the Books Online.
I think you can do this by using the DBCC SHRINKFILE commands with the
EMPTYFILE switch turned on. This should move data to other files in the
filegroup. Once the file has been emptied and marked as empty, you can
remove it.
You may need to run ALTER TABLE commands to move affected tables off of the
filegroup to somewhere else. Once your filegroup's files are completely
empty, you can use ALTER DATABASE ... REMOVEFILEGROUP to remove the
filegroup.
HTH
Rick Sawtell
MCT, MCSD, MCDBA