Solved

alter table A move tablespace TB1

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

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…
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 shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

758 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now