This is  oracle full backup script using RMAN
 
  1. The following parts need to be modified in the script
         
 
  1. Backup location
          ## backup location = /backup <= backup path
         
  1. oracle profile
                Change the following variables ( ORACLE_BASE, ORACLE_HOME….)        
       #########  oracle profile ########################################
         export ORACLE_BASE=/oracle                                 
         export ORACLE_HOME=$ORACLE_BASE/app/oracle/product/11.2    
        export ORACLE_SID=ppro                                     
        export PATH=$PATH:/usr/bin:/usr/sbin:$ORACLE_HOME/bin      
       #############################################################
 
        3)  crontab  ( backup time)  Register crontab for automatic execution
          ## 30 3 * * 1-6 /PATH /full_backup.sh ##  backup time  in crontab
 
  1. How to execute  ( #sh full_backup.sh as oracle account)
 
  1. You can check  backup file  in /backup partition
 
  1. Display  full_backup.sh
 
 
Script
[oracle@ogg2 backup]$ cat full_backup.sh
 
#!/bin/sh
#tart the rman commands
export ORACLE_BASE=/oracle
export ORACLE_HOME=$ORACLE_BASE/app/oracle/product/11.2
export ORACLE_SID=east
export PATH=$PATH:/usr/bin:/usr/sbin:$ORACLE_HOME/bin
 
rman target=/ << EOF
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 1 DAYS;
RUN
{
  ALLOCATE CHANNEL ch1 TYPE DISK MAXPIECESIZE 10G;
  sql 'alter system archive log current';
  BACKUP   AS compressed backupset
  FORMAT '/backup/%d_full_db_%T_%s'
  DATABASE ;
 
  BACKUP SPFILE
  FORMAT '/backup/%d_spfile_%T_%s' ;
 
  BACKUP AS compressed backupset
  FORMAT '/backup/%d_arc_%T_%s' archivelog all DELETE INPUT ;
 
  BACKUP AS compressed backupset
  FORMAT '/backup/%d_control_%T_%s'
  CURRENT CONTROLFILE;
 
  crosscheck backup;
  crosscheck archivelog all;
  delete noprompt obsolete;
  delete noprompt expired backup;
  delete noprompt archivelog until time 'SYSDATE - 3';
}
EXIT;
EOF
#
 
사업자 정보 표시
(주)블루원 | 김홍태 | 서울특별시 용산구 원효로 4가 135 금홍 2빌딩 | 사업자 등록번호 : 106-86-76684 | TEL : 02-3272-7200 | Mail : support_ora@blueone.co.kr | 사이버몰의 이용약관 바로가기

+ Recent posts