formatage SQL

This commit is contained in:
Yacine31
2024-02-10 02:30:28 +01:00
parent 2d51059e6c
commit a4bc29b998
35 changed files with 538 additions and 401 deletions

View File

@@ -1,33 +1,30 @@
prompt <h2>Les dernières sauvegardes RMAN (30 derniers jours/50 dernières lignes)</h2>
alter session set nls_date_format='DD/MM/YYYY HH24:MI:SS' ;
-- set linesize 250 heading off;
-- set heading on pagesize 999;
-- column status format a25;
-- column input_bytes_display format a12;
-- column output_bytes_display format a12;
-- column device_type format a10;
ALTER SESSION SET NLS_DATE_FORMAT='DD/MM/YYYY HH24:MI:SS';
SELECT
b.SESSION_KEY "Session Key",
b.input_type "Type",
to_char(b.start_time, 'DD-MM-YYYY HH24:MI') "Start Time",
to_char(b.end_time, 'DD-MM-YYYY HH24:MI') "End Time",
to_char(trunc(sysdate) + numtodsinterval(ELAPSED_SECONDS, 'second'),'hh24:mi:ss') "Duration",
b.output_device_type "Device Type",
b.input_bytes_display "Input Bytes",
b.output_bytes_display "Output Bytes",
B.SESSION_KEY "Session Key",
B.INPUT_TYPE "Type",
TO_CHAR(B.START_TIME, 'DD-MM-YYYY HH24:MI') "Start Time",
TO_CHAR(B.END_TIME, 'DD-MM-YYYY HH24:MI') "End Time",
TO_CHAR(TRUNC(SYSDATE) + NUMTODSINTERVAL(ELAPSED_SECONDS, 'second'), 'hh24:mi:ss') "Duration",
B.OUTPUT_DEVICE_TYPE "Device Type",
B.INPUT_BYTES_DISPLAY "Input Bytes",
B.OUTPUT_BYTES_DISPLAY "Output Bytes",
CASE
WHEN b.status = 'FAILED' THEN
'<span class="highlight">' || b.status || '</span>'
WHEN B.STATUS = 'FAILED' THEN
'<span class="highlight">'
|| B.STATUS
|| '</span>'
ELSE
b.status
END "Status"
B.STATUS
END "Status"
FROM
v$rman_backup_job_details b
V$RMAN_BACKUP_JOB_DETAILS B
WHERE
b.start_time > ( sysdate - 30 )
B.START_TIME > ( SYSDATE - 30 )
AND ROWNUM <= 50
ORDER BY
b.SESSION_KEY desc;
-- b.start_time DESC;
B.SESSION_KEY DESC;
-- b.start_time DESC;