Backup and recovery in MySQL and Oracle Database: the restore as the test

A completed backup proves that a copy exists, not that the service can be recovered. A comparison of MySQL logical export and RMAN in Oracle Database, and the design of a verifiable restore exercise.

A backup that finishes without errors proves that a copy exists, not that the service can be recovered from it. The second claim only holds after an exercise that goes through the required files, the recovery sequence and the confirmation that the application works again.

This article compares MySQL 8.4 logical export with Oracle Database 19c physical backup through RMAN, and proposes a restore exercise with reusable evidence. Installed versions, deployment type and licensed tools should be recorded in the procedure; options from one manual are not carried over to another environment without checking compatibility.

Recovery objectives and scope

Choosing commands comes after two definitions agreed with the business. The recovery point objective (RPO) expresses the tolerable data loss; the recovery time objective (RTO), the maximum acceptable time to restore operations. Both must be translated into measurable conditions for the exercise.

Failure scenarios are not equivalent. Losing a file may require the most recent available state; an accidental deletion committed by the application requires stopping just before the wrong change. A replica that has already received that deletion does not replace a historical copy.

The scope covers business data, accounts, permissions and the configuration the service needs, plus where encryption keys are kept and how to access them during an incident. A restore that depends on an absent person, or on a credential stored only on the lost server, has an unresolved dependency.

MySQL: consistent copy and binary logs

MySQL distinguishes logical backups, which represent structures and data as statements, from physical backups, which copy the database files. A mysqldump export makes recovering a schema easier, but its reload time must be measured with the real volume. The backup types documentation compares the methods and notes that the strategy must include the logs needed to roll forward from a base copy.

For InnoDB tables, the --single-transaction option exports a consistent view within a transaction. The guarantee does not extend to non-transactional engines, and DDL on the exported objects, such as ALTER TABLE or TRUNCATE TABLE, must be avoided during the export. The mysqldump 8.4 reference also documents --quick, which reads rows progressively.

Recovering to a point after the copy requires keeping the binary logs and the corresponding coordinates. The --source-data=2 option writes those coordinates as a comment in the export; combined with --single-transaction, it needs a brief global lock at the start and specific privileges. The impact of that lock and a window without schema changes must be planned before backing up.

It should be verified that the export includes the needed objects, such as routines and events where they exist. Users and privileges are not covered by a single-schema export. With GTID enabled, the procedure must document how its state is handled and which export and import options are compatible with the target.

Oracle Database: physical backup with RMAN

RMAN manages physical backups of Oracle Database and uses its metadata to select the required copies. Recovery consists of two distinct operations: RESTORE retrieves files from backups and RECOVER applies changes up to the required state. The data repair guide explains this difference, which the operating procedure must reflect.

Recovering beyond a copy requires the backups and the redo for the chosen point. In a strategy with online backups, that implies running in ARCHIVELOG mode and retaining the archived redo logs. The official RMAN introduction describes backing up the database and those logs, as well as protecting the control file and the parameter file.

The procedure must state how RMAN metadata is recovered if the source server is lost, where the copies are, what permissions the storage requires and which encryption components are involved. That the pieces are visible from the usual server does not prove the recovery team can read them from the exercise target.

A command template is not a universal recipe. In a multitenant database, it must be decided whether the exercise covers the whole CDB or a single PDB, and a different target requires preparing its paths and configuration. These decisions are resolved before any restore that writes files.

Comparing the methods

The table summarizes the structural differences between the two approaches. It does not say which one will finish first in a given environment; only an exercise on a representative target answers that.

CriterionMySQL with logical exportOracle with RMAN
Base copySQL statements that recreate objects and load the exported data.Physical backups that restore database files.
Roll forwardBinary logs from the copy's coordinates.Redo and backups needed to reach the chosen point.
Full testImport, apply logs according to the objective and verify the application.Restore, recover, open according to the scenario and verify the application.

If MySQL's logical reload does not meet the measured RTO, a physical method should be evaluated, first checking its compatibility and the license terms of the edition. In Oracle, the same check applies to additional compression, encryption or storage options.

Copy validation and isolated restore

In Oracle, the commands below ask RMAN to check the copies selected to restore the database and the archived redo logs. They run in the RMAN client, with the database mounted or open and a connection with appropriate privileges.

RESTORE DATABASE VALIDATE;
RESTORE ARCHIVELOG ALL VALIDATE;

According to Oracle's validation guide, RESTORE ... VALIDATE reads the backups and checks their integrity without writing files. It is useful evidence but does not replace a real restore: restoring, recovering and opening the database on the test target, then verifying application access and the agreed operations.

In MySQL, the export is imported into an isolated instance following the guide to reloading SQL-format backups. If the file includes CREATE DATABASE and USE, that determines how the target schema is selected. The test reviews loaded objects and import errors, and confirms the application connects with its intended permissions.

To reach a later point, only the binary logs for the intended interval are applied, with mysqlbinlog after restoring the full copy, according to the point-in-time recovery guide. The cut-off event must be located and rehearsed, so as not to replay the very operation being undone.

Exercise evidence

The test target must be separated from production connections and automations. Jobs that could send emails, charge payments or publish messages from the recovered database are disabled, and access to the exercise data follows the same restrictions as the source data.

  • Copy and logs used, with verifiable dates and locations.
  • Time measured from the start of the procedure until the application is available for the agreed checks.
  • Records before and after the chosen point verified, together with a controlled read and write operation.
  • Errors, dependencies and manual steps documented, each with an owner for correction.
  • Exercise repeated whenever the backup method or a recovery dependency changes.

The final report compares the objective with what was actually demonstrated. If the procedure needs corrections, it is updated and the affected stage repeated. The evidence must allow another operator to continue the work without reconstructing decisions in the middle of an incident.

Xterra Engine designs and runs restore exercises for MySQL and Oracle Database, and delivers the procedure with its measurement against the agreed RPO and RTO.

///// CONTACT

Facing something similar?

Tell us what you are working on and we will look at it together.

Based in Guatemala City (UTC−6), working with organizations in Central America and the United States during U.S. business hours, in English and Spanish.

CONTACT REQUEST↗

0 / 3000

Your message will be sent to info@xterraengine.com.