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 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. You can specify the name and location of the backup file and the log file. The ecadm backup command does not back up software and storage library contents. Run the ecadm backup command regularly and save the backup file 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 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.

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 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/images/os directory. This is because the size of some of the OS image files in this directory can be prohibitively large.

In addition to running the ecadm backup command, you should back up the /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.

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. 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 file in the /var/tmp/ocdumpdir directory on the database server. This file lets the restore operation restore the database schema. This option only backs up Oracle Enterprise Manager Ops Center data; other data on the database is not affected.

    • -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 verbosity level (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.3 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 host name and Enterprise Controller software version of the restored system must 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> flag.

    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 from the /var/tmp/ocdumpdir directory that corresponds with your backup file to the new 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
    #
    

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