DBMS_SCHEDULER
1. Run database program units
- PL/SQL anonymous blocks
- PL/SQL stored procedures
- Java stroed procedures
2 .Run executables that are external to the database
- Applications
- Batch files
- Shell scripts
3. Schedule job execution
- Time-based scheduling
- Event-based scheduling
- Dependency scheduling
[Job Objects]
Programs
Schedules
Jobs
Destinations
Chains
File Watches
Credentials
Job Classes
Windows
Groups
[Creating Jobs]
DBMS_SCHEDULER.CREATE_JOBJobs are created diabled by default and need to enabled with DBMS_SCHEDULER.ENABLE to run.
BEGINDBMS_SCHDULER.CREATE_JOB (job_name =>job_type =>job_action =>
program_name =>
start_date =>repeat_interval =>end_date =>auto_drop =>
destination_name =>
job_class =>comments =>)END;/- specify the value for program name, no need to specify the values for job_type,job_action and number of arguments
- specify the value for schedule name, no need to specify the values for start_date,repeat_intervals and end_date
- for local external jobs, remote external jobs and remote database jobs, must specify the credentials under which the job runs
[Credential]
- A credential is a user name and password pair stored in a dedicated database object. You assing a credential to a job sothat it can authenticate with an Oracle database or the operating system before running
- DBMS_SCHEDULER.CREATE_CREDENTIAL
- designate the locations at which to run a job by specifying either a single destination or a destination group in the job's destination_name attribute.If attribute is null, the job runs on the local host
[Destinations]
1. To create an external destination
- No DBMS_SCHEDULER package procedures to createan external destination. Need to create an external destination implicitly by registering a remote agent.[Link For Scheduler Agent]
- External destination name is automatically set to agent name
- Query views DBA_SCHEDULER_EXTERNAL_DESTS or ALL_SCHEDULER_EXTERNAL_DESTS
2. To create a database destination
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/14760466/viewspace-672171/
,如需转载,请注明出处,否则将追究法律责任。