环境aix 5308+oracle10204
运行一个查看数据字典的脚本(如统计表空间使用率)发现速度超慢(一般都超过4,5分钟) 而同一配置的另个库 10秒左右能出结果,执行计划一样!
异常库系统资源topas:
 Disk    Busy%     KBPS     TPS KB-Read KB-Writ  PgspOut       0  % Client    4.4
hdisk2   72.5   892.3   111.5   892.3     0.0   PageIn        0
hdisk18  68.0   860.3   107.5   852.3     8.0   PageOut       0  PAGING SPACE
hdisk14  49.5   852.3   106.5   852.3     0.0   Sios          0  Size,MB   16384
hdisk15  68.5   852.3   106.5   852.3     0.0                    % Used      9.9
hdisk4   67.5   852.3   106.5   852.3     0.0   NFS (calls/sec)  % Free     91.1
hdisk19  72.0   852.3   106.5   852.3     0.0   ServerV2       0
hdisk17  49.5   844.3   105.5   836.3     8.0   ClientV2       0   Press:
hdisk8   51.0   841.8   108.5   832.3     9.5   ServerV3       0   "h" for help
hdisk6   41.5   840.8   106.0   840.3     0.5   ClientV3       0   "q" to quit
hdisk9   50.5   840.3   105.0   836.3     4.0
得出这个库pv读写有点频繁然后对数据库性能进行的分析,发现很多语句执行效率较低:如
FINDING 1: 47% impact (202436 seconds)
--------------------------------------
SQL statements consuming significant database time were found.   RECOMMENDATION 1: SQL Tuning, 13% benefit (54858 seconds)
      ACTION: Run SQL Tuning Advisor on the SQL statement with SQL_ID
         "8y4ax7264yxm2".
         RELEVANT OBJECT: SQL statement with SQL_ID 8y4ax7264yxm2 and
         PLAN_HASH 342780786
         select transaction_id,consumer_id,fee,operate_flag,type,nvl(rtn,'0'),
         decode(priority,'2','1',priority) from (  select
         a.transaction_id,'86'||a.consumer_id
         consumer_id,a.fee,a.operate_flag,'EP' type,a.rtn,nvl(d.priority,'99')
         priority   from dbinter.ep_transaction a,dcustmsg b,dcustmsgadd
         c,dbinter.EP_PRIORITY d  where a.consumer_id=c.field_value and
         c.id_no=b.id_no and a.optcode=d.optcode(+) and (a.operate_flag = '0'
         or (a.operate_flag = '1' and a.rtn = '4'))  and
         c.field_code='10000195' and b.sm_code in ('','ny','wy') order by
         d.priority  ) where rownum < 60
      RATIONALE: SQL statement with SQL_ID "8y4ax7264yxm2" was executed 644
         times and had an average elapsed time of 84 seconds.
请问我怎样判断是数据库运行较慢导致这些sql语句运行速度较低,还是由于sql执行效率太低,导致数据库运行较慢!

解决方案 »

  1.   

    没人知道么,晕,我就执行了以下语句花了我6分钟,
      select count(*) from dba_free_space
      

  2.   

    再检查一下session看是否有问题
      

  3.   

    你的配置一致是指硬件?   查询空闲空间居然要6分钟,这个有点太慢了。 
    参考别人的经验  是否是  sga等设置的太小了?
      

  4.   

    count(*)数据量大的话本来就比较慢,但是你要多大的数据量查询竟要6分钟,他应该还有其他的什么操作吧