当前位置:龙泉人才网 - 职业人才 -

dba oracle(一文看懂Oracle数据库DBA_SCHEDULER_CREDENTIALS)

  • 职业人才
  • 2023-12-29 17:00
  • 龙泉小编

概述

今天主要简单介绍一下DBA_SCHEDULER_CREDENTIALS和常用的三个脚本。

dba oracle(一文看懂Oracle数据库DBA_SCHEDULER_CREDENTIALS)


1、 Displays scheduler information about job credentials.

COLUMN credential_name FORMAT A25 COLUMN username FORMAT A20 COLUMN windows_domain FORMAT A20 ​ SELECT credential_name, username, windows_domain FROM dba_scheduler_credentials ORDER BY credential_name;

dba oracle(一文看懂Oracle数据库DBA_SCHEDULER_CREDENTIALS)


2、Displays scheduler job information for previous runs.

SET VERIFY OFF ​ SET SERVEROUTPUT ON DECLARE l_clob CLOB; l_additional_info VARCHAR2(4000); l_external_log_id VARCHAR2(50); BEGIN SELECT additional_info, external_log_id INTO l_additional_info, l_external_log_id FROM (SELECT log_id, additional_info, REGEXP_SUBSTR(additional_info,'job[_0-9]*') AS external_log_id FROM dba_scheduler_job_run_details WHERE job_name = UPPER('&1') ORDER BY log_id DESC) WHERE ROWNUM = 1; ​ DBMS_OUTPUT.put_line('ADDITIONAL_INFO: ' || l_additional_info); DBMS_OUTPUT.put_line('EXTERNAL_LOG_ID: ' || l_external_log_id); ​ DBMS_LOB.createtemporary(l_clob, FALSE); ​ DBMS_SCHEDULER.get_file( source_file => l_external_log_id ||'_stdout', credential_name => UPPER('&2'), file_contents => l_clob, source_host => NULL); ​ DBMS_OUTPUT.put_line('stdout:'); DBMS_OUTPUT.put_line(l_clob); END; /

dba oracle(一文看懂Oracle数据库DBA_SCHEDULER_CREDENTIALS)


3、 Displays scheduler job information for previous runs.

SET LINESIZE 300 VERIFY OFF ​ COLUMN log_date FORMAT A35 COLUMN owner FORMAT A20 COLUMN job_name FORMAT A30 COLUMN error FORMAT A20 COLUMN req_start_date FORMAT A35 COLUMN actual_start_date FORMAT A35 COLUMN run_duration FORMAT A20 COLUMN credential_owner FORMAT A20 COLUMN credential_name FORMAT A20 COLUMN additional_info FORMAT A30 ​ SELECT log_date, owner, job_name, status error, req_start_date, actual_start_date, run_duration, credential_owner, credential_name, additional_info FROM dba_scheduler_job_run_details WHERE job_name = DECODE(UPPER('&1'), 'ALL', job_name, UPPER('&1')) ORDER BY log_date;

dba oracle(一文看懂Oracle数据库DBA_SCHEDULER_CREDENTIALS)


觉得有用的朋友多帮忙转发哦!后面会分享更多devops和DBA方面的内容,感兴趣的朋友可以关注下~

dba oracle(一文看懂Oracle数据库DBA_SCHEDULER_CREDENTIALS)

免责声明:本文内容来源于网络或用户投稿,龙泉人才网仅提供信息存储空间服务,不承担相关法律责任。若收录文章侵犯到您的权益/违法违规的内容,可请联系我们删除。
https://www.lqrc.cn/a/zhiye/94379.html

  • 关注微信

猜你喜欢

微信公众号