* goal: How to Move XMLTYPE LobSegment To a Different Tablespace ?
    * fact: Oracle Server - Enterprise Edition 9.2.0.1 
fix:
1. If you need to move the lob segment associated to an XMLTYPE column to
   another tablespace :
    SQL> create table test (id NUMBER, spec XMLTYPE);
    Table created.
    SQL> select table_name,column_name,segment_name from user_lobs;
    TABLE_NAME COLUMN_NAME    SEGMENT_NAME
    ---------- -------------- -------------------------  
    TEST       SYS_NC00003$   SYS_LOB0000027563C00003$$
    SQL> select segment_name,segment_type,tablespace_name
         from user_extents
         where segment_name='SYS_LOB0000027563C00003$$';
    SEGMENT_NAME              SEGMENT_TYPE TABLESPACE_NAME
    ------------------------- ------------ ---------------   
    SYS_LOB0000027563C00003$$ LOBSEGMENT   SYSTEM
2. Use the ALTER TABLE MOVE LOB command to move the XMLDATA of the lob
    segment to another tablespace: 
    SQL> alter table test move lob (spec.XMLDATA) store as test_clob
         (tablespace USERS);
    Table altered.
    SQL> select table_name,column_name,segment_name from user_lobs;
    TABLE_NAME COLUMN_NAME    SEGMENT_NAME
    ---------- -------------- -------------------------  
    TEST       SYS_NC00003$   TEST_CLOB
   SQL> select segment_name,segment_type,tablespace_name
        from user_extents
        where segment_name='TEST_CLOB';
    SEGMENT_NAME              SEGMENT_TYPE TABLESPACE_NAME
    ------------------------- ------------ ---------------   
    TEST_CLOB                 LOBSEGMENT   USERS
3. To get the following information from the dictionary views, you need to be 
in    a patched version of 9.2.0.1:
  
    SQL> select * from ALL_XML_TAB_COLS  where table_name='TEST' ;
   OWNER   TABLE_NAME COLUMN_NAME STORAGE_TYPE
   ------- ---------- ----------- ------------- 
   ELECTRE TEST       SPEC        CLOB
			
		
 
	
Partager