New features of Oracle 12C move (non-partitioned tables) Table online

Source: Internet
Author: User
Tags create index

In previous versions, move table could not be online, and move would lead to rowid changes to invalidate the corresponding index. ALTER TABLE move online in 12c will not block new transactions and will automatically maintain the validity of the index.

--Create an experiment table
Sql> CREATE TABLE Andy_move (ID int,name varchar2 (10));
Table created.
--Inserting data
Sql>
Begin
For I in 1.. The Loop
INSERT into andy_move values (i, ' andyi ');
End Loop;
Commit
End
/
PL/SQL procedure successfully completed.
--Create an index
Sql> CREATE index idx_andy_id on andy_move (ID);
Index created.
--View index status
Sql>
Col index_name for A25
Select Table_name,index_name,status,blevel,leaf_blocks,orphaned_entries from user_indexes where index_name = ' IDX_ Andy_id ';
table_name index_name STATUS blevel leaf_blocks ORP
------------------------- ------------------------- -------- ---------- ----------- ---
Andy_move idx_andy_id VALID 0 0 NO
--Move online non-partitioned table with online parameters
Sql> ALTER TABLE andy_move move online;
Table altered.
--View index status
Sql>
Col index_name for A25
Select Table_name,index_name,status,blevel,leaf_blocks,orphaned_entries from user_indexes where index_name = ' IDX_ Andy_id ';
table_name index_name STATUS blevel leaf_blocks ORP
------------------------- ------------------------- -------- ---------- ----------- ---
Andy_move idx_andy_id VALID 0 0 NO
--Move online partition table error
Sql> ALTER TABLE P_andy move online;
ALTER TABLE P_andy move online
*
ERROR at line 1:
Ora-14808:table does not support ONLINE MOVE table
--Move non-partitioned table, without online parameters
Delete from Andy_move where id>10 and id<20;
Sql> ALTER TABLE andy_move move;
Table altered.
--View index status
Sql>
Col index_name for A25
Select Table_name,index_name,status,blevel,leaf_blocks,orphaned_entries from user_indexes where index_name = ' IDX_ Andy_id ';
table_name index_name STATUS blevel leaf_blocks ORP
------------------------- ------------------------- -------- ---------- ----------- ---
Andy_move idx_andy_id unusable 0 1 NO

New features of Oracle 12C move (non-partitioned tables) Table online

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.