使用了STREAMS的库里会多一个约束类型!

SQL> select distinct CONSTRAINT_TYPE from dba_constraints
2 ;

V
R
U
P
?
C
O
--------------------------------------------------
C (check constraint on a table)
P (primary key)
U (unique key)
R (referential integrity)
V (with check option, on a view)
O (with read only, on a view)
SQL> select owner,
2 constraint_name,
3 table_name,
4 constraint_type,
5 search_condition, status
6 from dba_constraints
7 where constraint_type = '?'
8 ;

OWNER CONSTRAINT_NAME
------------------------------ ------------------------------
TABLE_NAME C
------------------------------ -
SEARCH_CONDITION
--------------------------------------------------------------------------------
STATUS
--------
SYS SYS_C001374
AQ$_REPLAY_INFO ?
"AGENT" IS NOT NULL
ENABLED


OWNER CONSTRAINT_NAME
------------------------------ ------------------------------
TABLE_NAME C
------------------------------ -
SEARCH_CONDITION
--------------------------------------------------------------------------------
STATUS
--------
SYS SYS_C001228
WRI$_ADV_DEFINITIONS ?
"TYPE" IS NOT NULL
ENABLED
SQL> select distinct type# from sys.cdef$ order by 1;

TYPE#
----------
1
2
3
4
5
6
7
11
Notice constraint type 11. So what is constraint type 11? And does this match what you are seeing in your database?

DBA_CONSTRAINTS视图的基表是 SYS.CDEF$ 。查看脚本?/rdbms/admin/sql.bsq可看基表的定义。
create table cdef$ /* constraint definition table */
( con# number not null, /* constraint number */
obj# number not null, /* object number of base table/view */
cols number, /* number of columns in constraint */
type# number not null, /* constraint type: */
/* 1 = table check, 2 = primary key, 3 = unique, */
/* 4 = referential, 5 = view with CHECK OPTION, */
/* 6 = view READ ONLY check */
/* 7 - table check constraint associated with column NOT NULL */
/* 8 - hash expressions for hash clusters */
/* 9 - Scoped REF column constraint */
/* 10 - REF column WITH ROWID constraint */
/* 11 - REF/ADT column with NOT NULL const */
/* 12 - Log Groups for supplemental logging */
/* 14 - Primary key supplemental logging */
/* 15 - Unique key supplemental logging */
/* 16 - Foreign key supplemental logging */

你可能感兴趣的:(Stream)