Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to copy tables from one tablespace to another?

322 views
Skip to first unread message

Sashi

unread,
Oct 5, 1999, 3:00:00 AM10/5/99
to
Hi,

I have a question for you'll.
I wanted to copy tables from one tablespace to antoher.
Is this possible by simple oracle commands or does this need extensive
coding?

Please let me know if you have faced this problem earlier.

Thanks
Shashi

TurkBear

unread,
Oct 5, 1999, 3:00:00 AM10/5/99
to
One way is to use the create table as select method as follows:

create table new_table_name tablespace new_space as select * from old_table;

Then
drop old_table;
rename new_table_name to old_table_name;

This takes time and space and will not preserve and constraints, links, etc...,
but it will work...

The Sql COPY command ( see help or manual) can do this if you wish to specify
another schema as well.....

Sashi <shas...@yahoo.com> wrote:

-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----

Jurij Modic

unread,
Oct 5, 1999, 3:00:00 AM10/5/99
to
On Tue, 05 Oct 1999 14:21:36 -0400, Sashi <shas...@yahoo.com> wrote:

>Hi,
>
>I have a question for you'll.
>I wanted to copy tables from one tablespace to antoher.
>Is this possible by simple oracle commands or does this need extensive
>coding?
>
>Please let me know if you have faced this problem earlier.
>
>Thanks
>Shashi

If you are using Oracle8i (aka 8.1.*) you can use the new option of
the ALTER TABLE command:

"ALTER TABLE table_name MOVE <destination_tablespace> ......"

This will preserve any indexes, constraints, grants, etc...

HTH,

Jurij Modic <jmo...@src.si>
Certified Oracle DBA (7.3 & 8.0 OCP)
================================================
The above opinions are mine and do not represent
any official standpoints of my employer

Sashi

unread,
Oct 6, 1999, 3:00:00 AM10/6/99
to
I use Oracle 8.04. Do you think this feature is incorporated in this
release.

Thanks,
Shashi

0 new messages