Index rebuild after moving table to a different tablespace?

Index rebuild after moving table to a different tablespace?

Oracle-Meng wrote:

Index rebuild after moving table to a different tablespace?

Only if you want to reuse.

See DBA guide

http://docs.Oracle.com/CD/B28359_01/server.111/b28310/tables006.htm#i1106606

Pass an array to a new Segment or a Tablespace

Move a table changes the ROWID of the rows in the table. This causes the indexes on the table to be marked UNUSABLE , and DML, access the table using these clues you will receive an ORA-01502 error. The indexes on the table must be deleted or rebuilt. Similarly, all the statistics in the table become invalid and new statistics should be collected after the removal of the table.

Tags: Database

Similar Questions

  • Move the tables to a different tablespace

    Hello
    I created 6 tables with my account in the USERS tablespace. If users wish to access (and he has privileges), it can be accessed as - username.nameoftb.
    Now, I would like to create new tablespace, move there all the USERS tablespace tables and if someone (who has permissions) to have access, it can, but only with the table name. Without using the username who created them.

    Could you please help me, how to proceed?
    -move the tables to a different tablespace
    -users can access without using the name of the creator

    Thank you!

    1. change the SMSC table. ERSUSERWISESUMMARY move tablespace ERST_01 nologging;

    Can also rebuild the indexes as well.

    ALTER Index SMSC. INDX_ERSDATA_STRTTIME reconstruction tablespace ERSX_01 nologging;

    2 create a synonym for this object

    create public synonym mrbt_activation for owner_name.object_name;

    Concerning
    Asif Kabir

  • table to a different tablespace to audit and return

    How to make sys.aud$ table of audit in another tablespace and moving back step by step, including the index log segment?

    is - anyone of you has scripts?

    You can follow this steps and the upper part of this use your own common sense-

    (1) find the audit settings
    SELECT name, value of the parameter $ v whose name like '% audit_trail % '.
    If true, then size can be quite large

    (2) find the size
    Select nom_segment, nom_tablespace, bytes/1024/1024 SIZE_MB, owner of dba_segments where nom_segment = '$ AUD.

    (3) find the existing table
    Select * from dba_indexes where table_name = '$ AUD.
    Select * from dba_tables where table_name = '$ AUD.

    4)
    CREATE TABLESPACE mytest DATAFILE «...» ' SIZE 100M AUTOEXTEND ON EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTOALLOCATE AUTO;

    (5) move now
    ALTER table sys.aud$ move tablespace mytest;
    ALTER table sys.aud$ move lob (sqlbind, sqltext) store as lobsegment (tablespace mytest);
    ALTER index... rebuild mytest tablespace online;

    (6) now move if necessary
    ALTER table sys. AUD$ ' move tablespace system;
    ALTER index... rebuild online tablespace system;

    (8) optional for drop tablespace
    Drop tablespace mytest, including data files;

    Thank you
    Kerry

  • Is it possible to move a subset of a table to a different tablespace?

    Hello again,

    We are planing to remove old data in our database.

    When we did the last time that we did something like this:
    remove the table so xy date timestamp < DATE; -date is a special code, all data before should be deleted.

    To is a bit more complex there is a cascade constraint (?) in the child table that will be deleted when the parent in xy row is removed.

    Due to the amount of data that will be deleted our DBAs had much to do with the logs (redo and archive) switching in the past.
    Now our DBAs fact the suggestion to move the data, will, which should be deleted, to a different tablespace (new). After you have moved the new tablespace should be deleted.
    I understand our DBAs want to reduce it again or archive newspapers.

    But is it really possible to move only the selected rows of a tablespace to another? I have found that tutorials to move an entire table.


    Thanks in advance
    Andreas

    Andreas S. wrote:

    But is it really possible to move only the selected rows of a tablespace to another? I have found that tutorials to move an entire table.

    Partitioned tables, Yes. The non partitioned tables, no *.

    * There are hacks that could be considered in an attempt to force the movement of the line of a tablespace to another, but these are ugly, nasty and all simply horrible - and is not reliable either.

  • The index of the primary key in a different tablespace.

    Hello

    I have a user PROD. It has received a tablespace PROD_TBS default.
    There is a separate table for all indexes space in the diagram, PROD_IDX.

    I want to create a TEST table as follows,

    CREATE TABLE TEST
    (TEST_ID, NUMBER (1),)
    NAME VARCHAR2 (10));

    It must be a primary key on the column test_id, but such that the corresponding unique index created by default because of the primary key must be created in the PROD_IDX tablespace.

    How to do this?

    Alternative solution:

    CREATE TABLE TEST
    (TEST_ID NUMBER(1),
    NAME VARCHAR2 (10),
    constraint test_pk primary key (test_id)
    using index tablespace prod_idx
     );
    

    Cheers, APC

    blog: http://radiofreetooting.blogspot.com

  • Creating index LOB after move comand

    Hello

    I'm done move the tables to a different tablespace. I also rebuild the index. I just wanted to ask if re-create a lobsegment the same thing with the other indices. What other command and more.
    ALTER index rebuild tablespace ts_new _name index. »

    Thank you

    >
    . We have a database of test and the pattern is CHEVY. CHEVY has a table named STOR1 with lob on the tablespace TS1 table column. I want to do is move the table to another TS Let's say TS1 >

    You want to move the tables in the tablespace even or an another tablespace as by what you wrote both the name of tablespaces are the same "TS1 *.» But I suppose you want to move to a different tablespace. So I gave the a name * TS2 *, to the other tablespace.

    Now, when the fire the command below

    SQL > ALTER TABLE STOR1 MOVE TABLESPACE TS2;

    This command will move the table to new table space but won't move the CLOB segment and it will always be in the original tablespace. This is because the LOB data is stored outside the table.

    Now, to control the storage space of the CLOB column by issuing the following sql:

    SELECT index_name, nom_tablespace FROM user_indexes WHERE table_name = 'STOR1 '.

    To move different tablespace CLOB column, we issue after a command.

    SQL > ALTER TABLE STOR1 MOVE LOB (TEST_NAME) STORE DID (TABLESPACE TS2);

    In above example, TEST_NAME is the column CLOB we want to spend again tablespace and tablespace TS2 target. Above command will pass successfully the LOB segments to the new tablespace. We can verify this by launching sql even once again.

    SQL > SELECT index_name, nom_tablespace FROM user_indexes WHERE table_name = 'STOR1 ';

    HTH
    Anand

  • At the same time index rebuild...

    OK, so I have a question that has puzzled me a bit. I think I understand the theory, but I am not convinced, so looking for 3xp3rt thoughts.

    I have the following table with the indexes following:

    Departments of instance name table Name Index
    AWESOME_DETAIL 20 1 AWESOME_DETAIL_B8

    The table itself has a DEGREE of 2 BODIES 1 value.

    What is happening is when the following is executed:

    ALTER INDEX REBUILD AWESOME_DETAIL_B8.

    the table is read in series, despite the index with a DOP of 20. However, when we do the following:

    ALTER INDEX REBUILD PARALLEL OF 20 AWESOME_DETAIL_B8

    The table is read with the parallelism and the treatment is faster (no surprise on the second part).

    When the index is rebuilt with the first statement, the degree of parallel remained unchanged at 20. If we run the second statement, and the index have had a degree of parallelism of the 2, then I expect the degree of parallelism of the index itself will be replaced by 20 (because I've seen this before).

    Is this expected behavior? Is the first statement saying Oracle "Hey, this rebuild operation does not have parallel" and the second statement saying: 'Hey, I'm specifying options of storage here, my friend, do in parallel of 20'.

    Essentially, the first statement is a pure DDL operation and the second statement is a DDL operation with storage options, where the change? And DDL operations ignore the declaration of principles on the subject, unlike, for example, a SELECT statement.

    I tried with a DISPLACEMENT of ALTER TABLE and saw the same behavior: without specifying PARALLEL in my statement, it read the table in series. When I specified PARALLEL, it read the table in parallel.

    Mark

    When you specify PARALLEL creating / REBUILD / MOVE, the degree is used for the C/R/M. it is always "in place" for all the readings (and will be used in DML If ALTER SESSION ACTIVATE PARALLEL_DML has been paid).
    However, the degree of PARALLEL set of the GET on the table / index is not automatically reused for the next RECONSTRUCTION/MOVE (although the degree that has been set remains!)

    Is the first statement saying Oracle "Hey, this rebuild operation does not have parallel" and the second statement saying: 'Hey, I'm specifying options of storage here, my friend, do in parallel of 20'.

    Yes, precisely.

    See http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/clauses006.htm#g1058315

    NOPARALLEL
    Specify NOPARALLEL for serial execution. It is the default value.

    Hemant K Collette

  • Creating INDEX on a BLOB column in a separate tablespace

    Hello


    Our database contains 2 storage spaces :

    -Tablespace DATA : is reserved to hold the data.

    -Tablespace INDX: is reserved to hold the index.


    For some reason, that we must create the indexes on columns of type blob and the pending order are:

    SQL > CREATE INDEX my_index ON DOC_CONTENTS (doc_content) INDEXTYPE IS CTXSYS. CONTEXT;  / / doc_content a blob type.

    SQL> index created

    Now, all indexes are created in the tablespace for DATA that is not good, they should be created in the tablespace INDX (now is empty)

    For this reason, and after a search, I specified the tablespace INDX , which will contain the index, and the used command is:

    SQL > CREATE INDEX my_index ON DOC_CONTENTS (doc_content) INDEXTYPE IS CTXSYS. CONTEXT TABLESPACE INDX;

    *

    ERROR on line 1:

    ORA-29850: invalid option for creating domain index

    NB: also, when I try to use the same command with varchar column, it works.

    SQL > CREATE INDEX my_index ON DOC_CONTENTS (doc_name) TABLESPACE INDX;  / / doc_content a type VARCHAR2.

    SQL> index created


    Do you have an idea on how to create indexes on a blob column in a different tablespace?

    This question has nothing to do with the Oracle objects, but is related to Oracle Text, then perhaps that some moderator moves text objects.

    To specify a storage space for a ctxsys.context Oracle Text index domain index tables, you must create a storage preference, specify storage spaces in attributes of this preference, then use this preference in settings of creating index.  Please see the example below which shows first create domain index tables in the default users tablespace, then the creation of the field tables to be indexed in the example tablespace.

    Scott@orcl_11gR2 >-test environment:

    Scott@orcl_11gR2 > doc_contents CREATE TABLE

    2 (doc_content BLOB)

    3.

    Table created.

    Scott@orcl_11gR2 > INSERT INTO doc_contents VALUES

    2 (UTL_RAW. CAST_TO_RAW ("test data"))

    3.

    1 line of creation.

    Scott@orcl_11gR2 >-create domain index tables in default users tablespace:

    Scott@orcl_11gR2 > my_index CREATE INDEX

    2 doc_contents (doc_content)

    3 INDEXTYPE IS CTXSYS. FRAMEWORK

    4.

    The index is created.

    Scott@orcl_11gR2 > SELECT index_name, nom_tablespace

    2 FROM user_indexes

    3. WHERE index-name LIKE '% MY_INDEX % '.

    4.

    INDEX_NAME TABLESPACE_NAME

    ------------------------------ ------------------------------

    MY_INDEX

    DR.$ MY_INDEX$ X USERS

    2 selected lines.

    Scott@orcl_11gR2 > SELECT table_name, nom_tablespace

    2 FROM user_tables

    3 WHERE table_name LIKE '% MY_INDEX % '.

    4.

    TABLE_NAME, TABLESPACE_NAME

    ------------------------------ ------------------------------

    DR. MY_INDEX$ I HAVE USERS

    USERS R DR$ MY_INDEX$

    DR.$ MY_INDEX$ N

    DR.$ MY_INDEX$ K

    4 selected lines.

    Scott@orcl_11gR2 >-creating the tables index field in example of tablespace:

    Scott@orcl_11gR2 > my_index DROP INDEX

    2.

    The index is deleted.

    Scott@orcl_11gR2 > start

    2 ctx_ddl.create_preference ("mystore', 'BASIC_STORAGE'");

    3 ctx_ddl.set_attribute ("mystore', 'I_TABLE_CLAUSE',")

    4 "tablespace storage example (original 1 K) ');

    5 ctx_ddl.set_attribute ("mystore', 'K_TABLE_CLAUSE',")

    6 "tablespace storage example (original 1 K) ');

    7 ctx_ddl.set_attribute ("mystore', 'R_TABLE_CLAUSE',")

    8 ' lob tablespace storage example (original 1 K)

    9 (data) store as (storage off in row cache)');

    10 ctx_ddl.set_attribute ("mystore', 'N_TABLE_CLAUSE',")

    11 "tablespace storage example (original 1 K) ');

    12 ctx_ddl.set_attribute ("mystore', 'I_INDEX_CLAUSE',")

    13 ' example of tablespace storage (initial 1 K) compress 2 ');

    14 ctx_ddl.set_attribute ("mystore', 'P_TABLE_CLAUSE',")

    15 "tablespace storage example (original 1 K) ');

    16 ctx_ddl.set_attribute ("mystore', 'S_TABLE_CLAUSE',")

    17 "tablespace storage example (original 1 K) ');

    18 end;

    19.

    PL/SQL procedure successfully completed.

    Scott@orcl_11gR2 > my_index CREATE INDEX

    2 doc_contents (doc_content)

    3 INDEXTYPE IS CTXSYS. FRAMEWORK

    4 PARAMETERS ('STORAGE mystore')

    5.

    The index is created.

    Scott@orcl_11gR2 > SELECT index_name, nom_tablespace

    2 FROM user_indexes

    3. WHERE index-name LIKE '% MY_INDEX % '.

    4.

    INDEX_NAME TABLESPACE_NAME

    ------------------------------ ------------------------------

    MY_INDEX

    DR.$ MY_INDEX$ X FOR EXAMPLE

    2 selected lines.

    Scott@orcl_11gR2 > SELECT table_name, nom_tablespace

    2 FROM user_tables

    3 WHERE table_name LIKE '% MY_INDEX % '.

    4.

    TABLE_NAME, TABLESPACE_NAME

    ------------------------------ ------------------------------

    DR. MY_INDEX$ I EXAMPLE

    DR.$ MY_INDEX$ R EXAMPLE

    DR.$ MY_INDEX$ N

    DR.$ MY_INDEX$ K

    4 selected lines.

    Post edited by: BarbaraBoehmer (corrected for error due to the already existing preference)

  • How to move a LOB to a different tablespace

    Hello
    I have a PRODUCT table where one of its fields is a LOB.
    The table has been created the TBL1 tablespace and Lob his field to a tablespace dedicad TBL_LB1
    I have to move the table to a different tablespace.
    The statement that I would use is

    ALTER TABLE PRODUCT MOVE TABLESPACE storage TBL2 (initial then the 4M 4 M);

    Can you tell me how to write the statement to move the Lob field to the new tablespace TBL_LB2?
    I don't know what syntax to use to move the Lob of TBL_LB1 to TBL_LB2 field

    Thank you

    Published by: user12180597 on 14-Dec-2009 6.20

    Hello

    Something like that

    ALTER TABLE Product
        MOVE LOB() STORE AS (
            TABLESPACE TBL_LB2
        )
    

    Concerning
    Anurag

  • After spending tables and index a different tablespace, index got unusable?

    Hello

    I moved to table and index a different tablespace. After the many indices obtained unusable. I did not understand thiis?

    How can I do still usable?

    best regards and thank you?

    If you bâtait the index (after moving the table, by the way), then they should be usable without something extra to see.
    Check this procedure only one (small) table and index if this index can be used later. If not, then you have a mystery :-)

    Kind regards
    Uwe Hesse

    http://uhesse.WordPress.com

  • Index rebuild required after truncate the table and load data

    Hello


    I have a situation that we truncate tables bit and then we loaded data [only content] on these tables. What you need to rebuild the index online is necessary or not?


    And another question is if we drop a few clues is the total amount of space is released or not. And re-create indexes will use the same amount of space. As I don't have disk space more? In this situation, rebuild the index online will be a better idea...

    Can you please on this...


    truncate the table some the few loading tables + reconstruction markings online is the best (or) droping little tables, a few tables loading + re-create the index is better

    Can you suggest the best way... We have a time that it currently we don't have enough space on the disk... [Option should not effect the space]

    user13095767 wrote:
    Ok. I have it...

    u want to say if we disbale the index while loading... Next, we need to spend the time to build.

    If the indexes are enabled, then rebuild again is not necessary after loading tables...

    Please answer if my understanding is correct...

    above is correct

    >

    If so, how abt the differences in the space occupied by the spaces of storage during the index rebuild and re-create... T he acquires more space if recreate us [deletion and creation] or rebuild online is preferable to an index...?

    space used is the same for all options.

  • ORA-14456: can not rebuild the index on a temporary table

    change the IND_DEBITDOCUMENT TABLESPACE INDEXDATA index rebuild
    *
    ERROR on line 1:
    ORA-14456: can not rebuild the index on a temporary table


    why it is given such error?

    Thanks in advance.

    This information is always kept to user_ | all_ | dba_ tables, in this case in the temporary column.

    Obvious, isn't it?

    ---------
    Sybrand Bakker
    Senior Oracle DBA

  • Index on the primary table becomes UNUSABLE after Exchange of partition

    Hello!

    I am the scene changes to partition and somehow, I see that the partition that I Exchange eventually becomes "UNUSABLE".


    The steps that I'm following:

    1. creating the temporary table:

    CREATE TABLE TEMP_TKTHEADER
    AS SELECT * FROM T3TKTHEADER
    WHERE 1 = 2

    2. replacement of the partition

    ALTER TABLE T3TKTHEADER
    PART08Q1Q2 PARTITION EXCHANGE
    WITH TABLE TEMP_TKTHEADER


    After the Exchange is carried out and I ask the stats of the index on the primary table (T3TKTHEADER as in this case):

    INDEX_NAME NOM_PARTITION STATUS
    ----------------------------------------------------------------------------------------------
    XTKTHDR1 PART08Q1Q2 UNUSABLE
    XTKTHDR10 PART08Q1Q2 UNUSABLE
    XTKTHDR11 PART08Q1Q2 UNUSABLE
    XTKTHDR12 PART08Q1Q2 UNUSABLE
    XTKTHDR13 PART08Q1Q2 UNUSABLE
    XTKTHDR14 PART08Q1Q2 UNUSABLE
    XTKTHDR2 PART08Q1Q2 UNUSABLE
    XTKTHDR3 PART08Q1Q2 UNUSABLE
    XTKTHDR4 PART08Q1Q2 UNUSABLE
    XTKTHDR5 PART08Q1Q2 UNUSABLE
    XTKTHDR6 PART08Q1Q2 UNUSABLE
    XTKTHDR7 PART08Q1Q2 UNUSABLE
    XTKTHDR8 PART08Q1Q2 UNUSABLE
    XTKTHDR9 PART08Q1Q2 UNUSABLE


    This is normal behavior!
    Is not swap Partition just supposed to change the pointer to the partition of the temporary table data and leave the rest of the table intact!

    Thank you
    AB007

    Dear AB007,

    Please see subpart of swap partition. I assumed that the version of your database is GR 11, 2;

    http://download.Oracle.com/docs/CD/E11882_01/server.112/e10592/statements_3001.htm#BABHHAHF

    INCLUDING | EXCLUDING INDEXES Specify INCLUDING INDEXES  if you want local index partitions or subpartitions to be exchanged with the corresponding table index (for a nonpartitioned table) or local indexes (for a hash-partitioned table).
    Specify EXCLUDING INDEXES  if you want all index partitions or subpartitions corresponding to the partition and all the regular indexes and index partitions on the exchanged table to be marked UNUSABLE.
    

    Hope that helps.

    Ogan

  • An index rebuild

    Hello
    I must set my DB and move some tables from one tablaspace to another.
    For example, a PRODUCT stored on tablespace TBL_1 table I wrote a script like this:

    ALTER table PRODUCT move tablespace TBL_2
    storage
    *(*
    initial 1 M
    According to 1 M
    PCTINCREASE 0
    *);*

    Its index to perform a script like this?

    ALTER index rebuild of IDX_PRODUCT;

    I just want to rebuid the index because I guess that after having pass the array to another tablaspace, the index is no longer gets its records, but I don't need to move the index to a different tablespace.
    My alter index statement above is fair?
    My version is Oracle 8.1.7.
    Thank you

    Yes.
    ALTER index rebuild of tablespace ;

  • Reduced index rebuild the size of

    Hi all

    I think that this topic was raised by several times up to now... But I would like to know as I'm very curious.

    An array of size 6 GB with index btree of 300 MB, the size very high CPU load in that server (I think because of I/O), after the reconstruction of this size of the index came up to 250 MB.

    Now all my seniors ordered me to rebuild all indexes in the database that are huge in size, so that the i/o and CPU will be back to normal.

    I had the argument with my elder for the reason why we need to rebuild the index?
    Answer: As Oracle has access to this index it a lot of scan crashes a lot because of fragmentation. Oracle also has to scan all the blocks below the high water mark, where some blocks have fewer lines.

    My doubt is: when index is fragmented (candidate means that after reconstruction, reduced its size) made Oracle scans unwanted blocks below let high water is wrong, because the INDEX and TABLE are two different concepts, INDEX maintains information on which all blocks, it would seek the required values. So Oracle will not scan the blocks unwanted in the INDEX.

    Do may doubt is good or bad?

    A few details:
    The indicator is in DMT tablespace.
    Oracle 8i version.
    Sun solaris with 5.8 version, with 8 CPUS and 6 GB of RAM
    None of the indices have a height more than two.

    Plz HELP me in this concept... I want to prove my elders.

    -Yasser

    Yasserracdba,

    People learn their theory IT more. The normal index is implemented as a B *-tree structure.
    This means

                                                                      1 
    
                                                 2        3                              5            6
    
                                          7       8    9   10                    11     12    13     14
                                                       
    

    This means: block 1 contains information on block 2, 3, 5, 6 (I forgot 4, does not renumber)
    Block 2 about 7 and 8
    Block 7, etc are the leaves blocks and contain the actual keys.
    The key consists of key values and a rowid.

    The index is balanced. For a single scan will always tell you the same number of blocks, in this case 4
    (3 blocks + block index 1 data).

    IF YOU DON'T HAVE A CLUE, YOU WILL BE FORCED TO READ THE ENTIRE TABLE, THE TABLE SCAN COMPLETE THIS CALLED (YOU CAN SHOUT, I CAN SHOUT TOO)

    TO ACCESS THE INDEX MEANS SELF-CONTAINED BED, FULL TABLE SCAN MEANS SCATTERED MULTI BLOCK READING (BLOCKS END UP NOT CONTIGUOUS CACHE)

    FOR RANGE SCANS IO CAN BE REDUCED. TO LOOK UP A KEY INDIVIDUAL IO WILL NOT, I REPEAT N O T, REDUCE.

    -----------------
    Sybrand Bakker
    Senior Oracle DBA

    Experts: those who don't read the documentation

    Published by: sybrand_b on May 28, 2009 11:04

Maybe you are looking for

  • automatic backup

    Is there an automatic backup feature in Firefox? If so, keep - you there different versions? I had to restore my PC. Once I did, I logged on my account of Firefox assuming it would sync my previous Favorites and passwords, but synchronize empty profi

  • problems of change of address

    I'm trying to change my billing address in the iTunes Store.  I have to update my credit card information.  I touch only in and continue the change of address and press ENTER.  Apple says that my card is rejected.  My Bank says it all credit card is

  • Satellite L300 Wireless does not work in mode access point

    Satellite L300 with built in wifi Realtek device.Internet is coming from an external USB device, and I want to make wifi internal working as a router/hotspot/access point, just to connect with my cell phone. I try to create the ad - hoc network in Wi

  • change the hd on probook g1 430

    I want to change with an ssd on my g1 HD 430 probook can I do this? I opened the slot on the bottom, but I see that ram slot... where is hd?

  • Windows Defender stopped running on 6/17. Now I get the error 0x800705b4.

    I rebooted, attempted to restart and got the above error message.  I also received a message of error 0x800106ba.  I tried to down load Windows Defender for Vista, but it will download it will not be installed.  The message is 'you don't need to inst