标记列删除恢复

简介:

 

 

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,如需转载请自行联系原作者

相关文章
|
7月前
|
SQL
sql语句按指定某个字段分组后删除重复数据只保留id最小/最大的一条数据
sql语句按指定某个字段分组后删除重复数据只保留id最小/最大的一条数据
152 0
|
8月前
|
关系型数据库 MySQL 测试技术
当update修改数据与原数据相同时会再次执行吗
当update修改数据与原数据相同时会再次执行吗
56 1
|
8月前
|
SQL 存储 关系型数据库
group by语句查询如何确保保留重复数据
group by语句查询如何确保保留重复数据
120 0
删除一段时间内的记录,关键在于删除时筛选条件确定删除范围
删除一段时间内的记录,关键在于删除时筛选条件确定删除范围
99 0
|
OLTP 数据库
数据的删除与修改
数据的删除与修改
202 0
|
存储 SQL 关系型数据库
FAQ系列 | 列类型被自动修改导致复制失败
FAQ系列 | 列类型被自动修改导致复制失败
118 0
|
算法 前端开发
删除被覆盖区间
🎈今天给大家带来的是算法练习,题目为"删除被覆盖区间"。
128 0
|
存储 关系型数据库 MySQL
MySQL索引的创建,查看,删除,修改操作详解(上)
MySQL索引的创建,查看,删除,修改操作详解
154 0
|
SQL 关系型数据库 MySQL
MySQL索引的创建,查看,删除,修改操作详解(下)
MySQL索引的创建,查看,删除,修改操作详解
243 0

热门文章

最新文章

下一篇
开通oss服务