题目:
20.View the Exhibit and examine the resource consumption details for the current plan in use by the
database instance.
Which two statements are true based on the output? (Choose two.)
Exhibit:
A. An attempt to start a new session by the user belonging to DSS_QUERIES fails with an error
B. A user belonging to DSS_QUERIES can log in to a new session but the session will be queued
C. The CPU_WAIT_TIME column indicates the total time that sessions in the consumer group waited for the CPU due to resource management
D. The CPU_WAIT_TIME column indicates the total time that sessions in the consumer group waited for the CPU due to resource management, I/O waits, and latch or enqueue contention
Answer: BC
参考答案 BC
从图中可以看到,消费者组DSS_QUERIES有4个活动会话,有2个会话处于排队状态,等待激活。
所以用户属于DSS_QUERIES组,新开启一个session的话, 则处于排队状态。所以A错误,B正确。
CPU_WAIT_TIME,这表示由于资源管理,使用者组中的会话等待CPU的总时间 .所以C正确。D错误。
参考文档:
https://docs.oracle.com/cd/E11882_01/server.112/e25494/dbrm.htm#ADMIN11906
V$RSRC_CONSUMER_GROUP Use the V$RSRC_CONSUMER_GROUP
view to monitor resources consumed, including CPU, I/O, and parallel servers. It can also be used to monitor statistics related to CPU resource management, runaway query management, parallel statement queuing, and so on. All of the statistics are cumulative from the time when the plan was activated.
SELECT name, active_sessions, queue_length,
consumed_cpu_time, cpu_waits, cpu_wait_time
FROM v$rsrc_consumer_group;
NAME ACTIVE_SESSIONS QUEUE_LENGTH CONSUMED_CPU_TIME CPU_WAITS CPU_WAIT_TIME
------------------ --------------- ------------ ----------------- ---------- -------------
OLTP_ORDER_ENTRY 1 0 29690 467 6709
OTHER_GROUPS 0 0 5982366 4089 60425
SYS_GROUP 1 0 2420704 914 19540
DSS_QUERIES 4 2 4594660 3004 55700
In the preceding query results, the DSS_QUERIES
consumer group has four sessions in its active session pool and two more sessions queued for activation.
A key measure in this view is CPU_WAIT_TIME
. This indicates the total time that sessions in the consumer group waited for CPU because of resource management. Not included in this measure are waits due to latch or enqueue contention, I/O waits, and so on.
https://docs.oracle.com/cd/E11882_01/server.112/e40402/dynviews_2157.htm#REFRN30214
V$RSRC_CONSUMER_GROUP
displays data related to currently active resource consumer groups.
Column | Datatype | Description |
---|---|---|
ID |
NUMBER |
Consumer group object ID (a unique number, consistent across database shutdowns and startups) |
NAME |
VARCHAR2(32) |
Name of the consumer group |
ACTIVE_SESSIONS |
NUMBER |
Number of currently active sessions in the consumer group |
EXECUTION_WAITERS |
NUMBER |
Number of currently active sessions waiting for an execution time slice in which they will be able to use CPU |
REQUESTS |
NUMBER |
Cumulative number of requests that were executed in the consumer group |
CPU_WAIT_TIME |
NUMBER |
Cumulative amount of time that sessions waited for CPU because of resource management. This does not include waits due to latch or enqueue contention, I/O waits, and so on. |
CPU_WAITS |
NUMBER |
Cumulative number of times all sessions in the consumer group had to wait for CPU because of resource management. This does not include waits due to latch or enqueue contention, I/O waits, and so on. |
CONSUMED_CPU_TIME |
NUMBER |
Cumulative amount of CPU time consumed by all sessions in the consumer group (in milliseconds) |
YIELDS |
NUMBER |
Cumulative number of times that sessions in the consumer group had to yield CPU to other sessions because of quantum expiration |
CPU_DECISIONS |
NUMBER |
Percentage of CPU decisions for which the consumer group was present |
CPU_DECISIONS_EXCLUSIVE |
NUMBER |
Percentage of the CPU decisions for which the consumer group was present and was the only consumer group present |
CPU_DECISIONS_WON |
NUMBER |
Percentage of the CPU decisions that the consumer group won |
QUEUE_LENGTH |
NUMBER |
Number of sessions waiting in the queue |
CURRENT_UNDO_CONSUMPTION |
NUMBER |
Current amount (in KB) of undo consumed by the consumer group |
ACTIVE_SESSION_LIMIT_HIT |
NUMBER |
Number of times that sessions in the consumer group were queued because the consumer group reached its active session limit |
UNDO_LIMIT_HIT |
NUMBER |
Number of times that queries in the consumer group were cancelled because the consumer group reached its UNDO_POOL limit |
SWITCHES_IN_CPU_TIME |
NUMBER |
Number of switches into the consumer group because of the Resource Manager plan's SWITCH_TIME limit |
SWITCHES_OUT_CPU_TIME |
NUMBER |
Number of switches out of the consumer group because of the Resource Manager plan's SWITCH_TIME limit |
SWITCHES_IN_IO_MEGABYTES |
NUMBER |
Number of switches into the consumer group because of the Resource Manager plan's SWITCH_IO_MEGABYTES limit |
SWITCHES_OUT_IO_MEGABYTES |
NUMBER |
Number of switches out of the consumer group because of the Resource Manager plan's SWITCH_IO_MEGABYTES limit |
SWITCHES_IN_IO_REQUESTS |
NUMBER |
Number of switches into the consumer group because of the Resource Manager plan's SWITCH_IO_REQS limit |
SWITCHES_OUT_IO_REQUESTS |
NUMBER |
Number of switches out of the consumer group because of the Resource Manager plan's SWITCH_IO_REQS limit |
SQL_CANCELED |
NUMBER |
Number of times that SQL queries running in the consumer group were aborted because they exceeded the Resource Manager plan's SWITCH_TIME limit and CANCEL_SQL was specified as the Resource Manager plan's SWITCH_GROUP |
ACTIVE_SESSIONS_KILLED |
NUMBER |
Number of times that sessions running in the consumer group were terminated because they exceeded the Resource Manager plan's SWITCH_TIME limit and KILL_SESSION was specified as the Resource Manager plan's SWITCH_GROUP |
IDLE_SESSIONS_KILLED |
NUMBER |
Number of times that sessions in the consumer group were killed because they were idle for too long (reached MAX_IDLE_TIME ) |
IDLE_BLKR_SESSIONS_KILLED |
NUMBER |
Number of times that sessions in the consumer group were killed because they were idle too long (reached MAX_IDLE_BLOCKER_TIME ) and were blocking other sessions |
QUEUED_TIME |
NUMBER |
Total amount of time that sessions in the consumer group have spent in the QUEUED state because of the active session limit (in milliseconds) |
QUEUE_TIME_OUTS |
NUMBER |
Number of times that requests from sessions in the consumer group timed out because they were queued for too long (reached QUEUEING_P1 ) |
IO_SERVICE_TIME |
NUMBER |
Cumulative I/O wait time (in milliseconds) |
IO_SERVICE_WAITS |
NUMBER |
Total number of wait requests |
SMALL_READ_MEGABYTES |
NUMBER |
Number of single block megabytes read |
SMALL_WRITE_MEGABYTES |
NUMBER |
Number of single block megabytes written |
LARGE_READ_MEGABYTES |
NUMBER |
Number of multiblock megabytes read |
LARGE_WRITE_MEGABYTES |
NUMBER |
Number of multiblock megabytes written |
SMALL_READ_REQUESTS |
NUMBER |
Number of single block read requests |
SMALL_WRITE_REQUESTS |
NUMBER |
Number of single block write requests |
LARGE_READ_REQUESTS |
NUMBER |
Number of multiblock read requests |
LARGE_WRITE_REQUESTS |
NUMBER |
Number of multiblock write requests |
CURRENT_PQS_ACTIVE Foot 1 |
NUMBER |
Number of active parallel statements in the consumer group. This value does not include parallel statements that are never queued, such as GV$ queries. |
CURRENT_PQ_SERVERS_ACTIVE Footref 1 |
NUMBER |
Number of active parallel servers in the consumer group. This value does not include servers running parallel statements that are never queued, such as GV$ queries. |
PQS_QUEUED Footref 1 |
NUMBER |
Number of times that sessions in the consumer group were queued when trying to run parallel statements |
PQS_COMPLETED Footref 1 |
NUMBER |
Total number of completed parallel statements in the consumer group |
PQ_SERVERS_USED Footref 1 |
NUMBER |
Total number of parallel servers used by completed parallel statements in the consumer group |
PQ_ACTIVE_TIME Footref 1 |
NUMBER |
Cumulative sum of the parallel active times for all completed parallel statements in the consumer group (in milliseconds) |
CURRENT_PQS_QUEUED Footref 1 |
NUMBER |
Number of sessions in the consumer group that are waiting in the parallel statement queue trying to run parallel statements |
PQ_QUEUED_TIME Footref 1 |
NUMBER |
Total amount of time that sessions in the consumer group were queued when trying to run parallel statements (in milliseconds) |
PQ_QUEUE_TIME_OUTS Footref 1 |
NUMBER |
Number of times that parallel statements from sessions in the consumer group timed out because their queue time exceeded the Resource Manager plan's PARALLEL_QUEUE_TIMEOUT limit |
Footnote 1 This column is available starting with Oracle Database 11g Release 2 (11.2.0.2).
See Also:
Oracle Database Administrator's Guide for information on resource groups
Oracle Database PL/SQL Packages and Types Reference for information on creating resource groups with the DBMS_RESOURCE_MANAGER
package
END
-- 2019-09-12 add
题目:
690. The database users regularly complain about the difficulty in performing transactions. On
investigation, you find that some users perform long-running transactions that consume huge amounts of
space in the undo tablespace, which caused the problem. You want to control the usage of the undo
tablespace only for these user sessions and you do not want these sessions to perform long-running
operations.
How would you achieve this?
A.Implement a profile for the users.
B.Implement external roles for the users.
C.Set the threshold for the undo tablespace.
D.Implement a Database Resource Manager plan.
参考答案 B(有误,应该是D )
解析
一些用户执行了大量的长事务,消耗了过多的undo空间。想控制每个session对undo表空间的使用。可以使用resource manager。
选择D 。
end