Oracle Rawdevice구성 RMAN Backup스크립트
#/bin/bash #RMAN backup script 2018/12/28 echo ##### BACKUP START!!!! ##### date echo ########################### # archive file delete(after 30 days) echo ##### rac1,rac2 ARCHIVE LOG FILE DELETE -AFTER 30 DAYS- ##### find /archive/. -mtime +30 -print -exec rm {} \; ssh rac2 'find /archive/. -mtime +30 -print -exec ssh rac2 rm {} \;' # ocr, vote backup echo ##### OCR BACKUP START ##### dd if=/dev/raw/raw13 of=/dbbackup/rman/ocrvote_bak/ocr.bak bs=200M count=1 echo ##### OCR BACKUP END ##### echo ##### VOTE BACKUP START ##### dd if=/dev/raw/raw15 of=/dbbackup/rman/ocrvote_bak/vote.bak bs=100M count=1 echo ##### VOTE BACKUP END ##### # spfile backup echo ##### SPFILE BACKUP START ##### sqlplus "/ as sysdba" << EOF create pfile='/backup/rman/pfile/initrac1.bak' from spfile; exit EOF echo ##### SPFILE BACKUP END ##### # rman full backup rman target / << EOF rman target / sql 'alter system archive log current'; sql "alter session set nls_date_format=''dd.mm.yyyy hh24:mi:ss''"; RUN { configure controlfile autobackup on; set command id to 'ORCLOnlineBackupFull'; ALLOCATE CHANNEL c1 DEVICE TYPE disk; ALLOCATE CHANNEL c2 DEVICE TYPE disk; ALLOCATE CHANNEL c3 DEVICE TYPE disk; ALLOCATE CHANNEL c4 DEVICE TYPE disk; backup AS COMPRESSED BACKUPSET full database tag ORCL_FULL format '/backup/rman/data/%d_%T_%s_%p_FULL' ; sql 'alter system archive log current'; backup tag ORCL_ARCHIVE format '/backup/rman/archive/%d_%T_%s_%p_ARCHIVE' archivelog all delete all input ; backup tag ORCL_CONTROL current controlfile format '/backup/rman/control/%d_%T_%s_%p_CONTROL'; release channel c1; release channel c2; release channel c3; release channel c4; } crosscheck backup; crosscheck backupset; crosscheck copy; crosscheck archivelog all; delete noprompt expired backup; delete noprompt obsolete; list backup; exit EOF |
'1. IT Story > Scripts' 카테고리의 다른 글
Oracle DB의 OS 상태 조회 스크립트 (0) | 2019.01.27 |
---|---|
OS(리눅스) 5초단위로 서버 및 DB 상태 출력 스크립트 (0) | 2019.01.24 |
Oracle Alert Log Viewer (11gR2) (0) | 2019.01.19 |
Oracle Wait Event 조회 스크립트 (0) | 2019.01.16 |
오라클 SQL TRACE 추출 스크립트 (0) | 2019.01.13 |
Oracle DB 기본 점검 스크립트 (0) | 2019.01.10 |
Oracle RMAN FULL BACKUP 스크립트 (0) | 2019.01.09 |
Oracle SQL Stat 조회 스크립트 (0) | 2019.01.08 |