MatrixOne Backup and Recovery Overview
Database backup and recovery are core operations for any database management system and are crucial for ensuring data security and availability. MatrixOne provides flexible and powerful database backup and recovery capabilities to ensure the integrity and continuity of user data. This article provides an overview of the importance of MatrixOne database backup and recovery, backup strategies, and backup methods.
Backup and Recovery Strategies
Database backup and recovery can restore operational status in various disaster recovery scenarios.
Here are backup and recovery methods for different situations:
Operating System Crash:
- With Physical Backup: Restore the entire database state using physical backup after a crash. Restore the backup to normal hardware conditions and apply redo logs to ensure data consistency.
- With Logical Backup: Rebuild the database architecture and data on a new server using logical backup. First, install the database software, execute SQL statements from the logical backup to create tables, indexes, and more, and then import the data.
Power (Detection) Failure:
- With Physical Backup: Recover the database using physical backup after a failure. Restore the backup to normal hardware conditions and apply redo logs for data consistency.
- With Logical Backup: Similarly, rebuild the database on a new server using logical backup.
File System Crash:
- With Physical Backup: Use a physical backup to recover the database, restore the backup to normal hardware conditions, and apply redo logs for data consistency.
- With Logical Backup: After a crash, rebuild the database architecture and data on a new server.
Hardware Issues (e.g., Hard Drive, Motherboard):
- With Physical Backup: Recover the database using physical backup, restoring the backup to new hardware conditions and applying redo logs for data consistency.
- With Logical Backup: Rebuild the database on new hardware using logical backup.
For backup and recovery, consider the following strategies:
Backup Frequency: Determine the frequency of backups, typically divided into full and incremental backups. Full backups consume more storage space and time but offer faster recovery, while incremental backups are more economical.
Backup Storage: Choose a secure backup storage location to ensure backup data is not easily compromised or lost. Typically, use offline storage media or cloud storage for backups.
Backup Retention Period: Determine the retention period for backup data to facilitate historical data retrieval and recovery when needed. Establish data retention policies based on regulations and business requirements.
Regardless of the recovery scenario, follow these principles:
- Consider stopping database operations to prevent data changes.
- Choose an appropriate backup for recovery based on backup type.
- Restore backup files.
- Consider applying corresponding redo logs to ensure data consistency.
- Start the database and perform the necessary testing.
Database Backup Methods
MatrixOne provides multiple backup methods, considering database requirements, performance, resources, and recovery time.
MatrixOne databases offer various backup tools to meet different scenarios and needs:
modump: Used for exporting data and schemas from the database. It generates recoverable SQL scripts for logical backups.
mo-backup: Used for physical backup and recovery.
mo-backupis a tool for physical backup and recovery of MatrixOne enterprise services, helping protect your MatrixOne database and perform reliable recovery operations when needed.
mo-backup is a physical backup and recovery tool for enterprise-level services. Contact your MatrixOne account manager for the tool download path and user guide.
Logical Backup and Recovery
SELECT INTO OUTFILE for Backup
SELECT ... INTO OUTFILE command to export retrieved data in a specific format to a file. The exported file is created by the MatrixOne service and is only available on the MatrixOne server host. Exporting to the client file system is not supported. Ensure that the export directory does not have files with the same name to avoid overwriting new files.
For more information on operational steps and examples, see Export data by SELECT INTO.
modump for Backup
MatrixOne supports logical backup using the
modump tool, which generates SQL statements that can be used to recreate database objects and data.
For more information on operational steps and examples, see Export data by MODUMP.
Using Command-Line Batch Import for Recovery
MatrixOne supports inserting many rows into database tables using the
LOAD DATA command. It also supports importing table structures and data into the entire database using the' SOURCE' command.
For more information, see Bulk Load Overview.