All Products
Search
Document Center

Data Management:Physically back up and restore an Oracle database hosted on a third-party cloud or a self-managed Oracle database

Last Updated:Mar 20, 2025

Data Disaster Recovery supports physical backups of Oracle databases running on the Windows or Linux operating systems. It can back up Oracle databases of various architectures, including single-instance databases, Data Guard physical standby databases, and Real Application Cluster (RAC) databases.

This topic describes how to physically back up an Oracle database. For more information about logical backups, see Logically back up and restore an Oracle database hosted on a third-party cloud or a self-managed Oracle database.

Supported Oracle databases

Single-instance databases, Automatic Storage Management (ASM)-based single-instance databases, Data Guard physical standby databases, and RAC databases can be physically backed up.

Note
  • To ensure that data in an Oracle RAC database is successfully backed up, you must check the following items of the database before you back up data: control files, server parameter files (SPFILEs), data files, archived log files, and redo log files of the database. For more information, see Query the files in an Oracle RAC database.

  • To back up the entire Oracle RAC database, you need to only install a backup gateway on one of the servers on which the Oracle RAC database is deployed and specify the system ID (SID) of the destination Oracle database.

Prerequisites

  • The archive mode is enabled for the Oracle database that you want to back up.

    Enable the archive mode

    Data Disaster Recovery uses the Recovery Manager (RMAN) tool to back up data in Oracle databases. By default, the archive mode of an Oracle database is disabled. You must manually enable the archive mode before you back up data in the database.

    1. Run the as sysdba command to log on to the Oracle database as the system administrator.

    2. Execute the ARCHIVE LOG LIST statement to query the archive status of the database. The following output is returned:

      Database log mode              No Archive Mode  # The archive mode is disabled.
      Automatic archival             Disabled
      Archive destination            USE_DB_RECOVERY_FILE_DEST  
      Oldest online log sequence     1    
      Current log sequence           2  
      Note

      If Archive Mode is returned as the value of the Database log mode parameter, the archive mode is enabled. In this case, you do not need to enable the archive mode again.

    3. If the archive mode is disabled, execute the SHUTDOWN IMMEDIATE statement to shut down the Oracle database. If the Oracle database is in the OPEN state, you cannot enable the archive mode for the Oracle database.

      Warning

      We recommend that you perform this step during off-peak hours.

    4. Execute the STARTUP MOUNT statement. After the statement is executed, the database is in the MOUNT state.

    5. Execute the ALTER DATABASE ARCHIVELOG statement to enable the archive mode.

    6. Execute the ARCHIVE LOG LIST statement again to query the archive status. The following output is returned:

      Databaselog mode             Archive Mode # The archive mode is enabled.
      Automatic archival           Enabled 
      Archive destination          USE_DB_RECOVERY_FILE_DEST 
      Oldest online log sequence 1
      Next log sequence to archive 2
      Currentlog sequence        2
      Note

      The default path for archiving log files of the Oracle database is $ORACLE_BASE/fast_recovery_area. By default, this directory has only 4 GB of space. The directory is also the default path for storing backup files and log files of flashback operations. If the space of the directory becomes insufficient, the database service is interrupted. To ensure sufficient space for files, you can change the size of the directory to a greater value or change the path for archiving log files based on your business requirements.

    7. Execute the ALTER DATABASE OPEN statement to start the Oracle database.

  • The SID of the Oracle database is obtained.

    Obtain the SID of an Oracle database

    • Linux

      Run the following command to obtain the SID of an Oracle database that is running from the system process information:

      ps -ef | grep ora_pmon_ | grep -v grep | awk -F "ora_pmon_" '{print "oracle sid: "$NF }' | grep -v print

      The following output indicates that the Oracle SID is orcl:

      oracle sid: orcl
    • Windows

      Run the following command in the Windows CLI to obtain the SID and service name of an Oracle database:

      sc query type=service | findstr SERVICE_NAME | findstr OracleService

      The following output indicates that the SID of the Oracle database is orcl and the service name is OracleServiceORCL:

      SERVICE_NAME: OracleServiceORCL
  • A backup gateway is added to the server where the Oracle database resides. For more information, see Install a backup gateway.

  • The directory of the database client is obtained.

    Obtain the directory of the database client

    1. Run the su - oracle command in the CLI to switch to the Oracle user.

    2. In the Oracle database, run the echo $ORACLE_HOME command to view the path assigned to the ORACLE_HOME environment variable in the current system.

      The following output indicates that the value of ORACLE_HOME is /opt/oracle/product/19c/dbhome_1:

      /opt/oracle/product/19c/dbhome_1
  • Oracle RAC files are obtained.

    Query Oracle RAC files

    To ensure that data in an Oracle database that uses the Real Application Clusters (RAC) architecture can be backed up, you must check the control files, server parameter files, data files, archived log files, and redo log files of the database before you back up data. If your Oracle database does not use the RAC architecture, the following operations are not required.

    • Query redo log files

      SELECT member FROM v$logfile WHERE type='ONLINE';

      The following figure shows the sample output.Each MEMBER entry starts with a plus sign (+). DBSBAKDAT1DG indicates the name of the ASM-based database that is used to store files for your RAC database.

    • Query archived log files

      SELECT name FROM v$archived_log WHERE DELETED='NO';

      The following figure shows the sample output.Each NAME entry starts with a plus sign (+). DBSBAKDAT1DG indicates the name of the ASM-based database that is used to store files for your RAC database.

    • Query data files

      SELECT name FROM v$datafile;

      The following figure shows the sample output.Each VALUE entry starts with a plus sign (+). DBSBAKDAT1DG indicates the name of the ASM-based database that is used to store files for your RAC database.

    • Query server parameter files

      SHOW parameter spfile;

      The following figure shows the sample output.Each VALUE entry starts with a plus sign (+). DBSBAKDAT1DG indicates the name of the ASM-based database that is used to store files for your RAC database.

    • Query control files

      SHOW parameter control_files;

      The following figure shows the sample output.Each VALUE entry starts with a plus sign (+). DBSBAKDAT1DG indicates the name of the ASM-based database that is used to store files for your RAC database.

Limits

Physical backups of Oracle databases depend on the RMAN tool and control files to manage backup metadata. Therefore, to ensure the reliability of backup and restoration, you must take note of the following items when you use Data Disaster Recovery to physically back up an Oracle database:

  • You cannot configure multiple backup schedules for one Oracle database. Otherwise, restoration exceptions occur.

  • If you restore an Oracle database by point in time, do not delete the latest full backup set before the specified point in time. Otherwise, restoration exceptions occur.

Step 1: Create a backup schedule

For more information, see Create a backup schedule.

Note

When you purchase a backup schedule, set the Data Source Type parameter to Oracle and the Backup Method parameter to Physical Backup.

Step 2: Configure the backup schedule

  1. Log on to the DMS console V5.0.

  2. In the top navigation bar, choose Security and Specifications (DBS) > Data Disaster Recovery (DBS) > Backup Plan.

    Note

    If you use the DMS console in simple mode, move the pointer over the 2023-01-28_15-57-17.png icon in the upper-left corner of the DMS console and choose All Features > Security and Specifications (DBS) > Data Disaster Recovery (DBS) > Backup Plan.

  3. On the Backup Schedules page, find the backup schedule that you want to configure and click Configure Backup Schedule in the Actions column.

  4. In the Configure Backup Source and Destination step of the Configure Backup Schedule wizard, configure the backup source and destination, and click Next in the lower-right corner of the page.

    image.png

    Section

    Parameter

    Description

    N/A

    Schedule Name

    The name of the backup schedule. Data Disaster Recovery automatically generates a backup schedule name. We recommend that you enter a descriptive name that is easy to identify. Backup schedule names do not need to be unique.

    Backup Source Information

    Backup Mode

    The method that is used to back up data. By default, the backup method that you selected when you purchased the backup schedule is used. In this example, Physical Backup is used.

    Instance Region

    The region in which the database that you want to back up is deployed.

    Backup Gateway

    The backup gateway that is installed to back up data. For more information about how to install a backup gateway, see Install a backup gateway.

    Database Type

    The type of the database that you want to back up. Default value: Oracle.

    SID

    The SID of the source Oracle database. For more information, see the Obtain the SID of an Oracle database section of the "Prepare for physical backup of an Oracle database" topic.

    Database

    The SQL*Plus command that is used to connect to the database. The SQL*Plus command is in the following format: <Database username>/<Password>@<Instance name> as sysdba. Example: sys/password@orcl as sysdba.

    Note

    You can also enter / as sysdba. However, if the operating system authentication is disabled for the sysdba user in your database environment, you cannot connect to the database by using the / as sysdba command. In this case, enter the <Database username>/<Password>@<Instance name> as sysdba command.

    Oracle Home

    The program directory of the database that you want to back up. For more information, see Obtain the directory of the database client.

    Note

    This parameter is optional.

    Compliance warranty regarding cross-border data transfers

    Read and agree to the compliance commitment by selecting the check box.

    Backup Destination Information

    Backup Storage Type

    The type of storage that is used to store the backup data. Valid values:

    • DBS Storage (recommended): Backup data is stored in Data Disaster Recovery without the need to create an Object Storage Service (OSS) bucket. You are charged based on the volume of your data that is stored in Data Disaster Recovery. For more information about the billing method, see Storage fees.

    • OSS For User: You must create a bucket in the OSS console in advance. For more information, see Create buckets.

    Note
    • In this example, DBS Storage (recommended) is selected. If you select OSS For User, you must configure the OSS Bucket Name parameter. Only the Standard storage class is supported.

    • If you want to store a large amount of data, we recommend that you purchase subscription storage plans to offset fees. Data Disaster Recovery storage plans are more cost-efficient than the pay-as-you-go billing method.

    Storage Encryption

    Specifies whether to encrypt the backup data. Valid values:

    • Encrypted: recommended. Data Disaster Recovery uses AES-256 to encrypt data.

      The server-side encryption feature is used in OSS. When you upload an object to a bucket for which server-side encryption is enabled, OSS encrypts and stores the object. When you download the encrypted object from OSS, OSS decrypts the object and returns the decrypted object to you. For more information, see Server-side encryption.

    • Non-encrypted: The backup data is not encrypted.

  5. In the Edit Backup Objects step, Back Up Entire Instance is selected by default. Click Next.

    Note

    If you back up an entire database, the permission data and stored procedures are also backed up.

  6. In the Configure Backup Time step, configure the parameters that are described in the following table. Then, click Next in the lower-right corner of the page.

    Parameter

    Description

    Full-scale Backup Frequency

    The frequency of the backup schedule. Valid values: Periodic Backup and Single Backup.

    Full Data Backup Recurrence

    The days of the week on which Data Disaster Recovery runs the backup schedule. You can select one or more days of a week. Select at least one day of the week.

    Start At

    The start time of the backup. We recommend that you specify a point in time during off-peak hours. Example: 01:00.

    Note

    If a previous full data backup is not finished at the start time of the next backup, Data Disaster Recovery skips the next backup.

    Incremental Backup

    Specifies whether to enable incremental backup.

    Note

    Before you enable incremental backup, make sure that the binary logging feature is enabled for the database that you want to back up. By default, the binary logging feature is enabled for an ApsaraDB RDS for MySQL database. If you use a self-managed database, you must manually enable the binary logging feature.

    This parameter is displayed only when you set the Full-scale Backup Frequency parameter to Periodic Backup.

    Maximum Concurrent Threads for Full Data Backup

    The maximum number of concurrent threads that are available for a full backup. You can configure this parameter to adjust the backup speed. For example, you can reduce the number of backup threads to minimize impacts on the database.

    Backup network speed limit

    The limit on the network bandwidth. You can specify the limit based on your business requirements. Default value: 0, which indicates that the network bandwidth is not limited.

    Transaction Log backup interval

    The interval at which incremental backup is performed. Data Disaster Recovery performs incremental backup based on your configurations. If you set the interval to 10 minutes, Data Disaster Recovery performs an incremental backup every 10 minutes.

    Delete Logs upon Backup Success

    Specifies whether to automatically delete the archived log files that are backed up from a self-managed database. Valid values:

    • Enable: Data Disaster Recovery automatically deletes the log files archived prior to the period specified by the archive log save days parameter from a self-managed database after a successful backup. Default value of the archive log save days parameter: 7. If you use the default value of this parameter, Data Disaster Recovery automatically deletes the log files archived seven days ago from a self-managed database after a successful backup.

    • Disable: Data Disaster Recovery does not automatically delete the archived log files that are backed up from a self-managed database.

    Enable compression

    Specifies whether to enable compression during backup. Valid values:

    • Enable: recommended. Data is compressed during backup to reduce storage space.

    • Disable: Data is not compressed during backup.

    Backup set mode

    The method that is used to back up the database. Valid values:

    • Non-intrusive streaming backup: Data Disaster Recovery uses Oracle System Backup to Tape (SBT) to back up data. The backup data is stored as backup sets on a virtual tape before the data is streamed to the cloud. This method requires less storage space and does not have a negative impact on the source database.

    • Sandbox instance mount backup: Data Disaster Recovery uses the RMAN tool to perform image copy backup. Backup data is streamed and sent to Object Storage Service (OSS) by using the Filesystem in Userspace (FUSE) protocol, instead of being stored on disks. After the sandbox feature is enabled, backup data can be mounted within seconds.

      Note

      You must install the FUSE protocol on your server to ensure successful backup tasks.

  7. In the Edit Lifecycle step, configure the lifecycle of full backup data in the Configure Full Data Backup Lifecycle section.

    If you set the Incremental Backup parameter to Enable in Step 6, you must configure the lifecycle of incremental backup data. For more information about the lifecycle rules of backup data, see How do I manage the lifecycle rules of backup sets?

  8. After the preceding configurations are complete, click Precheck in the lower-right corner of the page.

  9. If the Precheck Passed message appears, click Start Task.

    Note
    • If the backup schedule status changes to Running, the backup schedule takes effect.

    • If an exception or error occurs when you start the backup schedule, troubleshoot the exception or error at the earliest opportunity. For more information, see How do I fix errors for an abnormal backup schedule? If your issue persists after you use the solution that is provided in the preceding topic, contact technical support in the Data Disaster Recovery DingTalk group (ID: 35585947).

Data restoration

Data Disaster Recovery allows you to restore an Oracle database to a different server, to a different directory on the source server, or to the original directory on the source server.

  1. Log on to the DMS console V5.0.

  2. In the top navigation bar, choose Security and Specifications (DBS) > Data Disaster Recovery (DBS) > Backup Plan.

    Note

    If you use the DMS console in simple mode, move the pointer over the 2023-01-28_15-57-17.png icon in the upper-left corner of the DMS console and choose All Features > Security and Specifications (DBS) > Data Disaster Recovery (DBS) > Backup Plan.

  3. On the Backup Schedules page, find the backup schedule that you want to manage and click Manage in the Actions column.

  4. On the Configure Task page, click Restore Database in the upper-right corner.

  5. In the Set Time Restored To step, configure the parameters that are described in the following table and click Next.

    Section

    Parameter

    Description

    N/A

    Task Name

    The name of the restore task. Data Disaster Recovery automatically generates a task name. We recommend that you specify a name that can help you identify the task. Task names do not need to be unique.

    Set Time Restored To

    Time Range Available to Restore

    The time range from the point in time when the first full backup set is created to the point in time when the latest full backup set is created. The database can be restored to a point in time within the time range.

    Restore To

    The point in time to which you want to restore the source database. The value must be within the time range that is specified by the Time Range Available to Restore parameter.

    Note
    • If the incremental backup feature is enabled, Data Disaster Recovery allows you to restore the data to a point in time from the completion of the first full backup to the completion of the last incremental backup.

    • If the incremental backup feature is disabled, Data Disaster Recovery allows you to restore the data to a point in time when a full backup is complete.

    Configure Destination Database

    Instance Region

    The region in which the backup gateway of the destination server resides.

    Backup Gateway

    The backup gateway of the destination server. For more information about how to install a backup gateway, see Install a backup gateway.

    Database Type

    The type of the database that you want to restore. Default value: Oracle.

    Address

    The endpoint used to connect to the database that you want to restore. Default value: localhost.

    Port Number

    The port number used to connect to the database that you want to restore. Default value: 1521.

    SID

    The SID of the database that you want to restore.

    Note

    You can customize a parameter file in the ORACLE_HOME/dbs directory based on the SID. If no parameter file exists, Data Disaster Recovery automatically creates a minimum available parameter file for you to restore the Oracle database.

    Destination Directory

    The directory that is used to restore the database.

    Note

    To ensure that you have enough space for restoration, we recommend that you reserve at least 1.3 times the size (in GB) of the source instance or five to six times the size of the Data Disaster Recovery full backup set. Data is compressed when Data Disaster Recovery performs backups.

    You can view the size of the full backup set in the console. Log on to the Data Disaster Recovery console. In the left-side navigation pane, click Backup Schedules. On the Backup Schedules page, find the backup schedule of the source database and click the name of the backup schedule. In the left-side navigation pane, choose Backup Tasks > Full Data. On the page that appears, you can view the size of the full backup set. For more information, see View a backup schedule.

    Database program directory

    The program directory of the database that you want to restore. In this example, set this parameter to the absolute path that is specified by the ORACLE_HOME variable.

    Compliance warranty regarding cross-border data transfers

    Read and agree to the compliance commitment by selecting the check box.

  6. In the Configure Objects to Restore step, set the Restore Mode parameter to Restore Entire Instance and click Precheck in the lower-right corner of the page.

    Note

    To restore an Oracle database from a physical backup, you must restore the entire instance.

  7. After the Precheck Passed message appears in the Precheck dialog box, click Start Task and wait until the database is restored.

    Note

    The amount of time required to restore a database depends on the specifications of the backup schedule and the size of the database. Higher specifications offer a higher restoration speed. For more information, see Performance tests on logical backup and physical backup.

  8. (Optional) Log on to the restored database and execute the following SQL statement to start the database:

    ALTER database OPEN RESETLOGS;

Your Oracle database is restored.

FAQ

Can I back up an Oracle database to different regions at the same time?

The backup feature of Data Disaster Recovery is implemented based on the RMAN tool, and the backup metadata structure of the RMAN tool does not support the format of cross backup. Therefore, you cannot back up data to different regions at the same time.