Disclaimer

Saturday, 23 November 2024

Incremental backup shell script - RMAN

 

Incremental Backup Shell script and RCV file :-

1) rman_incremental_level_0_backup.sh
2) rman_incremental_level_0_OLAPPROD.rcv

Step 1: cat /home/oracle/DBbackup/scripts/rman_incremental_level_0_backup.sh

#!/bin/ksh export ORACLE_HOME=/oracle/19c/product/19.3.0/db export TNS_ADMIN=$ORACLE_HOME/network/admin export ORACLE_SID=OLAPPROD export PATH=$PATH:/$ORACLE_HOME/bin export LIB_PATH=$ORACLE_HOME/lib TS=`date +%d%m%y_%H%M%S` export TS rman target/ catalog RMAN/RMAN@RMANDB @/home/oracle/DBbackup/scripts/rman_incremental_level_0_OLAPPROD.rcv >>/home/oracle/DBbackup/rmanbackup/incremental/rman_level_0_backup$TS.log


Step 2: cat /home/oracle/DBbackup/scripts/rman_incremental_level_0_OLAPPROD.rcv

RUN {
sql "alter database backup controlfile to trace";
allocate channel ch1 device type SBT_TAPE PARMS 'ENV=(TDPO_PROFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
allocate channel ch2 device type SBT_TAPE PARMS 'ENV=(TDPO_PROFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
allocate channel ch3 device type SBT_TAPE PARMS 'ENV=(TDPO_PROFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
allocate channel ch4 device type SBT_TAPE PARMS 'ENV=(TDPO_PROFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
backup INCREMENTAL LEVEL 0
filesperset 5
format 'OLAP_DB_L0_%u_%p_%c'
database;
release channel ch1;
release channel ch2;
release channel ch3;
release channel ch4;
}



$ date

Thu Apr  9 19:18:19 IST 2024


Run the command in background :-

$ nohup sh /home/oracle/DBbackup/scripts/rman_incremental_level_0_backup.sh &


[1]     25494018

$ Sending nohup output to nohup.out.


Crosscheck the your rman job by executing "jobs" command:-


$ jobs

[1] +  Running     nohup sh /home/oracle/DBbackup/scripts/rman_incremental_level_0_backup.sh &











No comments:

Post a Comment

How to recovery PDB when PDB database is dropped in Oracle

  How to recovery PDB when PDB database is dropped :) [oracle@rac01 ~]$ sqlplus '/as sysdba' SQL*Plus: Release 21.0.0.0.0 - Product...