Restoration monitoring means watching several independent signals at once, because no single command tells you the whole story. On SQL Server, the reliable place to start is sys.dm_exec_requests joined with sys.dm_exec_sessions, plus sys.master_files for file-level progress and msdb history for past runs. On PostgreSQL, watch pg_stat_progress_basebackup during a base backup, pg_stat_progress_create_index for the rebuild phase, and the server log for recovery messages. On MySQL, SHOW PROCESSLIST and the error log reveal the active phase. The key condition: figure out whether the database is in a restoring state that blocks access, and track percent-complete from the server's own counters rather than guessing from elapsed time.
First, Understand What You're Actually Monitoring
A restore is not one operation. It's a sequence: reading the backup media, decompressing or decrypting, applying data pages, replaying transaction log records (redo), optionally rolling back uncommitted transactions (undo), then bringing the database online. Each phase produces different observable signals, and a monitor that only checks one of them will mislead you.
There are two broad families of restore to keep straight:
Offline/physical restore. The database file is being written and recovery is applied before the database opens. During this time the database is typically inaccessible. This is the classic SQL Server RESTORE DATABASE ... WITH NORECOVERY/STANDBY pattern or a MySQL/Percona XtraBackup "prepare" step. Online/logical restore. Rows or tables are reloaded through the SQL layer while the target remains partially usable, such as pg_restore into a live schema or a mysqldump replay.
Monitoring differs sharply between the two. For offline restores you're mostly reading progress counters and wait states. For online restores you're watching row counts, locks, replication lag, and the query activity of the restore session itself.
A third category matters for disaster recovery: point-in-time recovery (PITR), where a base backup is restored and then WAL/binlog archives are replayed up to a target timestamp. Here "status" has two meanings: how far the replay has progressed, and whether it will hit the requested target.
Prerequisites Before You Start Watching
You can't monitor what you didn't instrument. Before kicking off the restore:
1: Confirm you have monitoring access. A login with permission to view server state or the relevant dynamic management views. If you're restoring into a fresh instance, the admin account will do; if you're restoring into a shared server, make sure your account can see the restore session's details without altering it. 2: Capture the baseline. Record the target database's expected size, the backup file size, the start time, and the recovery model. Without a baseline, you can't convert "gigabytes restored" into a meaningful percentage. 3: Open a separate connection. Keep one session dedicated to the restore command and another for monitoring. If you monitor from the same connection, you'll block yourself when the restore holds the session. 4: Set your logging. Make sure the server's error log location is known and that you can tail it. Many restore failures announce themselves there first. 5: Know your alerting channel. Decide up front how you'll be notified if progress stalls—a terminal watch, a scripted poll, or an external monitor. This is a stop-the-world operation for the target, and silent stalls are the most common failure mode.
Reading SQL Server Restore Progress
SQL Server exposes restore progress through session-scoped DMVs. The core query joins active requests to sessions and filters for the restore command:
The percent_complete column is the headline figure, but read it with the right mental model: it reports progress for the current file or the current unit of work, not necessarily the whole restore across all files. estimated_completion_time is a rough extrapolation in milliseconds and can jump erratically early on; trust it less than the trend.
For a multi-file restore, join sys.master_files to see per-file activity, and check sys.dm_io_pending_io_requests if you suspect the restore is I/O-bound rather than CPU- or lock-bound. The wait_type column is often more diagnostic than the percentage. A restore waiting on ASYNC_IO_COMPLETION is waiting on disk, which is normal; a restore waiting on a lock held by another session is a problem you can act on.
What success looks like: percent_complete climbs steadily, estimated_completion_time trends down, and wait_type settles into I/O-related waits. When the command finishes, it disappears from sys.dm_exec_requests. What a stall looks like: percent_complete unchanged for a long stretch, wait_time climbing, or blocking_session_id set to something non-zero. In the last case, identify the blocking session before killing anything.
The message trail in msdb is your after-the-fact record. msdb.dbo.restorehistory and msdb.dbo.backupset let you confirm what was restored, from which file, and when. For live status, though, stay on the DMVs; the history tables update as operations complete, not continuously.
Reading PostgreSQL Restore and Recovery Progress
PostgreSQL splits the story. During base backup (the initial copy, often via pg_basebackup or a physical backup tool), pg_stat_progress_basebackup reports the streaming phase, bytes streamed, and the tablespace count. During recovery replay of WAL, the server writes log messages and the pg_stat_recovery_prefetch and related views give a sense of how much WAL is being replayed, if those views are available in your version. For a logical restore via pg_restore, the better signal is pg_stat_progress_create_index for index rebuilds and pg_stat_activity to see the restore session and its wait events.
A practical polling query for pg_restore sessions:
For PITR, the single most important monitor is the log line announcing that recovery has started and the line announcing recovery has completed at the target. Historically PostgreSQL wrote dedicated "redo starts" and "redo done" messages; in more recent versions these are emitted as structured logs, and pg_controldata can confirm the state of a stopped cluster. The point: don't poll a database that's still replaying WAL as if it were online. Recovery is single-threaded for the replay itself in many configurations, so a quiet database during recovery is expected, not a failure.
Success check: the log shows replay advancing and eventually a "database system is ready to accept connections" line after recovery completes, and a SELECT pg_is_in_recovery(); returns f if the server is promoted. Failure check: repeated log errors about missing WAL segments, invalid checkpoint records, or a recovery loop that restarts—those are stop conditions, not tuning opportunities.
Reading MySQL and MariaDB Restoration Progress
MySQL's physical restore tools, such as Percona XtraBackup, run their own progress output—--progress on the command line prints percentage based on data copied and processed. Inside a running server, a logical reload from mysqldump appears as one or more sessions in SHOW PROCESSLIST (or performance_schema.threads and events_statements_current), often in Query state with the source SQL visible. The error log carries the "ready for connections" message and any InnoDB recovery notices.
A useful pattern is to watch InnoDB redo application: after a crash recovery or a physical restore, the server may spend time in "InnoDB: applying a batch of redo log records" before it accepts connections. The error log is authoritative here, because the server isn't yet queryable. Once it is, SHOW ENGINE INNODB STATUS gives the latest recovery status for finished operations.
For logical restores, monitoring means two things at once: is the restore session still alive and moving, and is the target schema growing as expected? Row counts on key tables and the file size in information_schema or the data dictionary give you a lagging but trustworthy confirmation that the import is actually applying data rather than spinning.
Stop condition: if the error log shows "redo log corruption" or repeated apply failures, halt and have a database administrator investigate before attempting a retry that could write to the same files.
Interpreting Progress Percentages Correctly
Percent-complete readings from servers are estimates built on internal counters, and they mislead in predictable ways. A restore that shows 90% complete can sit at 90% for a long time when the final step is replaying a heavy tail of log records or rebuilding indexes—work that wasn't part of the data-copy percentage. That's not a stalled restore; it's a phase change.
Three interpretation rules help:
Treat integer percentages as coarse, not linear in time. A jump from 10% to 80% doesn't mean the remaining 20% takes one-fifth as long. Log replay and index rebuilds often front-load data movement and back-load processing. Watch rate of change, not just the number. Sample every 30 or 60 seconds and compute the delta. A decreasing delta is your early warning. Cross-check against a second signal. File size, transaction log consumption, error log messages, or row counts in a restored table all help confirm progress when the percentage is frozen.
For a worked sanity check: if the backup is 500 GB and progress reports 60% after 90 minutes, a naive extrapolation suggests about 150 minutes total, but only if the remaining 200 GB is copy-bound. If the final phase replays a log-heavy tail, the real finish may be later. Use the estimate for capacity planning, not for committing to a restore-by time.
Watching Storage, Logs, and Waiting on Files
The restore process competes for disk, and the most common silent slowdown is storage saturation. Monitor the target volume's free space and write throughput alongside the database-specific counters. If free space is dropping toward a margin, you have a decision point: pause, expand, or relocate. Do that before the restore fails, not after.
If your database is in full recovery model and this is a restore of a different database, the transaction log of the system or another database won't grow for the restore itself; but if you are restoring with WITH NORECOVERY and continuing to apply log backups, your restore sequence's recovery state matters more than log space on a live database. Still, when restoring into an environment where other databases are active, their log growth can eat the shared volume.
Tail the error log as a first-class monitor. On SQL Server, the error log reports restore completion and the "roll forward"/"roll back" phases; on PostgreSQL and MySQL, recovery messages are the only real-time window while the server is still single-threaded and offline.
Building a Practical Monitoring Loop
A reliable routine beats a dashboard nobody checks. Use this sequence when a restore is in progress:
1: At launch (0–2 minutes): confirm the restore session exists, capture its session ID, start time, and the command text. Note where the server writes logs. 2: Every 30–60 seconds: sample percent-complete, wait type or wait event, and elapsed time. Record them; don't eyeball them. 3: Every 2–5 minutes: check the error log tail and free space on the target volume. A successful restore that fills the disk is still a failed restore. 4: On a suspicious stall: get the blocking session ID (if present), check whether the restore is waiting on a lock or on I/O, and only then decide whether to intervene. Wait-and-see beats an unnecessary kill. 5: On completion: verify with the database-specific success signal—the command vanishes, the log says ready, or pg_is_in_recovery() returns false—and confirm the restored database opens and responds to a trivial query.
Expected result: you know within one polling interval whether the restore is moving and whether it's healthy. The check for success is simply that the last sample shows movement and the log shows the phase transition you expected. If two consecutive samples show no change and the wait type is a lock, you have a cause. If they show no change and the wait type is I/O, you may have a slow disk, not a stall.
Common Failure Modes and Their Signatures
Different problems present differently, and the initial response is usually reversible:
Restore is blocked by another session. Signature: blocking_session_id is non-zero, wait_type is lock-related. Response: identify the blocker, confirm it's safe to interrupt, then act. Don't kill the restore. Media error or CRC failure. Signature: the restore fails with a message naming the backup file. Response: verify the backup's integrity before re-running, and re-fetch the artifact. Log chain gap. Signature: SQL Server reports needing an earlier log backup; PostgreSQL reports a missing WAL segment. Response: locate the missing piece; do not skip recovery targets to force progress. Disk full. Signature: free space trending to zero and can be correlated with the restore's writes. Response: expand or relocate before the write fails. Version or compatibility mismatch. Signature: the restore errors immediately with a version or file-format message. Response: restore into a compatible instance; don't force flags that bypass checks unless you understand the consequences.
The stop condition for professional help is clear: when the log shows corruption of the backup itself, when a recovery target can't be reached without a gap in the archive chain, or when a restore has stalled for an extended period with an unknown wait state on a production server you don't own. At that point a DBA or the database vendor's support should take over, because a wrong retry can overwrite good media or the wrong target.
Tools and Automation That Keep You Honest
Beyond ad-hoc queries, a few dependencies-free approaches scale well:
A small polling script that samples the relevant system view every minute, writes to a log, and exits with a non-zero code on a stall. Keep it read-only and low-frequency. Native or vendor progress output where available: pg_basebackup's progress, pg_restore's verbose mode, XtraBackup's progress, and SQL Server's STATS option, which emits percentage messages at intervals. These are cheap and require no extra infrastructure. Log-based alerting on the recovery-start and recovery-complete marker lines. It's the one signal that works even before the server accepts connections.
Automate the boring checks and keep a human on the phase transitions and the log tail. That division keeps you from missing the moment a restore silently changes character.
FAQ
Does a frozen percentage always mean the restore is broken? No. Index rebuilds and transaction log replay often sit at a fixed percentage for a long stretch. Check the wait type and the log before acting; a lock wait is actionable, a disk I/O wait is not necessarily a fault.
Can I query the database while it's restoring? Usually not during a physical restore—many engines keep the target offline or in a recovery state until replay finishes. With WITH STANDBY in SQL Server or a read-only recovery state, you may be able to read, but writes stay blocked. Confirm the state through the system view, not assumptions.
How often should I sample progress? For restores expected to finish within an hour, every 30 seconds is plenty. For multi-hour restores, every minute or two reduces noise; what matters is that samples are regular enough to compute a rate of change.
What's the single most reliable success signal? The engine's own completion message: the restore command disappears from the active-request view and the log records that the database is ready, or the server reports it is no longer in recovery. Percent-complete alone can finish before the last replay step does.