DM7和DM8的日誌量比較,DM8關閉單表的邏輯附加日誌

yanhengdoudou發表於2020-03-30

 

1.1      DM7 DM8 的日誌量比較,DM8 關閉單表的邏輯附加日誌

1.1.1   現象描述

1.        DM8 在日誌格式上,比起DM7 做了優化,我們從日誌量上進行一定的比較。

2.        DM8 關閉單表的邏輯附加日誌語法是:alter table test1 add logic log; -- 來源:DM8 SQL 手冊,【3.6.2 表修改語句】章節

1.1.2   處理方法

1.1.2.1 構造實驗

1.1.2.1.1        實驗1 和結果

登入DM7 資料庫,執行下面語句:

declare

v1 BIGINT ;

v2 varchar ;

begin

select * into v2 from v$version limit 1 ;

print ( v2 );

 

BEGIN

execute immediate 'SELECT ID_CODE ' INTO V2 ; PRINT ( V2 );

EXCEPTION WHEN OTHERS THEN

NULL ;

END ;

 

for rs2 in ( select

'VARCHAR' ) loop

 

FOR RS21 IN 0 .. 1 LOOP

 

for rs1 in ( SELECT 'ADD' V1 UNION ALL SELECT 'DROP' ) loop

 

for rs in 1 .. 3 loop

 

EXECUtE immediate 'drop table if exists test1' ;

execute immediate 'create table test1(v1 varchar)' ;

 

 

EXECUTE IMMEDIATE 'SP_SET_PARA_VALUE(1,''RLOG_APPEND_LOGIC'',' ||RS21|| ');' ;

 

begin

EXECUtE immediate 'alter table test1 ' ||RS1 . V1|| ' logic log;' ;

exception when others then

print ( 'cannot drop logic log;' );

end ;

 

checkpoint ( 100 );

select stat_val into v1 from v$sysstat where id=81 ;

 

EXECUTE IMMEDIATE 'insert into test1 select level CONNECT BY LEVEL<=100000 ;' ;

commit ;

checkpoint ( 100 );

 

select TRUNC (( stat_val-v1 ) /1024 . 0/1024*1000000 ) MB into v1 from v$sysstat where id=81 ;

 

PRINT CASE when RS21=0 THEN 'No append' else 'Append' end || ' ' ||RS|| ' ' ||RS1 . V1|| ' ' ||V1/1000000 . 0 ;

 

end loop ;

END LOOP ;

 

END LOOP ;

 

end loop ;

end ;

其輸出結果為:

DM Database Server x64 V7.6.0.197-Build(2019.09.12-112648)ENT

 

cannot drop logic log;

No append 1 ADD 3.325195

cannot drop logic log;

No append 2 ADD 3.325683

cannot drop logic log;

No append 3 ADD 3.325683

cannot drop logic log;

No append 1 DROP 3.325683

cannot drop logic log;

No append 2 DROP 3.329101

cannot drop logic log;

No append 3 DROP 3.327148

cannot drop logic log;

Append 1 ADD 3.327148

cannot drop logic log;

Append 2 ADD 13.115722

cannot drop logic log;

Append 3 ADD 13.115722

cannot drop logic log;

Append 1 DROP 13.11914

cannot drop logic log;

Append 2 DROP 13.115722

cannot drop logic log;

Append 3 DROP 13.115722

1.1.2.1.2        實驗1 和結果

登入DM8 資料庫,執行下面語句:

執行上面同樣的SQL

 

其輸出結果為:

 

DM Database Server 64 V8

 

1-1-56-19.12.23-117493-ENT

No append 1 ADD 3.274902

No append 2 ADD 3.27539

No append 3 ADD 3.27539

No append 1 DROP 3.27539

No append 2 DROP 3.276855

No append 3 DROP 3.284179

Append 1 ADD 10.624511

Append 2 ADD 10.624023

Append 3 ADD 10.624511

Append 1 DROP 10.617187

Append 2 DROP 10.617187

Append 3 DROP 10.624511

1.1.2.2 總結

 

通過上面實驗,我們可以形成如下表格和推論。

推論:在資料庫服務端 未啟用邏輯附加日誌時DM8 日誌量比DM7 會減少約 1.5% ;在啟用邏輯附加日誌時,其日誌量比DM7 會減少約 23.5%

說明:這裡只是測試的簡單的varchar 型別,其他測試方法結果不一定相同,其他的資料型別結果也不會相同,但都可以通過類似的方式測試。這裡只是提供一種探究方法、提供特定型別在特定測試方式下的結果參考。

 

dmserver 版本

是否開啟全庫邏輯附加日誌

第幾次

是否啟用單表邏輯日誌

日誌量MB

三次的平均值

DM8 比DM7減少的歸檔量百分比

DM Database Server x64   V7.6.0.197-Build(2019.09.12-112648)ENT

No

1

ADD

3.325195

3.325520


DM Database Server x64   V7.6.0.197-Build(2019.09.12-112649)ENT

No

2

ADD

3.325683



DM Database Server x64   V7.6.0.197-Build(2019.09.12-112650)ENT

No

3

ADD

3.325683



DM Database Server x64   V7.6.0.197-Build(2019.09.12-112651)ENT

No

1

DROP

3.325683

3.327311


DM Database Server x64   V7.6.0.197-Build(2019.09.12-112652)ENT

No

2

DROP

3.329101



DM Database Server x64   V7.6.0.197-Build(2019.09.12-112653)ENT

No

3

DROP

3.327148



DM Database Server x64   V7.6.0.197-Build(2019.09.12-112654)ENT

Append

1

ADD

3.327148

13.115722


DM Database Server x64   V7.6.0.197-Build(2019.09.12-112655)ENT

Append

2

ADD

13.115722



DM Database Server x64   V7.6.0.197-Build(2019.09.12-112656)ENT

Append

3

ADD

13.115722



DM Database Server x64   V7.6.0.197-Build(2019.09.12-112657)ENT

Append

1

DROP

13.119140

13.116861


DM Database Server x64 V7.6.0.197-Build(2019.09.12-112658)ENT

Append

2

DROP

13.115722



DM Database Server x64   V7.6.0.197-Build(2019.09.12-112659)ENT

Append

3

DROP

13.115722



DM Database Server 64 V8 1-1-56-19.12.23-117493-ENT

No

1

ADD

3.274902

3.275227

-1.54%

DM Database Server 64 V8 1-1-56-19.12.23-117494-ENT

No

2

ADD

3.275390



DM Database Server 64 V8 1-1-56-19.12.23-117495-ENT

No

3

ADD

3.275390



DM Database Server 64 V8 1-1-56-19.12.23-117496-ENT

No

1

DROP

3.275390

3.278808

-1.48%

DM Database Server 64 V8 1-1-56-19.12.23-117497-ENT

No

2

DROP

3.276855



DM Database Server 64 V8 1-1-56-19.12.23-117498-ENT

No

3

DROP

3.284179



DM Database Server 64 V8 1-1-56-19.12.23-117499-ENT

Append

1

ADD

10.624511

10.624348

-23.45%

DM Database Server 64 V8 1-1-56-19.12.23-117500-ENT

Append

2

ADD

10.624023



DM Database Server 64 V8 1-1-56-19.12.23-117501-ENT

Append

3

ADD

10.624511



DM Database Server 64 V8 1-1-56-19.12.23-117502-ENT

Append

1

DROP

10.617187

10.619628

-23.52%

DM Database Server 64 V8 1-1-56-19.12.23-117503-ENT

Append

2

DROP

10.617187



DM Database Server 64 V8 1-1-56-19.12.23-117504-ENT

Append

3

DROP

10.624511



 


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69949798/viewspace-2680769/,如需轉載,請註明出處,否則將追究法律責任。

相關文章