91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

oracle reference partition引用分區(一)

發布時間:2020-08-10 23:59:05 來源:ITPUB博客 閱讀:185 作者:路途中的人2012 欄目:建站服務器
SQL> create table t_hash_partition_parent(a int primary key,b int)
  2  partition by hash(a)
  3  partitions 2
  4
SQL> /
Table created.
---報錯原因:a int后應有,號
SQL> create table t_reference_partition(id int primary key,a int constraint fk_a
 foreign key(a), references t_hash_partition_parent(a))
  2  partition by reference(fk_a)
  3  /
create table t_reference_partition(id int primary key,a int constraint fk_a fore
ign key(a), references t_hash_partition_parent(a))
                                                            *
ERROR at line 1:
ORA-02253: constraint specification not allowed here
---掃錯原因:外鍵列必須是not null
SQL> ed
Wrote file afiedt.buf
  1  create table t_reference_partition(id int primary key,a int constraint fk_a
 foreign key(a), references t_hash_partition_parent(a))
  2* partition by reference(fk_a)
SQL> create table t_reference_partition(id int primary key,a int,constraint fk_a
 foreign key(a) references t_hash_partition_parent(a))
  2  partition by reference(fk_a)
  3  /
partition by reference(fk_a)
                       *
ERROR at line 2:
ORA-14652: reference partitioning foreign key is not supported

SQL> ed
SQL> create table t_reference_partition(id int primary key,a int not null,constr
aint fk_a foreign key(a) references t_hash_partition_parent(a))
  2  partition by reference(fk_a)
  3  /
Table created.
-----分表的分區數
SQL> select partition_name from user_tab_partitions where table_name='T_HASH_PAR
TITION_PARENT';
PARTITION_NAME
------------------------------------------------------------
SYS_P43
SYS_P44

---引用分區的分區表,結論:引用分區的分區表取決于父分區表的分區個數
SQL> select partition_name from user_tab_partitions where table_name='T_REFERENC
E_PARTITION';
PARTITION_NAME
------------------------------------------------------------
SYS_P45
SYS_P46

-----引用分區之constraint使用說明:
---引用分區必須要引用外鍵約束,且主分區表的父鍵必須構建pk或unique constraint,同時要滿足enable validate not deferenable
You must specify a referential integrity constraint defined on the table being created, which must refer to a primary key or unique constraint on the parent table.
The constraint must be in ENABLE VALIDATE NOT DEFERRABLE state, which is the default when you specify a referential integrity constraint during table creation.
 
---所有引用的外鍵必須定義為not null
All foreign key columns referenced in constraint must be NOT NULL.
 
---如指定約束,不能再指定on delete set null;即在操作父表時,不能同時設置匹配子表的記錄為空
When you specify the constraint, you cannot specify the ON DELETE SET NULL clause of the references_clause.
 
---所引用的父表必須是分區表;且父表分表方法不能是interval mode
The parent table referenced in the constraint must be an existing partitioned table. It can be partitioned by any method except interval partitioning.
 
---引用分區和父分區表所引用的外鍵及父鍵絕不能包含基于pl sql function or lob列的虛擬列
The foreign and parent keys cannot contain any virtual columns that reference PL/SQL functions or LOB columns.
 

---引用分區的操作限制:

-----引用分區約束取決于父分區表的分區策略,即父分區是什么分區類型,它就隸屬于什么分區類型
Restrictions for reference partitioning are derived from the partitioning strategy of the parent table.
 
----iot,外部表,域索引存儲表不能使用引用分區
You cannot specify this clause for an index-organized table, an external table, or a domain index storage table.
 
----父分區表也可以是引用分區,但約束不能是自包含
The parent table can be partitioned by reference, but constraint cannot be self-referential. The table being created cannot be partitioned based on a reference to itself.
 
----如父分區表啟用了行移動,引用分區也須啟行移動
If ROW MOVEMENT is enabled for the parent table, it must also be enabled for the child table.
 
 
向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

米脂县| 德化县| 调兵山市| 保康县| 雷山县| 崇左市| 三原县| 揭西县| 大关县| 贵港市| 巴彦县| 抚宁县| 沂水县| 绿春县| 花莲市| 通化市| 南漳县| 荣昌县| 中西区| 古交市| 长子县| 澎湖县| 米泉市| 潼关县| 额敏县| 榕江县| 嘉善县| 清水河县| 深泽县| 成安县| 武胜县| 宁化县| 巴林右旗| 雷波县| 阿尔山市| 新和县| 鄱阳县| 昌都县| 泰兴市| 永宁县| 丰原市|