Skip to main content
Druva Documentation

Configure the Phoenix Backup Store and RMAN hosts to backup databases

    

Phoenix Editions: File:/tick.png Business File:/cross.png Enterprise File:/tick.png Elite

Overview

After the Phoenix Backup Store is created, a mount must be created on the Phoenix Backup Store which serves as the location where Oracle Recovery Manager (RMAN) stores the database backups. Phoenix then creates a snapshot of the Oracle RMAN backup on the Phoenix Backup Store and uploads it to the Phoenix Cloud. 

To backup databases, Druva provides scripts that are shipped with the Phoenix Backup Store. Use these scripts to configure the Phoenix Backup Store for backup and restore of Oracle databases. See, Template shell scripts for Linux RMAN hosts and Template batch file and RMAN script for Windows RMAN hosts

The  process includes the following stages:

  1. Create a backup mount on the registered Phoenix Backup Store.  See, Create a mount on the Phoenix Backup Store.
  2. Map the backup mount on the RMAN host. See,
  3. Let RMAN store backups on the mount. See, 

Prerequisite

The Phoenix Backup Store is deployed and activated. For more information, see Deploy and register a Phoenix Backup Store.

Create a mount on the Phoenix Backup Store

  1. Log in to the Phoenix Management Console.
  2. From the top menu, select the Organization where you want to configure the Phoenix Backup Store.
    The Organization page appears. 
  3. On the Organization page, click Protect > Oracle on the top-menu. 
    The Oracle page appears. 
    back_mount.png
  4. On the Oracle page, under the Phoenix Backup Stores tab, select a Phoenix Backup Store and then click Create Backup Mount.
    The Create Backup Mount wizard appears.
  5. In the Assign Administrative Group section of the wizard, select an existing administrative group or create a new one and click Next: Create Backup Mount. You see this section when you create a backup mount for the first time.
  6. In the Backup Mount Details tab of the wizard, provide:
    Field Description
    Backup Mount Name The backup mount name is the RMAN target location. The Backup Mount Name field identifies the Phoenix Backup Store mount where the Oracle RMAN backups are stored.  For example, testmount. Ensure that you enter alphanumeric characters only. 
    Storage The storage is the location on the Phoenix Cloud where the snapshot is stored after the Phoenix Backup Store uploads the snapshot to the Phoenix Cloud. 
    IP Whitelist The list of IP addresses of the Oracle RMAN hosts that can store Oracle RMAN backups on the mount.

    To allow multiple IP addresses, either use a comma or a wildcard. For example, if you enter 192.0.*.*, all the servers with the IP addresses starting 192.0.0.0 through 192.0.255.255 can access the mount. If you want to allow servers with specific IP addresses to access the mount, enter the IP addresses using a comma. For example, you want two servers with IP addresses 192.0.2.0 and 198.51.100.1 to access the mount. To allow access to the mount, enter 192.0.2.0, 198.51.100.1. 

    If no IP address is provided, any system can connect to the Phoenix Backup Store.
    Max Bandwidth

    Bandwidth available to the Phoenix Backup Store to upload the snapshots to the Phoenix Cloud. 

    Note:  If you specify  0, you can utilize the entire available bandwidth.

    After you provide all the details, click Next.
  7. In the Retention tab of the wizard, provide:

    Field  Description
    All Snapshots for <the number of> Days Phoenix retains all the snapshots that are created for the number of days specified in Daily snapshots.
    Weekly revisions for <the number of> Weeks Number of weekly snapshots that Phoenix should retain. Phoenix treats the latest snapshot in the week as the weekly snapshot.
    Monthly revisions for <the number of> Months Number of monthly snapshots that Phoenix should retain. Phoenix treats the latest snapshot in the month as the monthly snapshot.
    Yearly revisions for <the number of> Years Number of yearly snapshots that Phoenix should retain. Phoenix treats the latest snapshot in the year as the yearly snapshot.
    After you provide the retention settings, click Finish.

Phoenix creates a mount on the Phoenix Backup Store, and you can see it listed in the Backup Mounts tab of the Oracle page.

Backup Oracle databases using RMAN hosted on a Linux server

After you create a mount on the Phoenix Backup Store, you have:

  1. To map it to the Linux server that hosts the RMAN. To map the mount to the RMAN host, you need the details of the backup mount which is a shared directory on the Phoenix Backup Store.
  2. Update and run the RMAN scripts provided by Druva that use the Phoenix Backup Store API to backup databases.

Map the mount to the RMAN hosted on a Linux server

In this example, the backup mount on the Phoenix Backup Store is mapped to the /local/testmount folder on the RMAN host. 

  1. Log on to the virtual machine that is set up as the Phoenix Backup Store.
  2. Transfer the following scripts from the Phoenix Backup Store to the server that hosts Oracle Recovery Manager (RMAN). The scripts are stored under the /opt/Druva/Phoenix/PhoenixBackupStore/bin folder on the Phoenix Backup Store.
    • phoenix_get_mount_details.sh:This script provides the details of the backup mount and the Phoenix Backup Store. Use this script to get the location of the backup mount so that you can map it to the RMAN host. 
    • oracle_rman_backup.sh:This script runs the RMAN commands that back up a database, create an Oracle RMAN backup and store it on the backup mount. You can modify this script to provide RMAN parameters that specify the type of backup and information related to backup like filesperset and channels for a backup. 
  3. Run the phoenix_get_mount_details.sh script on the RMAN host with the IP address of the Phoenix Backup Store server and backup mount name as the parameters.

    Run the script as:

    ./phoenix_get_mount_details.sh <Phoenix-Backup-Store-ip-address> <backup-mount-name>
    For example:
    ./phoenix_get_mount_details.sh 192.0.2.1 testmount

    The output of the phoenix_get_mount_details.sh script is the path to the backup mount. You have to map the backup mount to the RMAN host so that when you run a backup job using the RMAN script, the RMAN can store the Oracle RMAN backup on the backup mount.

    Sample output of the RMAN script:

    Remote mountpath is 192.0.2.1:/Phoenix/testmount/oracle_data
    Mount options : retrans:5,timeo:1200, rw, user
    

    If you are using a Real Application Cluster (RAC) setup, the nfs mount should have NOAC option.

  4. Map the backup mount to the RMAN host after you generate its path. For example, if the RMAN host is  also Linux based,
    Run the following command for a standalone host: 
    sudo mount -t nfs <Phoenix-Backup-Store-IP-Address>:<path-to-backup-mount-on-Phoenix-Backup-Store> <path-to-local-folder-on-rman-host-for-mapping>

    For example:

    sudo mount -t nfs 192.0.2.1:/Phoenix/testmount/oracle_data /local/testmount

    Example command for a Real Application Cluster setup

    sudo mount -t -o noac,rw,user nfs 192.0.2.1:/Phoenix/testmount/oracle_data /local/testmount

    For more information on the mount command, see Ubuntu Manpage: mount [External link to Ubuntu Manpages].

  5. Add the folder as an entry to /etc/fstab to ensure that the backup mount stays mapped to the RMAN host if it is restarted.  For example:
    192.0.2.1:/Phoenix/testmount/oracle_data /local/testmount nfs rw,user,timeo=1200,noac
    • 192.0.2.1 is an example IP address of the Phoenix Backup Store.
    • /Phoenix/testmount/oracle_data is an example path to the backup mount on the Phoenix Backup Store.
    • /local/testmount is an example path to a folder on the RMAN host to which the backup mount is mapped. When RMAN writes data to this folder, data is actually written to the backup mount through NFS.
    • rw,user,timeo=1200,noac are applicable mount options. For more information, see Fstab [External link to Ubuntu documentation].
  6. Change the ownership of the mapped folder on the RMAN host. The ownership of the mount on the RMAN host should belong to the oracle/oinstall user.  Run the following command as the root user to change the ownership of the folder:
    sudo chown -R oracle:oinstall <path-to-local-folder-on-rman-host-to-which-backup-mount-is-mapped>

    For example:

    sudo chown -R oracle:oinstall /local/testmount

    or

    sudo chmod -R 777 /local/testmount
  7. After you map the backup mount to the RMAN host, you can backup Oracle databases. 

Run the script on a Linux server

Before you run the script, ensure you have:

  • The IP address of the Phoenix Backup Store that hosts the backup mount
  • The backup mount name

The run-time parameters of the oracle_rman_backup.sh , oracle_rman_data_backup.sh, and oracle_rman_archivelog_backup.sh scripts are: 

  • A folder path that will store the logs that the RMAN generates.
  • IP address of the Phoenix Backup Store that hosts the backup mount.
  • The name of the backup mount.

Procedure

  1. Log on to the virtual machine that is set up as the Phoenix Backup Store.
  2. On the terminal, change directory to the folder in which the script is stored. 
  3. You can choose to back up data files and archived log files in the database simultaneously or separately. Perform one of the following steps:
    • To back up data files and archived log files simultaneously, run the following script as the Oracle user:
      ./oracle_rman_backup.sh <path-to-a-folder-on-rman-host-to-store-rman-logs> <ip-address-of-the-phoenix-backup-store> <name-of-the-backup-mount>
      For example:
      ./oracle_rman_backup.sh /home/test-usr/rman-log-directory 192.0.2.1 testmount
    • To back up data files and the archived log files separately, run the following two scripts as the Oracle user: 
      • To back up data files, run the following script as the Oracle user:
        ./oracle_rman_data_backup.sh <path-to-a-folder-on-rman-host-to-store-rman-logs> <ip-address-of-the-phoenix-backup-store> <name-of-the-backup-mount>
        For example:
        ./oracle_rman_data_backup.sh /home/test-usr/rman-log-directory 192.0.2.1 testmount
      • To back up the archived log files in the database based on the required backup frequency, run the following script as the Oracle user: 
        ./oracle_rman_archivelog_backup.sh <path-to-a-folder-on-rman-host-to-store-rman-logs> <ip-address-of-the-phoenix-backup-store> <name-of-the-backup-mount>
        For example:
        ./oracle_rman_archivelog_backup.sh /home/test-usr/rman-log-directory 192.0.2.1 testmount

        Note: You cannot back up data files and the archived log files separately for the Oracle RAC configuration. 

When the script is run, the RMAN creates an Oracle RMAN backup and stores it on the backup mount of the Phoenix Backup Store. All the logs of the Oracle RMAN backup job are stored in the folder you provide at the time of running the script. 

Note: Phoenix can also back up and restore Oracle instances running on Solaris. Use the following scripts to back up data files and archived logs, separately.

Backup Oracle databases using RMAN hosted on a Windows server

After you create a backup mount on the Phoenix Backup Store, you have to:

  1. To map it to the Windows server that hosts the RMAN. To map the mount to the RMAN host, you need the details of the backup mount which is a shared directory on the Phoenix Backup Store.
  2. Update and run the RMAN script and a template batch file provided by Druva that uses the Phoenix Backup Store API to backup databases.

Map the mount to the RMAN hosted on a Windows server

  1. On the Windows Server, install the Network File System client. 
    • For Windows 2014 and later, run the following command:

      PS C:\> 
      Install-WindowsFeature
      -Name NFS-Client

    • For Windows 2012 and earlier, follow the steps as provided in the Microsoft documentation
       
  2. Enable Direct NFS Client for Oracle. The Direct NFS Client for Oracle optimizes the operations that RMAN performs to store backups on the Phoenix Backup Store mount. For more information, see Enabling Direct NFS Client [External link to Oracle documentation]
  3. Enable write permissions for the anonymous user on the Windows Server. With the write permissions, the anonymous user can write data on the backup mount of the Phoenix Backup Store. 
    To enable write permissions for the anonymous user:
    1. Run regedit to start the Registry Editor. 
    2. In the Registry Editor, navigate to the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Default folder in the left pane. 
    3. Create two DWORD 32-bit values in the folder. The two values create a user and group ID for the anonymous user that can write to the backup mount on the Phoenix Backup Store. To create the values:
      • In the right-pane, right-click and then select New > DWORD 32-bit value. Specify the name as AnonymousGID. Ensure that:
        • The value is either 0 or it matches the GID of the root user on the Phoenix Backup Store
        • Base is decimal
      • In the right-pane, right-click and then select New > DWORD 32-bit value again. Specify the name as AnonymousUID. Ensure that:
        • The value is either 0 or it matches the UID of the root user on the Phoenix Backup Store
        • Base is decimal
    4. Close the Registry Editor and restart the Windows Server. 
  4. Set up the curl utility on the Windows Server. For more information, see How do I set up and use cURL on Windows.

Note:  If you have TLS version 1.2 or higher, install and use the CURL Chocolatey package manager. External link for Chocolatey package manager.

For older version of TLS, you can by pass the execution policy to install the CURL Chocolatey package manager.  Copy and run the complete command:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol  [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient). DownloadString('https://chocolatey.org/install.ps1'))

Run the batch file on a Windows server

For Windows RMAN hosts, Druva provides a template batch file and an RMAN script to backup databases. The files are:

  • oracle_rman_backup.bat: This batch file runs the RMAN script that backs up a database. You can modify this script to provide RMAN parameters that specify the type of backup and information related to backup like filesperset and channels for a backup. 
  • rman_backup_windows.rman: This script runs the backup job on RMAN.

Note: The contents of the files for Windows RMAN hosts are available in this reference article. You can copy the contents of the files and create your own scripts to backup databases.

Before you run the batch file

Ensure you have:

  • The IP address of the Phoenix Backup Store that hosts the backup mount
  • The backup mount name. 
  • Enabled hard mount. Run the following command:
    nfsadmin client localhost config mtype=hard
    For more information, see nfsadmin [External link to Microsoft documentation]

The run-time parameters of the oracle_rman_backup.bat script are: 

  • A folder path that will store the logs that the RMAN generates
  • IP address of the Phoenix Backup Store that hosts the backup mount
  • The name of the backup mount

Procedure

  1. Open the command prompt as admin on the Windows Server. 
  2. Create a directory.
    For example, create PhoenixScripts folder and change it into PhoenixScripts directory.
    Sample command:
    mkdir C:\PhoenixScripts
    cd C:\PhoenixScripts
  3. Create the oracle_rman_backup.bat and rman_backup_windows.rman scripts based on the templates provided. See, Template batch file and RMAN script for Windows RMAN hosts.  
  4. Copy both the scripts to the folder you created.  
  5. Run the batch file. For example:
oracle_rman_backup.bat C:\local\rman-logs-directory 192.0.2.1 testmount