Database backup (DBS) allows you to restore an Oracle database to a different machine, to a different directory of the source machine, or to the same directory of the source machine. This topic describes how to restore an Oracle database.

Prerequisites

Data in the Oracle database is backed up. For more information, see Use DBS to back up an Oracle RAC database and Back up an Oracle instance.

Restoration methods

Restoration method Description Configuration description
Restore data to a different machine Data is restored from the source server to another server. Select the backup gateway of the destination server.
Restore data to a different directory of the source machine Data is restored from the source server to different directory of the source server. Select the backup gateway of the source server and configure a different value for the Destination Directory.
Restore data to the same directory of the source machine Data from the source database is restored to the same directory of the source server. Select the backup gateway of the source server and configure the same value for the Destination Directory. By default, if you do not specify this field, the source directory is used.

Restore a physical backup

This section provides an example on how to restore an Oracle database from a physical backup.

  1. Log on to the DBS console.
  2. In the left-side navigation pane, click Backup Schedules.
  3. On the Backup Schedules page, click Manage in the Actions column corresponding to the ID of the backup schedule based on which you want to create physical backups.
  4. On the Configure Task page, click Restore Database in the upper-right corner.
  5. In the Set Time Restored To step of the Create Restore Task wizard, set the parameters as described in the following table and click Next.
    Section Parameter Description
    N/A Task Name The name of the restoration task. DBS generates a task name. We recommend that you set a descriptive task name that is easy to identify. Task names do not have to be unique.
    Set Time Restored To Time Range Available to Restore The time range available to restore the source database. DBS displays the available 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.
    Configure Destination Database Instance Region The region where the backup gateway of the destination server resides.
    Backup Gateway The backup gateway that is installed to restore data. For more information about how to install a backup gateway, see Add 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 number of the port used to connect to the database that you want to restore. Default value: 1521.
    SID The site identifier (SID) of the database that you want to restore.
    Note You can customize the parameter file in the ORACLE_HOME/dbs directory based on the SID name. If no parameter files exist, DBS automatically creates a minimum available parameter file for you to restore the Oracle database.
    Destination Directory The directory used to restore the database.
    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.
  6. In the Configure Objects to Restore step, set Restore Mode to Restore Entire Instance and click Precheck.
  7. If the Precheck Passed message appears, click Start Task. Wait until the database is restored.
    Note The amount of time used to restore a database depends on the specification of the backup schedule and the size of the database. A higher specification indicates a higher restoration speed. For more information, see Backup and recovery performance tests.
  8. Open the restored database and run the following SQL statement to start the database.
    ALTER database OPEN RESETLOGS;
    Your Oracle database is restored.

Restore a logical backup

This section provides an example on how to restore an Oracle database from a logical backup.

  1. Log on to the DBS console.
  2. In the left-side navigation pane, click Backup Schedules.
  3. On the Backup Schedules page, click Manage in the Actions column corresponding to the ID of the backup schedule based on which you want to create physical backups.
  4. On the Configure Task page, click Restore Database in the upper-right corner.
  5. In the Set Time Restored To step of the Create Restore Task wizard, set the parameters as described in the following table and click Next.
    Section Parameter Description
    N/A Task Name The name of the restoration task. DBS generates a task name. We recommend that you set a descriptive task name that is easy to identify. Task names do not have to be unique.
    Set Time Restored To Time Range Available to Restore The time range available to restore the source instance. DBS displays the available 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.
    Configure Destination Database Database Location The location of the database that you want to back up. Valid values:
    • User-Created Database with Public IP Address <IP Address:Port Number>
    • ECS-Hosted Database
    • Express Connect DB/VPN Gateway/Intelligent Gateway
    • POLARDB Instance
    • No public network IP: Port's self-built database (accessed through the database gateway)
    Database Type The type of the database that you want to restore. Default value: Oracle.
    Instance Region The region where the destination instance to which you want to restore your database resides.

    This parameter is available only when you set Database Location to ECS-Hosted Database, POLARDB Instance, or No public network IP: Port's self-built database (accessed through the database gateway).

    Address The public endpoint used to connect to the database that you want to restore.

    This parameter is available only when you set Database Location to User-Created Database with Public IP Address <IP Address:Port Number>, Express Connect DB/VPN Gateway/Intelligent Gateway, or No public network IP: Port's self-built database (accessed through the database gateway).

    Port Number The number of the port used to connect to the database that you want to restore.

    By default, this parameter is unavailable when you set Database Location to POLARDB Instance.

    ECS Instance ID The ID of the Elastic Compute Service (ECS) instance where the database that you want to back up resides.

    This parameter is available only when you set Database Location to ECS-Hosted Database.

    PolarDB Instance ID The ID of the PolarDB instance that you want to back up.

    This parameter is available only when you set Database Location to POLARDB Instance.

    Peer VPC The VPC where the database that you want to restore resides.

    This parameter is available only when you set Database Location to Express Connect DB/VPN Gateway/Intelligent Gateway.

    Database gateway instance ID The ID of the database gateway.

    This parameter is available only when you set Database Location to No public network IP: Port's self-built database (accessed through the database gateway).

    SID The SID of the database that you want to restore.
    Database Account The username of the account used to connect to the database that you want to restore.
    Password The password of the account used to connect to the database that you want to restore.

    After you enter the username and password of the database account, click Test Connection next to the password to check whether the information of the instance that you want to restore is correct.

    If the specified parameters are valid, the Test Passed message appears. If the Test Failed message appears, click Check next to Test Failed. Modify the information about the database that you want to restore based on the check results.
  6. In the Configure Objects to Restore step, set the parameters as described in the following table and click Precheck.
    Parameter Description
    Conflict Handling Select one of the following methods for Conflict Handling:
    • Fail when Object with the Same Name Exists.
    • Rename Object with the Same Name: If you select this option, DBS renames the new table that is to be created by the restoration task. For example, a table to be restored in the source database and an existing table in the destination database have the same name job_info. The system renames the new table that is restored from the table in the source database in the following format: job_info_dbs_<ID of the restoration task>_</Timestamp>.
    Objects to Restore The database or table that you want to restore. Select the database or table that you want to restore in the Available section and click the right arrow to add it to the Selected section.
  7. If the Precheck Passed message appears, click Start Task.