Backup Ranger KMS Database

You must backup the MySQL, POSTEGRES, and Oracle databases.

POSTGRES
  1. Dump the contents of a database to a file by running the following command. Replace dbname with the name of the database to be backed up:
     pg_dump -U [username for database] rangerkms > rangerkms.sql

    Example

    pg_dump -U rangerkms rangerkms > /root/backups/ranger/db/kms/rangerkms.sql

Oracle

  1. Set path to Oracle home :
    • export ORACLE_HOME=/opt/oracle/product/12.2.0
    • export PATH=${PATH}:${ORACLE_HOME}/bin
    • export ORACLE_SID=orcl12c (db_name)
  2. Backup Ranger admin database:
    exp userid=rangeradmin/rangeradmin owner=rangeradmin log=backups/ranger/db/admin/admin_db_bkp.log file=backups/ranger/db/admin/orcl12c.sql statistics=none
  3. Backup Ranger KMS database:
    exp userid=rangerkms/rangerkms owner=rangerkms log=backups/ranger/db/kms/kms_db_bkp.log 
    file=backups/ranger/db/kms/orcl12c.sql statistics=none