• difference between Truncate and Delete


    一、delete产生rollback,如果删除大数据量的表速度会很慢,同时会占用很多的rollback segments .truncate 是DDL操作,不产生rollback,速度快一些.
      
      Truncate table does not generate rollback information and redo records so it is much faster than delete.
      
      In default, it deallocates all space except the space allocated by MINEXTENTS unless you specify REUSE STORAGE clause.
      
      二、不从tablespace中腾出空间,需要
      
      ALTER TABLESPACE AAA COALESCE; 才有空间
      
      三、truncate 调整high water mark 而delete不.truncate之后,TABLE的HWM退回到 INITIAL和NEXT的位置(默认)
      
      delete 则不可以。
      
      四、truncate 只能对TABLE
      
      delete 可以是table,view,synonym
      
      五、TRUNCATE TABLE 的对象必须是本模式下的,或者有drop any table的权限 而 DELETE 则是对象必须是本模式下的,或被授予 DELETE ON SCHEMA.TABLE 或DELETE ANY TABLE的权限
  • 相关阅读:
    test
    有偏估计和无偏估计
    Spark Shuffle
    Adaboost算法推导
    Spark优化 – 基础篇
    决策树 – 回归
    HBase的文件合并(minor/major compact)
    HBase的列式存储
    centos7配置固定ip
    Generate a Certificate Signing Request (CSR) in macOS Keychain Access
  • 原文地址:https://www.cnblogs.com/Winston/p/1088793.html
Copyright © 2020-2023  润新知