• No results found

Restoring an Instance Using the mrec Utility

For an Oracle Database Cloud - Database as a Service instance hosting a single- instance database, you can use the Media Recovery (mrec) utility to restore the service

instance if cannot be restored using the orec command or RMAN. This situation

could occur if you've deleted critical configuration files or data files (such as the database redo log files, for example), or if something else has happened that caused the instance to be lost.

The mrec utility restores the instance to the point of the last backup. This is equivalent

to restoring the database and configuration from a tape device external to the instance. The mrec utility should be considered a last resource and used only when an instance

cannot be restored in any other way.

Before You Begin

To restore an instance using the mrec utility, the following conditions must be met:

• The instance that you want to restore (referred to as the original instance) must have been created using the Oracle Database Cloud Service service level, not the Oracle Database Cloud Service - Virtual Image service level.

• A backup of the original instance, including configuration files, must exist in cloud storage. The instance will be restored up to the latest backup available in cloud storage (data files and configuration files). If such a backup doesn’t exist, you can't use mrec to restore the instance.

You must also know the following:

• The settings used to create the original instance.

• The credentials and URL of the Oracle Storage Cloud Service instance to which the original instance is backed up.

• The database system identifier (SID) associated with the original instance.

Procedure

To restore an instance using mrec:

1. Use the Create Database Cloud Service Instance wizard to create a new instance.

See Creating a Database as a Service Instance.

The backup of the original instance will be restored to this new instance. Make sure you specify the following:

• The Oracle Database Cloud Service service level.

• The same Oracle Database version and software edition as the original instance. • On the Service Details page, the same settings as the original instance. At a

minimum, the compute shape, storage capacity, and backup and recovery configuration settings must be identical to those of the original instance. If the compute node associated with the original instance still exists, a different instance name can be used.

2. Connect as the opc user to the compute node associated with the newly created

service instance.

For detailed instructions, see Connecting to a Compute Node Through Secure Shell (SSH).

3. Start a root-user command shell: $ sudo -s

#

4. Prepare the new compute node so mrec can be used (the compute node must have

minimal configuration):

a. Run the deinstall script to remove everything in the attached storage volumes: # /home/oracle/deinstall.pl

b. Run the ocde script to execute the prep or sda assistant and configure the

compute node with the requirements for mrec:

# /var/opt/oracle/ocde/ocde -alist='prep sda'

This configuration will take some time. When it's done, the compute node is ready for mrec.

5. Create a new oss.cfg configuration file with the exact same parameters and

values as those in the oss.cfg file of the original instance:

a. Connect to the original instance as opc user and start a root-user command

shell.

b. Locate the oss.cfg file and view its contents. For example:

# cd /home/oracle/bkup # cat oss.cfg

Copy the parameters in the file. The same parameters and values must be used in the oss.cfg file for the new instance.

If you can’t access the oss.cfg file for the original instance, these are the

parameters you’ll need to specify:

oss_tid=storage-service-identity-domain oss_sname=storage-service-name

oss_user=storage-service-admin-user-name oss_passwd=storage-service-admin-user-password oss_url=storage-service-container-URL oss_auth_url=storage-service-authentication-URL For example: oss_tid=usoracle04791 oss_sname=dbaasoss oss_user=admin-user-name oss_passwd=admin-user-password oss_url="https://storage.us2.oraclecloud.com/v1/dbaasoss-usoracle04791/ mycontainer" oss_auth_url="https://storage.us2.oraclecloud.com/auth/v1.0" c. Switch back to your connection to the new instance.

d. Create an oss.cfg file that contains the parameters used in the oss.cfg file of

the original instance:

# cd /var/opt/oracle/mrec # vim oss.cfg

e. Change ownership of the new oss.cfg file from the root user to the oracle

user. Also change permissions:

# chown oracle:oinstall oss.cfg # chmod 0600 oss.cfg

6. While still in the root-user command shell connection to the new instance, run the

mrec utility:

# cd /var/opt/oracle/mrec # ./mrec -oss_cfgfile ./oss.cfg

-old_hostname hostname-of-node-to-restore -sid SID-of-instance-to-restore

where:

hostname-of-node-to-restore is the simple name of the compute node to

restore (doesn't need to be fully qualified). For example, prod01.

SID-of-instance-to-restore is the database system identifier (SID) of the

database instance to restore. For example, orcl.

The mrec utility pulls files over from the original instance, installs the module used

for cloud backups, and attempts recovery. Information about progress and status is displayed in the terminal window as the utility runs. If recovery is successful, you’ll see a message indicating that the instance has been recovered and is in an open state. The amount of time this takes depends on the size of the instance that you’re recovering.

Restoring from a Backup on Service Instances Hosting Oracle RAC