Database Backups 101: Logical vs Physical Backups | Severalnines (2024)

Databases are important to all businesses, therefore, it is fundamental to have a good backup policy in place and put it into implementation right from the start. Prior to deciding on the database backup method, it is first important to decide on what type of data needs to be backed up and how it might affect the overall uptime of the business.

Thinking this way is a good rule of thumb when drafting a backup strategy to ensure that recovery occurs quickly that the data is secure and, of course, that you minimize the downtime.

Database backups can be categorised as either a physical or logical backup, and in this blog we will explain the differences.

What is a Physical Database Backup?

Physical database backups are a backup of database directories and files (such as data files, data controls and archived logs). The backups should always be stored in a separate, dedicated storage (such as a disk, tape, or in the cloud). This type of backup is useful when you need to restore the complete database within a short period of time. You can have either a full or incremental backup for your physical backup.

A full physical backup will contain a complete set of data files, archived files, and transaction files. This is needed if you want to perform a full database restoration with minimal application errors and data loss.

It’s always advisable to have a full physical backup done on a weekly or monthly basis. It is best to take them in complete downtime, (meaning there are no database interactions) this is to avoid any inconsistent data showing up during the data recovery. Should you only need to have a backup of the recent transactions, then you should perform an incremental physical backup, which does not require any downtime. This type of backup might slow down the database processes, however.

What is a Logical Database Backup?

A Logical Backup contains copies of information about a database (such as tables, schemas, and procedures) and are commonly exported out as binary files using EXPORT/ IMPORT tools. If you need to restore or move a copy of the database to another environment (platform) then, logical backups are a great option.

With the help of an appropriate import tool, the logical data elements (such as tables, schemas, and procedures) in the backup can be restored at a lowest level with all the interdepencies elements on a specific database platform.

The data of a table is also exported using Structure Query Language (SQL) and this is stored in a binary format as well. It does not contain any instance-related information (any location or environment information like a physical backup) and can be restored on any other machines or environments and is not suitable for any OS-level restoration because it only contains the structural level information of a database.

Full logical backups should be done on a weekly basis and it is commonly used as a substitute if the full, physical backup is not available.

Physical Database Backups vs Logical Database Backups

Both types of backups hold copies of the content in a different format. The format plays an important role in the size backup, hence where storage size is of concern, the logical backup can be given a priority and performed at a frequent interval.

For a complete system restoration, physical backups are a good option as it has the complete information at the backup point (hence it requires less restoration time).

If the database is to be restored at a different location or environment, then a logical backup would be the best choice.

Pros & Cons of Physical & Logical Database Backups

With logical backups, you can backup a selected set of data (saves time and storage). This type of backup also allows filters to exclude certain data during the export and is resilient to errors caused by storage media like tapes. If there is a missing link point, the logical backup has the ability to rebuild the structure.

The downside of this type of backup is that it does not have the file system information (making the restoring process tougher).

The primary benefit of a physical backup is it is simple and fast, as it does not care about the format of data. It merely makes a mirror copy and loads it to another device.

The negative side of physical backups is that it is typically only used to recreate the system at restoration and will not be able to do a full restore if there are any missing files. Should this scenario arise, you need to ensure the backup is recreated with the missing files and then proceed to the restore process.

Conclusion

In summary a logical database backup is a copy of the logical information of a database extracted and stored in a binary format. A physical database backup is a copy of the complete database contents , structure, tables and all relevant transactions you need to restore your database.

So which is the best? This really depends on the backup and restoration planning needed to meet the organisational needs. It’s always best to have both types of backups, however, the restoration and retention should clearly specify the frequency method and the data being included in the backup right from the start.

Database Backups 101: Logical vs Physical Backups | Severalnines (2024)

FAQs

Database Backups 101: Logical vs Physical Backups | Severalnines? ›

In summary a logical database backup is a copy of the logical information of a database extracted and stored in a binary format. A physical database backup is a copy of the complete database contents , structure, tables and all relevant transactions you need to restore your database.

What are the 3 types of backups? ›

Types of Backups
  • Full backup: The most basic and comprehensive backup method, where all data is sent to another location.
  • Incremental backup: Backs up all files that have changed since the last backup occurred.
  • Differential backup: Backs up only copies of all files that have changed since the last full backup.

What is the difference between logical dump and physical dump? ›

If a data set is dumped logically, it is restored logically; if it is dumped physically, it is restored physically. A data set restore operation from a full-volume dump is a physical data set restore operation.

What is a physical backup? ›

In its simplest form, physical backup is the movement of all data from one raw device to another; in the context of file system backup the source devices are disks and the destination devices may include disk, CD-Rom, floppy, Zip drives, and of course, tape.

What is the benefit of logical backup? ›

Logical backups have a few benefits: they are portable and can be restored to different platforms or versions of the database software; they allow selective backup or restoration of specific objects or schemas; and they can be used to transfer data between different database systems or formats.

What are the two main types of backups? ›

The most common backup types are a full backup, incremental backup and differential backup. Other backup types include synthetic full backups and mirroring.

What is the rule of 3 backups? ›

The 3-2-1 backup strategy simply states that you should have 3 copies of your data (your production data and 2 backup copies) on two different media (disk and tape) with one copy off-site for disaster recovery.

What is the difference between logical and physical backup? ›

In summary a logical database backup is a copy of the logical information of a database extracted and stored in a binary format. A physical database backup is a copy of the complete database contents , structure, tables and all relevant transactions you need to restore your database.

What is the difference between logical and physical backup in MySQL? ›

Physical backup methods are faster than logical because they involve only file copying without conversion. Output is more compact than for logical backup. Because backup speed and compactness are important for busy, important databases, the MySQL Enterprise Backup product performs physical backups.

What is difference between dump and backup? ›

Dump expects a level value as part of the command. These levels specify the type and order of related full and incremental backups. A level 0 backup is a full backup job, meaning that it backs up the entire file system, regardless of changes.

Is physical backup faster than logical backup? ›

- It is often used for selectively backing up specific tables, schemas, or other logical components. - Logical backups can be slower than physical backups, especially for large databases, due to the need to generate SQL statements or other logical representations of the data.

What is a database backup? ›

A database backup is an exact copy of your database kept in a separate location. Most administrators use database backups to restore lost data in an emergency, such as data loss due to an outage or system failure.

Is RMAN logical or physical? ›

The main difference between RMAN and Data Pump is that RMAN operates on the physical level, while Data Pump operates on the logical level.

What is logical backup and physical backup in Oracle? ›

Ultimately, every physical backup is a copy of files that store database information to another location, whether on disk or on offline storage media such as tape. Logical backups contain logical data such as tables and stored procedures.

What is the difference between logical and physical backup in PostgreSQL? ›

Physical backups capture the database's state at a specific point in time. They involve copying the actual PostgreSQL database data at the file system level. Logical backups involve exporting specific database objects or the entire database into a human-readable SQL file format.

What are the types of backups? ›

There are 3 main types of backup: Full, differential and incremental.

What is hot backup and cold backup? ›

n the context of data backup and recovery, a cold backup is a backup taken while the system or application is not running, whereas a hot backup is a backup taken while the system or application is still running.

Which are the four most common methods of data backup? ›

4 data backup methods
  • USB stick. USB flash drives are basically miniature hard drives that you connect to your computer using a USB port. ...
  • External hard drive. An external hard drive is perfect when used as backup storage media. ...
  • Network attached storage. ...
  • Cloud storage.

Which backup type is fastest? ›

Incremental backups are completed quickly and require fewer resources. Disadvantage: While incremental backups have the fastest backup time, they also boast the slowest data recovery time.

What is the difference between full backup and differential backup? ›

Full backups comprise entire data backup sets, regardless of already existing backups or data change circ*mstances. Differential backups comprise data files that have changed since the most recently completed full backup.

Top Articles
Latest Posts
Article information

Author: Dong Thiel

Last Updated:

Views: 6043

Rating: 4.9 / 5 (79 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Dong Thiel

Birthday: 2001-07-14

Address: 2865 Kasha Unions, West Corrinne, AK 05708-1071

Phone: +3512198379449

Job: Design Planner

Hobby: Graffiti, Foreign language learning, Gambling, Metalworking, Rowing, Sculling, Sewing

Introduction: My name is Dong Thiel, I am a brainy, happy, tasty, lively, splendid, talented, cooperative person who loves writing and wants to share my knowledge and understanding with you.