How to backup Oracle Enterprise Manager 12c Grid

As the monitoring and management framework for your ecosystem, an important part of your high availability strategy is to ensure Enterprise Manager is regularly backed up so that it can be restored in the event of failure.

Let's see how we can backup our Oracle Enterprise Manager 12c.

This is a required task for your environment if your OEM is part of your production system. Bellow is the list of targets needed for you to backup in order to have a complete restore in case of a complete disaster.

  • 1-Oracle Inventory
  • 2-Middle-ware Home and EM domain
  • 3-Management Repository Database
  • 4-Instance Home where OMS is installed
  • 5-Default Management Agent with OMS
  • 6-Software Library
  • 1-Oracle Inventory
  • You have to backup your Oracle Inventory for all your "Homes", and i mean your : -database home -OMS home -AGENT home.

  • 1.1 Backup the Database Oracle Inventory
  • You need to use the opatch tool to find the location of your oracle Inventory

    [oracle@DCG023 OPatch]$ ./opatch lsinventory
    Oracle Interim Patch Installer version 11.2.0.3.4
    Copyright (c) 2012, Oracle Corporation.  All rights reserved.
    
    
    Oracle Home       : /u00/product/11.2.0/dbhome_1
    Central Inventory : /u00/oraInventory
       from           : /u00/product/11.2.0/dbhome_1/oraInst.loc
    OPatch version    : 11.2.0.3.4
    OUI version       : 11.2.0.1.0
    Log file location : /u00/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2014-02-10_19-32-56PM_1.log
    
    Lsinventory Output file location : /u00/product/11.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2014-02-10_19-32-56PM.txt
     
  • 1.2 Backup the OMS Oracle Inventory
  • find it's location first; normally i keep them on the same location as the database inventory.

      [oracle@DCG023 scripts]$ locate oraInst.loc| grep oms
    /u00/oms12.0.3/oms/oraInst.loc
    
     [oracle@DCG023 scripts]$ cat /u00/oms12.0.3/oms/oraInst.loc
    inventory_loc=/u00/oraInventory
    inst_group=oinstall
    
    
     
  • 1.3 Backup the AGENT Oracle Inventory
  •  [oracle@DCG023 bin]$ locate oraInst.loc| grep agent
    /u00/agent12.0.3/core/12.1.0.3.0/oraInst.loc
    
    [oracle@DCG023 bin]$ cat /u00/agent12.0.3/core/12.1.0.3.0/oraInst.loc
    inventory_loc=/u00/oraInventory
    inst_group=oinstall
    
    
     

    Once found make a tar ball out of it :

    So as i said i keep them on the same location if repository is on the same host as OMS.

     [oracle@DCG023 u00]$ tar -cvzf GRID_Inventory.tar.gz oraInventory
    oraInventory/
    oraInventory/logs/
    oraInventory/logs/DetachHome2013-08-20_01-03-01PM.log
    oraInventory/logs/DetachHome2013-08-20_12-54-20PM.log
    ..............
    ..............
    
     -rw-r--r--  1 oracle oinstall 12415863 Feb 11 12:47 GRID_Inventory.tar.gz
    
     

    So finished backing up our Inventory.

  • 2- Middle-ware Home and EM domain - take a snapshot of your OMS(Oracle Management Service) use the syntax bellow:
  •  <oms_HOME>/bin/emctl exportconfig oms [-sysman_pwd <sysman password>]
    [-dir <backup dir>] Specify directory to store backup file
    [-keep_host] Specify this parameter if the OMS was installed
     using a virtual hostname (using ORACLE_HOSTNAME=<virtual_hostname>)
     

    Running exportconfig captures a snapshot of the OMS at a given point in time, thus allowing you to back up the most recent OMS configuration on a regular basis. exportconfig should always be run on the OMS running the WebLogic Admin Server. If required, the most recent snapshot can then be restored on a fresh OMS installation on the same or different host.

  • Running the backup command of your OMS(Oracle Management Service)
  • [oracle@DCG023 bin]$ ./emctl exportconfig oms -sysman_pwd secret_password -dir /u01/backup/OMS
    
    Oracle Enterprise Manager Cloud Control 12c Release 3
    Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.
    ExportConfig started...
    Machine is Admin Server host. Performing Admin Server backup...
    Exporting emoms properties...
    Exporting secure properties...
    
    Export has determined that the OMS is not fronted
    by an SLB. The local hostname was NOT exported.
    The exported data can be imported on any host but
    resecure of all agents will be required. Please
    see the EM Advanced Configuration Guide for more
    details.
    
    Exporting configuration for pluggable modules...
    Preparing archive file...
    Backup has been written to file: /u01/backup/OMS/opf_ADMIN_20140210_123417.bka
    
    The export file contains sensitive data.
     You must keep it secure.
    
    ExportConfig completed successfully!
    
    
     
  • 3-Management Repository Database
  • Take a backup of your database using RMAN tool.

     RMAN> BACKUP AS BACKUPSET DATABASE PLUS ARCHIVELOG;
    
     
  • 4-Instance Home where OMS is installed
  • Create a tar ball of your Oracle Home

     [oracle@DCG023 u00]$ echo $ORACLE_HOME
     /u00/product/11.2.0/dbhome_1
    
     [oracle@DCG023 u00]$tar -cvfz OHBAK.tar.gz /u00/product/11.2.0/dbhome_1
    
     
  • 5-Default Management Agent with OMS
  •  --OMS home backup
     [oracle@DCG023 u00]$tar -cvfz OMS.tar.gz /u00/oms12.0.3/oms/bin
     --AGENT home backup
     [oracle@DCG023 u00]$tar -cvfz AGENT.tar.gz /u00/agent12.0.3/core/12.1.0.3.0/bin
     
  • 6-Software Library
  • The software library is a centralized media storage for Enterprise Manager software entities such as software patches, virtual appliance images, reference gold images, application software, and their associated directive scripts. The software library is an essential part of Enterprise Manager framework and is required by many Enterprise Manager features in order to function properly. The software library storage locations should be backed up periodically using file system backup. Oracle recommends the backup be performed at a frequency of 1 to 24 hours.

    To find the location of your Software Library follow the steps bellow

    Make tar ball out of it !

    tar -cvfz SOFT_LIB.tar.gz /u00/em12.3_lib