RE: transfer Tablespace

  • From: "Freeman, Donald" <dofreeman@xxxxxxxxxxx>
  • To: <oracle-l@xxxxxxxxxxxxx>
  • Date: Fri, 19 Mar 2004 13:36:51 -0500

This will work for table and index segments. I created a "REORG" tablespace to 
hold everything until I rebuilt the source tablespace.
 
SELECT 'ALTER '||segment_type||' '||owner||'.'||segment_name||' REBUILD 
TABLESPACE REORG;'
FROM dba_segments
WHERE tablespace_name ='TEFL_INDX'
AND SEGMENT_TYPE ='INDEX';
 
SELECT 'ALTER '||segment_type||' '||owner||'.'||segment_name||' MOVE TABLESPACE 
REORG;'
FROM dba_segments
WHERE tablespace_name ='TEFL_DATA'
AND SEGMENT_TYPE ='TABLE';
 
I have one table with a blob column:  I moved the table as inidicated in the 
first lline and moved the blob column
as indicated in teh second column. 
 
ALTER TABLE TEFL.FREE_FORM_DATA move TABLESPACE TEFL_DATA;
ALTER TABLE TEFL.FREE_FORM_DATA move lob(BINARY_DATA) store as ( tablespace 
TEFL_DATA );
 
"BINARY_DATA" is the blob column name.  You should be able to do both these 
things with one statement but I couldn't
get it to work.
 
-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx]On 
Behalf Of Huascar Espinoza
Sent: Friday, March 19, 2004 1:15 PM
To: oracle-l@xxxxxxxxxxxxx
Subject: transfer Tablespace


 How can I transfer a database to other Tablespace and datafile without loss 
data?
 
Thank you,
 
Huascar

Other related posts: