如何生成AWR report?

  1. Connect to Oracle DB as sysdba or "/":  
    set ORACLE_SID= yoursid;
    sqlplus sys/pwd as sysdba
  2. alter system flush shared_pool;
  3. alter system flush buffer_cache;
  4. Run the following command,来创建一个snapshot,并记录时间和id.
    exec dbms_workload_repository.create_snapshot;
  5. Execute use case,这是可以执行需要分析的用例,运行完后再次创建一个snapshot.
  6. Again re-run the above command
    dbms_workload_repository.create_snapshot;
  7. 使用自带的awrrpt.sql来创建,Create AWR report in html format between the snapshots you take in above steps. 
    ${ORACLE_HOME}/rdbms/admin/awrrpt.sql;
    
    注: ${ORACEL_HOME} 应替换成环境里的实际路径

发表评论