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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MySQL truncate原理MySql
- oracle truncate table recover(oracle 如何拯救誤操作truncate的表)Oracle
- openGauss lo_truncate
- truncate table (tablename )表明
- kingbase——建立truncate函式函式
- 分割槽表truncate慢處理
- undo truncate 導致qps下降分析
- Sqlserver 如何truncate linked server的表SQLServer
- 如何在Linux中使用 Truncate 命令Linux
- mysql——ROUND與TRUNCATE函式之比較MySql函式
- delete和truncate刪除的區別delete
- truncate操作消除ORACLE SEG壞塊解析Oracle
- SQL資料庫中Truncate的用法SQL資料庫
- [20181212]關於truncate reuse storage.txt
- 在MySQL中 Truncate Delect Drop 的區別MySql
- SQLSERVER 的 truncate 和 delete 有區別嗎?SQLServerdelete
- MySQL truncate慢影響系統qps分析MySql
- MySQL資料災難挽救之truncate tableMySql
- 資料庫:drop、truncate、delete的區別資料庫delete
- [20181031]truncate IDL_UB1$恢復.txt
- [20180627]truncate table的另類恢復.txt
- [20181212]truncate的另類恢復5.txt
- mysql 大表drop和truncate 技術風險點MySql
- [20210720]修改TRI_PREVENT_DROP_TRUNCATE觸發器.txt觸發器
- Mysql truncate table時解決外來鍵關聯MySql
- mysql執行truncate drop 時卡死問題解決MySql
- linux 0.12 核心學習 (bitmap.c/ truncate.c)Linux
- [20180630]truncate table的另類恢復2.txt
- 翻譯:TRUNCATE TABLE(已提交到MariaDB官方手冊)
- 7_Oracle truncate異常恢復之plsql修復OracleSQL
- 6_Oracle truncate異常恢復之bbed修復Oracle
- 資料庫關鍵詞 drop、truncate和delete的用法資料庫delete
- oracle資料庫災難挽救應急方案之DDL誤操作恢復(truncate)Oracle資料庫
- 使用硬連結和coreutils的truncate工具shrink大檔案方法一例
- Postgresqlddl在事務中可以回滾,truncate時relfilenode在當前會話會改變SQL會話
- 【資料庫資料恢復】如何恢復Oracle資料庫truncate表的資料資料庫資料恢復Oracle
- MySQL必知必會:簡介undo log、truncate、以及undo log如何幫你回滾事物MySql
- 【資料庫資料恢復】誤truncate table的Oracle資料庫資料恢復方案資料庫資料恢復Oracle
- 【資料庫資料恢復】oracle資料庫誤truncate table怎麼恢復資料?資料庫資料恢復Oracle