DBAtlas · Database operations atlas

Check last backup status / time

Oracle

SELECT session_key, input_type, status,
       start_time, end_time,
       output_bytes_display
FROM v$rman_backup_job_details
ORDER BY start_time DESC
FETCH FIRST 10 ROWS ONLY;

RMAN history can also be viewed with RMAN> LIST BACKUP SUMMARY.

PostgreSQL

-- WAL archiving health (for physical backup/PITR):
SELECT last_archived_wal, last_archived_time,
       failed_count, last_failed_time
FROM pg_stat_archiver;

Logical (pg_dump) backups are not recorded inside the DB; check the logs of the backup tool/job.

MySQL

-- There is no built-in backup record; check the backup tool's log.
-- For the binlog-based PITR window:
SHOW BINARY LOGS;

SHOW BINARY LOGS shows the available binlog files (the PITR window); backup history is in the tool's (Xtrabackup, etc.) log.

SQL Server

SELECT database_name,
       MAX(backup_finish_date) AS last_backup,
       CASE type WHEN 'D' THEN 'Full' WHEN 'I' THEN 'Diff'
                 WHEN 'L' THEN 'Log' END AS backup_type
FROM msdb.dbo.backupset
GROUP BY database_name, type
ORDER BY database_name;

msdb.dbo.backupset records every backup taken by SQL Server.

MongoDB

// There is no built-in backup record. PITR window = oplog duration:
rs.printReplicationInfo()  // oplog first/last event times

The oplog window determines how far back you can do PITR from the replica set; backup history is in the tool's log.

Redis

INFO persistence
# check the rdb_last_save_time (epoch), rdb_last_bgsave_status,
# aof_last_bgrewrite_status lines

rdb_last_save_time gives the time of the last successful RDB save (Unix epoch); rdb_changes_since_last_save shows how many writes are not yet backed up.

Open in DBAtlas →