RMAN CONFIGURATION
==================
RMAN> show all;
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name JTCPROD are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE 2 G;
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE;
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/JTCPROD/ora_prod/11204/dbs/snapcf_JTCPROD.f'; # default
CRON JOB FOR RMAN BACKUP
=======================
[oraprod@proddb122 ~]$ crontab -l
00 02 * * * /u01/JTCPROD/ora_prod/scripts/rmanbackup_full.sh >> /u01/JTCPROD/ora_prod/scripts/rmanbackup_full.log
( to edit $crontab -e , the above cron job will run daily at 2:00 am)
SCRIPT for level 0 full backup including archive and controlfile
============================================================
[oraprod@proddb122 ~]$ vi /u01/JTCPROD/ora_prod/scripts/rmanbackup_full.sh
#!/bin/bash
ORACLE_HOME=/u01/JTCPROD/ora_prod/11204; export ORACLE_HOME
ORACLE_SID=JTCPROD; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
/u01/JTCPROD/ora_prod/11204/bin/rman target / @'/u01/JTCPROD/ora_prod/scripts/rmanscript.sh'
[oraprod@proddb122 ~]$ vi /u01/JTCPROD/ora_prod/scripts/rmanscript.sh
run
{
backup incremental level 0 database format '/u01/BACKUP/RMANBKP/%d_DB_%T_%u_s%s_p%p';
sql 'alter system archive log current';
backup archivelog all format '/u01/BACKUP/RMANBKP/%d_ARCH_%T_%u_s%s_p%p';
backup current controlfile format '/u01/BACKUP/RMANBKP/control_%t.bak';
Compress the RMAN Backup and delete the obsolete backup and schedule it using cron job
=================================================================
[root@proddb122 TARRMANBKP]# crontab -l
30 02 * * * /u01/JTCPROD/ora_prod/scripts/tarbkp.sh >> /u01/JTCPROD/ora_prod/scripts/tarbkp.log
[root@proddb122 TARRMANBKP]# vi /u01/JTCPROD/ora_prod/scripts/tarbkp.sh
#Compress of backup files ###
echo "Timestamp : `date` :Backedup Database files compression in process ..."
tar -czvf /u01/BACKUP/RMANBKP/JTCPROD_Backup_`date +%d%m%Y`.tgz /u01/BACKUP/RMANBKP/*
echo "Timestamp : `date` :Backedup Database files compression completed successfully..."
echo "Timestamp : `date` :Copying tar file in process ..."
cp -r /u01/BACKUP/RMANBKP/*.tgz /u01/BACKUP/TARRMANBKP # copying backup files from backup location to other directory
echo "Timestamp : `date` :Successfully copied tar files"
Removing tar and backup files to release space #######
echo "Timestamp : `date` :removing files from backup location in process ..."
rm -rf /u01/BACKUP/RMANBKP/*
echo "Timestamp : `date` :Successfully removed files from backup location"
~
==================
RMAN> show all;
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name JTCPROD are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE 2 G;
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE;
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/JTCPROD/ora_prod/11204/dbs/snapcf_JTCPROD.f'; # default
CRON JOB FOR RMAN BACKUP
=======================
[oraprod@proddb122 ~]$ crontab -l
00 02 * * * /u01/JTCPROD/ora_prod/scripts/rmanbackup_full.sh >> /u01/JTCPROD/ora_prod/scripts/rmanbackup_full.log
( to edit $crontab -e , the above cron job will run daily at 2:00 am)
SCRIPT for level 0 full backup including archive and controlfile
============================================================
[oraprod@proddb122 ~]$ vi /u01/JTCPROD/ora_prod/scripts/rmanbackup_full.sh
#!/bin/bash
ORACLE_HOME=/u01/JTCPROD/ora_prod/11204; export ORACLE_HOME
ORACLE_SID=JTCPROD; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
/u01/JTCPROD/ora_prod/11204/bin/rman target / @'/u01/JTCPROD/ora_prod/scripts/rmanscript.sh'
[oraprod@proddb122 ~]$ vi /u01/JTCPROD/ora_prod/scripts/rmanscript.sh
run
{
backup incremental level 0 database format '/u01/BACKUP/RMANBKP/%d_DB_%T_%u_s%s_p%p';
sql 'alter system archive log current';
backup archivelog all format '/u01/BACKUP/RMANBKP/%d_ARCH_%T_%u_s%s_p%p';
backup current controlfile format '/u01/BACKUP/RMANBKP/control_%t.bak';
Compress the RMAN Backup and delete the obsolete backup and schedule it using cron job
=================================================================
[root@proddb122 TARRMANBKP]# crontab -l
30 02 * * * /u01/JTCPROD/ora_prod/scripts/tarbkp.sh >> /u01/JTCPROD/ora_prod/scripts/tarbkp.log
[root@proddb122 TARRMANBKP]# vi /u01/JTCPROD/ora_prod/scripts/tarbkp.sh
#Compress of backup files ###
echo "Timestamp : `date` :Backedup Database files compression in process ..."
tar -czvf /u01/BACKUP/RMANBKP/JTCPROD_Backup_`date +%d%m%Y`.tgz /u01/BACKUP/RMANBKP/*
echo "Timestamp : `date` :Backedup Database files compression completed successfully..."
echo "Timestamp : `date` :Copying tar file in process ..."
cp -r /u01/BACKUP/RMANBKP/*.tgz /u01/BACKUP/TARRMANBKP # copying backup files from backup location to other directory
echo "Timestamp : `date` :Successfully copied tar files"
Removing tar and backup files to release space #######
echo "Timestamp : `date` :removing files from backup location in process ..."
rm -rf /u01/BACKUP/RMANBKP/*
echo "Timestamp : `date` :Successfully removed files from backup location"
~
No comments:
Post a Comment