投入多少,收获多少;投入多深,领悟多深。太阳底下没有新鲜事,排列组合就是创新。每天多做一点点,就是进步的开始,每天进步一点点,就是成功的开始,每天创新一点点,就是领先的开始。

check约束在IMP时会产生冗余

上一篇 / 下一篇  2008-04-20 11:39:34 / 个人分类:ORACLE

SQL> create table t(id number ,name char(4));
Table created.
SQL> insert into t values(1,'yxy');
1 row created.
SQL> commit;
Commit complete.

SQL> alter table t add  check (id=0 or id=1) enable;
Table altered.
SQL> select owner,constraint_name,constraint_type,last_change,SEARCH_CONDITION from dba_constraints where table_name='T';
OWNER      CONSTRAINT_NAME                C LAST_CHANGE    SEARCH_CONDITION
---------- ------------------------------ - -------------- --------------------------------------------------
YXYUP     SYS_C0013294                   C 20071217184452 id=0 or id=1
oracle@test:/home/oracle#exp yxyup/abc123 tables=t file=t.dmp log=t.log
Export: Release 10.2.0.3.0 - Production on Mon Dec 17 18:45:17 2007
Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning and Data Mining options
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set
About to export specified tables via Conventional Path ...
. . exporting table                              T          1 rows exported
Export terminated successfully without warnings.
oracle@test:/home/oracle#imp yxyup/abc123 tables=t file=t.dmp log=t.log rows=N ignore=Y
Import: Release 10.2.0.3.0 - Production on Mon Dec 17 18:45:23 2007
Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning and Data Mining options
Export file created by EXPORT:V10.02.01 via conventional path
import done in ZHS16GBK character set and AL16UTF16 NCHAR character set
. importing YXYUP's objects into YXYUP
. importing YXYUP's objects into YXYUP
Import terminated successfully without warnings.

SQL> r
  1* select owner,constraint_name,constraint_type,last_change,SEARCH_CONDITION from dba_constraints where table_name='T'
OWNER      CONSTRAINT_NAME                C LAST_CHANGE    SEARCH_CONDITION
---------- ------------------------------ - -------------- --------------------------------------------------
YXYUP     SYS_C0013295                   C 20071217184523 id=0 or id=1
YXYUP     SYS_C0013294                   C 20071217184452 id=0 or id=1
---我晕

SQL>drop table t cascade  constraints purge;
Table dropped.
SQL> create table t(id number constraint id_c check (id=0 or id=1) , name char(4));
Table created.
SQL> insert into t values(1,'yxy');
1 row created.
SQL> commit;
Commit complete.
SQL> select owner,constraint_name,constraint_type,last_change,SEARCH_CONDITION from dba_constraints where table_name='T';
OWNER      CONSTRAINT_NAME                C LAST_CHANGE    SEARCH_CONDITION
---------- ------------------------------ - -------------- --------------------------------------------------
YXYUP     ID_C                           C 20071217183919 id=0 or id=1
oracle@test:/home/oracle#exp yxyup/abc123 tables=t file=t.dmp log=t.log
Export: Release 10.2.0.3.0 - Production on Mon Dec 17 18:45:17 2007
Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning and Data Mining options
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set
About to export specified tables via Conventional Path ...
. . exporting table                              T          1 rows exported
Export terminated successfully without warnings.
oracle@test:/home/oracle#imp yxyup/abc123 tables=t file=t.dmp log=t.log rows=N ignore=Y
Import: Release 10.2.0.3.0 - Production on Mon Dec 17 18:45:23 2007
Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning and Data Mining options
Export file created by EXPORT:V10.02.01 via conventional path
import done in ZHS16GBK character set and AL16UTF16 NCHAR character set
. importing YXYUP's objects into YXYUP
. importing YXYUP's objects into YXYUP
Import terminated successfully without warnings.
SQL> r
  1* select owner,constraint_name,constraint_type,last_change,SEARCH_CONDITION from dba_constraints where table_name='T'
OWNER      CONSTRAINT_NAME                C LAST_CHANGE    SEARCH_CONDITION
---------- ------------------------------ - -------------- --------------------------------------------------
YXYUP     ID_C                           C 20071217183919 id=0 or id=1
SQL> r
  1* select owner,constraint_name,constraint_type,last_change,SEARCH_CONDITION from dba_constraints where table_name='T'
OWNER      CONSTRAINT_NAME                C LAST_CHANGE    SEARCH_CONDITION
---------- ------------------------------ - -------------- --------------------------------------------------
YXYUP     ID_C                           C 20071217183919 id=0 or id=1

TAG:

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

日历

« 2008-10-12  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 6757
  • 日志数: 164
  • 建立时间: 2007-12-06
  • 更新时间: 2008-10-10

RSS订阅

Open Toolbar