Oracle 视图 USER_ADVISOR_SQLW_JOURNAL 官方解释,作用,如何使用详细说明

本站中文解释

Oracle视图USER_ADVISOR_SQLW_JOURNAL可以缓存SQL Workload Advisor的执行记录,包括采集的会话、建议的SQL优化的评级、建议的修改等。我们可以利用该视图来查看Workload完成状况、比较建议前后的SQL性能差异、分析建议的修改以及检查SQL采集到会话信息等。

使用方法:

1.根据业务需要检索SQL Workload Advisor的执行记录,如下:
SELECT * FROM USER_ADVISOR_SQLW_JOURNAL WHERE SQL_TEXT LIKE ‘%sale%’;
(此查询条件可以根据实际的SQL文本修改)

2.根据需要对检索的记录进行分组,分析建议前后的SQL性能差异,查看差异分析表如下:
SELECT SQL_TEXT,SESSION_ID,SESSION_SNAP_ID,SQLCA_ELAPSED_TIME_DELTA,SQLCA_CPU_TIME_DELTA,SQLCA_DISK_READS_DELTA, SIZE_DELTA,FSN_SIZE_DELTA FROM USER_ADVISOR_SQLW_JOURNAL WHERE SQL_TEXT LIKE ‘%sale%’ GROUP BY SQL_TEXT,SESSION_ID,SESSION_SNAP_ID;

3.查看采集到会话信息,可以进一步调整优化建议,如下:
SELECT SESSION_ID,SERIAL#,USERNAME,HOST,ELAPSED_TIME,SQLCA_ELAPSED_TIME,SQLCA_DISK_READS,SQLCA_BUFFER_GETS FROM USER_ADVISOR_SQLW_JOURNAL WHERE SQL_TEXT LIKE ‘%sale%’
GROUP BY SESSION_ID,SERIAL#,USERNAME,HOST,ELAPSED_TIME,SQLCA_ELAPSED_TIME,SQLCA_DISK_READS,SQLCA_BUFFER_GETS;

官方英文解释

USER_ADVISOR_SQLW_JOURNAL displays the journal entries for the workload objects owned by the current user. Its columns (except for OWNER) are the same as those in DBA_ADVISOR_SQLW_JOURNAL.

See Also:

“DBA_ADVISOR_SQLW_JOURNAL”


数据运维技术 » Oracle 视图 USER_ADVISOR_SQLW_JOURNAL 官方解释,作用,如何使用详细说明