Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: moving tables from one tablespace to another

Re: moving tables from one tablespace to another

From: Andrew Allen <andrew.allen_at_sppaammkiller.handleman.com>
Date: Wed, 19 Mar 2003 17:40:08 GMT
Message-ID: <3E789E6D.90701@sppaammkiller.handleman.com>


harish wrote:
> in my oracle 8i database, when database is exported from one user A
> (default tablespace a) and imported in a different user B (default
> tablespace a), the tables that are imported in the user B is been
> storing in tablespace A. But i want it to be stored in tablespace B
> which is the default tablespace of user B.
> Now how to solve this problem?
> what is the sql statement for moving a table from one tablespace to
> another?

First, you should not be associating tablespaces with users. It does nothing for you. If you are doing this to manage user space there are better and easier ways to do this.

However, if you absolutely insist on importing the tables to a different tablespace then you have several choices. For example. 1. > create table b.foo tablespace b as select * from a.foo where 1=2;

    Then do your import with IGNORE=y to supress the error messages for     already existing objects.
2. Execute the import with the INDEXFILE parameter set to some file

    like create_tables.sql. Edit that file to change the tablespace     names to whatever you like, run it to create the tables. Now you     are ready to import the data -- again, IGNORE=y. There are other ways to do what you ask, but these two will get you started.

--
AjA
Received on Wed Mar 19 2003 - 11:40:08 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US