-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathreporttemplate.cfg
31 lines (31 loc) · 1.82 KB
/
reporttemplate.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
[template]
sqlplusheader: -- Running header
set pages 0
set echo on
spool ${logfile} append
conn /@${dbname} as sysdba
alter session set nls_timestamp_tz_format='yyyy-mm-dd hh24:mi:ss TZH:TZM';
set lines 500
sqlplusautorestoreheader: -- Running header
set pages 0
set echo on
spool ${logfile} append
conn ${autorestorecatalog}
alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';
alter session set NLS_NUMERIC_CHARACTERS=".";
set lines 500
sqlplusfooter: spool off
exit
jobstatus: SELECT 'OUTLOG: { "type": "job", "job_name": "'||job_name||'", "state": "'||state||'", "failure_count": '||failure_count||', "last_start_date": "'||last_start_date||'", "last_run_duration": "'||last_run_duration||'", "next_run_date": "'||next_run_date||'" }'
FROM dba_scheduler_jobs
WHERE owner like '%%BACKUPEXEC' AND job_name IN ('IMAGECOPY_JOB', 'ARCHLOGBACKUP_JOB')
UNION ALL
SELECT 'OUTLOG: { "type": "exec", "job_name": "'||job_name||'", "last_successful": "'||MAX (CASE WHEN status = 'SUCCEEDED' THEN log_date END)||'", "last_failed": "'||MAX (CASE WHEN status = 'FAILED' THEN log_date END)||'" }'
FROM dba_scheduler_job_log
WHERE owner like '%%BACKUPEXEC' AND operation = 'RUN' AND job_name IN ('IMAGECOPY_JOB', 'ARCHLOGBACKUP_JOB')
GROUP BY job_name;
autorestorestatus: SELECT 'OUTLOG: { "avgrestoremin": '||round(AVG (CASE WHEN success = 1 AND validated_corruption = 0 THEN finish_time - start_time END) * 24 * 60)||', "last_success": "'||MAX (CASE WHEN success = 1 THEN start_time END)||
'","last_fail": "'||MAX (CASE WHEN success = 0 THEN start_time END)||'","avgdiff":'||round(AVG (CASE WHEN success = 1 THEN verificationtimediffseconds END))||',"last_validated": "'||
MAX (CASE WHEN success = 1 AND validated_corruption = 1 THEN start_time END)||'"}'
FROM restoreaction
WHERE db_unique_name = '${dbname}';