0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features); } //-->

OBE Home > Database 10 g > Single Instance > Manageability > Scheduler Admin

Administering the Scheduler

Purpose

This module describes how you can create a job class, window and resource plan to administer jobs using the Scheduler.

Topics

This module will discuss the following topics:

 Overview
 Prerequisites
 Creating a Job Class
 Creating a Window
 Creating Jobs that Belong to Different Job Classes
 Purging Logs

Viewing Screenshots

 Place the cursor on this icon to display all screenshots. You can also place the cursor on each icon to see only the screenshot associated with it.

Overview

Back to List

What is the Database Scheduler?

The Scheduler enables database administrators and application developers to control when and where various tasks take place. These tasks can be time consuming and complicated, so using the Scheduler can help you to improve the management and planning of these tasks. In addition, by ensuring that many routine database tasks occur without manual intervention, you can lower operating costs, implement more reliable routines, and minimize human error.

The Scheduler uses three main components:

 A schedule specifies when and how many times a job is executed. Similar to programs, schedules are database entities and can be saved in the database. The same schedule can be used by multiple jobs.
 A program is a collection of metadata about what will be run by the scheduler. This includes information such as the program name, the type of program, and information about arguments passed to the program.
 A job specifies what needs to executed and when. For example, the "what" could be a PL/SQL procedure, an executable C program, a java application, a shell script, or client-side PL/SQL. You can specify the program (what) and schedule (when) as part of the job definition, or you can use an existing program or schedule instead.

Prerequisites

Back to Topic List

Before starting this module, you should have:

1.

Completed the Configuring Linux for the Installation of Oracle Database 10g lesson

2.

Completed the Installing the Oracle Database 10g on Linux lesson

3.

Completed the Scheduling Jobs lesson

Creating a Job Class

Back to Topic List

A job class defines a category of jobs that share common resource usage requirements and other characteristics. Perform the following:

1.

Open a browser and enter the following URL:

                               
                                 
http://<hostname>:5500/em
                              
                            

Login as sys/<password> as SYSDBA and click Login.

Move your mouse over this icon to see the image

 

2.

Click Administration tab .

Move your mouse over this icon to see the image

 

3.

Click Job Classes.

Move your mouse over this icon to see the image

 

4.

Click Create.

Move your mouse over this icon to see the image

 

5.

Enter the following information and click the search light next to Resource Consumer Group.

Name: COMPUTE_CLASS001
Description: This job class contains all the compute jobs
Logging Level: log job runs only (RUNS)
Log Retention Period: 7

Move your mouse over this icon to see the image

 

6.

Select the LOW_GROUP consumer group and click Select.

Move your mouse over this icon to see the image

 

7.

Click OK.

Move your mouse over this icon to see the image

 

8.

Your job class has been created. Click your Database breadcrumb.

Move your mouse over this icon to see the image

 

9.

A user needs to have EXECUTE privilege on a job class to create jobs in that job class. Click Users.

Move your mouse over this icon to see the image

 

10.

Select the user you want to have access to this job class. In this case, click HR.

Move your mouse over this icon to see the image

 

11.

Select Object Privileges tab.

Move your mouse over this icon to see the image

 

12.

Select Job Classes from the Select Object Type drop down list box and click Add.

Move your mouse over this icon to see the image

 

13.

Click the Search light next to Select Job Classes.

Move your mouse over this icon to see the image

 

14.

Check COMPUTE_CLASS001 and click Select.

Move your mouse over this icon to see the image

 

15.

Select EXECUTE from the list of privileges and click Move. Then click OK.

Move your mouse over this icon to see the image

 

16.

Click Apply.

Move your mouse over this icon to see the image

 

17.

Now the HR user can create jobs that can belong to the job class.. Click the database breadcrumb.

Move your mouse over this icon to see the image

 

Creating a Window

Back to Topic List

A window is represented by an interval of time with a well-defined beginning and end and is used to activate different resource plans at different times. Perform the following:

1.

Click Windows.

Move your mouse over this icon to see the image

 

2.

Click Create.

Move your mouse over this icon to see the image

 

3.

Enter the name COMPUTE_WINDOW001 and click Create Resource Plan.

Move your mouse over this icon to see the image

 

4.

Enter the Plan COMPUTE_PLAN001 and click Modify.

Move your mouse over this icon to see the image

 

5.

Select LOW_GROUP and click Move. Then click OK.

Move your mouse over this icon to see the image

 

6.

Enter 90 for the LOW_GROUP Level 1 plan and 10 for the OTHER_GROUPS Level 1 plan. Then click OK.

Move your mouse over this icon to see the image

 

7.

Enter the following information and click OK.

Resource Plan: COMPUTE_PLAN001
Priority: High
Description: For the duration of this window the COMPUTE_PLAN001 will be active
Schedule: Use a Calendar
Repeat: By Days
Interval: 7
Time: 11:00PM
Start: Later
Date: Today's date
Time: 6:00PM
Duration: 4 hours
End Date: One year from today's date

Move your mouse over this icon to see the image

 

8 .

Now you are ready to create a job that uses the window and job class you just created. Click your Database breadcrumb.

                               
                                 
                                   Move your mouse over this icon to see the image
                                                              
                            

 

Creating Jobs that Belong to Different Job Classes

Back to Topic List

You will now create 2 jobs in different job classes and will show how the CPU is allocated between the two jobs. You will perform the following tasks:

 Set Resource Limit Initialization Parameter
 Create a Job that Belongs to the Job Class you Created Previously
 Create a Job that Belongs to the Default Job Class
 Enable the First Job
 Review the CPU Allocation

Set Resource Limit Initialization Parameter

Back to List

If this parameter is not set then the database will not be tracking statistics. Perform the following:

1.

Click All Initialization Parameters.

Move your mouse over this icon to see the image

 

2.

Enter resource in the filter field and click Go.

Move your mouse over this icon to see the image

 

3.

Select TRUE for resource_limit and click Apply.

Move your mouse over this icon to see the image

 

4.

The change has been made. Click your Database breadcrumb.

Move your mouse over this icon to see the image

 

Create a Job that Belongs to the Job Class you Created Previously

Back to List

Perform the following:

1.

Click Jobs.

Move your mouse over this icon to see the image

 

2.

Click Create.

Move your mouse over this icon to see the image

 

3.

Enter the following information and click the search light next to Job Class.

Name: CPU_JOB001
Owner: SYS
Enabled: No
Description: This job is a cpu intensive job
Logging Level: Log job runs only (RUNS)

Move your mouse over this icon to see the image

 

4.

Select the COMPUTE_CLASS001 Job Class and click Select.

Move your mouse over this icon to see the image

 

5.

Select TRUE for Restartable and enter the following in the Command Type area and select the Schedule tab.

                               
                                 
declare
  i number;
  f number;
  begin
    for i in 1..30000000 loop
      f := f * i;
    end loop;
  end;
                              
                            

Move your mouse over this icon to see the image

 

6.

Make sure the Start is set to Immediately and click OK.

Move your mouse over this icon to see the image

 

7.

Your job has been created. Click the Disabled tab to see the job you just created. If you cannot see the job click Refresh..

Move your mouse over this icon to see the image

 

Create a Job that Belongs to the Default Job Class

Back to List

Since this job is very similar to the last, you will use the Create Like feature. Perform the following:

1.

Select the radio button in front of the job CPU_JOB001 you just created and click Create Like.

Move your mouse over this icon to see the image

 

2.

Change the following and click the search light next to Job Class.

Name: CPU_JOB002
Enabled: Yes

Move your mouse over this icon to see the image

 

3.

Select the DEFAULT_JOB_CLASS Job Class and click Select.

Move your mouse over this icon to see the image

 

4.

Click OK.

Move your mouse over this icon to see the image

 

Enable the First Job

Back to List

Now you want to enable the first job. Perform the following:

1.

Select the job CPU_JOB001.

Move your mouse over this icon to see the image

 

2.

Change Enabled to Yes and click Apply.

Move your mouse over this icon to see the image

 

3.

Select the Jobs breadcrumb.

Move your mouse over this icon to see the image

 

Review the CPU Allocation

Back to List

Perform the following:

1.

Select the Runing tab.

 

2.

You notice how the cpu is allocated between the two jobs.

 

Purging Logs

Back to Topic List

You can purge job logs. Perform the following:

1.

Click Purge All Logs.

Move your mouse over this icon to see the image

 

2.

Click Yes to confirm.

Move your mouse over this icon to see the image

 

3.

All the logs have been purged.

Move your mouse over this icon to see the image

 

 Place the cursor on this icon to hide all screenshots.

 

Left Curve
Popular Downloads
Right Curve