Oracle Weblogic Backup with Bacula
  • Post category:Uncategorized
  • Post comments:0 Comments

Overview

For WebLogic backups, Oracle [1] recommends these backup types.

  • Offline (Oracle Fusion Middleware Environment), immediately after installation and after applying any patches or upgrades. When you perform an offline backup, the Administration Server, all Managed Servers in the Oracle WebLogic Server domain, and all system components in the Oracle instances should be shut down before backing up the files.
  • Online (Oracle Fusion Middleware Environment or Run-Time Artifacts Only), meaning that you do not shut down the environment before backing up the files, so do not make any configuration changes until the backup is completed. To ensure that no changes are made in the Oracle WebLogic Server domain, it is advisable to lock the WebLogic Server configuration as explained later.

Common Directories Definitions

According to Oracle [2] and Figure 1, these are common directories that will be included on the backup, among others.

Oracle Weblogic Backup with Bacula 1

Figure 1. Typical WebLogic Directories

Offline Complete WL Environment Bacula Backup Job

After installing and configuring the Bacula Backup client in the WebLogic server, create a new FileSet with the following directory includes:

/Source_Middleware_Home 

Create new Bacula backup Job (e.g. WebLogicOfflineBackup). This Job can be created with no defined or null schedule, so it can be run only when desired. It may also run before and after Job scripts to stop and start WebLogic services in an automated fashion.

Reload Bacula Director to apply the configurations. Run a test backup and restore Jobs.

Online Complete WL Environment Bacula Backup Job

Install the Bacula Client and Bacula Enterprise Oracle DB Backup Plugin (if available) in all WebLogic hosts.

Create a lock.sh and a unlock.sh script (e.g. /opt/bacula/scripts), so Bacula can lock domain configurations with a ClientRunBeforeJob (lock) script run and a ClientRunAfterJob (unlock configurations), with the example wlst commands [3].

# Obtain a lock on the current configuration (http://sqltech.cl/doc/oas11gR1/web.1111/e13813/reference.htm#WLSTC322)
startEdit([waitTimeInMillis],[timeoutInMillis], [exclusive])

# Release your lock on the configuration (http://sqltech.cl/doc/oas11gR1/web.1111/e13813/reference.htm#WLSTC326)
stopEdit([defaultAnswer])

Create another script for ClientRunBeforeJob execution to create a record of your Oracle Fusion Middleware environment (https://docs.oracle.com/cd/E15523_01/core.1111/e10064/backup.htm#ASTDA405). This information (hostname, domain name, virtual host name, installation type etc.) is necessary when needed to restore and recover your Oracle Fusion Middleware environment. You can dump this information to a /etc (which will be included in bacula backup) text file, or send via email.

On Bacula director configuration, Create a FileSet that includes the Middleware home (MW_HOME), the OraInventory directory, the OraInst.loc and oratab files (etc):

/MW_HOME/
/scratch/oracle/OraInventory
/etc

Remark 1: if the domain is not located within the Middleware home, include the Administration Server domain separately. E.g.:

/MW_HOME/user_projects/domains/domain_name/*

Remark 2: if the Oracle instance home is not located within the Middleware home, back up the Oracle instance home. The Oracle instance home contains configuration information about system components, such as Oracle HTTP Server or Oracle Internet Directory.

/ORACLE_INSTANCE/*

Remark 3: if a Managed Server is not located within the domain, include the Managed Server directory. For example:

/MW_HOME/user_projects/domains/domain_name/servers/server_name/*

In the same FileSet, add a Plugin* configuration with your favorite EBacula Oracle DB Backup plugin method:

Plugin = "oracle: mode=rman"

*If using Community Bacula or if you don’t have the Oracle plugin make sure to configure a rman backup execution and destination copies.

Your final FileSet should be something like that:

FileSet {
  Name = WebLogicOnlineConfigurations
  Include {
    Options {
      Signature = MD5
    }
  Plugin = "oracle: mode=rman"
  File = /MW_HOME/
  File = /scratch/oracle/OraInventory
  File = /etc
  }
}

Configure a Bacula Backup job with all the ClientRun script execution directives and with the created FileSet. Provide the desired schedule. Reload Bacula Director to apply changes.

Run an ad hoc backup and restore Job for test purposes.

Windows Considerations

Besides all the prior recommendations, create another ClientRunvefore Job script to export the following Registry Keys:

HKEY_LOCAL_MACHINESoftwareoracle
HKEY_LOCAL_MACHINESystemCurrentControlSetServices

To export a key, use the following command:

regedit /E C:oracleregistry.reg HKEY_LOCAL_MACHINESoftwareoracle
regedit /E C:oracleregistry.reg HKEY_LOCAL_MACHINESystemCurrentControlSetServices

Make sure to back up the script generated Registry export file.

Online Run-Time Artifacts Only Bacula Backup Job

Install Bacula Clients, Oracle Plugin and create (if you did not) the same domain configurations lock/unlock and record generation scripts created in the prior topic to avoid inconsistency.

Create a Bacula FileSet such as:

FileSet {
  Name = WebLogicOnlineConfigurations
  Include {
    Options {
      Signature = MD5
    }
  Plugin = oracle: "mode=rman"
  File = /MW_HOME/user_projects/domains/domain_name/*
  File = /ORACLE_INSTANCE/*
  }
}

Configure a Bacula Backup Job with all the ClientRun script execution directives and with the created FileSet. Provide the desired schedule. Reload Bacula Director to apply changes.

Run an ad hoc backup and restore Job for test purposes.

Restore

Refer to the official Oracle Disaster Recovery documentation available in https://docs.oracle.com/cd/E15523_01/core.1111/e10064/backup.htm#ASTDA394.

Use Bacula to restore the required folders and database.

References

  1. https://docs.oracle.com/cd/E15523_01/core.1111/e10064/backup.htm#ASTDA193
  2. https://docs.oracle.com/cd/E17904_01/install.1111/b32474/concepts.htm#ASINS264
  3. http://sqltech.cl/doc/oas11gR1/web.1111/e13715/config_wls.htm

Disponível em: enEnglish

Leave a Reply