RMAN backup status
Job details
Name: | RMAN backup status |
Platform: | Oracle |
Category: | Availability |
Description: | Checks the status of RMAN backup from V$RMAN_BACKUP_JOB_DETAILS performance view. |
Long description: | Checks the status of RMAN backup from V$RMAN_BACKUP_JOB_DETAILS performance view. |
Version: | 3.2 |
Default schedule: | 10 6 * * |
Requires engine install: | Yes |
Compatibility tag: | .[type=‘instance’ & databasetype=‘oracle’]/.[hasengine=‘YES’ & (version like ‘10.2%’)] |
Parameters
Name | Default value | Description |
---|---|---|
backup expire time | 24 | Backup expire time. |
return status when backup RUNNING | 1 | Return status value (ALARM – 2, WARNING – 1, or OK – 0) when RMAN backup status value is RUNNING. |
return status when backup FAILED | 2 | Return status value (ALARM – 2, WARNING – 1, or OK – 0) when RMAN backup status value is FAILED. |
Job Summary
- Purpose: The purpose of this job is to monitor the Oracle RMAN backup operations by checking the status, details, and historical data from RMAN backup processes. This includes monitoring for completed, running, and failed backups to ensure that data protection processes are functioning as expected.
- Why: This job is important because it helps in ensuring the availability and reliability of database backups, which are critical for disaster recovery and data integrity. Monitoring these backups allows the identification of issues early, preventing potential data loss and enabling timely corrective actions.
- Manual checking: You can check this manually in the database by issuing these SQL commands:
SELECT * FROM V$RMAN_BACKUP_JOB_DETAILS;
Implementation Details
This monitoring job includes several major components reflected in its implementation:
- Oracle instance selection based on specific versions (like ‘10.2%’) and the presence of an RMAN engine.
- Execution of SQL scripts to manage and store backup job details in a custom table.
- An Oracle function to fetch detailed error text from the RMAN output, useful for diagnosing failed backups.
- A procedure to evaluate the status of backups, which registers different states (completed, running, failed) and records these events with timestamps and performance stats in a database table.
Dependency and Cleanup
The job has dependencies on several database objects:
- A self-dependency on “rman_backup_status”
- Dependency on “f_get_rman_output” for fetching error texts
- Dependency on “backup_job_details” table to store backup logs
On failure, clean-up operations are triggered to ensure there is no residual corrupt data affecting subsequent backups.
Database Report Generation
Backup Reporting:
Title | Description | SQL Query |
---|---|---|
RMAN Backup History | Displays chronological RMAN backup details including status and time taken. | “SELECT start_time as ‘Backup Started’, end_time as ‘Backup Ended’, status, TIME_TAKEN_DISPLAY as ‘Elaps Time’, round(output_bytes/1048576) as ‘Output MB’, round(input_bytes/1048576) as ‘Input MB’ FROM backup_job_details ORDER BY 1 DESC“ |
Backup Size History | Shows the history of backup sizes graphically. | “SELECT start_time as ‘Backup Date’, round(output_bytes/1048576) as ‘Output (MB)’ FROM V$RMAN_BACKUP_JOB_DETAILS ORDER BY 1 ASC“ |
RMAN Backup Pieces | Lists details of individual RMAN backup pieces. | “SELECT completion_time as ‘Backup Ended’, round(elapsed_seconds) as ‘Elapsed Time’, handle, recid, device_type as ‘Device Type’, tag, status FROM V$BACKUP_PIECE WHERE deleted = ‘NO’ ORDER BY completion_time DESC“ |
RMAN Configuration | Displays current configuration settings for RMAN. | “SELECT name, value FROM V$RMAN_CONFIGURATION“ |
These reports serve to provide an in-depth review of backup processes, configuration settings, and historical data to maintain the health and effectiveness of backup systems.