Software Testing and Quality Management

我的最新日志

  • delphi下DLL创建及调用-阿祖总结

    2007-10-18

    有两种方法去创建DLL
    1.常规手段去创建File->New->Other,在New选项卡下选择DLL Wizard,工程文件如下:
    library Project1;

    { Important note about DLL memory management: ShareMem must be the
      first unit in your library's USES clause AND your project's (select
      Project-View Source) USES clause if your DLL exports any procedures or
      functions that pass strings as parameters or function results. This
      applies to all strings passed to and from your DLL--even those that
      are nested in records and classes. ShareMem is the interface unit to
      the BORLNDMM.DLL shared memory manager, which must be deployed along
      with your DLL. To avoid using BORLNDMM.DLL, pass string information
      using PChar or ShortString parameters. }

    uses
      SysUtils,
      Classes;

    {$R *.res}

    begin
    end.
    2.还可以将Application下的工程文件的program更名为library,并删除单元文件,删除工程文件下的begin也end之间的代码,并在begin之前加上EXPORT
    ---------------------------------------------------------------------------
    连库的详细说明:
    1.创建DLL

    本例是通过Dll访问数据库,在数据库里调用一个函数并且返回想要的数据。
    按第一种方法创建DLL模型后,在此基础之上再建立一个窗体文件(为的是连库用),在创建Form窗体上添加TSQLConnection及TSimpleDataSet两个组件,将TSQLConnection里的连库参数添加好,再将TSimpleDataSet里Connection属性改为在TSQLConnection组件的名称即可,这样就准备好写代码前题了!
    在DLL的单元的{$R *.res}下声明我们要定义的函数,代码如下:

    library mydll;

    uses
      SysUtils,
      Classes,
      FOrms,
      Unit1 in 'Unit1.pas' {Form1};

    {$R *.res}

    function ENCRYPT(vFlag:String):pchar;export;//定义的函数
    var
      v:string;

    begin

      if form1=nil then
         form1:=TForm1.Create(application);//Dll在加载时不能自动创建窗体文件,就是刚才咱们之前手动创建的窗体文件!得写一小段代码才行!
      form1.SQLConnection1.Open;
      form1.SimpleDataSet1.Close;
      form1.SimpleDataSet1.DataSet.CommandText:='select RAWTOHEX(TSANGHAOCRYPTO.ENCRYPT(TO_CHAR('''+vFlag+'''))) from dual';//调用数据库的函数;
      form1.SimpleDataSet1.Open;
      v:=form1.SimpleDataSet1.Fields[0].AsString;//将查询的数据给变量V;
      form1.Close;
      form1:=nil;//将窗体资源释放
      ENCRYPT:=pchar(v);

    end;
    exports ENCRYPT;
    begin
    end.
    在刚才创建的单元文件里写如下代码,
    procedure TForm1.FormCreate(Sender: TObject);//连库
    begin
      SQLConnection1.Open;
    end;

    procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);//释放资源
    begin
      Action :=cafree
    end;
    ---------------------------------------------------------------------------
    2.编译DLL
    用CTRL+F9即可创建DLL文件了!
    ---------------------------------------------------------------------------
    3.调用DLL
    有了DLL调用就不难了,这样操作:打开Delphi后,创建一个Application,在窗体Form上添加两个Edit、一个Button组件后,在单元文件下书写如下代码即可:
    unit Unit1;

    interface

    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;

    type
        TForm1 = class(TForm)
        Button1: TButton;
        Edit1: TEdit;
        Edit2: TEdit;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;

    var
      Form1: TForm1;

    implementation
    function ENCRYPT(vFlag:String):pchar;external 'mydll.dll';//声明函数
    {$R *.dfm}

    procedure TForm1.Button1Click(Sender: TObject);
    begin
      edit2.Text:=strpas(ENCRYPT(edit1.Text));//调用函数
    end;

    end.
    ---------------------------------------------------------------------------

  • 安装LR后,创建、执行脚本不能正常进行的解决办法之一!

    2007-10-18

    我下面要说的两种情况可能是造成问题的主要原因!

       1.LR不能正确录制脚本,如:录制的过程中不能将事件的信息写入脚本
       
       2.Controller里的图不能正常显示数据或者干脆就没有图的显示!

    这两种原因很可能是安装的防火墙造成的,解决办法:
       
       1.卸载防火墙,再试上述两种情况!
       
       2.如果问题依然可以在没有防火墙的情况下重装LR,如果LR正常好用,将其注册表备份出来,
         再安装防火墙,而后进入安全模式,恢复注册表,这样就没有问题了!


    如果这样两种方法都不能正常使用LR的话,说明你的系统有问题了,建议重做系统吧~~
    有问题可以给我发邮件38984984@qq.com
  • ★LR8.1中文版新安装方法,100%好用!+解决ANALYSIS下不能打开其它计数器的问题★

    2007-10-18


    测试环境:刚装好的机器,没有安装杀毒软件及防火墙,操作系统是WINXPSP2(电脑公司Ghost 6.0);
    有问题请给我发E-mail:zu.stone@qq.com
          想
    要安装LR8.1,一定先要安装LR8.0,否则直接装8.1时会有License10天的提示!

         1.在安装8.0的过程中,系统会提示输入LICENSE,将10000 web clients AEABEXFR-YTIEKEKJJMFKEKEKWBRAUNQJU-KBYGB输入;

         2.安装完毕后,将安装目录下的lm70.dll(1个),mlr5lprg.dll(2个)备份出来,并将它们的路径记住;

         3.再卸载LR8.0,重起后,安装LR8.1,在安装8.1时,安装程序会先解压安装文件到X:\TEMP\...某一个路径的文件夹下,先不要安装,

           在这个文件夹下搜索lm70.dll(2个)和mlr5lprg.dll(3个,其中有一个与另两个不一样的),注意替换时,lm70.dll(2个)都替换成之前备份的lm70.dll,
          
           mlr5lprg.dll(3个)其中两个是一样大小,把这两个替换成之前备份大的那个,剩下的那个替换成之前备份的小的文件,好像都是216K,在汉化包里的将这两

           个文件也替换了,替换方法同上所述,这样就不用安装后再做替换了!这样以后再安装时就不用替换来替换去了!
       

    安装8.1英文版后,将X:\...\Mercury\LoadRunner下的dat文件夹备份一个DAT,再安装汉化,安装后,将备份的DAT里的online_graphs里的online_resource_graphs.rmd考贝到dat文件夹下.(这样做是解决ANALYSIS下不能打开其它计数器的问题)  有问题请给我发E-mail:zu.stone@qq.com
      

       如果安装存在任何问题,将X:\...\Mercury\下的loadrunner文件夹改名,再将"LR8.1中文版备份"改名[loadrunner],拷贝到X:\...\Mercury\下!
       

       如果8.1中文版备份还存在问题,还是将X:\...\Mercury\下的loadrunner文件夹改名,再将"LR8.1英文版备份"改名[loadrunner],拷贝到X:\...\Mercury\下!
      

       如果8.1英文版备份也存在问题,那就只能用8.0了,我是没有办法了!
      

       注意:如果安装防火墙之类的软件时,
       出现问题:1.VUGEN运行脚本结束时非常慢;
                      2.在CONTROLL下虚拟用户不能运行,只能挂起,就是防火墙的问题,卸载即可解决此问题。


    强烈建议安装LR的机器不要安装防火墙!安装的机器会影响LR的准确性!         
    另有办法解决:把好用的LR8.1全部的注册表文件做个备份,再安装杀毒软件防火墙,安装后,重起进入安全模式,把刚才的注册表恢复就OK了! 如果不好用,那只能将防火墙卸载了!
    这可是数日的劳动成果,支持就顶一下,转帖请注明出处,谢谢!
    有问题请给我发E-mail:zu.stone@qq.com
  • loadrunner 监视 weblogic(JMX) 操作详细步骤

    2007-10-18

    阿祖总结 ZU.STONE@QQ.COM

    前提:测试机器装有lr和JDK1.4
    1.删除...\Mercury Interactive\Mercury LoadRunner\classes下jmxri.jar文件,或改名!

    2.将...\bea\weblogic81\server\lib下的weblogic.jar复制到..\Mercury Interactive\Mercury LoadRunner\classes

    3.打开...\Mercury Interactive\Mercury LoadRunner\dat\monitors\WebLogicMon.ini

    将其中的JVM=javaw.exe修改成JVM=...\j2re1.4.2_04\bin\javaw.exe(自己实际路径)

    将JavaVersion=1.3,这个是版本,将其改成实际的!

    将JVM_CLASSES1=jmxri.jar改成JVM_CLASSES1=weblogic.jar

    4.打开LR-COTROLLER,添加WEB APPLICATION SERVER GRAPHS下的WEBLOGIC(JMX),右键图,选择
    ADD measurementS...,在弹出的窗体里单击ADD,填上IP:PORT(端口为80也需要写),填上操作系统后,单击OK,再添加计数器吧!就是单击刚才弹出的窗体下方的ADD,不细说了,都完事了别忘了单击OK.

    完成这些之后,就可以看到图上有变化了,只要WEBLOGIC服务没有问题的话!好不容易才试出来的!

  • 解决TD登录滞留GetCommonSetting问题的方法[转]

    2007-8-21

    用户进入TD前的工作是先取得自己的私有配置文件
    该配置文件里保存了用户退出前界面(requirements、testplan、testlab、defects等)和用户的一些配置(比如各个模块的显示规则)
    配置文件一般保存在C:\TD_Dir\Default\zyh\Settings\Private(安装目录有可能不同,但一定是在TD_Dir目录下)
    在该目录下有以每个用户名字命名的文件夹

    当启用瑞星文件监控的时候
    用户登录时访问配置文件是比较慢的,在状态栏里会一直显示GetCommonSetting,有时会造成客户端死掉

    解决此问题的方法有两种
    1、关掉瑞星的文件监控
    2、删掉C:\TD_Dir\Default\zyh\Settings\Private下的用户目录
    删掉用户的配置信息后,用户就想当于一个新用户登录,自然跳过GetCommonSetting这一步,当然这样登录是直接进入需求管理界面,一些用户的私有设置也会因

    此丢失(建议设置成Public)
    手动删除自然会比较麻烦,可以写一个bat文件设成定时任务就方便多了每天晚上清理一次足矣

    文件内容如下:
    //bat file content
    @删除TD用户的临时目录
    cd C:\TD_Dir\Default\zyh\Settings\Private
    rd . /s/q
    exit

    路径一定要写对,删错了文件麻烦就大了 呵呵
    至于如何设成定时任务,too easy ! 就不多说了

    原始链接:http://www.51testing.com/?53222/action_viewspace_itemid_9309.html

  • 单元测试介绍

    2007-8-06

    单元测试介绍,觉得好就支持一下吧!

    UnitTest.chm
    (2007-07-03 16:38:41, Size: 848 kB, Downloads: 16)

  • 教你如何进行集成测试-文档合集

    2007-8-06

    教你如何进行集成测试-文档合集
    觉得好就顶一下!

    FD-PE-00-W(测试报告).doc
    (2007-07-03 16:40:49, Size: 97 kB, Downloads: 28)


    集成测试 (2).txt
    (2007-07-03 16:40:49, Size: 7.2 kB, Downloads: 30)


    集成测试.doc
    (2007-07-03 16:40:49, Size: 229 kB, Downloads: 38)


    集成测试计划书.doc
    (2007-07-03 16:40:49, Size: 52.5 kB, Downloads: 35)


    集成测试计划怎么写.txt
    (2007-07-03 16:40:49, Size: 2.28 kB, Downloads: 26)


    集成测试指南.pdf
    (2007-07-03 16:40:49, Size: 21.2 kB, Downloads: 30)

  • 教你如何进行系统测试

    2007-8-06

    教你如何进行系统测试
    觉得好就顶一下!

    软件系统测试工作指南.pdf
    (2007-07-03 16:43:32, Size: 48.8 kB, Downloads: 16)

  • 质量管理技术文档合集

    2007-8-06

    质量管理技术文档合集
    觉得好就顶一下!

    CMMI文件清单中英文对照表.xls
    (2007-07-03 16:47:03, Size: 56.5 kB, Downloads: 95)


    EPIGS质量保证计划.doc
    (2007-07-03 16:47:03, Size: 168 kB, Downloads: 108)


    Error等级.doc
    (2007-07-03 16:47:03, Size: 26 kB, Downloads: 88)


    QualityManageActivity.pdf
    (2007-07-03 16:47:03, Size: 277 kB, Downloads: 92)


    SQAPPT.ppt
    (2007-07-03 16:47:03, Size: 203 kB, Downloads: 88)


    测试工作的监控方法.pdf
    (2007-07-03 16:47:03, Size: 177 kB, Downloads: 101)


    测试工作流程.ppt
    (2007-07-03 16:47:03, Size: 551 kB, Downloads: 118)


    测试管理实施方案V2[1].0.doc
    (2007-07-03 16:47:03, Size: 45 kB, Downloads: 91)


    测试项目管理.ppt
    (2007-07-03 16:47:03, Size: 387 kB, Downloads: 95)


    软件SQA PPT.ppt
    (2007-07-03 16:47:03, Size: 63 kB, Downloads: 95)

  • 常用Oracle数据库调优工具介绍[转]

    2007-7-14

    1.   数据库级调优

    1.1. 修改数据库参数

    sys用户登录,运行如下的命令:

    alter system set optimizer_index_cost_adj=10 scope=spfile
    alter system set optimizer_dynamic_sampling=5 scope=spfile

     

    optimizer_index_cost_adj取值0-1000 ,缺省100 ; 值越小oracle就越趋向使用索引

    optimizer_dynamic_sampling    配置oracle对没有统计信息的表会动态采样,会得到更准确的统计信息,同时让优化器得到更准确的执行计划。这个参数对临时表尤其有用。

    1.2. 分析表

    应该把所有没有做过分析的表都做一下分析:

    执行如下语句的返回结果。

    select

    'analyze table '||owner||'.'||table_name||' compute statistics; '

    from dba_tables

    where num_rows is null

    and owner not in ('SYS','SYSTEM')

    and table_name not like '%$%'

    and temporary = 'N'

     

    如果针对SCHEMA里的所有表做分析,JZ21为例

    begin

    dbms_stats.gather_schema_stats ('JZ21');

    end;

    /

    1.3. 增加数据维护的job

    1.3.1.    将表的监视打开

     select ‘alter table ‘||owner||’.’||table_name||’ monitoring; ’  

    from dba_tables

    where owner not in (‘SYS’,’SYSTEM’,’OUTLN’,’WMSYS’) 

    and table_name not like '%$%'

    and TEMPORARY=’N’;

     

      这个监视是在内存中做的,一般情况下对性能不会有什么影响,如果发现实在有影响的时候,

     

    下面语句关闭监视,

    select ‘alter table ‘||owner||’.’||table_name||’ nomonitoring; ’  

    from dba_tables

    where owner not in (‘SYS’,’SYSTEM’,’OUTLN’,’WMSYS’) 

    and table_name not like '%$%'

    and TEMPORARY=’N’;

     

    1.3.2.    添加JOB

    sys用户登录

    执行如下语句,mynextdate,mynextSatdate需要手工更改为下一日和下一个周六。

     

      define mynextdate='2004-03-03';  --to_char(sysdate + 1,'yyyy-mm-dd');

      define mynextSatdate='2004-03-06'; --to_char(NEXT_DAY(sysdate,7),'yyyy-mm-dd');

     

      --每天早上3点左右执行flush monitor info

      call sys.dbms_job.remove(101);

      call sys.dbms_job.isubmit( 101,

                           'sys.DBMS_STATS.FLUSH_DATABASE_MONITORING_INFO();',

                           to_date('&mynextdate 03:00:00','YYYY-MM-DD HH24:MI:SS'),

                           'to_date(''&mynextdate 03:00:00'',''YYYY-MM-DD HH24:MI:SS'') + 1');

      commit;                      

      --统计数据库信息

      call sys.dbms_job.remove(102);

      call sys.dbms_job.isubmit( 102,

                           'sys.dbms_stats.gather_database_stats (options => ''GATHER STALE'');',

                           to_date('&mynextdate 03:10:00','YYYY-MM-DD HH24:MI:SS'),

                           'to_date(''&mynextdate 03:10:00'',''YYYY-MM-DD HH24:MI:SS'') + 1');

      commit;                       

     

      --每周六下午6:30把执行对那些被更新特别频繁的表的索引做rebuild

     

      call sys.dbms_job.remove(201);

      call sys.dbms_job.isubmit( 201,

                           'execute immediate ''alter INDEX history.PK_INCREMENT_STOCK_BALANCE_HIS rebuild nologging'';'||

                           'execute immediate ''alter INDEX history.ind_inc_stock_balance_1 rebuild nologging'';'||

                           'execute immediate ''alter INDEX history.ind_inc_stock_balance_2 rebuild nologging'';'||

                           'execute immediate ''alter INDEX history.PK_TB_INCREMENT_BALANCE_HIS rebuild nologging'';'||

                           'execute immediate ''alter INDEX history.Ind_inc_balance rebuild nologging'';',

                           to_date('&mynextdate 18:30:00','YYYY-MM-DD HH24:MI:SS'),

                           'to_date(''&mynextdate 18:30:00'',''YYYY-MM-DD HH24:MI:SS'') + 7');

      commit;  

     

    1.4. 删除重复的索引

    查找重复的索引

    select  *

        from

    ( select    index_owner,

    index_name,

    table_owner,

    table_name,

                 max(decode(p, 1,     c,NULL)) ||

                 max(decode(p, 2,', '||c,NULL)) ||

                 max(decode(p, 3,', '||c,NULL)) ||

                 max(decode(p, 4,', '||c,NULL)) ||

                 max(decode(p, 5,', '||c,NULL)) ||

                 max(decode(p, 6,', '||c,NULL)) ||

                max(decode(p, 7,', '||c,NULL)) ||

                max(decode(p, 8,', '||c,NULL)) ||

                max(decode(p, 9,', '||c,NULL)) ||

                max(decode(p,10,', '||c,NULL)) ||

                max(decode(p,11,', '||c,NULL)) ||

                max(decode(p,12,', '||c,NULL)) ||

                max(decode(p,13,', '||c,NULL)) ||

                max(decode(p,14,', '||c,NULL)) ||

                max(decode(p,15,', '||c,NULL)) ||

                max(decode(p,16,', '||c,NULL)) index_cols

           from (select index_owner,index_name,table_owner,table_name, substr(column_name,1,30) c, column_position p

                      from dba_ind_columns )

          group by index_owner,index_name,table_owner,table_name  ) A,

       ( select index_owner,

    index_name,

    table_owner,

    table_name,

                 max(decode(p, 1,     c,NULL)) ||

                max(decode(p, 2,', '||c,NULL)) ||

                max(decode(p, 3,', '||c,NULL)) ||

                max(decode(p, 4,', '||c,NULL)) ||

                max(decode(p, 5,', '||c,NULL)) ||

                max(decode(p, 6,', '||c,NULL)) ||

                max(decode(p, 7,', '||c,NULL)) ||

                max(decode(p, 8,', '||c,NULL)) ||

                max(decode(p, 9,', '||c,NULL)) ||

                max(decode(p,10,', '||c,NULL)) ||

                max(decode(p,11,', '||c,NULL)) ||

                max(decode(p,12,', '||c,NULL)) ||

                max(decode(p,13,', '||c,NULL)) ||

                max(decode(p,14,', '||c,NULL)) ||

                max(decode(p,15,', '||c,NULL)) ||

                max(decode(p,16,', '||c,NULL)) index_cols

           from (select index_owner,index_name,table_owner,table_name, substr(column_name,1,30) c, column_position p

                      from dba_ind_columns )

          group by index_owner,index_name,table_owner,table_name  ) B

       where a.table_owner=b.table_owner

    and a.table_name=b.table_name

    and (a.index_owner<>b.index_owner

    or a.index_name <> b.index_name )

    and a.index_cols like b.index_cols || '%'

    and a.owner not in (‘SYS’,’SYSTEM’,’OUTLN’,’WMSYS’) 

    and a.table_name not like '%$%'

     

    出来的结果中,排在后面的索引是可以删除的。

     

     

    1.5. 做为一项常规任务,每个月做一次停下应用的维护

    检查哪些表碎片比较多,对这些碎片很多的表做move,同时将失效的索引全部重建。

    这一项任务是在已经对表都做了分析的情况下来做。

     

    scrīpt0,对表全部做分析

    begin

    dbms_stats.gather_schema_stats (‘JZ21’);

    end;

    /

     

    针对所有的schema都做一次。

     

    --查看哪些表的空间碎片比较大,目前是认为大于30%就做整理。

    select * from (

    Select owner,table_name,(num_rows*avg_row_len/8000),blocks,

    (num_rows*avg_row_len/8000)/( decode(blocks,0,1,null,1,blocks)) bb

    from dba_tables where owner in (‘JZ21’) 

    and TEMPORARY=’N’

    ) tt

    where tt.bb<0.7 and blocks>10;

     

    --生成整理脚本scrīpt1

    select ‘alter table ‘||owner||’.’||table_name||’ move; ’ from (

    Select owner,table_name,(num_rows*avg_row_len/8000),blocks,

    (num_rows*avg_row_len/8000)/( decode(blocks,0,1,null,1,blocks)) bb

    from dba_tables where owner in (‘JZ21’) 

    and TEMPORARY=’N’

    ) tt

    where tt.bb<0.7 and blocks>10;

     

    --预备好分析脚本,不过这个脚本应该最后做scrīpt3

    select 'exec dbms_stats.gather_table_stats( '''||owner||''','''||table_name||''' ,method_opt => ''for all columns'', cascade => true ); ' from (

    Select owner,table_name,(num_rows*avg_row_len/8000),blocks,

    (num_rows*avg_row_len/8000)/( decode(blocks,0,1,null,1,blocks)) bb

    from dba_tables where owner in (‘JZ21’) 

    and TEMPORARY='N'

    ) tt

    where tt.bb<0.7 and blocks>10;

     

     

    --生成重建索引脚本scrīpt2

    select ‘alter index ‘||owner||’.’||index_name||’ rebuild nologging;’ from dba_indexes where owner in (‘JZ21’)  and status='UNUSABLE' ;

     

    步骤:先执行scrīpt0

    结束后,生成scrīpt1,scrīpt2,scrīpt3

    按顺序执行,scritp1,scrīpt2,scrīpt3

     

     

    1.6. 特殊情况下对数据库重新整理

    1.6.1.    对表做move

    alter table test_move move ;

     

      select ‘alter table ‘||owner||’.’||table_name||’ move; ’  from dba_tables where owner in (‘JZ21’)  and TEMPORARY=’N’;

     

    这里用需要做moveschema替换。

     

    1.6.2.    indexrebuild

    alter INDEX idx_test_move rebuild nologging;

     

    select ‘alter index ‘||owner||’.’||index_name||’ rebuild nologging;’ from dba_indexes where owner in (‘JZ21’);

     

     

    1.6.3.    对所有的表做分析

     

    begin

    dbms_stats.gather_schema_stats (‘JZ21’);

    end;

    /

     

    针对所有的schema都做一次。

     

    1.7. 对索引打开监视开关,看哪些索引没有被使用(慎用)

    select ‘alter index ‘||owner||’.’||index_name||’ monitoring usage;’ from dba_indexes

    where owner not in (‘SYS’,’SYSTEM’);

     

    在运行了一个很完整的周期以后(对我们来说,例如2个完整的交易日),检查有哪些索引没有被使用

     

    select index_name,monitoring,used,start_monitoring,end_monitoring from v$object_usage

    where used='NO';

    如果这些索引不是主键或唯一索引,一般情况下这些索引可以去掉。

     

    检查完一次以后,将索引监视关闭,不需要老是监视索引的使用:

    select ‘alter index ‘||owner||’.’||index_name||’ nomonitoring usage;’ from dba_indexes where owner in (‘WHT’);

    2.   语句调优

    2.1. PL/SQL中的语法解释工具

    语句的执行效率是否符合需要,一个是简单的把语句提取出来直接执行一下,看效果如何,但很多情况下,语句的运行是根据实际的条件运行的,所以有时候我们写完语句有要先分析一下语句是否是最优的,这时候我们就可以用PL/SQLexplain窗口(或直接选种语句后,按F5),有时侯,我们已知语句比较慢,要寻找为什么会慢,也可以如此做。

    EXPLAIN窗口,我们需要关注几个重要的东西,COST(成本),如果这个COST数字很大,说明语句效率不高,需要想办法;有无TABLE ACCESS FULL,如果有,只要数据量大一些,效率就不会高。我们要尽量避免产生table access full,方法之一就是建索引,另一个方法是改写连接方式,使能够用到索引。另一个需要关注的是join方式,nest loops outer hash join outer,这两种方式的效果是不一样的,有时有天壤之别,目前我没有类似的经验可以写,以后碰到后补充。

    2.2. ORACLE提供的调优工具

    ORACLE 本身提供了很好的客户端的性能调试和跟踪工具。ORACLE的工具非常好,可以帮助我们很容易的找到系统性能的瓶颈语句在哪里。ORACLE性能调整工具的位置在:

    开始程序—Oracle – Orahome92 – Enterprise Management Packs –Diagnostics –Performance Manager,登陆后找到数据库栏,然后连接就可以看到。

    我常用其中的两项来调整性能(其他的也很有用处):一,顶层会话;二,SQL ,分别做介绍。

    顶层会话: