AN ASM NEED DO NOTHING WHEN A DEPENDENT RDBMS INSTANCE FAILS

14. þ D. An ASM need do nothing when a dependent RDBMS instance fails.ý A, B, and C. An ASM instance operates independently of the RDBMS instances that are using it. If any file recovery is needed, it is done through the RDBMS instance.

CHAPTER 21

The Resource Manager

Exam Objectives

In this chapter you will learn to• 053.17.1 Understand the Database Resource Manager• 053.17.2 Create and Use Database Resource Manager Components

773

Many computer systems will have several groups of users, each with different standards for the level of service they require. If the system as a whole is highly stressed, it may be impossible to deliver the desired level of service to all groups. But if a priority structure can be negotiated, then it should be possible to guarantee a certain level of service to certain groups—perhaps at the expense of other groups.In a mainframe environment, the operating system itself handles allocating resources to tasks. A transaction processing (TP) monitor will ensure that high-priority jobs get the processing power they need. But simpler operating systems such as Unix or Windows may not have proper resource scheduling capabilities. Oracle’s Resource Manager brings mainframe-style resource management capabilities to all supported Oracle platforms, meaning that you as DBA can guarantee that certain groups of database users will always receive a certain level of service, no matter what the overall workload on the database may be.

The Need for Resource Management

Operating systems like Unix or Windows use a very simple algorithm to assign resources to different processes: round-robin time slicing. To the operating system, there is really no difference between any of the background processes that make up the Oracle instance and any of the many server processes that support user sessions: as far as the operating system is concerned, a process is a process; it will be brought onto CPU, given a few cycles of CPU time, and then switched off CPU so that the next process can be brought on. The operating system has no way of knowing that one server process is supporting a session doing completely trivial work, while another server process is supporting a session doing work critical to the survival of the organization. A more immediate problem that all DBAs come across is that one bad SQL statement can kill the database. The Resource Manager provides a mechanism whereby the operating system’s time-slicing algorithm can be adjusted, to ensure that some users receive more processing capacity than others—and to ensure that any single query does not destroy performance for everyone else. The underlying mechanism is to place a cooperative multitasking layer controlled by Oracle on top of the operating system’s preemptive multitasking system.Throughout this chapter, the environment is assumed to be that of a telesales organization. There are several groups of users: of particular interest are the data entry clerks and the management accountants.There may be 200 data entry clerks in the call center, taking orders over the telephone. If their database sessions are running slowly, this is disastrous for the company. Customers will dial in only to be told “you are number 964 in the queue, your call is important to us, please do not hang up . . . .” This is happening because the data entry clerks cannot process calls fast enough: they take an order, they click the Submit button, and then they wait . . . and wait . . . and wait . . . for the system to respond. This is costing money.On the other hand, the management accountants’ work is not so urgent. Perhaps an advertisement has been run on one local radio station, and the response in terms of sales inquiries needs to be evaluated before running the advertisement nationwide. This is important work, but it doesn’t have to be real time. If the reports take ten minutes to run instead of five, does it really matter?TIP Do not adjust the priorities of Oracle processes by using the Unix renice command, or the Windows equivalent. Oracle assumes that the operating system is treating all processes equally, and if you interfere with this there may be unexpected (and disastrous) side effects.What is needed is a technique for ensuring that if the database sessions supporting the data entry clerks need computing resources, they get them—no matter what. This could mean that at certain times of day when the call center is really busy, the clerks need 100 percent of computing resources. The Resource Manager can handle this, and during PART IIIthat time of peak usage the sessions supporting the management accountants may hang completely. But during other times of day, when the call center is not busy, there will be plenty of resources available to be directed to the management accountants’ work.At month end, another task will become top priority: the end-of-month billing runs, and the rollover of the ledgers into the next accounting period. The Resource Manager needs to be versatile enough to manage this, too.Clearly, the Resource Manager is only necessary in highly stressed systems, but when you need it, there is no alternative. In fact, you are using the Resource Manager whether you know it or not; it is configured by default in all databases from release 8i onward, but the default configuration has no effect on normal work.

The Resource Manager Architecture

Users are placed in Resource Manager consumer groups, and Resource Manager plans, consisting of a set of directives, control the allocation of resources across the groups. Each session is assigned to a group, depending upon attributes defined when the session was established and possibly modified subsequently. The underlying architecture places a cooperative multitasking layer on top of the preemptive multitasking provided by the operating system. The server process of a session in a low-priority group will, when brought onto CPU by a context switch, voluntarily relinquish the CPU earlier than it would have done if relying purely on the operating system’s preemptive multitasking algorithm.

Consumer Groups

A Resource Manager consumer group is a set of users with similar resource requirements. One group may contain many users, and one user may be a member of many groups, but at any given moment, each session will have one group as its effective group. When a user first creates a session, his default consumer group membership will be active, but if he is a member of multiple groups, he can switch to another group, activating his membership of that group. The switch can be manual or automatic, depending on a number of factors.