“高级网络压缩”不适用于Oracle 12c

时间:2015-04-30 13:24:19

标签: oracle oracle12c tnsnames

在我看来,压缩不适用于我们的系统( Oracle Database 12c企业版12.1.0.2.0 - 64位生产)。 我使用此Oracle Whitepaper进行了配置。

Serverside配置( sqlnet.ora ):

SQLNET.COMPRESSION = on
SQLNET.COMPRESSION_LEVELS = high
SQLNET.COMPRESSION_THRESHOLD = 1024

客户端配置( tnsnames.ora ):

MY12C =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 1.2.3.4)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = MYSERVICE)
    )
  )

MY12C_COMP =
  (DESCRIPTION =
    (COMPRESSION=on)
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 1.2.3.4)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = MYSERVICE)
    )
  )

SQLPLUS的测试脚本(版本 SQLPlus:版本12.1.0.1.0生产):

set serveroutput on
set linesize 2000

--Package only used to save statistic value
create or replace package sesStat is
    startVal number;
end;
/

--Save statistic value
begin
select ms.value into sesstat.startVal from v$mystat ms, v$statname sn where ms.statistic#=sn.statistic# and sn.name='bytes sent via SQL*Net to client';
end;
/

--Query which delivers lot of Data
SELECT to_char(lpad('xxx', 3500, level)) as col
FROM DUAL CONNECT BY LEVEL <= 499;

--generating some Output
declare
val number;
cVersion varchar2(100);
bnr varchar2(100);
begin
select distinct client_version into cVersion from V$SESSION_CONNECT_INFO where sid=sys_context('USERENV', 'SID');
select banner into bnr from v$version where rownum=1;
select ms.value -sesstat.startVal into val from v$mystat ms, v$statname sn where ms.statistic#=sn.statistic# and sn.name='bytes sent via SQL*Net to client';
dbms_output.put_line('ClientVersion: ('||cVersion||') Server-Version: ('||bnr||') Sent Data: '||val/1024||' kb');
end;
/

测试: 根据MY12C调用Testscript,MY12C_COMP提供完全相同的输出:

ClientVersion: (12.1.0.1.0) Server-Version: (Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production) Sent Data: 1714,4111328125 kb

我的期望是,如果我使用“Compression = on”子句启动针对TNS-Entry的testscript,那么发送的数据应该更少。

我做错了什么?

0 个答案:

没有答案