oracle中drop、delete和truncate的區別

來源:互聯網
上載者:User

標籤:表資料   acl   表數   使用   cat   無法   trunc   不能   刪除檔案   

oracle中可以使用drop、delete和truncate三個命令來刪除資料庫中的表,


1. delete和truncate都是刪除表中的內容而不能刪除表的結構,而drop則是刪除表的結構和內容(表將不複存在);


2. delete可以刪除整個表的資料也可以有選擇性地刪除某一條或多條資料,而truncate則是一次性刪除整個表的資料;


3. 使用delete刪除的表資料並沒有真正被刪掉,資料佔用的資料表空間還存在,相當於Windows中將資料刪除到資源回收筒中,日後有需要還可以恢複;


4. 使用truncate刪除的表資料會連同其佔用的資料表空間一起直接被刪掉,相當於Windows中使用del+shift鍵直接刪除檔案一樣,無法恢複。

oracle中drop、delete和truncate的區別

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.