Home  >  Article  >  Database  >  Where can I see the error message of Oracle scheduled task execution?

Where can I see the error message of Oracle scheduled task execution?

下次还敢
下次还敢Original
2024-04-19 05:48:15857browse

Oracle scheduled task execution error information can be viewed in the following locations: job log (job_log) job scheduler log (scheduler_job_log) database alert log (alert_log.log) job queue job (job_queue_jobs) DBMS_SCHEDULER.GET_JOB_LOG package

Where can I see the error message of Oracle scheduled task execution?

Oracle scheduled task execution error information location

Oracle The error information generated during the execution of scheduled tasks can be viewed at the following location :

1. View the job log (job_log)

<code class="sql">SELECT
  JOB_NAME,
  LOG_DATE,
  STATUS,
  LOG_DETAILS
FROM
  DBA_JOBS_LOG
WHERE
  JOB_NAME = '<作业名称>';</code>

2. View the job scheduler log (scheduler_job_log)

<code class="sql">SELECT
  SCHEDULER_JOB_NAME,
  RUN_DATE,
  STATUS,
  LOG_DETAILS
FROM
  DBA_SCHEDULER_JOB_LOG
WHERE
  SCHEDULER_JOB_NAME = '<作业名称>';</code>

3. Check the database alarm log (alert_log.log)

If the error message is serious, it may be recorded in the database alarm log. By default, the alarm log is located in the following path:

  • ##Unix/Linux: /oracle//admin//bdump/< ;oracle_sid>.log
  • ##Windows:
  • ...\Oracle\diag\rdbms\\\trace
4. View job queue jobs (job_queue_jobs)

<code class="sql">SELECT
  JOB_NAME,
  QUEUE_NAME,
  STATUS,
  MESSAGE
FROM
  DBA_JOB_QUEUE_JOBS
WHERE
  JOB_NAME = '<作业名称>';</code>

5. Use the DBMS_SCHEDULER.GET_JOB_LOG package

<code>DECLARE
  jlob DBMS_LOB.CLOB;
BEGIN
  DBMS_SCHEDULER.GET_JOB_LOG(
    '作业名称',
    jlob
  );
  -- 将 CLOB 中的数据导出为字符串
  DBMS_OUTPUT.PUT_LINE(DBMS_LOB.SUBSTR(
    jlob,
    1,
    DBMS_LOB.GETLENGTH(jlob)
  ));
END;
/</code>

The above is the detailed content of Where can I see the error message of Oracle scheduled task execution?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn