9 Perform Backup and Recovery

Oracle Enterprise Manager Ops Center has capabilities that can be used to recover data and resume functions if the Enterprise Controller system fails.

This chapter includes the following sections:

Introduction to Backup and Recovery

Oracle Enterprise Manager Ops Center has several tools that can be used for disaster recovery. These tools let you preserve Oracle Enterprise Manager Ops Center data and functionality if the Enterprise Controller or Proxy Controller systems fail.

The ecadm backup and ecadm restore commands back up and restore the Enterprise Controller. They also back up and restore the colocated Proxy Controller unless otherwise specified. The proxyadm backup and proxyadm restore commands back up and restore remote Proxy Controllers.

The ecadm backup command creates a tar file that contains all of the Oracle Enterprise Manager Ops Center information stored by the Enterprise Controller, including asset data, administration data, job history, and the database password, but not including software and storage library contents. The proxyadm backup command creates a tar file that contains all of the Oracle Enterprise Manager Ops Center information stored by the Proxy Controller, including asset data. You can specify the name and location of the backup file and the log file for each command.

Run the ecadm backup and proxyadm backup commands regularly and save the backup files on a separate system.

If the Enterprise Controller system fails, you can use the ecadm restore command and the backup file to restore the Enterprise Controller to its previous state on the original system or on a new system. The ecadm restore command accepts the name of the backup file as input, and restores the Enterprise Controller to the state it had at the time of the backup.

If you are restoring the Enterprise Controller on a new system, you must verify that the new system is compatible.

  • The new system must have the same architecture and operating system as the old system. It is recommended that the operating system versions be identical, including updates and SRUs.

  • The host name of the new system should be the same as the old system. You can change the host name of the new system, provided the old host name is added as an alias host name in the new system.

  • The IP address of the new system can be different. If the new system has a different IP address, the restore process includes a step to configure any remote Proxy Controllers to use the new Enterprise Controller IP address. The MAC address of the new system can be different.

  • The new system's Enterprise Controller software version must also match those of the backed up system.

For a regular back up and restore procedure, the IP address and the host name of the new system should match that of the old system. For a disaster recovery procedure, the IP address and the host name of the new system can be different than that of the old system.

If a remote Proxy Controller system fails, you can use the proxyadm restore command and the backup file to restore the Proxy Controller. The proxyadm restore command accepts the name of the backup file as input, and restores the Proxy Controller to the state it had at the time of the backup.

Some of the procedures described in this section use the ecadm and proxyadm commands. See Command Line Administration for more information about these commands.

  • On Oracle Solaris systems, these commands are in the /opt/SUNWxvmoc/bin/ directory.

  • On Linux systems, these commands are in the /opt/sun/xvmoc/bin/ directory.

Roles for Backup and Recovery

You require specific roles to perform backup and recovery tasks in Oracle Enterprise Manager Ops Center.

The following table lists the tasks and the role required to complete the task. Contact your administrator if you do not have the necessary role or privilege to complete a task.

Table 9-1 Backup and Recovery Tasks and Roles

Task Role

Backup and Restore an Enterprise Controller

Ops Center Admin

Backup and Restore an Proxy Controller

Ops Center Admin

Actions for Backup and Recovery

You can perform various backup and recovery operations using Oracle Enterprise Manager Ops Center.

Using Oracle Enterprise Manager Ops Center, you can perform the following tasks:

  • Backup an Enterprise Controller

  • Restore an Enterprise Controller

  • Backup an Proxy Controller

  • Restore an Proxy Controller

Location of Backup and Recovery Information in the User Interface

In the Oracle Enterprise Manager Ops Center user interface, you can find information of Backup and Recovery in different locations.

Table 9-2 Location of Backup and Recovery Information in the UI

To See Location

Back up or Restore Enterprise Controller

Command Line

Back up or Restore Proxy Controller

Command Line

Backing Up and Restoring an Enterprise Controller

You can use the ecadm command to back up and restore an Enterprise Controller.

Backing Up an Enterprise Controller

You can create a backup for the Enterprise Controller using the ecadm command with the backup subcommand.

Note:

The ecadm backup command does not back up the /var/opt/sun/xvm/locallib/ local library and /var/opt/sun/xvm/images/os directory.

In addition to running the ecadm backup command, you should back up the /var/opt/sun/xvm/locallib/ local library and /var/opt/sun/xvm/images/os directory and manually archive the files to another server, file-share facility, or a location outside of the /var/opt/sun directory.

By default, the server data is saved in a backup file in the /var/tmp directory with a file name that includes a date and time stamp. You can define the file name and location during the backup, as shown in the example below.

If you are using an embedded database, the backup file includes the product schema from the embedded database. This database schema includes all logical structures and data related to Oracle Enterprise Manager Ops Center. If you are using a customer-managed database, you can back up the database schema using the --remotedb option, or you can use the existing backup and recover processes implemented by your database administrator.

  1. From the command line, log in to the Enterprise Controller system.
  2. Stop the Enterprise Controller by running the ecadm command with the stop subcommand and the -w option.

    For example:

    ecadm stop -w
    
  3. Use the ecadm command with the backup subcommand to back up the Enterprise Controller.

    The following options may be used with the ecadm command:

    • -o|--output <backup file>: Specify the file in which the backup archive is generated. Do not specify a path inside the /opt/*xvm* directories. The default output file is /var/tmp/sat-backup-<date>-<time>.tar.

    • -l|--logfile <logfile>: Save output from command in <logfile>. Log files are stored in the /var/tmp/ directory.

    • -d|--description <description string>: Embed the <description string> as the description of the backup archive.

    • -r|--remotedb: If the Enterprise Controller uses a customer-managed database, export the database schema to a .dmp file in the Oracle Enterprise Manager Ops Center dump directory on the database server. This directory is /var/tmp/ocdumpdir in the examples used in the installation documentation, but any directory can be specified as the dump directory during installation and configuration. The .dmp file lets the restore operation restore the database schema. This option only backs up the Oracle Enterprise Manager Ops Center database schema; other schemas and data are not included.

    • -t|--tag <tag>: Embed <tag> as a single-word tag in the backup archive.

    • -T|--tempdir <dir>: Specify the temporary staging directory location.

    • -v|--verbose: Increase the verbosity level. This option may be repeated.

    For example:

    ecadm backup -o /var/backup/EC-17December.tar
    ecadm: using logFile = /var/opt/sun/xvm/logs/sat-backup-2012-12-17-16:21:12.log
    ecadm: *** PreBackup Phase
    ecadm: *** Backup Phase
    ecadm: *** PostBackup Phase
    ecadm: *** Backup complete
    ecadm: *** Output in /var/backup/EC-12December.tar
    ecadm: *** Log in /var/opt/sun/xvm/logs/sat-backup-2012-12-17-16:21:12.log
    
  4. Copy the backup file to a separate system.
  5. Start the Enterprise Controller by running the ecadm command with the start subcommand and the -w option.

    For example:

    ecadm start -w
    

Restoring an Enterprise Controller

You can use a backup file to restore the state of the Enterprise Controller to the state it had at the time of the backup.

This procedure describes the steps for disaster recovery. It restores the data from the backup file, which is the archive created by the ecadm backup operation. It also defines the procedure to change the host name and the IP address of an Enterprise Controller.

If you are using an embedded database, the restore process restores the product schema from the embedded database. If you are using a customer-managed database, you can use the --remotedb option to restore the product schema on the customer-managed database, or do not use this option to restore the Enterprise Controller without restoring the database.

Note:

Before you restore on a system, you must uninstall any previously existing Enterprise Controllers, Proxy Controllers, and Agent Controllers from the system.
  1. Prepare the Enterprise Controller system.

    • If you are restoring the backup on a new system, then the new system must have the same architecture and operating system as the old system. It is recommended that the operating system versions be identical, including updates and SRUs. The new system's host name and Enterprise Controller software version must also match those of the backed up system. If the host name does not match, add the old host name as an alias to the/etc/hosts file.

    • If you are restoring the backup on the same system, but the software has become corrupt or an upgrade failed, uninstall the Enterprise Controller software.

      Run the install script with the -e and -k options. The -e option uninstalls the Enterprise Controller and co-located Proxy Controller, and the -k option preserves the Oracle Configuration Manager software. For example:

      # cd /var/tmp/OC/xvmoc_full_bundle
      # install -e -k
      
  2. Install the Enterprise Controller to the same version that was running when the backup was made, but do not configure the Enterprise Controller, as the ecadm restore command restores your configuration settings.

    Note:

    If you are using a customer-managed database which is still functioning, the Enterprise Controller installation procedure indicates several steps that you must skip and an additional option that you must use to avoid overwriting your existing database schema.

  3. Run the ecadm command with the restore subcommand and the -i <backup directory location and file name> option.

    The following options may be used with the ecadm command:

    • -i|--input <backup file>: (Required) Specify the location of the backup file.

    • -l|--logfile <logfile>: Save output from command in <logfile>. Log files are stored in the /var/tmp/ directory.

    • -r|--remotedb: If the Enterprise Controller uses a customer-managed database, this option restores the product schema on that database. If you are restoring on a new database system, copy the .dmp file that corresponds with your backup file from the Oracle Enterprise Manager Ops Center dump directory to the new database system and verify that it is owned by the oracle user on the new system.

    • -e|--echa: If the Enterprise Controller is configured in HA mode, this option indicates that the co-located Proxy Controller should not be restored.

    • -d|--tempdir <dir>: Specify the temporary staging directory location.

    • -v|--verbose: Increase verbosity level (may be repeated)

    For example:

    ecadm restore -i /var/backup/EC-17December.tar
    ecadm: using logFile = /var/opt/sun/xvm/logs/sat-restore-2012-12-17-21:37:22.log
    ecadm: *** PreRestore Phase
    ecadm: *** Restore Phase
    ecadm: *** PostRestore Phase
    ecadm: *** Log in /var/opt/sun/xvm/logs/sat-restore-2012-12-17-21:37:22.log
    
  4. For an Enterprise Controller with an enabled co-located Proxy Controller, the restore should restore and start the co-located Proxy Controller. The co-located Proxy Controller starts only if the Proxy Controller was enabled during the backup procedure. Check the co-located Proxy Controller's status using the proxyadm command with the status subcommand. If the Proxy Controller is stopped, restart it using the proxyadm command with the start subcommand and the -w option.

    # proxyadm status
    offline
    # proxyadm start -w
    proxyadm: Starting Proxy Controller with SMF...
    proxyadm: Proxy Controller services have started
    #
    
  5. If you restored the Enterprise Controller on a new system, restart each remote Proxy Controller to use the new Enterprise Controller.

    1. Stop the Proxy Controller using the proxyadm command with the stop subcommand and the -w option. For example:

      # proxyadm stop -w
      
    2. On the remote Proxy Controller, update the /var/opt/sun/xvm/persistence/scn-proxy/connection.properties URL property to point to the IP address of the new Enterprise Controller. Update this URL property through the command line interface using the proxyadm command with the update subcommand and the -s option:

      proxyadm update -s|--satellite-ip <ip>
      
    3. Restart the Proxy Controller using the proxyadm command with the start subcommand and the -w option. For example:

      # proxyadm start -w
      
  6. Restart the co-located Agent Controllers using the agentadm command with the start subcommand and the -w option. For example:

    /opt/SUNWxvmoc/bin/agentadm start -w
    

Note:

After restoring the Enterprise Controller, the asset details might take several minutes to display completely in the user interface.

Note:

During the database schema restore, an import log is created. The name of the import log appears in the Enterprise Controller restore log file with the OC_import<timestamp>.log format. You can check the progress of the database import status using this import log.

Example 9-1 Restoring an Enterprise Controller With an Embedded Database

# /opt/SUNWxvmoc/bin/ecadm restore -v -i /var/tmp/OC/server1/EC-17December.tar -l logfile-restore-15January.log

In this example, the ecadm restore command includes options to set the restore in verbose mode (-v), and to create a restore log (-l) for debugging purposes. The input (-i) option specifies the backup file location.

Example 9-2 Restoring an Enterprise Controller With a Customer-Managed Database

In this example, the ecadm restore command includes the (-r) option to restore the database schema on a customer-managed database. The input (-i) option specifies the backup file location.

# /opt/SUNWxvmoc/bin/ecadm restore -i /var/tmp/OC/server1/EC-17December.tar -r

Example 9-3 Restoring an Enterprise Controller With a Customer-Managed Database Without Restoring the Database Schema

In this example, the ecadm restore command includes options to set the restore in verbose mode (-v), and to create a restore log (-l) for debugging purposes. The input (-i) option specifies the backup file location. The (-r) option is not included.

# /opt/SUNWxvmoc/bin/ecadm restore -v -i /var/tmp/OC/server1/EC-17December.tar -l logfile-restore-15January.log

Backing Up and Restoring a Proxy Controller

You can use the proxyadm command to back up and restore a remote Proxy Controller.

The Proxy Controller backup file includes asset data, but does not include the contents of the /var/opt/sun/xvm/images/os directory. You must back up images stored in this directory separately.

The following topics are covered:

Backing Up a Proxy Controller

You can create a backup for a remote Proxy Controller using the proxyadm command with the backup subcommand.

If you are using a co-located Proxy Controller, it is backed up by the ecadm backup operation, and no additional backup is needed.

By default, the server data is saved in a backup file in the /var/tmp directory with a file name that includes a date and time stamp. You can define the file name and location during the backup, as shown in the example below.

  1. From the command line, log in to the Proxy Controller system.
  2. Use the proxyadm command with the backup subcommand to back up the Proxy Controller.

    The following options may be used with the proxyadm command:

    • -o|--output <backup file>: Specify the file in which the backup archive is generated. Do not specify a path inside the /opt/*xvm* directories. The default output file is /var/tmp/proxy-backup-<date>-<time>.tar.

    • -l|--logfile <logfile>: Save output from command in <logfile>. Log files are stored in the /var/tmp/ directory.

    • -d|--description <description string>: Embed the <description string> as the description of the backup archive.

    • -t|--tag <tag>: Embed <tag> as a single-word tag in the backup archive.

    • -T|--tempdir <dir>: Specify the temporary staging directory location.

    • -v|--verbose: Increase the verbosity level. This option may be repeated.

    For example:

    proxyadm backup -o /var/backup/PC-B_Sept14.tar
    
  3. Copy the backup file to a separate system.

Restoring a Proxy Controller

You can use a backup file to restore the state of a Proxy Controller to the state it had at the time of the backup.

This procedure restores the data from the backup file, which is the archive created by the proxyadm backup operation.

  1. Install the Proxy Controller if it has not been installed.
  2. Upgrade the Proxy Controller to the same version that was running when the backup was made, if it is not already running that version. Perform this upgrade from the command line.
  3. Run the proxyadm command with the restore subcommand and the -i <backup directory location and file name> option.

    The following options may be used with the proxyadm command:

    • -i|--input <backup file>: (Required) Specify the location of the backup file.

    • -l|--logfile <logfile>: Save output from command in <logfile>. Log files are stored in the /var/tmp/ directory.

    • -T|--tempdir <dir>: Specify the temporary staging directory location.

    • -v|--verbose: Increase verbosity level (may be repeated)

    For example:

    proxyadm restore -i /var/backup/PC-B_Sept14.tar
    
  4. Stop the Proxy Controller by running the proxyadm command with the stop subcommand and the -w option.

    For example:

    proxyadm stop -w
    
  5. Start the Proxy Controller by running the proxyadm command with the start subcommand and the -w option.

    For example:

    proxyadm start -w
    

Related Resources for Backup and Recovery

You can view the Oracle Enterprise Manager Ops Center documents for additional information.

For more information, see these Oracle resources: