?
Solved

alter table A move tablespace TB1

Posted on 2007-03-22
3
Medium Priority
?
2,596 Views
Last Modified: 2013-12-19
Hi all,
          I want to move a table A using tablespace TB1 to tablespace TB2. In order to achieve this, i can issue     " alter table A move tablespace TB2" , but my question is can we do it on fly? or do we have to restrict anything before carrying this out? And also if the table has any indexes or constraints, is it necessary to move them too? or are they not affected by this?

Thanks,
Harris.
0
Comment
Question by:harris2107
3 Comments
 
LVL 8

Accepted Solution

by:
gvsbnarayana earned 300 total points
ID: 18778705
Hi,
  You may consider online redefinition
This link may help you
http://www.dbspecialists.com/presentations/online_redef.html

HTH
Regards,
Badri.
0
 
LVL 4

Assisted Solution

by:kripa_odba
kripa_odba earned 300 total points
ID: 18791464
If you are using
Alter table tblname move tablesspacename   ,you need to restrict transactions which are using this table.
You don't have to move the indexes with the table to new tablespace.Indexes will continue to exists  in the tablespace where they belong previously.

When you move the table to a new tablespace the status of the indexes will become Unusable.So after moving the table you are suppose to rebuild the indexes... If your table is partitioned table and indexes are global indexes then you can use UPDATE GLOBAL INDEXES clause while moving the table.

Or otherwise you can use DBMS_REDEFINITION package for moving the  table to new tablespace as gvsbnarayana specified.In this case ,you don't have to restric the transations which uses the table in question.

Hope this will be helpful to you..

Regards
0
 
LVL 28

Assisted Solution

by:Naveen Kumar
Naveen Kumar earned 150 total points
ID: 18837322
As long as the table is not used by other programs/users for DML operations, you can move it to other tablespace.

But remember to rebuild the indexes of this table otherwise they will be in INVALID status and any program trying to access the data in the table with the help of the index will give an error.

Thanks
0

Featured Post

Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
Via a live example, show how to take different types of Oracle backups using RMAN.
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question