Solved

alter table A move tablespace TB1

Posted on 2007-03-22
3
2,546 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 100 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 100 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 50 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
execute immediate plsql block 5 58
error in my cursor 5 41
Row_number in SQL 6 34
oracle collections 2 22
This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

829 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