QUESTION 24
A new report process containing a complex query is written, with high impact on the database. You want to collect basic statistics about query, such as the level of parallelism, total database time, and the number of I/O requests. For the database instance STATISTICS_LEVEL, the initialization parameter is set to TYPICAL and the
CONTROL_MANAGEMENT_PACK_ACCESS parameter is set to DIAGNOSTIC+TUNING. What should you do to accomplish this task?
A. Execute the query and view Active Session History (ASH) for information about the query.
B. Enable SQL trace for the query.
C. Create a database operation, execute the query, and use the DBMS_SQL_MONITOR.REPORT_SQL_MONITOR function to view the report.
D. Use the DBMS_APPLICATION_INFO.SET_SESSION_LONGOPS procedure to monitor query execution and view the information from the V$SESSION_LONGOPS view.
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Explanation:
The REPORT_SQL_MONITOR function is used to return a SQL monitoring report for a specific SQL
statement.
Incorrect Answers:
A: Not interested in session statistics, only in statistics for the particular SQL query.
B: We are interested in statistics, not tracing.
D: SET_SESSION_LONGOPS Procedure This procedure sets a row in the V$SESSION_LONGOPS view.
This is a view that is used to indicate the on-going progress of a long running operation. Some Oracle functions, such as parallel execution and Server Managed Recovery, use rows in this view to indicate the status of, for example, a database backup. Applications may use the SET_SESSION_LONGOPS procedure to advertise information on the progress of application specific long running tasks so that the progress can be monitored by way of the V$SESSION_LONGOPS view.
问题24
编写了一个包含复杂查询的新报表进程,对数据库的影响很大。您希望收集有关查询的基本统计信息,例如并行级别、数据库总时间和I/O请求数量。对于数据库实例STATISTICS_LEVEL,初始化参数设置为TYPICAL, CONTROL_MANAGEMENT_PACK_ACCESS参数设置为DIAGNOSTIC+TUNING。为了完成这项任务,你应该做些什么?
A.执行查询并查看Active Session History (ASH)查询信息。
启用SQL跟踪查询。
创建一个数据库操作,执行查询,并使用
D.BMS_SQL_MONITOR。命令功能REPORT_SQL_MONITOR查看报表。
D.使用DBMS_APPLICATION_INFO。在V$SESSION_LONGOPS视图中监控查询执行和查看信息。
正确答案:C
部分:(一)
解释
解释/参考:
解释:
REPORT_SQL_MONITOR函数用于返回特定SQL的SQL监视报告
声明。
不正确的答案:
答:对会话统计不感兴趣,只对特定SQL查询的统计感兴趣。
B:我们对统计感兴趣,不是追踪。
D: SET_SESSION_LONGOPS过程在V$SESSION_LONGOPS视图中设置一行。这是一个视图,用于指示一个长期运行的操作的正在进行的进度。一些 Oracle函数,如并行执行和服务器管理恢复,使用这个视图中的行来指示状态,例如,数据库备份。应用程序可以使用SET_SESSION_LONGOPS过程来发布特定于应用程序的长时间运行任务的进度信息,以便通过V$SESSION_LONGOPS视图来监控进度。_LONGOPS视图来监控进度。