createtablex(iint,namevarchar(20));Tablecreated.SQL>selectcount(*)fromx;COUNT(*)----------0Statistics----------------------------------------------------------1recursivecalls0dbbloc" />

日韩久久久精品,亚洲精品久久久久久久久久久,亚洲欧美一区二区三区国产精品 ,一区二区福利

oracle:block 的 water mark問題

系統(tǒng) 2164 0

? ? ?看了小布老師關(guān)于block里面數(shù)據(jù)存儲(chǔ)的high water mark的實(shí)驗(yàn),自己也做了一遍。

?

SQL> create table x(i int,name varchar(20));

Table created.

?

SQL> select count(*) from x;

COUNT(*)
----------
0

Statistics
----------------------------------------------------------
1 recursive calls
0 db block gets
4 consistent gets
0 physical reads
0 redo size
514 bytes sent via SQL*Net to client
469 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed

?

SQL> begin
2 for i in 1 ..100000
3 loop
4 insert into x values(i,'my');
5 end loop;
6 commit;
7 end;
8 /

PL/SQL procedure successfully completed.

SQL> commit;

Commit complete.

?

SQL> select count(*) from x;

COUNT(*)
----------
100000

Statistics

----------------------------------------------------------
0 recursive calls
0 db block gets
186 consistent gets
0 physical reads
0 redo size
515 bytes sent via SQL*Net to client
469 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed

?

SQL> delete from x;

100000 rows deleted.

?

Statistics

----------------------------------------------------------
1062 recursive calls
104609 db block gets
790 consistent gets
5 physical reads
25386252 redo size
838 bytes sent via SQL*Net to client
709 bytes received via SQL*Net from client
4 SQL*Net roundtrips to/from client
5 sorts (memory)
0 sorts (disk)
100000 rows processed

SQL> commit;

Commit complete.

?

SQL> select count(*) from x;

COUNT(*)
----------
0

Statistics

----------------------------------------------------------
0 recursive calls
0 db block gets
186 consistent gets
0 physical reads
0 redo size
514 bytes sent via SQL*Net to client
469 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed

?

?

SQL> truncate table x;

Table truncated.

?

SQL> select count(*) from x;

COUNT(*)
----------
0

Statistics

----------------------------------------------------------
1 recursive calls
1 db block gets
6 consistent gets
0 physical reads
96 redo size
514 bytes sent via SQL*Net to client
469 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed

?

?

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

通過上面的實(shí)驗(yàn),我們可以看出water mark的作用。

如果delete 數(shù)據(jù),oracle去查詢時(shí),還是要從0開始查,直至water mark為止。

如果truncate數(shù)據(jù),也就是說,oracle發(fā)現(xiàn)water mark=0,直接就返回了。其實(shí)truncate是把表的segment給清除了,自然不占用空間。

?

(有個(gè)疑問,小布老師實(shí)驗(yàn)里面,physical reads是比較大的;我的實(shí)驗(yàn)里面physical reads=0;

也就是說數(shù)據(jù)一直保存在內(nèi)存里面,沒有保存到硬盤;我的環(huán)境是10.2.0.1,他是9i有關(guān)系?

還是10g有個(gè)系統(tǒng)表對數(shù)據(jù)自動(dòng)統(tǒng)計(jì),現(xiàn)在還沒統(tǒng)計(jì)的原因?)

?

?

oracle:block 的 water mark問題


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號(hào)聯(lián)系: 360901061

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長非常感激您!手機(jī)微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會(huì)非常 感謝您的哦!!!

發(fā)表我的評(píng)論
最新評(píng)論 總共0條評(píng)論
主站蜘蛛池模板: 柘城县| 纳雍县| 临武县| 务川| 柘城县| 郎溪县| 昌都县| 临沂市| 晋江市| 松溪县| 上杭县| 武义县| 宽城| 搜索| 雷州市| 孟津县| 怀柔区| 攀枝花市| 孟州市| 志丹县| 仁化县| 墨江| 泌阳县| 化州市| 华宁县| 齐齐哈尔市| 云浮市| 富源县| 合作市| 安塞县| 辉南县| 桦甸市| 望江县| 马鞍山市| 徐汇区| 大关县| 华容县| 扶余县| 于田县| 高要市| 阜宁县|