Dcba article: What is the Oracle SETUNUSEDCOLUMN operation?

Source: Internet
Author: User
Let's start a test and set one of the columns as UNUSED: SQLDESCT_FIDNameNull? Type

Let's take a test and set one of the columns as UNUSED: SQL DESC T_FID Name Null? Type-COL1 NUMBER COL2 NUMBER COL3 number SQL alter table T_FID set unused (COL3); Table altered. SQL alter system checkpoint; System altered. Then we can check

Let's start a test and set one of the columns as UNUSED:

SQL> DESC T_FID
Name Null? Type
--------------
COL1 NUMBER
COL2 NUMBER
COL3 NUMBER
SQL> ALTER TABLE T_FID SET UNUSED (COL3 );
Table altered.
SQL> alter system checkpoint;
System altered.

Then let's check the three columns (COL #, SEGCOL #, NAME) in the COL $ table to see what the value is?
I used the DESC command of AUL/MyDUL for convenience.

AUL> desc alex. t_fid
Storage (OBJ # = 7641 OBJD = 7641 TS = 2 FILE = 3 BLOCK = 1529 CLUSTER = 0)
No. SEQ Column Name Type
------------------
1 1 COL1 NUMBER
2 2 COL2 NUMBER
0 3 sys_c1_4_05092817: 31: 11 $ NUMBER

AUL> unload table alex. t_fid;
17:32:40
Unload OBJD = 7641 FILE = 3 BLOCK = 1529 CLUSTER = 0...
9, 8, 7
17:32:40

From this we can see that when set unused is used, the name of a column is changed. In addition, the value of the display sequence of this column is SET to 0, which is 3.
Although Oracle does not provide reverse operations, the original data still exists. The reason may be that not null and other constraints cannot be guaranteed.

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.