This article provides an overview of all the resource manager enhancements in Oracle Database 11g.
TOPICS:
1. I/O Calibration
2. Per Session I/O Limits
3. Resource Manager Statistics in AWR
4. Built-In Resource Plans
1) I/O Calibration (DBMS_RESOURCE_MANAGER.CALIBRATE_IO):
++ This feature help assess the I/O capability of the database‘s storage system, and gauge maximum IOPS and Mbytes/s. When Calibrate I/O is invoked it will generate I/O intensive read-only random I/O (db_block_size) and large-block (1MByte) sequential I/O workloads. Unlike various external I/O calibration tools, this tool uses the Oracle code stack and runs in the database, issuing I/O against blocks stored in the database.
IMPORTANT NOTES:
Example:
++ If asynchronous I/O is not enabled, the procedure returns the following error.
++ Only one calibration can be run at a time. If another calibration is initiated at the same time, it will fail.
SETUP:
a) Asynchronous I/O shoulbd be enabled by setting the FILESYSTEMIO_OPTIONS parameter to ASYNC or SETALL.
b) Then call the CALIBRATE_IO function using the DBMS_RESOURCE_MANAGER procedure.
++ The CALIBRATE_IO procedure accepts two parameters to specify the number of physical disks (default 1) and the maximum tolerable latency (default 20ms).
Example:
--------
++ The V$IO_CALIBRATION_STATUS views show the current status of the calibration runs. During a run the status of ‘IN PROGRESS‘ is displayed. Once a run is complete the status switches to ‘READY‘ and the calibration time is displayed.
Description of DBA_RSRC_IO_CALIBRATE (DBA table that stores I/O Calibration results):
++ Output can be seen as below,
2) Per Session I/O Limits:
++ In previous versions of Oracle, the DBA could specify the maximum amount of time a session could run before some action was taken; for example, the call was aborted, the session was killed, or the session was migrated to a new consumer group. This feature is configured on a per consumer group basis in a resource plan.
++ In Oracle Database 11g, DBAs can also specify the maximum number of I/O requests or the maximum megabytes of I/O that a session can issue before the same set of actions are taken. This feature is used for two purposes. The first is to automatically identify runaway queries. The second is to move sessions executing long-running calls to lower-priority consumer groups.
++ The SWITCH_IO_MEGABYTES and SWITCH_IO_REQS parameters are now available in addition to the SWITCH_TIME parameter. All three parameters default to NULL, meaning unlimited.
EXAMPLE:
--------
The following example switches the resource consumer group from oltp_group to batch_group for the current call within the session if the elapsed time exceeds 120 seconds, the number of I/O requests exceeds 5000 or the amount of I/O requested exceeds 1024M.
3) Resource Manager Statistics in AWR:
++ AWR contains new historical views for Resource Manager statistics. These new views, DBA_HIST_RSRC_PLAN and DBA_HIST_RSRC_CONSUMER_GROUP, contain the historical version of the statistics in the views V$RESOURCE_PLAN and
V$RESOURCE_CONSUMER_GROUP. AWR also contains per-minute metrics for resource consumption and Resource Manager-induced waits in the view V$RSRCMGRMETRIC.
This feature makes it easier to view historical Resource Manager statistics.
4) Built-In Resource Plans
++ Oracle 11g includes a built-in MIXED_WORKLOAD_PLAN, designed to give OLTP operations priority over batch operations. The plan contains two consumer groups (INTERACTIVE_GROUP and BATCH_GROUP). Calls assigned to the INTERACTIVE_GROUP are automatically switched to the BATCH_GROUP if they exceed 60 seconds. The complete definition of this plan is referenced in the Oracle documentation:
Oracle? Database Administrator‘s Guide
11g Release 1 (11.1)
Part Number B28310-04
An Oracle-Supplied Mixed Workload Plan
The RESOURCE_MANAGER_PLAN parameter is used to tell the instance which resource plan to use.
++ You must then grant access on the relevant consumer groups to individual users. The following example grants access on both consumer groups to the TEST user and makes the INTERACTIVE_GROUP the default consumer group. Querying the DBA_USERS view shows the default setting has been recorded.
++ Connecting to the database as the TEST user and querying the V$SESSION view shows the correct consumer group assignment is working.
++ We can see the consumer group switch take place if we create an artificially long call.
++ As we can see, the call was initially assigned to the INTERACTIVE_GROUP, but switched to the BATCH_GROUP as the call took longer than 60 seconds.
Resource Manager Enhancements in Oracle Database 11g (文档 ID 884082.1)
原文:http://blog.itpub.net/21754115/viewspace-1359890/