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