In oracle, to move objects from one tablespace to another
I can write some DDL and move the object. How do you
move, for example tables from one filegroup to another?
Only method I've come up with so far is rename the object,
recreate it in the filegroup I want it in and move any
associated data over. Is there an easier method?Yes, assuming the table has a clustered index, you can recreate this
index on the target filegroup with use of the DROP EXISTING keyword. For
example
SET QUOTED_IDENTIFIER ON
GO
CREATE CLUSTERED UNIQUE INDEX MyIndex ON MyTable(MyColumn) WITH
DROP_EXISTING ON "MyFilegroup"
Hope this helps,
Gert-Jan
"Cathy S." wrote:
> In oracle, to move objects from one tablespace to another
> I can write some DDL and move the object. How do you
> move, for example tables from one filegroup to another?
> Only method I've come up with so far is rename the object,
> recreate it in the filegroup I want it in and move any
> associated data over. Is there an easier method?|||Thanks...I figured it out.
>--Original Message--
>In oracle, to move objects from one tablespace to another
>I can write some DDL and move the object. How do you
>move, for example tables from one filegroup to another?
>Only method I've come up with so far is rename the
object,
>recreate it in the filegroup I want it in and move any
>associated data over. Is there an easier method?
>.
>|||Cathy
You can also do it from the design table window. Bring up
the table properties and change the filegroup in the drop
down option.
It pretty much does what Gert-Jan says, creates a
clustered index(although in a much more complicated way, I
captured it in profiler to see what it does, it does a
lot), even if the table does not have one (then drops it).
Regards
John
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment