Thursday, August 1, 2019

RMAN backup status check

This script will be run in the target database(not in the catalog).

Login as sysdba and issue the following script:

This script will report on all currently running RMAN backups like full, incremental & archivelog backups:

Script-1) Below script will give you RMAN backup status along with start and stop timing.

SELECT
    session_key,
    input_type,
    status,
    TO_CHAR(
        start_time,
        'mm/dd/yy hh24:mi'
    ) start_time,
    TO_CHAR(
        end_time,
        'mm/dd/yy hh24:mi'
    ) end_time,
    elapsed_seconds / 3600 hrs
FROM
    v$rman_backup_job_details
ORDER BY start_time DESC;


STEP-2 Below script will give you SID, Total Work, Sofar & % of completion.

SELECT
    sid,
    serial#,
    context,
    sofar,
    totalwork,
    round(
        sofar / totalwork * 100,
        2
    ) "% COMPLETE"
FROM
    v$session_longops
WHERE
        opname LIKE 'RMAN%'
    AND
        opname NOT LIKE '%aggregate%'
    AND
        totalwork != 0
    AND
        sofar <> totalwork;


STEP-3 Below script is used for historical backup status  :

SELECT
    session_key,
    input_type,
    status,
    TO_CHAR(
        start_time,
        'mm-dd-yyyy hh24:mi:ss'
    ) AS rman_bkup_start_time,
    TO_CHAR(
        end_time,
        'mm-dd-yyyy hh24:mi:ss'
    ) AS rman_bkup_end_time,
    elapsed_seconds / 3600 hours
FROM
    v$rman_backup_job_details
ORDER BY start_time desc;

No comments:

Post a Comment