8 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.

The following features and topics are covered in this chapter:

8.1 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 new Enterprise Controller system must have the same operating system and architecture, and must have the same version of Oracle Enterprise Manager Ops Center installed as was used when the backup was made. 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 the new Enterprise Controller system has a new IP address, you must manually update the Proxy Controllers to use the new IP address.

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 Appendix A, "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.

8.2 Backing Up and Restoring an Enterprise Controller

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

8.2.1 Backing Up an Enterprise Controller

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

To Back Up an Enterprise Controller

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. 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.

    • -c|--configdir <dir>: Specify an alternate backup configuration directory.

    • -l|--logfile <logfile>: Save output from command in <logfile>. Log files are stored in the /var/opt/sun/xvm/logs/ 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
    
  3. Copy the backup file to a separate system.

8.2.2 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.

To Restore an Enterprise Controller

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

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 leave this option off to make no changes to the database.

  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 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
      
    • If you are restoring the backup on the same system, and the software is functioning normally, unconfigure the Enterprise Controller.

  2. Install the Enterprise Controller if it has not been installed, 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. Upgrade the Enterprise 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.

  4. 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.

    • -c|--configdir <dir>: Specify an alternate restore configuration directory.

    • -l|--logfile <logfile>: Save output from command in <logfile>. Log files are stored in the /var/opt/sun/xvm/logs/ 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 colocated Proxy Controller should not be restored.

    • -T|--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
    
  5. For an Enterprise Controller with a co-located Proxy Controller, check the 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
    #
    
  6. If you restored the Enterprise Controller on a new system, reconfigure each remote Proxy Controller to use the new Enterprise Controller.

    1. As root, log in to the Proxy Controller.

    2. Unconfigure the Proxy Controller using the proxyadm command with the unconfigure subcommand and the -k option. For example:

      # proxyadm unconfigure -k
      
    3. Reconfigure the Proxy Controller using the proxyadm command with the configure subcommand and the -s <Enterprise Controller hostname>, -u <Enterprise Controller admin user name>, and -p <Enterprise Controller password file name> options. For example:

      # proxyadm configure -s <new hostname> -u root -p <passwordfilename>
      
    4. Restart the Proxy Controller using the proxyadm command with the start subcommand and the -w option. For example:

      # proxyadm start -w
      

Note:

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

Example: Restoring an Enterprise Controller With an Embedded Database

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.

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

Example: 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: 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

8.3 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.

8.3.1 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.

To Back Up a Proxy Controller

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.

    • -c|--configdir <dir>: Specify an alternate backup configuration directory.

    • -l|--logfile <logfile>: Save output from command in <logfile>. Log files are stored in the /var/opt/sun/xvm/logs/ 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.

8.3.2 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.

To Restore a Proxy Controller

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.

    • -c|--configdir <dir>: Specify an alternate restore configuration directory.

    • -l|--logfile <logfile>: Save output from command in <logfile>. Log files are stored in the /var/opt/sun/xvm/logs/ 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