# Preparing Linux to backup Oracle

#### Oracle database backup involves generating a database dump using backup scripts and then backing up the resulting dump file.

***

## Linux preparation process

{% hint style="warning" %}
**Xopero ONE agent** requires the availability of the `rman` and `sqlplus` tools. Before starting, ensure that these tools are installed and accessible.
{% endhint %}

{% stepper %}
{% step %}
Using the **Linux** command line, log in to the account used for backing up your **Oracle** database and execute the following commands:

```bash
echo 'connect target /; quit' | rman
```

```bash
echo 'SELECT INSTANCE_NAME FROM V$INSTANCE;' | sqlplus / as sysdba
```

{% endstep %}

{% step %}
If these tools are unavailable (example below) you need to configure the environment variables.

<figure><img src="https://319733277-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0CBTl43C3OO6ySL1DJ6k%2Fuploads%2FpGP74LLgpZXQJJupCAaa%2Fimage.png?alt=media&#x26;token=45f6451a-6ff2-4d39-949e-5280a7bd9cbb" alt=""><figcaption></figcaption></figure>

1. Edit the `/home//.bash_profile` file and add the following records:

```bash
export ORACLE_SID=<database_ID>
```

```bash
export ORACLE_HOME=database_directory
```

{% hint style="warning" %}
The `database_directory` specifies the location of the **Oracle** database.
{% endhint %}

```bash
export PATH=$ORACLE_HOME/bin:$PATH
```

<figure><img src="https://319733277-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0CBTl43C3OO6ySL1DJ6k%2Fuploads%2FSHvnhIarZ8cwZS1vgqpc%2Fimage.png?alt=media&#x26;token=7afbc266-00fe-4c9b-a4f8-c6bdb166ab1d" alt="" width="563"><figcaption><p><em>Example of correctly configured environment variables.</em></p></figcaption></figure>

2. Now, after logging in again, executing the following commands should complete successfully.

```bash
echo 'connect target /; quit' | rman
```

```bash
echo 'SELECT INSTANCE_NAME FROM V$INSTANCE;' | sqlplus / as sysdba
```

<figure><img src="https://319733277-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0CBTl43C3OO6ySL1DJ6k%2Fuploads%2FpxJXSb5XtDPoowy8YFXM%2Fimage.png?alt=media&#x26;token=579c069f-8202-4c10-b509-1484914897ca" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Once done, your **Linux** system should now be ready to backup an **Oracle** environment.
{% endstep %}
{% endstepper %}
