오라클

HOT BACKUP

OEasy 2006. 11. 2. 11:35
BULLETIN CATEGORY 
BULLETIN TOPIC
: RDBMS 
: HOT BACKUP

 Hot backup은 오라클이 기동중에 데이타베이스를 백업하는 방법이다. 이때 기본적으로 데이타베이스는 아카이브모드이어야 한다.  데이타베이스를 핫백업하는 중에 데이타를 조회할 수도 있도 변경할 수도 있다. 하지만 데이타 화일과 제어화일만 백업할 수 있고 온라인 로그화일은 백업할 수 없다. Control file의 backup은 'alter database backup controlfile to trace'를 이용한다.    
 예를들어 3/25에 /oradb1/data1.dbf 화일이 손상되었다고 가정하자.  3/21이후에 /oradb1/data1.dbf 화일을 3/23에 hot backup받은 것이 있다고 하면, 3/23에 백업한 화일을 이용해서 복구하면 된다.  즉 21일부터가 아니라 23일부터 아카이브화일들을 적용하므로서 복구시간을 줄일 수 있는 것이다.    

다음은 hot backup시의 주의사항이다.    

    오라클이 아카이브 모드 상태에서 운영되어야 한다.    
    최근에 콜드백업한 이후의 아카이브 화일이 있어야 한다.    
    online log file을 미러링 한다.    
    alter tablespace ... begin backup; 한 후에는 반드시 alter tablespace ... end backup을 해 준다. 
Hot backup을 위한 script는 다음과 같다.    
   

# -------------------------------------------------------------   
#  Hot Backup for oracle7 dbms tablespace users    
#  For each tablespace    
#      1. begin backup for data file    
#      2. dd backup    
#      3. end backup    
# -------------------------------------------------------------   
sqldba lmode=y <<EOFotpt   
connect internal   
spool users.log   
!date   

REM USERS BACKUP   

alter tablespace users begin backup;   
!time dd if=/dev/rdsk/c21t0d2s3 of=/dev/rmt/c1t5d0s0yn bs=32768   
!time dd if=/dev/rdsk/c21t0d3s3 of=/dev/rmt/c1t5d0s0nn bs=32768   
!time dd if=/dev/rdsk/c21t0d3s9 of=/dev/rmt/c1t5d0s0nn bs=32768   
!time dd if=/dev/rdsk/c21t2d2s3 of=/dev/rmt/c1t5d0s0nn bs=32768   
!time dd if=/dev/rdsk/c21t2d3s4 of=/dev/rmt/c1t5d0s0nn bs=32768   
!time dd if=/dev/rdsk/c41t0d2s3 of=/dev/rmt/c1t5d0s0nn bs=32768   
!time dd if=/dev/rdsk/c41t0d3s3 of=/dev/rmt/c1t5d0s0nn bs=32768   
!time dd if=/dev/rdsk/c41t0d3s8 of=/dev/rmt/c1t5d0s0ny bs=32768   
!time dd if=/dev/rdsk/c41t2d1s3 of=/dev/rmt/c1t6d0s0yn bs=32768   
!time dd if=/dev/rdsk/c41t2d2s3 of=/dev/rmt/c1t6d0s0nn bs=32768   
!time dd if=/dev/rdsk/c41t2d3s4 of=/dev/rmt/c1t6d0s0ny bs=32768   
alter tablespace users end backup;   
!echo "*--------------------------------------------------------*"   
!echo "###  SUNDAY BACKUP NOMAL COMPLETE...   ###"   
!echo "*--------------------------------------------------------*"   

!date   
spool off   

exit   
EOFotpt   
------------------------------------------------------------------   
select a.file#,a.status,b.tablespace_name   
from v$backup a,dba_data_files b   
where a.file#=b.file_id   
and a.status='ACTIVE'   
/   
   

   


Oracle Korea Customer Support Technical Bulletins
 

'오라클' 카테고리의 다른 글

OPS에서 새로운 NODE 추가방법  (0) 2006.11.02
ORACLE PARALLEL SERVER  (0) 2006.11.02
TABLEDATA STRIPING  (0) 2006.11.02
LOCK문제의 확인과 해결방법  (0) 2006.11.02
ORACLE 자동 STARTUP/SHUTDOWN  (0) 2006.11.02