This discussion is archived
1 Reply Latest reply: Oct 11, 2013 2:39 AM by Anar Godjaev RSS

move table in tablespace

Newbie
Currently Being Moderated

Could you please move and write me as a script tables in tablespace ?

  • 1. Re: move table in tablespace
    Anar Godjaev Expert
    Currently Being Moderated

    HI,

     

    RHELSENSEI wrote:

     

    Could you please move and write me as a script tables in tablespace ?

     

    1) Move Table script

     

    SELECT    'ALTER TABLE '

           || owner

           || '.'

           || table_name

           || ' MOVE TABLESPACE TABLESPACE_NAME;'

      FROM dba_tables

    WHERE owner LIKE 'TABLE_NAME%';

     

    2)  Rebuld index script

     

    SELECT    'ALTER INDEX '

           || owner

           || '.'

           || index_name

           || ' REBUILD TABLESPACE TABLESPACE_NAME;'

      FROM dba_indexes

    WHERE owner LIKE 'TABLE_NAME%';

     

    Thank you

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points