oracle 性能(杂)

l         In-memory sort ratio :该项显示内存中完成的排序所占比例。最理想状态下,在 OLTP系统中,大部分排序不仅小并且能够完全在内存里完成排序。

公式: sorts (memory) / ( sorts (memory) + sorts (disk) )

执行:

select a. value /(b. value +c. value )

from v$sysstat a,v$sysstat b,v$sysstat c

where a . name = 'sorts (memory)' and

         b. name = 'sorts (memory)' and c. name = 'sorts (disk)' ;

l         Parse to execute ratio :在生产环境,最理想状态是一条 sql语句一次解析多数运行。

公式: 1 - (parse count/execute count)

执行:

select 1 -(a. value /b. value )

from v$sysstat a,v$sysstat b

where a. name = 'parse count (total)' and b. name = 'execute count' ;

l         Parse CPU to total CPU ratio :该项显示总的 CPU花费在执行及解析上的比率。如果这项比率较低,说明系统执行了太多的解析。

公式: 1 - (parse time cpu / CPU used by this session)

执行:

select 1 -(a. value /b. value )

from v$sysstat a,v$sysstat b

where a. name = 'parse time cpu' and

        b. name = 'CPU used by this session' ;

l         Parse time CPU to parse time elapsed :通常,该项显示锁竞争比率。这项比率计算

是否时间花费在解析分配给 CPU进行周期运算 (即生产工作 )。解析时间花费不在 CPU周期运算通常表示由于锁竞争导致了时间花费

公式: parse time cpu / parse time elapsed

执行:

select a. value /b. value

from v$sysstat a,v$sysstat b

where a. name = 'parse time cpu' and b. name = 'parse time elapsed' ;

V$SYSSTAT 获取负载间档 (Load Profile) 数据

  负载间档是监控系统吞吐量和负载变化的重要部分,该部分提供如下每秒和每个事务的统计信息: logons cumulative, parse count (total), parse count (hard), executes, physical reads, physical writes, block changes, and redo size.

  被格式化的数据可检查 'rates'是否过高,或用于对比其它基线数据设置为识别 system profile在期间如何变化。例如,计算每个事务中 block changes可用如下公式:

db block changes / ( user commits + user rollbacks )

执行:

select a. value /(b. value +c. value )

from v$sysstat a,v$sysstat b,v$sysstat c

where a. name = 'db block changes' and

        b. name = 'user commits' and c. name = 'user rollbacks' ;

其它计算统计以衡量负载方式,如下:

l         Blocks changed for each read:这项显示出 block changes block reads中的比例。它将指出是否系统主要用于只读访问或是主要进行诸多数据操作 (如: inserts/updates/deletes)

公式: db block changes / session logical reads

执行:

select a. value /b. value

from v$sysstat a,v$sysstat b

where a. name = 'db block changes' and

         b. name = 'session logical reads' ;

l         Rows for each sort

公式: sorts (rows) / ( sorts (memory) + sorts (disk) )

执行:

select a. value /(b. value +c. value )

from v$sysstat a,v$sysstat b,v$sysstat c

where a. name = 'sorts (rows)' and

         b. name = 'sorts (memory)' and c. name = 'sorts (disk)' ;

你可能感兴趣的:(oracle,sql,C++,c,C#)