国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

相當方便快速消除行遷移的表的方法

2024-07-21 02:37:52
字體:
來源:轉載
供稿:網友

  Row Migration,是Oracle里面的一個重要的基本概念。
  一般傳統意義上,我們需要消除行遷移。 因為這樣,會造成額外的IO消耗。傳統的辦法一般是導入倒出整個表。
  但是這樣的風險比較大,而且Downtime會比較長。
  當有外鍵約束之類的時候,也非常的麻煩。
  也有人選擇用刪除migration的行,然后重新Insert ,但是和EXP/Imp一樣,當遭碰到FK/PK限制的時候,也會很頭疼。
  我們可以用下面的辦法來最方便的進行重組,消除row migration:
  SQL> alter table t add t1 date default sysdate;
   
  Table altered.
   
  SQL> c/t1/t2
    1* alter table t add t2 date default sysdate
  SQL> /
   
  Table altered.
   
  SQL> c/t2/t3
    1* alter table t add t3 date default sysdate
  SQL> /
   
  Table altered.
   
  SQL> analyze table t compute statistics;
   
  Table analyzed.
   
  SQL> select table_name,num_rows,CHAIN_CNT from user_tables where table_name='T';
   
  TABLE_NAME            NUM_ROWS CHAIN_CNT
  ------------------------------ ---------- ----------
  T                  41616    3908
   
  SQL> alter table t move ;
   
  Table altered.
   
  SQL> analyze table t compute statistics;
   
  Table analyzed.
   
  SQL> select table_name,num_rows,CHAIN_CNT from user_tables where table_name='T';
   
  TABLE_NAME            NUM_ROWS CHAIN_CNT
  ------------------------------ ---------- ----------
  T                  41616     0

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 邻水| 水城县| 黑龙江省| 新沂市| 南漳县| 额济纳旗| 深水埗区| 余姚市| 进贤县| 和龙市| 邻水| 福鼎市| 永平县| 将乐县| 梅河口市| 黄龙县| 上高县| 库车县| 上林县| 黔南| 宜黄县| 宁阳县| 武宣县| 山东| 土默特左旗| 南雄市| 岳阳市| 安乡县| 南平市| 商洛市| 孟津县| 晋江市| 中卫市| 怀集县| 克拉玛依市| 隆回县| 连云港市| 郴州市| 龙江县| 乐至县| 云南省|