Skip Headers
Oracle® Application Server Administrator's Guide
10g Release 3 (10.1.3)
B25209-03
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
 
Next
Next
 

18 Backup Strategy and Procedures

This chapter describes the Oracle Application Server backup strategy and procedures.

It contains the following topics:

18.1 Recommended Backup Strategy

This section describes the recommended backup strategy for Oracle Application Server. Using this strategy ensures that you can perform the recovery procedures described in this book.

The backup strategy is as follows:

The flow chart in Figure 18-1 provides an overview of how to decide which type of backup is appropriate for a given circumstance.

Figure 18-1 Deciding the Type of Backup Needed

Type of Backup Flowchart
Description of "Figure 18-1 Deciding the Type of Backup Needed"

Task 1: Perform a Complete Cold Backup of Your Oracle Application Server Environment

The first backup you perform should be an image backup, which includes all of the files in your environment. You should also create a record of your environment.

  1. Perform a complete Oracle Application Server environment backup.

    This will serve as the baseline for all subsequent instance backups.

    Refer to Section 18.2.3, "Performing a Complete Oracle Application Server Environment Backup".

  2. Create a record of your Oracle Application Server environment.

    In the event you need to reconstruct your environment, you can refer to this record.

    Refer to Section 18.2.1, "Creating a Record of Your Oracle Application Server Configuration".

Task 2: Perform Instance Backups on a Regular Basis

After every administrative change, or, if this is not possible, on a regular basis, perform an instance backup of your Oracle Application Server environment.


See Also:

Appendix E, "Examples of Administrative Changes" to learn more about administrative changes

Refer to Section 18.2.2, "Performing an Oracle Application Server Instance Backup from the Command Line".

Task 3: Perform a New Complete Environment Backup After a Major Change

If you make a major change to your Oracle Application Server environment, you must perform a new image backup of your Oracle Application Server environment. This backup will serve as the basis for subsequent instance backups. You should also update the record of your environment with the new configuration information.

Perform a new image backup after:

To do so:

  1. Update the record of your Oracle Application Server environment.

    Refer to Section 18.2.1, "Creating a Record of Your Oracle Application Server Configuration".

  2. Perform a complete Oracle Application Server environment backup.

    Refer to Section 18.2.3, "Performing a Complete Oracle Application Server Environment Backup".

Task 4: Perform Instance Backups on a Regular Basis (Return to Task 2)

After you establish a new complete Oracle Application Server environment backup, return to Task 2 and continue to perform instance backups on a regular basis.

Additional Tips:

18.2 Backup Procedures

This section describes the backup procedures in detail. To maintain configuration data consistency, you should backup each of your Oracle Application Server instances at the same time. While backing up one Oracle Application Server instance, ensure that no configuration changes are made in any of the other instances.

This section contains the following topics:

18.2.1 Creating a Record of Your Oracle Application Server Configuration

In the event you need to restore and recover your Oracle Application Server environment, it is important to have all the necessary information at your disposal. This is especially true in the event of a hardware loss that requires you to reconstruct all or part of your Oracle Application Server environment on a new disk or host.

You should maintain an up-to-date record of your Oracle Application Server environment that includes the information listed in this section. You should keep this information both in hardcopy and electronic form. The electronic form should be stored on a host or e-mail system that is completely separate from your Oracle Application Server environment.

Your Oracle Application Server hardware and software configuration record should include:

  • The following information for each host in your environment:

    • Hostname

    • Virtual hostname (if any)

    • Domain name

    • IP address

    • Hardware platform

    • Operating system release level and patch information

  • The following information for each Oracle Application Server installation in your environment:

    • Host on which the installation resides

    • User name, userid number, group name, groupid number, environment profile, and type of shell for the operating system user that owns the Oracle home (/etc/passwd and /etc/group entries)

    • Directory structure, mount points, and full path for ORACLE_HOME

    • Amount of disk space used by the installation

    • Port numbers used by the installation


      Note:

      Use opmnctl status -l to determine the ports in use.

18.2.2 Performing an Oracle Application Server Instance Backup from the Command Line

This section describes how to perform various Oracle Application Server instance backups from the command line. An instance-level backup backs up all the required components in an application server instance: configuration files, repositories for mid-tier.

Once you have performed a complete Oracle Application Server environment backup, you should perform subsequent instance-level backups after every administrative change, or, if this is not possible, on a regular basis.

Performing a Cold Backup of an Oracle Application Server Instance

Use the following command to perform a cold backup of an Oracle Application Server instance:

bkp_restore.sh -m backup_instance_cold
bkp_restore.bat -m backup_instance_cold

Performing an Incremental Cold Backup of an Oracle Application Server Instance

Use the following command to perform an incremental cold backup of an Oracle Application Server instance:

bkp_restore.sh -m backup_instance_cold_incr
bkp_restore.bat -m backup_instance_cold_incr

Performing an Online Backup of an Oracle Application Server Instance

Use the following command to perform an online backup of an Oracle Application Server instance:

bkp_restore.sh -m backup_instance_online 
bkp_restore.bat -m backup_instance_online

Performing an Incremental Online Backup of an Oracle Application Server Instance

Use the following command to perform an incremental online backup of an Oracle Application Server instance:

bkp_restore.sh -m backup_instance_online_incr -l level
bkp_restore.bat -m backup_instance_online_incr -l level

18.2.3 Performing a Complete Oracle Application Server Environment Backup

This section describes how to perform a complete Oracle Application Server environment backup. You should backup the node after installation or after an upgrade. Perform the following tasks for each instance on the host:

Configuration Backup of the Node

Run the following command to create a backup of the node configuration:

On UNIX:

bkp_restore.sh -m configure

On Windows:

bkp_restore.bat -m configure

Node Backup Preparation

Run the following command to prepare a node for backup:

On UNIX:

bkp_restore.sh -m node_backup -o prepare

On Windows:

bkp_restore.bat -m node_backup -o prepare

Creating an Image Backup of the Instance

This task creates an archive of an instance that includes the Oracle home, oratab, central inventory, Windows registries and so forth. On UNIX, the command must be run from root. Run the following command to create an image backup of the instance:

On UNIX:

bkp_restore.sh -m node_backup  -o image_backup -P archive path

On Windows:

bkp_restore.bat -m node_backup  -o image_backup -P archive path

After the command completes, the backup is placed in the directory specified in archive path.

18.3 Recovering a Loss of Host Automatically

OracleAS Recovery Manager provides an automated procedure to take a full backup of the instances on one host and restore them to a new host after losing the original operating environment.

Loss of Host Automation (LOHA) automates the tasks necessary for the Oracle Application Server user to migrate Oracle Application Server instances from one host to another. The new host can be a different host running the same operating system or the same host after system re-imaging. LOHA provides a solution for a loss of host when you want to restore the original instances to a new environment without having to reinstall the instances and preserve the application data.

LOHA supports all middle-tier installations, and the new host's name can be the same or different from the original host. For different host names, some manual work is required. LOHA does not support the Toplink standalone install type.

LOHA can move all the Oracle Application Server instances from one host to a new host if the new host does not have any other Oracle Application Server instances already running. You can restore a subset of the instances to the new host if the subset does not have any dependencies on the instances remaining on the old host. You cannot restore instances from multiple hosts to a single host.

LOHA can also be used to recover a corrupted instance on a host without affecting other instances on the same host.

This section contains the following topics:

18.3.1 Preparing to Use Loss of Host Automation

The Loss of Host Automation service is installed as part of OracleAS Recovery Manager. It is installed into the following directory:

On UNIX:

ORACLE_HOME/backup_restore/loha

On Windows:

ORACLE_HOME\backup_restore\loha

To use the Loss of Host Automation service, you must configure OracleAS Recovery Manager as described in Chapter 17, "Oracle Application Server Recovery Manager".

The Loss of Host service has the following prerequisites:

  • The new host must have the same version of operating system and the same level of patches as required by Oracle Application Server.

  • In the config.inp file, the orainst_loc_path field must be changed only if the instance is installed with the -invPtrLoc installer command line option. It must be changed to reflect the nonstandard location of oraInst.loc.

  • For Windows platforms, Windows Support Files (WSF) must be installed. You can obtain WSF from the Oracle Application Server installation cd.

  • For Windows platforms, the Microsoft service utility sc.exe must be installed on both the original host and the new host. According to Microsoft, it is part of the NT ResourceKit. For Windows XP, the utility is part of the installation. For Windows 2000 platforms, it must be installed. Ensure that it is in the execution path.

  • For UNIX platforms, ensure that the ORACLE_HOME environment variable does not have a trailing forward slash (/).

  • On the new host, jar (Windows) or tar (Unix) must be available to unpack the node archive. If your system has its own tar program, use it instead of GNU tar.

  • The user must have administrative privileges on the system such that system or root level tasks can be performed.

  • There should not be any other Oracle products installed on the new host. For example, if there are some Oracle Application Server instances on this new host, they must be shutdown and uninstalled cleanly.

  • The user/group ID on the new host must match that on the original host.

  • Check port usage on the new host. Make sure there are not any processes using the same ports as any of the Oracle Application Server instances you are restoring. If any processes are using the same ports, reconfigure the processes to use different ports before restoring any Oracle Application Server instance.

  • After completing the restore, the same mount point and full path, as the original middle-tier Oracle home, are preserved. Ensure that the Oracle home parent directory is on a file system with enough space to hold the middle-tier installation, and that the directory is owned by the same user and group as on the original host.

18.3.2 Enabling Loss of Host Automation

The following tasks must be performed, for each instance on the original host, to enable the Loss of Host Automation service:

Configuration Backup of the Node

You should backup the node after installation or after an upgrade. Run the following command to create a backup of the node configuration:

On UNIX:

bkp_restore.sh -m configure

On Windows:

bkp_restore.bat -m configure

Node Backup Preparation

During node backup preparation, the Loss of Host Automation service determines the following information about the current host:

  • Operating system

  • Host name

  • IP address

  • User/group ID

  • Install type

  • Central inventory location

  • Oracle home locations

  • Windows registry and all Windows services created for all Oracle homes

The service also creates an instance backup with this operation.

Run the following command to prepare a node for backup:

On UNIX:

bkp_restore.sh -m node_backup -o prepare

On Windows:

bkp_restore.bat -m node_backup -o prepare

Creating an Image Backup of the Original Host

This task creates an archive of an instance that includes the original Oracle home, oratab, central inventory, Windows registries and so forth. On UNIX, the command must be run from root. Run the following command to create an image backup of the original instance:

On UNIX:

bkp_restore.sh -m node_backup  -o image_backup -P archive path

On Windows:

bkp_restore.bat -m node_backup  -o image_backup -P archive path

After the command completes, the backup is placed in the directory specified in archive path.

18.3.3 Restoring a Node on a New Host

The commands in this section restore a node on a new host after a loss of host. Before performing the following steps, ensure that all the prerequisites in Section 18.3.1, "Preparing to Use Loss of Host Automation" are fulfilled.

The following commands must be run in order:

  1. Unpack the backup archive of the old node:

    On UNIX, login as root:

    cd /
    tar -xvpf archive_name
    
    

    On Windows:

    jar -xvf archive_name
    
    
  2. The following command restores Oracle Universal Installer related metadata such as oratab (UNIX), Windows registries, and central inventory on the new host. If multiple instances are to be restored, this operation should be performed only for the first instance. The command must be run as root on UNIX.

    On UNIX:

    bkp_restore.sh -m node_restore -o sys_init
    
    

    On Windows:

    bkp_restore.bat -m node_restore -o sys_init
    
    
  3. The following command registers the instance with oratab and the central inventory; it also sets up daemon start/stop script by running root.sh on UNIX, or, on Windows, it creates Windows services. The command must be run as root on UNIX.

    On UNIX:

    bkp_restore.sh -m node_restore -o inst_register
    
    

    On Windows:

    bkp_restore.bat -m node_restore -o inst_register
    
    
  4. This command reconfigures the instance on the new host. This includes IP changing, config backup restore and so forth, depending on the install type. Prior to running the command, run opmnctl shutdown to ensure that OPMN and Enterprise Manager processes are not using ports required by the reconfigure process. The command must be run as the owner of the instance. The path to the instance backups must be valid.

    On UNIX:

    bkp_restore.sh -m node_restore -o inst_reconfigure -t config_bkp_timestamp
    
    

    On Windows:

    bkp_restore.bat -m node_restore -o inst_reconfigure -t config_bkp_timestamp
    
    

    Without a timestamp argument, this command shows all the available instance backups. For a successful completion of this operation, ensure that all the other required services are running if they do not belong to this instance.

    LOHA will not detect port conflicts on the new host. It is recommended that you do not run other applications using the same TCP ports that are to be used by the restored instance. Any port conflict will cause this operation to fail.

18.3.4 Recovering an Instance on the Same Host

When an instance of Oracle Application Server requires an image restore to correct a problem, you can use LOHA to recover the instance. Perform the following steps to recover the instance:

  1. Completely shutdown the instance.

  2. Perform step 1 of Section 18.3.3, "Restoring a Node on a New Host" to unpack the latest image backup of the instance.

  3. Perform steps 3 and 4 of Section 18.3.3, "Restoring a Node on a New Host" to register and configure the instance.

    If the instance has any dependencies on other instances of Oracle Application Server, the other instances must be running.