![Page 1: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/1.jpg)
BASEL BERN BRUGG DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. GENF
HAMBURG KOPENHAGEN LAUSANNE MÜNCHEN STUTTGART WIEN ZÜRICH
DBMS_SCHEDULER 12.2New Features
Alexander HofstetterConsultant
![Page 2: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/2.jpg)
About me
Consultant, Trivadis GmbH, Munich
Since 2008 Oracle DBA
Working with Oracle since 2005
Latest Projects
– High Availability
– Automation
– Migration & Upgrades
DBMS_SCHEDULER 12.2 New Features31.05.2017
![Page 3: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/3.jpg)
Our company.
DBMS_SCHEDULER 12.2 New Features
Trivadis is a market leader in IT consulting, system integration, solution engineering
and the provision of IT services focusing on and
technologies
in Switzerland, Germany, Austria and Denmark. We offer our services in the following
strategic business fields:
Trivadis Services takes over the interacting operation of your IT systems.
O P E R A T I O N
31.05.2017
![Page 4: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/4.jpg)
COPENHAGEN
MUNICH
LAUSANNE
BERN
ZURICH
BRUGG
GENEVA
HAMBURG
DÜSSELDORF
FRANKFURT
STUTTGART
FREIBURG
BASEL
VIENNA
With over 600 specialists and IT experts in your region.
DBMS_SCHEDULER 12.2 New Features
14 Trivadis branches and more than
600 employees
200 Service Level Agreements
Over 4,000 training participants
Research and development budget:
CHF 5.0 million
Financially self-supporting and
sustainably profitable
Experience from more than 1,900
projects per year at over 800
customers
31.05.2017
![Page 5: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/5.jpg)
Agenda
DBMS_SCHEDULER 12.2 New Features
1. Scheduler Basics
2. Resource Management
3. Scheduling
4. New Features 12.2
5. Conclusion
31.05.2017
![Page 6: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/6.jpg)
DBMS_SCHEDULER 12.2 New Features
Scheduler Basics
31.05.2017
![Page 7: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/7.jpg)
Introduction
DBMS_SCHEDULER 12.2 New Features
Implemented in 10gR1
Time- and event-based scheduling
Monitoring, logging and reporting possibilities
Resource management
31.05.2017
![Page 8: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/8.jpg)
Architecture
DBMS_SCHEDULER 12.2 New Features
sys.scheduler$_job Table
The job coordinator ( cjqNNN process) controls the jobs
– Queries the job table
– Spawns and cleanup slave processes if needed
– Switches to sleep mode and wake up
– There is one coordinator per instance in a RAC environment
31.05.2017
![Page 9: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/9.jpg)
Architecture II
DBMS_SCHEDULER 12.2 New Features
Job Execution by Job Slave
– Gathers all required information about the job
– Starts a database session
– Opens a transaction and starts the job
– After completion transaction is commited and closed
– Closes the the database session
31.05.2017
![Page 10: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/10.jpg)
Architecture III
DBMS_SCHEDULER 12.2 New Features
After completion
– Run Count
– Logging
– Rescheduling if required
– Look for new work or go to sleep
31.05.2017
![Page 11: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/11.jpg)
Job Categories
DBMS_SCHEDULER 12.2 New Features
Database Job
– PL/SQL Block
– Stored Procedure
External Job
– Executable
Script Job
– SQL Script
– External Script
– Backup Script
31.05.2017
![Page 12: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/12.jpg)
Job Categories II
DBMS_SCHEDULER 12.2 New Features
Chain Job
Lightweight Job
Multiple-destination Job
Detached Job
In-Memory-Job
31.05.2017
![Page 13: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/13.jpg)
DBMS_SCHEDULER 12.2 New Features
Resource Management
31.05.2017
![Page 14: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/14.jpg)
Resource management
DBMS_SCHEDULER 12.2 New Features
Resource Manager
– Provides more control over hardware resources
– Limits the amount of CPU usage
– Limit the degree of parallelism and priority
– Limit the amount of active sessions
– Move session to another group
31.05.2017
![Page 15: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/15.jpg)
Resource management II
DBMS_SCHEDULER 12.2 New Features
Job Classes
– Assign Consumer Group
– Assign Service
– Define logging level
– Created in SYS schema
– MANAGE SCHEDULER privilege is necessary
31.05.2017
![Page 16: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/16.jpg)
Resource management III
DBMS_SCHEDULER 12.2 New Features
Windows
– Assign Resource Plan
– Only one Window can be active
– Overlapping is possible (not recommended)
– Manage Scheduler privilege is necessary
31.05.2017
![Page 17: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/17.jpg)
DBMS_SCHEDULER 12.2 New Features
Scheduling
31.05.2017
![Page 18: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/18.jpg)
Scheduling
DBMS_SCHEDULER 12.2 New Features
Time-based scheduling
– Start at a particular date and time
– Once or repeating, even complex intervals
Event-based scheduling
– Job starts based on an event
– There a two kindes of event
31.05.2017
![Page 19: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/19.jpg)
Time-based Scheduling
DBMS_SCHEDULER 12.2 New Features
start_date, repeat_interval, end_date
repeat_interval can be Calender Expression or PL/SQL Expression
– Calendar: FREQ=MINUTELY; INTERVAL=5;
– PL/SQL: SYSTIMESTAMP + INTERVAL '5' MINUTE
FREQ, INTERVAL, BYMONTH, BYWEEKNO, BYYEARDAY,
BYDATE,BYMONTHDAY,BYDAY,BYHOUR,BYMINUTE,BYSECOND,BYSETPOS,
INCLUDE,EXCLUDE,INTERSECT,PERIODS,BYPERIOD
Syntax available at:
http://tinyurl.com/jo4645n
31.05.2017
![Page 20: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/20.jpg)
Scheduling Examples
DBMS_SCHEDULER 12.2 New Features
Every 2nd Thursday
FREQ=Weekly; INTERVAL=2; BYDAY=THU
Last workday of a month
FREQ=MONTHLY; BYDAY=MON,TUE,WED,THU,FRI; BYSETPOS=-1;
Every 2nd hour every 5 minutes from Monday to Friday
FREQ=MINUTELY;INTERVAL=5;BYDAY=MON,TUE,WED,THU,FRI;
BYHOUR=0,2,4,6,8,10,12,14,16,18,20,22
31.05.2017
![Page 21: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/21.jpg)
DBMS_SCHEDULER 12.2 New Features
New Features 12.2
31.05.2017
![Page 22: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/22.jpg)
Job Incompatibilities
DBMS_SCHEDULER 12.2 New Features
You can define an incompability between two or more jobs
Only one of the group can be running at a time
Incompatibility can be defined at job or program level
31.05.2017
![Page 23: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/23.jpg)
Job Incompatibilities – Job Level
DBMS_SCHEDULER 12.2 New Features
Only one Job in the definition can run at the time
All other jobs in the same group have to wait until first jobs finishes
Example: you have got one Incompatible Group with JOB A, B und C
while JOB A runs, you can‘t start JOB B or C.
31.05.2017
![Page 24: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/24.jpg)
Job Incompatibilities – Program Level
DBMS_SCHEDULER 12.2 New Features
Only Jobs running the same Program can run at a time
All other jobs, using other programs in the same group have to wait until all jobs
finish.
Example: you have got one Incompatible Group with Program A, B und C
Job 1+2 run Program A ; Job 3+4 run Program B; Job 5+6+7+8 run Program C
While a Job 5 with Program C is running, only Job 6, 7 and 8 would run
Job 1,2,3 and 4 can‘t start as long a job with Program C is running
31.05.2017
![Page 25: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/25.jpg)
Job Incompatibilities Procedures
DBMS_SCHEDULER 12.2 New Features
CREATE_INCOMPATIBILITY
ADD_TO_INCOMPATIBILITY
REMOVE_FROM_INCOMPATIBILITY
DROP_INCOMPATIBILITY
31.05.2017
![Page 26: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/26.jpg)
Job Incompatibilities: CREATE_INCOMPATIBILITY
DBMS_SCHEDULER 12.2 New Features
DBMS_SCHEDULER.CREATE_INCOMPATIBILITY (
incompatibility_name IN VARCHAR2,
object_name IN VARCHAR2,
constraint_level IN VARCHAR2 DEFAULT 'JOB_LEVEL',
enabled IN BOOLEAN DEFAULT TRUE,
comments IN VARCHAR2 DEFAULT NULL);
BEGIN
dbms_scheduler.create_incompatibility(
incompatibility_name => 'incompatible1',
object_name => 'job1,job2,job3',
enabled => true );
END;
/
31.05.2017
![Page 27: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/27.jpg)
Job Incompatibilities ADD_TO_INCOMPATIBILITY
DBMS_SCHEDULER 12.2 New Features
DBMS_SCHEDULER.ADD_TO_INCOMPATIBILITY (
incompatibility_name IN VARCHAR2,
object_name IN VARCHAR2);
BEGIN
dbms_scheduler.add_to_incompatibility(
incompatibility_name => 'incompatible1',
object_name => 'job4');
END;
/
31.05.2017
![Page 28: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/28.jpg)
Job Incompatibilities REMOVE_FROM_INCOMPATIBILITY
DBMS_SCHEDULER 12.2 New Features
DBMS_SCHEDULER.REMOVE_FROM_INCOMPATIBILITY (
incompatibility_name IN VARCHAR2,
object_name IN VARCHAR2);
BEGIN
dbms_scheduler.remove_from_incompatibility(
incompatibility_name => 'incompatible1',
object_name => 'job2');
END;
/
31.05.2017
![Page 29: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/29.jpg)
Job Incompatibilities DROP_INCOMPATIBILITY
DBMS_SCHEDULER 12.2 New Features
DBMS_SCHEDULER.DROP_INCOMPATIBILITY (
incompatibility_name IN VARCHAR2);
BEGIN
dbms_scheduler.drop_incompatibility(
incompatibility_name => 'incompatible1');
END;
/
31.05.2017
![Page 30: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/30.jpg)
Job Incompatibilities Views
DBMS_SCHEDULER 12.2 New Features
USER_SCHEDULER_INCOMPATS
USER_SCHEDUER_INCOMPAT_MEMBER
USER_SCHEDULER_INCOMPATS
Name Null? Type
-------------------------------- -------- ---------------------
INCOMPATIBILITY_NAME NOT NULL VARCHAR2(128)
CONSTRAINT_LEVEL VARCHAR2(13)
ENABLED VARCHAR2(5)
JOBS_RUNNING_COUNT NUMBER
COMMENTS VARCHAR2(256)
31.05.2017
![Page 31: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/31.jpg)
Job Incompatibilities Views
DBMS_SCHEDULER 12.2 New Features
USER_SCHEDULER_INCOMPAT_MEMBER
Name Null? Type
-------------------------------- -------- ---------------------
INCOMPATIBILITY_OWNER NOT NULL VARCHAR2(128)
INCOMPATIBILITY_NAME NOT NULL VARCHAR2(128)
OBJECT_OWNER NOT NULL VARCHAR2(128)
OBJECT_NAME NOT NULL VARCHAR2(128)
31.05.2017
![Page 32: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/32.jpg)
DBMS_SCHEDULER 12.2 New Features
Resource Queues
31.05.2017
![Page 33: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/33.jpg)
Resource Queues
DBMS_SCHEDULER 12.2 New Features
Specifies how many resources are required to execute a Job
Resource can be specified by name and count
At execution time Scheduler ensures that available resources are not exceeded
Jobs can‘t run until required resources are available
31.05.2017
![Page 34: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/34.jpg)
Resource Queues Procedures
DBMS_SCHEDULER 12.2 New Features
CREATE_RESOURCE
SET_ATTRIBUTE / _NULL
SET_RESOURCE_CONSTRAINT
DROP_RESOURCE
31.05.2017
![Page 35: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/35.jpg)
Resource Queues CREATE_RESOURCE
DBMS_SCHEDULER 12.2 New Features
DBMS_SCHEDULER.CREATE_RESOURCE (
resource_name IN VARCHAR2,
units IN PLS_INTEGER,
status IN VARCHAR2 DEFAULT 'ENFORCE_CONSTRAINTS',
constraint_level IN VARCHAR2 DEFAULT 'JOB_LEVEL',
comments IN VARCHAR2 DEFAULT NULL);
BEGIN
DBMS_SCHEDULER.CREATE_RESOURCE(
resource_name => 'app_resource1',
units => 2,
status => 'ENFORCE_CONSTRAINTS',
comments => 'Resource1');
END;
/
31.05.2017
![Page 36: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/36.jpg)
Resource Queues SET_RESOURCE_CONSTRAINT
DBMS_SCHEDULER 12.2 New Features
DBMS_SCHEDULER.SET_RESOURCE_CONSTRAINT (
object_name IN VARCHAR2,
resource_name IN VARCHAR2,
units IN NUMBER DEFAULT 1);
BEGIN
DBME_SCHEDULER.SET_RESOURCE_CONSTRAINT(
OBJECT_NAME => 'job1',
RESOURCE_NAME => 'app_resource1',
UNITS =>1);
END;
/
31.05.2017
![Page 37: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/37.jpg)
Resource Queues DROP_RESOURCE
DBMS_SCHEDULER 12.2 New Features
BEGIN
DBMS_SCHEDULER.DROP_RESOURCE(
resource_name => 'app_resource1',
force => true
)
END;
/
31.05.2017
![Page 38: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/38.jpg)
Resource Queues Views
DBMS_SCHEDULER 12.2 New Features
USER_SCHEDULER_RESOURCES
USER_SCHEDULER_RESOURCES
Name Null? Type
-------------------------------- -------- ---------------------
RESOURCE_NAME NOT NULL VARCHAR2(128)
STATUS VARCHAR2(19)
RESOURCE_UNITS NUMBER
UNITS_USED NUMBER
JOBS_RUNNING_COUNT NUMBER
COMMENTS VARCHAR2(256)
31.05.2017
![Page 39: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/39.jpg)
Resource Queues Views
DBMS_SCHEDULER 12.2 New Features
USER_SCHEDULER_RSC_CONSTRAINTS
USER_SCHEDULER_RSC_CONSTRAINTS
Name Null? Type
-------------------------------- -------- ---------------------
OBJECT_OWNER NOT NULL VARCHAR2(128)
OBJECT_NAME NOT NULL VARCHAR2(128)
RESOURCE_OWNER NOT NULL VARCHAR2(128)
RESOURCE_NAME NOT NULL VARCHAR2(128)
UNITS_USED NUMBER
31.05.2017
![Page 40: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/40.jpg)
DBMS_SCHEDULER 12.2 New Features
In-Memory Jobs
31.05.2017
![Page 41: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/41.jpg)
In-Memory Jobs
DBMS_SCHEDULER 12.2 New Features
Should be created and run during a short period of time
In-memory jobs have a larger memory footprint
There are 2 types of in-memory jobs:
– IN_MEMOR_RUNTIME
– IN_MEMORY_FULL
31.05.2017
![Page 42: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/42.jpg)
IN_MEMORY_RUNTIME
DBMS_SCHEDULER 12.2 New Features
Based on Lightweight Jobs (persistent)
Repeatable
Run with DEFAULT_IN_MEMORY_JOB_CLASS
– Logging level = none
– No information in scheduler views
31.05.2017
![Page 43: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/43.jpg)
IN_MEMORY_FULL
DBMS_SCHEDULER 12.2 New Features
Not persistent, only in memory
Must be associated to a program
Not repeatable, supposed to run once
Do not generate Redo at create or during runtime
On RAC job is only present where created
They are not propagated to physical or logical standby
31.05.2017
![Page 44: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/44.jpg)
In-Memory Runtime Job Example
DBMS_SCHEDULER 12.2 New Features
BEGIN
DBMS_SCHEDULER.CREATE_JOB (
job_name => 'my_repeat_job',
program_name => 'repeat_prog',
start_date => systimestamp,
repeat_interval => 'freq=secondly;interval=10',
job_style => 'IN_MEMORY_RUNTIME',
enabled => true);
END;
/
31.05.2017
![Page 45: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/45.jpg)
In-Memory Full Job Example
DBMS_SCHEDULER 12.2 New Features
BEGIN
DBMS_SCHEDULER.CREATE_JOB (
job_name => 'my_immediate_job',
program_name => 'fast_op',
job_style => 'IN_MEMORY_FULL',
enabled => true);
END;
/
31.05.2017
![Page 46: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/46.jpg)
Job Type Comparison
DBMS_SCHEDULER 12.2 New Features
92
160
485
75
128
486
73112
445
35
79
302
0
100
200
300
400
500
600
25000 50000 100000
seco
nd
s
Job count
Creation Time
Regular Lightweight In-Memory Runtime In-Memory Full
31.05.2017
![Page 47: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/47.jpg)
Job Type Comparison
DBMS_SCHEDULER 12.2 New Features
179
326
681
126
307
655
122
259
642
114
180
513
0
100
200
300
400
500
600
700
800
25000 50000 100000
seco
nd
s
Job count
Execution Time
Regular Lightweight In-Memory Runtime In-Memory Full
31.05.2017
![Page 48: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/48.jpg)
In-Memory Views
DBMS_SCHEDULER 12.2 New Features
V$SCHEDULER_INMEM_MDINFO
Name Null? Type
----------------------------------------- ---------------------
OBJID NUMBER
PRGOID NUMBER
LAST_ENABLED_TIME TIMESTAMP(3) WITH TIME ZONE
CLSOID NUMBER
INSTANCE_ID NUMBER
FLAGS NUMBER
CREATOR VARCHAR2(128)
CLIENT_ID VARCHAR2(65)
GUID VARCHAR2(33)
CON_ID NUMBER
31.05.2017
![Page 49: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/49.jpg)
In-Memory Views
DBMS_SCHEDULER 12.2 New Features
V$SCHEDULER_INMEM_RTINFO
Name Null? Type
----------------------------------------- ---------------------
USERID NUMBER
OBJID NUMBER
ID_TYPE NUMBER
NAME VARCHAR2(128)
NEXT_RUN_DATE TIMESTAMP(3) WITH TIME ZONE
LAST_START_DATE TIMESTAMP(3) WITH TIME ZONE
LAST_END_DATE TIMESTAMP(3) WITH TIME ZONE
RUN_COUNT NUMBER
FAILURE_COUNT NUMBER
RUNNING_INSTANCE NUMBER
RUNNING_SLAVE NUMBER
JOB_STATUS NUMBER
CON_ID NUMBER
31.05.2017
![Page 50: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/50.jpg)
DBMS_SCHEDULER 12.2 New Features
Conclusion
31.05.2017
![Page 51: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/51.jpg)
Conclusion
DBMS_SCHEDULER 12.2 New Features
New Possibilites to regulate jobs
– Job Incompatibilities defines jobs / programs which can‘t run parallel
– Resource Queues defines a number of resource which can‘t be exceeded
New Possibilities for extra fast jobs
– In-Memory Runtime job for a persistent, repeatable jobs
– In-Memory Full job for an extra fast one time executable job
31.05.2017
![Page 52: DBMS SCHEDULER 12 · Job Incompatibilities –Program Level DBMS_SCHEDULER 12.2 New Features Only Jobs running the same Program can run at a time All other jobs, using other programs](https://reader030.vdocuments.mx/reader030/viewer/2022040302/5e7e418606f6017d6842e5e8/html5/thumbnails/52.jpg)
Any questions…?
Alexander Hofstetter
Tel: +49 89 99 27 59 302
DBMS_SCHEDULER 12.2 New Features31.05.2017