# Oracle database backup

#### In Xopero ONE, you can back up a variety of databases, including MySQL, Microsoft SQL, PostgreSQL, and Oracle.

***

## General information

The **Oracle** database backup process in **Xopero ONE** consists of two stages:

1. Creating a database dump using backup scripts.
2. Backing up the created dump file.

The first stage is executed through **Xopero ONE** using the [backup scripts](https://helpcenter.xopero.com/xopero-one-en/management/backup-plans/scripts) feature, while the second stage is performed as a standard **file-level backup**.

**Xopero ONE** creates a full database copy using the **RMAN** tool. It does not interfere with other copies performed by **RMAN**, but the backup created by **Xopero ONE** will be visible in **RMAN**.

{% hint style="warning" %}
The backup reflects the database state at the moment the dump creation task finishes, as **Xopero ONE** attaches the archive logs to ensure data consistency.
{% endhint %}

***

## Requirements and limitations

{% hint style="warning" %}
**Xopero ONE** supports **Oracle** database environments starting from version **19c**.
{% endhint %}

{% hint style="danger" %}
**Xopero ONE** supports **Oracle** database backup only on supported **Linux** operating systems.
{% endhint %}

The Oracle database environment must operate in `ARCHIVELOG` mode. For instructions on how to change the database mode, refer to [this article](https://helpcenter.xopero.com/xopero-one-en/backup-and-recovery/workstations-and-servers/database-backup/changing-oracle-database-mode).

***

## Backup configuration

{% hint style="info" %}
If a file-level backup plan has already been created and is running, you can skip directly to **step 6**.
{% endhint %}

{% stepper %}
{% step %}
Log in to [**XMS**](#user-content-fn-1)[^1], go to the **Backup** tab (**Plans** > **Backup**) and click the **+ Add plan** button in the top toolbar.

<figure><img src="https://319733277-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0CBTl43C3OO6ySL1DJ6k%2Fuploads%2Fd0F5f5WhfSR9uvIlOIH6%2Fimage.png?alt=media&#x26;token=25d5ea87-098c-479d-b73f-70fd4e31c0a3" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Select **Devices** from the platforms list.

<figure><img src="https://319733277-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0CBTl43C3OO6ySL1DJ6k%2Fuploads%2F4ZVwNgz1HAtRTmTxa3il%2Fimage.png?alt=media&#x26;token=50f868db-0b47-41cc-8e02-d6649344a33f" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
In the next aside, select **Files & folders** option and choose one or more devices for the plan to apply to (you can also select the plan to include all activated devices).

<figure><img src="https://319733277-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0CBTl43C3OO6ySL1DJ6k%2Fuploads%2Fv9YCWJEaNZrkBElog39m%2Fimage.png?alt=media&#x26;token=08def376-ced7-4bf5-89ee-ff2ef8c32093" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Define the name of the backup plan.
{% endstep %}

{% step %}
Configure your backup plan according to your needs (more information about the backup plan setup can be found in [this article](https://helpcenter.xopero.com/xopero-one-en/backup-and-recovery/workstations-and-servers/file-level-backup)).
{% endstep %}

{% step %}
Go to the **Advanced settings** section and click **Edit** to customize additional options.

<figure><img src="https://319733277-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0CBTl43C3OO6ySL1DJ6k%2Fuploads%2FRyfgoxkvn1BZkxzswOIX%2Fimage.png?alt=media&#x26;token=6a3e613e-5e14-422b-8c24-52905e764352" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Scroll down to the **Backup scripts** section and click the **Pre-task script** toggle to turn it on.

<figure><img src="https://319733277-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0CBTl43C3OO6ySL1DJ6k%2Fuploads%2FZlH6T78heqkgJMjgCtUv%2Fimage.png?alt=media&#x26;token=0e970b7e-069e-4fa9-9c98-67f1200ab2ca" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Select the script dedicated to backing up the **Oracle** database environment.

<figure><img src="https://319733277-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0CBTl43C3OO6ySL1DJ6k%2Fuploads%2FF7m3XYH6kLK0b4YD3ZFG%2Fimage.png?alt=media&#x26;token=c2c99780-f03f-4784-a911-8d732839520c" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Set up the script arguments — it should be entered in the **Script arguments** field as follows:

```
ORACLE_SID;dbuser;temp_directory
```

1. `ORACLE_SID` — the database identifier.
2. `dbuser` — the name of the user with backup privileges (for example, `database_user`). This must be a local **Linux** **OS** user with permissions to back up the **Oracle** environment. Instructions for creating this user are provided in the [Creating a user to back up **Oracle**](#how_to_create_user_to_back_up_the_oracle_environment_-_how_to_requirements_and_permissions) section of this article.
3. `temp_directory` — the directory where the **Oracle** tool will temporarily write backup files. After the backup tasks are complete, these files will be deleted. This directory must also be included in the **Data to protect** section when creating a [file-level backup plan](https://helpcenter.xopero.com/xopero-one-en/backup-and-recovery/workstations-and-servers/file-level-backup).
   {% endstep %}

{% step %}
You can enable the two additional options using the checkboxes:

1. **Wait for the script to continue the task** — the application will wait until the dump is ready.
2. **Fail the task if the script fails** — if the script fails, the system will notify you of the backup error.

<figure><img src="https://319733277-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0CBTl43C3OO6ySL1DJ6k%2Fuploads%2F3l8LsulpuY5ePaUxG7r1%2Fimage.png?alt=media&#x26;token=ac5de632-48fc-4a30-a097-2f3065c0d5eb" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Double-check your settings and click **Save** to close the **Advanced settings** aside.
{% endstep %}

{% step %}
After completing the configuration, click the **Save** button. The protection plan will then automatically begin protecting your devices and databases according to the schedule you defined.

{% hint style="success" %}
You can also click **Save\&Run** button to immediately start the backup process, regardless of schedule.
{% endhint %}
{% endstep %}
{% endstepper %}

***

## Creating a user to back up Oracle <a href="#how_to_create_user_to_back_up_the_oracle_environment_-_how_to_requirements_and_permissions" id="how_to_create_user_to_back_up_the_oracle_environment_-_how_to_requirements_and_permissions"></a>

1. Add a new user (for example, `dbuser`) to the **Linux** operating system by executing the following command:

```bash
sudo useradd dbuser
```

2. Add the user to the `dba` group, which has permission to perform backups:

```bash
sudo usermod -a -G dba dbuser
```

{% hint style="danger" %}
**Oracle** tools may require additional permissions, such as access to the file system — in that case, you may need to add the user to other groups depending on your system configuration.
{% endhint %}

3. Finally, configure the system environment variables by following the instructions in [this article](https://helpcenter.xopero.com/xopero-one-en/backup-and-recovery/workstations-and-servers/database-backup/preparing-linux-to-backup-oracle).

[^1]: Xopero ONE Management Service
