[관리] oracle open backup 예제1

#!/bin/sh

#rdate -s time.nuri.net

bkdir_name=`date +%Y%m%d`

#mount -t ext2 /dev/hda1 /orabackup

rm -rf /orabackup/ora_*-1

mv /orabackup/ora_* /orabackup/ora_${bkdir_name}-1 mkdir /orabackup/ora_${bkdir_name}

$ORACLE_HOME/bin/sqlplus internal<<EOF

alter tablespace system begin backup;

!cp /home/oracle/data1/oradata/ORA8/system01.dbf /orabackup/ora_${bkdir_name}/system01.dbf

alter tablespace system end backup;

alter tablespace RBS begin backup;

!cp /home/oracle/data1/oradata/ORA8/rbs01.dbf /orabackup/ora_${bkdir_name}/rbs01.dbf

!cp /home/oracle/data1/oradata/ORA8/rbs02.dbf /orabackup/ora_${bkdir_name}/rbs02.dbf

alter tablespace RBS end backup;

alter tablespace TEMP begin backup;

!cp /home/oracle/data1/oradata/ORA8/temp01.dbf /orabackup/ora_${bkdir_name}/temp01.dbf

!cp /home/oracle/data1/oradata/ORA8/temp02.dbf /orabackup/ora_${bkdir_name}/temp02.dbf

alter tablespace TEMP end backup;

alter tablespace USERS begin backup;

!cp /home/oracle/data1/oradata/ORA8/users01.dbf /orabackup/ora_${bkdir_name}/users01.dbf

alter tablespace USERS end backup;

alter tablespace TOOLS begin backup;

!cp /home/oracle/data1/oradata/ORA8/tools01.dbf /orabackup/ora_${bkdir_name}/tools01.dbf

!cp /home/oracle/app/oracle/product/8.0.5/dbs/data.dbf /orabackup/ora_${bkdir_name}/data.dbf

!cp /home/oracle/app/oracle/product/8.0.5/dbs/data2.dbf /orabackup/ora_${bkdir_name}/data2.dbf

!cp /home/oracle/app/oracle/product/8.0.5/dbs/data3.dbf /orabackup/ora_${bkdir_name}/data3.dbf

alter tablespace TOOLS end backup;

alter tablespace TB_DGJOB begin backup;

!cp /home/oracle/app/oracle/product/8.0.5/dbs/datafile_dg_1.dbf /orabackup/ora_${bkdir_name}/datafile_dg_1.dbf

alter tablespace TB_DGJOB end backup;

alter database backup controlfile to ‘/orabackup/ora_${bkdir_name}/control.ctl’ reuse;

alter database backup controlfile to trace;

!cp /home/oracle/data1/oradata/ORA8/redoORA801.log /orabackup/ora_${bkdir_name}/redoORA801.log

!cp /home/oracle/data2/oradata/ORA8/redoORA802.log /orabackup/ora_${bkdir_name}/redoORA802.log

!cp /home/oracle/data3/oradata/ORA8/redoORA803.log /orabackup/ora_${bkdir_name}/redoORA803.log

!cp /home/oracle/app/oracle/product/8.0.5/dbs/initORA8.ora /orabackup/ora_${bkdir_name}/initORA8.ora

exit

EOF

서진우

슈퍼컴퓨팅 전문 기업 클루닉스/ 상무(기술이사)/ 정보시스템감리사/ 시스존 블로그 운영자

You may also like...

8 Responses

  1. 2024년 9월 12일

    … [Trackback]

    […] Here you will find 25860 additional Info on that Topic: nblog.syszone.co.kr/archives/563 […]

  2. 2024년 9월 13일

    … [Trackback]

    […] Find More Info here on that Topic: nblog.syszone.co.kr/archives/563 […]

  3. 2024년 11월 8일

    … [Trackback]

    […] Find More Information here on that Topic: nblog.syszone.co.kr/archives/563 […]

  4. 2024년 11월 8일

    … [Trackback]

    […] Find More to that Topic: nblog.syszone.co.kr/archives/563 […]

  5. 2024년 11월 15일

    … [Trackback]

    […] Information to that Topic: nblog.syszone.co.kr/archives/563 […]

  6. 2024년 11월 16일

    … [Trackback]

    […] Find More here on that Topic: nblog.syszone.co.kr/archives/563 […]

  7. 2024년 11월 26일

    … [Trackback]

    […] There you can find 50413 more Information to that Topic: nblog.syszone.co.kr/archives/563 […]

  8. 2024년 11월 26일

    … [Trackback]

    […] Information to that Topic: nblog.syszone.co.kr/archives/563 […]

페이스북/트위트/구글 계정으로 댓글 가능합니다.