• Arun Kumar

Automating RMAN Backups via Catalog Scripts

Activity Flow

  • Connect to catalog and create your RMAN run block

  • On target create shell script to call catalog script

Create Catalog Stored Script

create global script db_full_bkp
{
backup database plus archivelog;
}

Execute Stored Scripts


Within RMAN

RUN { EXECUTE SCRIPT db_full_bkp; }

Shell Prompt

$ rman target / catalog rman_rc/rman_rc@rcat script 'db_full_bkp'

Create Script To Run From Corntab

/u02/rman/scripts/PRODDB_CATSCRIPT_rman_bkp.sh

#!/bin/bash
. /home/oracle/.bash_profile
export DATE=$(date +%m%d%y_%H%M%S)
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export ORACLE_SID=proddb
$ORACLE_HOME/bin/rman target / catalog rman_rc/rman_rc@rcat script 'db_full_bkp' log=/u01/rman/logs/${DATE}_proddb_cat_BACKUP.log

give execute permission on backup script file:

chmod 775 /u01/rman/scripts/SID_rman_bkp.sh

Schedule the script in crontab to run at 4pm daily

crontab -e
00 16 * * * /u01/rman/scripts/SID_rman_bkp.sh

Updating Stored Scripts

REPLACE SCRIPT full_bkp
{
BACKUP DATABASE PLUS ARCHIVELOG;
}


Stored Scripts Administration


Deleting Stored Scripts:

DELETE SCRIPT full_bkp;

Display Stored Scripts:

LIST SCRIPT NAMES;
LIST GLOBAL SCRIPT NAMES;
LIST ALL SCRIPT NAMES;
PRINT SCRIPT full_bkp;


Recent Posts

See All

MySQL Installation on Linux

This article demonstrates MySQL installation on Oracle Enterprise Linux 6.5 version. Installation of MySQL Make sure you are able to connect internet via virtual machine. Try to ping google.com and pr

Add ISO image storage repository on XenServer

If you have used VMware ESXI, its very easy to upload ISO files to the data store and create VMs. With XenServer, you must create your own ISO repository to upload ISO files. Create ISO directory Acce

Perform Manual Switchover on Physical Standby

Connect to proddb database via client: Take a new putty session and connect to proddb database via client machine. Keep querying below sqlplus sys/sys@proddb as sysdba SQL> select name, open_mode, db

  • Facebook
  • Twitter
  • YouTube
  • Instagram

© 2020 by DBA Genesis

Feedback