标记列删除恢复

 

 

SQL*Plus: Release 9.0.1.0.1 - Production on 星期二 9月 19 15:05:59 2006

 

(c) Copyright 2001 Oracle Corporation.  All rights reserved.

 

请输入用户名:  system/manager

 

连接到:

Oracle9i Enterprise Edition Release 9.0.1.1.1 - Production

With the Partitioning option

JServer Release 9.0.1.1.1 - Production

 

SQL> create table stu

  2  (stu_code varchar2(10),

  3  stu_name varchar2(10),

  4  stu_age varchar2(3));

 

表已创建。

 

SQL> insert into stu values('001', 'Jack', '25');

 

已创建 1 行。

 

SQL> insert into stu values('002', 'Tom', '24');

 

已创建 1 行。

 

SQL> insert into stu values('003', 'Jerry', '25');

 

已创建 1 行。

 

SQL> select * from stu;

 

STU_CODE   STU_NAME   STU

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

001        Jack       25

002        Tom        24

003        Jerry      25

 

SQL> conn sys/change_on_install as sysdba

已连接。

SQL> desc obj$

 名称                                      是否为空? 类型

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

 

 OBJ#                                      NOT NULL NUMBER

 DATAOBJ#                                           NUMBER

 OWNER#                                    NOT NULL NUMBER

 NAME                                      NOT NULL VARCHAR2(30)

 NAMESPACE                                 NOT NULL NUMBER

 SUBNAME                                            VARCHAR2(30)

 TYPE#                                     NOT NULL NUMBER

 CTIME                                     NOT NULL DATE

 MTIME                                     NOT NULL DATE

 STIME                                     NOT NULL DATE

 STATUS                                    NOT NULL NUMBER

 REMOTEOWNER                                        VARCHAR2(30)

 LINKNAME                                           VARCHAR2(128)

 FLAGS                                              NUMBER

 OID$                                               RAW(16)

 SPARE1                                             NUMBER

 SPARE2                                             NUMBER

 SPARE3                                             NUMBER

 SPARE4                                             VARCHAR2(1000)

 SPARE5                                             VARCHAR2(1000)

 SPARE6                                             DATE

 

SQL> select obj#, name from obj$ where name = 'STU';

/****注 :name是表名,表名必须大写************/

 

      OBJ# NAME

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

     32132 STU

 

SQL> desc tab$

 名称                                      是否为空? 类型

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

 

 OBJ#                                      NOT NULL NUMBER

 DATAOBJ#                                           NUMBER

 TS#                                       NOT NULL NUMBER

 FILE#                                     NOT NULL NUMBER

 BLOCK#                                    NOT NULL NUMBER

 BOBJ#                                              NUMBER

 TAB#                                               NUMBER

 COLS                                      NOT NULL NUMBER

 CLUCOLS                                            NUMBER

 PCTFREE$                                  NOT NULL NUMBER

 PCTUSED$                                  NOT NULL NUMBER

 INITRANS                                  NOT NULL NUMBER

 MAXTRANS                                  NOT NULL NUMBER

 FLAGS                                     NOT NULL NUMBER

 AUDIT$                                    NOT NULL VARCHAR2(38)

 ROWCNT                                             NUMBER

 BLKCNT                                             NUMBER

 EMPCNT                                             NUMBER

 AVGSPC                                             NUMBER

 CHNCNT                                             NUMBER

 AVGRLN                                             NUMBER

 AVGSPC_FLB                                         NUMBER

 FLBCNT                                             NUMBER

 ANALYZETIME                                        DATE

 SAMPLESIZE                                         NUMBER

 DEGREE                                             NUMBER

 INSTANCES                                          NUMBER

 INTCOLS                                   NOT NULL NUMBER

 KERNELCOLS                                NOT NULL NUMBER

 PROPERTY                                  NOT NULL NUMBER

 TRIGFLAG                                           NUMBER

 SPARE1                                             NUMBER

 SPARE2                                             NUMBER

 SPARE3                                             NUMBER

 SPARE4                                             VARCHAR2(1000)

 SPARE5                                             VARCHAR2(1000)

 SPARE6                                             DATE

 

SQL> select obj#, cols from tab$ where obj# = 32132;

 

      OBJ#       COLS

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

     32132          3

 

SQL> desc col$

 名称                                      是否为空? 类型

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

 

 OBJ#                                      NOT NULL NUMBER

 COL#                                      NOT NULL NUMBER

 SEGCOL#                                   NOT NULL NUMBER

 SEGCOLLENGTH                              NOT NULL NUMBER

 OFFSET                                    NOT NULL NUMBER

 NAME                                      NOT NULL VARCHAR2(30)

 TYPE#                                     NOT NULL NUMBER

 LENGTH                                    NOT NULL NUMBER

 FIXEDSTORAGE                              NOT NULL NUMBER

 PRECISION#                                         NUMBER

 SCALE                                              NUMBER

 NULL$                                     NOT NULL NUMBER

 DEFLENGTH                                          NUMBER

 DEFAULT$                                           LONG

 INTCOL#                                   NOT NULL NUMBER

 PROPERTY                                  NOT NULL NUMBER

 CHARSETID                                          NUMBER

 CHARSETFORM                                        NUMBER

 SPARE1                                             NUMBER

 SPARE2                                             NUMBER

 SPARE3                                             NUMBER

 SPARE4                                             VARCHAR2(1000)

 SPARE5                                             VARCHAR2(1000)

 SPARE6                                             DATE

 

SQL> select obj#, col#, name, intcol#, property from col$ where obj# = 32132;

 

      OBJ#       COL# NAME                              INTCOL#   PROPERTY

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

     32132          1 STU_CODE                                1          0

     32132          2 STU_NAME                                2          0

     32132          3 STU_AGE                                 3          0

 

SQL> conn system/manager

已连接。

SQL> alter table stu set unused (stu_name);

 

表已更改。

 

SQL> alter table stu set unused (stu_age);

 

表已更改。

 

SQL> select * from stu;

 

STU_CODE

----------

001

002

003

 

SQL> conn sys/change_on_install as sysdba

已连接。

SQL> select obj#, cols from tab$ where obj# = 32132;

 

      OBJ#       COLS

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

     32132          1

 

SQL> update tab$ set cols = 3 where obj# = 32132;

 

已更新 1 行。

 

SQL> select obj#, cols from tab$ where obj# = 32132;

 

      OBJ#       COLS

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

     32132          3

 

SQL> select obj#, col#, name, intcol#, property from col$ where obj# = 32132;

 

      OBJ#       COL# NAME                              INTCOL#   PROPERTY

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

     32132          1 STU_CODE                                1          0

     32132          0 SYS_C00002_06091915:22:04$              2      32800

     32132          0 SYS_C00003_06091915:22:19$              3      32800

 

SQL> update col$ set col# = 2, name = 'STU_NAME', property = 0 where intcol# = 2 and property = 32800;

 

已更新 1 行。

 

SQL> update col$ set col# = 3, name = 'STU_AGE', property = 0 where intcol# = 3 and property = 32800;

 

已更新 1 行。

 

SQL> conn system/manager

已连接。

SQL> select * from stu;

 

STU_CODE

----------

001

002

003

 

SQL> alter system flush shared_pool;

 

系统已更改。

 

SQL> select * from stu;

 

STU_CODE   STU_NAME   STU

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

001        Jack       25

002        Tom        24

003        Jerry      25

 

SQL>


本文转自温景良博客园博客,原文链接:http://www.cnblogs.com/wenjl520/archive/2008/11/01/1324095.html,如需转载请自行联系原作者

上一篇:printk


下一篇:c – printk是行缓冲的吗?