Truncate and data_object_id
預設的,一個表當進行truncate 表時DATA_OBJECT_ID將增加1;
但是當此表有一個索引時,進行truncate 表時DATA_OBJECT_ID將增加2:
SQL>
SQL> create table x ( x number );
Table created.
SQL> select object_id, data_object_id, last_ddl_time, created from user_objects where object_name = 'X';
OBJECT_ID DATA_OBJECT_ID LAST_DDL_TIM CREATED
---------- -------------- ------------ ------------
779899 779899 01-JUL-14 01-JUL-14
SQL> truncate table x;
Table truncated.
SQL> select object_id, data_object_id, last_ddl_time, created from user_objects where object_name = 'X';
OBJECT_ID DATA_OBJECT_ID LAST_DDL_TIM CREATED
---------- -------------- ------------ ------------
779899 779899 01-JUL-14 01-JUL-14
SQL> insert into x values ( 1 );
1 row created.
SQL> commit;
Commit complete.
SQL> select count(1) from x;
COUNT(1)
----------
1
SQL> select object_id, data_object_id, last_ddl_time, created from user_objects where object_name = 'X';
OBJECT_ID DATA_OBJECT_ID LAST_DDL_TIM CREATED
---------- -------------- ------------ ------------
779899 779899 01-JUL-14 01-JUL-14
SQL> truncate table x;
Table truncated.
SQL> select object_id, data_object_id, last_ddl_time, created from user_objects where object_name = 'X';
OBJECT_ID DATA_OBJECT_ID LAST_DDL_TIM CREATED
---------- -------------- ------------ ------------
779899 779900 01-JUL-14 01-JUL-14
SQL> truncate table x;
Table truncated.
SQL> select object_id, data_object_id, last_ddl_time, created from user_objects where object_name = 'X';
OBJECT_ID DATA_OBJECT_ID LAST_DDL_TIM CREATED
---------- -------------- ------------ ------------
779899 779900 01-JUL-14 01-JUL-14
SQL> insert into x values ( 1 );
1 row created.
SQL> select object_id, data_object_id, last_ddl_time, created from user_objects where object_name = 'X';
OBJECT_ID DATA_OBJECT_ID LAST_DDL_TIM CREATED
---------- -------------- ------------ ------------
779899 779900 01-JUL-14 01-JUL-14
SQL> commit;
Commit complete.
SQL> select object_id, data_object_id, last_ddl_time, created from user_objects where object_name = 'X';
OBJECT_ID DATA_OBJECT_ID LAST_DDL_TIM CREATED
---------- -------------- ------------ ------------
779899 779900 01-JUL-14 01-JUL-14
SQL> truncate table x;
Table truncated.
SQL> select object_id, data_object_id, last_ddl_time, created from user_objects where object_name = 'X';
OBJECT_ID DATA_OBJECT_ID LAST_DDL_TIM CREATED
---------- -------------- ------------ ------------
779899 779901 01-JUL-14 01-JUL-14
SQL>
SQL>
SQL>
SQL> create index kk on x(x);
Index created.
SQL> select count(1) from x;
COUNT(1)
----------
0
SQL> insert into x values ( 1 );
1 row created.
SQL> select object_id, data_object_id, last_ddl_time, created from user_objects where object_name = 'X';
OBJECT_ID DATA_OBJECT_ID LAST_DDL_TIM CREATED
---------- -------------- ------------ ------------
779899 779901 01-JUL-14 01-JUL-14
SQL> commit;
Commit complete.
SQL> select object_id, data_object_id, last_ddl_time, created from user_objects where object_name = 'X';
OBJECT_ID DATA_OBJECT_ID LAST_DDL_TIM CREATED
---------- -------------- ------------ ------------
779899 779901 01-JUL-14 01-JUL-14
SQL> truncate table x;
Table truncated.
SQL> select object_id, data_object_id, last_ddl_time, created from user_objects where object_name = 'X';
OBJECT_ID DATA_OBJECT_ID LAST_DDL_TIM CREATED
---------- -------------- ------------ ------------
779899 779904 01-JUL-14 01-JUL-14
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/13750068/viewspace-1200843/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- truncate操作導致DATA_OBJECT_ID改變Object
- OBJECT_ID、DATA_OBJECT_ID與truncate的本質Object
- TRUNCATE in postgresqlSQL
- OBJECT_ID和DATA_OBJECT_IDObject
- Differences between DATA_OBJECT_ID and OBJECT_IDObject
- object_id 及 data_object_id (oracle)ObjectOracle
- MySQL truncate原理MySql
- truncate 命令使用
- object_id and data_object_id in dba_objectsObject
- oracle truncate table recover(oracle 如何拯救誤操作truncate的表)Oracle
- Diffrence Between delete and truncatedelete
- truncate 比 delete 慢delete
- drop、delete 與truncatedelete
- SQL – TRUNCATE vs DELETESQLdelete
- truncate操作巨慢
- object_id 與data_object_id 的區別Object
- object_id與data_object_id淺析(一)Object
- object_id與data_object_id淺析(二)Object
- object_id與data_object_id的關係Object
- TRUNCATE資料恢復資料恢復
- truncate delete drop 區別delete
- truncate delete 的區別delete
- openGauss lo_truncate
- 【Linux之truncate 命令用法】Linux
- 簡述truncate、delete和dropdelete
- Oracle Truncate表恢復(ODU)Oracle
- OGG 獲取truncate 操作
- Truncate,Delete,Drop的比較.delete
- truncate與delete的區別delete
- truncate 比 delete 慢的原因。delete
- 執行truncate在pl/sqlSQL
- truncate和delete 的區別delete
- partition table中truncate應用
- Oracle中object_id和data_object_id的區別OracleObject
- data_object_id 及 object_id 的聯絡與區別Object
- object_id and data_object_id 區別_20091213Object
- 分割槽表truncate慢處理
- Oracle大表清理truncate .. reuse storageOracle