Вы находитесь на странице: 1из 4

How to setup and configure RMAN Backup.

Author: Jamshid T. C Creation Date: May 18, 2005 Last Update date: sep 01, 2005 Version: 1.0

How to setup and configure RMAN Backup

1. Purpose This document explain how to setup and configure RMAN backup for a production database 2. Setting up and configure RMAN Given below are the steps to configure a RMAN backup on a target Database. 2.1 Add the tns entry On the target host add this entry in tnsnames.ora catdb10g = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = rman.dbora.corp.yahoo.com )(PORT = 1521)) ) (CONNECT_DATA = (SID =catdb10g)(SERVER = DEDICATED) ) ) 2.2 Register the Target database in RMAN recovery catalog. Set the ORACLE_SID and connect to both the catdb10g and the target database (with sys user) $export $ORACLE_SID=comm $rman target / catalog rman/rman@catdb10g RMAN>register database; 2.3 Configure RMAN: After registering the database, give the below configuration commands making proper changes.
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 14 DAYS; CONFIGURE BACKUP OPTIMIZATION ON; CONFIGURE DEFAULT DEVICE TYPE TO DISK; CONFIGURE CONTROLFILE AUTOBACKUP ON; CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/mnt/commrman/backup/%F'; (Change to the correct path) CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO COMPRESSED BACKUPSET;

How to setup and configure RMAN Backup

CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; CONFIGURE CHANNEL 1 DEVICE TYPE DISK FORMAT '/mnt/commrman/backup/%d_%T_%U' MAXPIECESIZE 4 G; (Change to the correct path) CONFIGURE MAXSETSIZE TO UNLIMITED; CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/home/oracle/OraHome1/dbs/snapcf_targetdb.f '; (Change to the correct path)

2.4 Crosscheck archivelogs RMAN will search for all the archive logs which it finds in the controlfile while trying to backup. You need to update RMAN about the actual archivelogs present on the disk by giving the below command. You can either remove all the archivelogs While taking the first full backup if it is not of any use or let RMAN backup all that. RMAN>crosscheck archivelog all;

2.5 Enable block change tracking Connect as sysdba on target database then execute this command.(change the block change track file name/path accordingly)
SQL>ALTER DATABASE ENABLE BLOCK CHANGE TRACKING USING FILE '/home/oracle/OraHome1/dbs/catdb10g_change_track.f' ;

3. Setting up the scripts 3.1 Copy the Automation scripts:


Copy the folder rman_scripts from /homes/jamshid to the target host. These are the files/folder in this folder 1. weekly_bkp.sh --takes a level 0 incremental backup once in a week 2. daily_bkp.sh --takes a level 2 differential incremental backup daily 3. midweek_bkp.sh --takes a level 1 differential incremental backup in midweek 4. .rman --Password for rman@catdb10g 5. logs --folder for output log files.

3.2 Add entries to the .bash_profile


Edit the ~/.bash_profile file and set the following. # location of Oracle Home export ORACLE_HOME=/home/oracle/OraHome1 # Path need to access oracle software export PATH=".:$HOME/bin:$ORACLE_HOME/bin:$PATH"

How to setup and configure RMAN Backup

#required lib version export LD_LIBRARY_PATH=".:$ORACLE_HOME/lib:$LD_LIBRARY_PATH" #Mail list export MAIL_TO=jamshid@yahoo-inc.com,jamshid_tc@yahoo.com #path of rman_scripts folder export RMAN_SCRIPTS_FOLDER=/home/oracle/rman_scripts #query nls_database_parameters of target DB and set nls_lang accordingly export NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1 #set date format export NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"

3.3 Put the scripts in the crontab


Put the scripts in crontab appropriately, passing ORACLE_SID of the targetdb as one argument E.g.:#####RMAN backup scripts. #Weekly LEVEL 0 backup 0 0 * * 0 /home/oracle/rman_scripts/weekly_bkp.sh comm > /home/oracle/rman_scripts/weekly_bkp.log 2>&1 #Daily LEVEL 2 backup 0 0 * * 1,2,4,5,6 /home/oracle/rman_scripts/daily_bkp.sh comm > /home/oracle/rman_scripts/daily_bkp.log 2>&1 #Midweek LEVEL 1 backup 0 0 * * 3 /home/oracle/rman_scripts/midweek_bkp.sh comm > /home/oracle/rman_scripts/midweek_bkp.log 2>&1

Notes: The above scripts will delete all the archivelogs older than 15 days from their location

How to setup and configure RMAN Backup

Вам также может понравиться