1. <ul id="0c1fb"></ul>

      <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
      <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区

      RELATEED CONSULTING
      相關(guān)咨詢
      選擇下列產(chǎn)品馬上在線溝通
      服務(wù)時(shí)間:8:30-17:00
      你可能遇到了下面的問題
      關(guān)閉右側(cè)工具欄

      新聞中心

      這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
      降低高水位線

      1、建立初始化數(shù)據(jù)演示數(shù)據(jù)表中的高水位的變化

      成都創(chuàng)新互聯(lián)是專業(yè)的長春網(wǎng)站建設(shè)公司,長春接單;提供成都網(wǎng)站建設(shè)、做網(wǎng)站,網(wǎng)頁設(shè)計(jì),網(wǎng)站設(shè)計(jì),建網(wǎng)站,PHP網(wǎng)站建設(shè)等專業(yè)做網(wǎng)站服務(wù);采用PHP框架,可快速的進(jìn)行長春網(wǎng)站開發(fā)網(wǎng)頁制作和功能擴(kuò)展;專業(yè)做搜索引擎喜愛的網(wǎng)站,專業(yè)的做網(wǎng)站團(tuán)隊(duì),希望更多企業(yè)前來合作!

       

      (1)、建立用戶和表

      SYS@odb>create user test8 identified by test8;

      SYS@odb>grant connect,resource to test8;

      SYS@odb>conn test8/test8

      TEST8@odb>create table gaoshuiwei as select * from all_objects;

      TEST8@odb>select TABLE_NAME,NUM_ROWS,BLOCKS from user_tables where table_name='GAOSHUIWEI';

       TABLE_NAME                       NUM_ROWS     BLOCKS

      ---------------------------------------- ----------

      GAOSHUIWEI                          68309        500

       

      TEST8@odb>delete from gaoshuiwei;  

      TEST8@odb>commit;

      TEST8@odb>select count(*) from gaoshuiwei;

        COUNT(*)

      ----------

               0

       

      TEST8@odb>select TABLE_NAME,NUM_ROWS,BLOCKS from user_tables wheretable_name='GAOSHUIWEI';

      TABLE_NAME                       NUM_ROWS     BLOCKS

      ---------------------------------------- ----------

      GAOSHUIWEI                          68309        500

       

      可以看到在刪除表中的數(shù)據(jù)后,在user_tables里面該表還是有68309行和500個(gè)快大約8M左右;

      (2)、在次插入數(shù)據(jù)

      TEST8@ odb>insert intogaoshuiwei  select * from all_objects;

      TEST8@ odb>commit;

      TEST8@ odb>select count(*) fromgaoshuiwei;

       COUNT(*)

      ----------

           68309

      TEST8@ odb>selectTABLE_NAME,NUM_ROWS,BLOCKS from user_tables where table_name='GAOSHUIWEI';

      TABLE_NAME                       NUM_ROWS     BLOCKS

      ---------------------------------------- ----------

      GAOSHUIWEI                          68309       500

      TEST8@ odb>delete fromgaoshuiwei;

      68309 rows deleted.

      TEST8@ odb>commit;

      Commit complete.

      TEST8@ odb>selectTABLE_NAME,NUM_ROWS,BLOCKS from user_tables where table_name='GAOSHUIWEI';

       TABLE_NAME                       NUM_ROWS     BLOCKS

      ---------------------------------------- ----------

      GAOSHUIWEI                          68309        500

       

      看到信息沒什么變化,需要搜集統(tǒng)計(jì)信息;

      TEST8@odb>

      execdbms_stats.gather_table_stats('TEST8','GAOSHUIWEI',cascade=>true);

       PL/SQL procedure successfullycompleted.

       

      TEST8@ odb>selectTABLE_NAME,NUM_ROWS,BLOCKS from user_tables where table_name='GAOSHUIWEI';

       TABLE_NAME                       NUM_ROWS     BLOCKS

      ---------------------------------------- ----------

      GAOSHUIWEI                              0        500

       

       

      TEST8@ odb>selectsegment_name,segment_type,bytes from user_segments wheresegment_name='GAOSHUIWEI';     //查看段的信息

       SEGMENT_NAME         SEGMENT_TYPE            BYTES

      -------------------------------------- ----------

      GAOSHUIWEI           TABLE                 8388608

       

      塊500 大約8M左右, 生成執(zhí)行計(jì)劃:

       

      TEST8@odb>explain plan for select count(*) from gaoshuiwei;

      Explained.

      TEST8@odb>select * from table(dbms_xplan.display);

      該表是0行數(shù)據(jù) ,全表掃描,cost  189 ;原因是因?yàn)榈脑摫韥砘氐牟迦雱h除,高水位線一直沒有降下來,還會(huì)掃描500個(gè)塊,全部掃描一遍返回結(jié)果,如果發(fā)現(xiàn)表的數(shù)據(jù)不大,但是查詢很慢,可能和高水位有關(guān):

      可采用

      方法(1)、使用truncate 方法

      方法(2)、使用移動(dòng)表空間的方法

      方法(3)、使用收縮表空間的方法

      TEST8@ odb>alter table gaoshuiwei enablerow movement;  //啟用行移動(dòng)

      TEST8@ odb>alter table gaoshuiwei shrinkspace compact; //壓縮表的空間,這時(shí)還沒發(fā)生變化

      TEST8@ odb>alter table gaoshuiwei shrinkspace;  //降低表的高水位線這時(shí)變化就比較明顯了

      對索引也可以設(shè)置同樣的操作

      alter indexPUB_LOG_PK shrink space compact;



      文章題目:降低高水位線
      當(dāng)前網(wǎng)址:http://ef60e0e.cn/article/pohcjg.html
      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区
      1. <ul id="0c1fb"></ul>

        <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
        <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

        北流市| 丽水市| 乌审旗| 留坝县| 襄汾县| 类乌齐县| 南昌县| 闻喜县| 华池县| 石泉县| 巩义市| 会理县| 霞浦县| 花莲县| 聂拉木县| 龙川县| 米泉市| 镇雄县| 睢宁县| 凤城市| 舒兰市| 集贤县| 贺州市| 中牟县| 杨浦区| 左贡县| 云南省| 运城市| 兰西县| 新巴尔虎右旗| 合山市| 灵丘县| 万荣县| 桂东县| 馆陶县| 北辰区| 新余市| 广饶县| 黔南| 密山市| 开鲁县|