Modify the job Scheduler log level for Oracle and delete the run log

Source: Internet
Author: User

The Job runs long enough to generate a large number of running logs, which can be purged as follows:

1. Create Job:

Create job links to previous job class.       Dbms_scheduler.create_job (job_name = ' test_log_job ', Job_type = ' Plsql_block ', job_action = = ' BEGIN NULL; END; ', Job_class = ' No_logging_class ', Enabled = False, Auto_drop = False, com ments = ' job used to job logs. ');

2. Job Log level:

The--job log level is determined by two factors, one is the job's own log level, and one is the log level of the job cloass used, whichever is the highest value.
--job the log level at creation time is dbms_scheduler by default. Logging_runs,
--When you create a job, if you do not specify a job class, the default is Default_job_class, and default_job_class default logging level is Dbms_scheduler. Logging_runs,
-So the logging level of the job created is at least logging_runs.
--If you do not generate a log, you must prohibit the JOB's own log level, and you cannot use the default default of Default_job_class.

--Re-establish the No Log job class:

Begin Dbms_scheduler.create_job_class (job_class_name = ' No_logging_class ', Resource_consumer_group = > ' Default_consumer_group ', logging_level = Dbms_scheduler. Logging_off); end;

--Disable the job itself log, modify the log level Logging_level properties:

BEGIN dbms_scheduler.set_attribute (' job_name ', ' logging_level ', Dbms_scheduler. Logging_off); END;

--1) Dbms_scheduler. Logging_off: Turn off logging function;
--2) Dbms_scheduler. Logging_runs: The operation information of the task is recorded;
--3) Dbms_scheduler. Logging_full: Records all relevant information of the task, not only the operation of the task, even the creation of tasks, modifications, etc. will be recorded in the log.

3. Query and Delete job Log:
--Scheduler_jobs generated logs can be viewed in both the current normal user and the SYS user (full capitalization of names)

SELECT * from All_scheduler_job_log where owner= ' USERNAME ' and job_name= ' XXX ' select * from All_scheduler_job_run_details where owner= ' USERNAME ' and job_name= ' xxx ' and job_name= ' xxx '

--Log in with the SYS user to delete the running information for a job under a user:

Delete from all_scheduler_job_run_details where owner= ' USERNAME ' and job_name= ' XXX '

This article is from the "Qytag (upspringing)" blog, so be sure to keep this source http://qytag.blog.51cto.com/6125308/1574112

Modify the job Scheduler log level for Oracle and delete the run log

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.