Raw Device 에서 백업 쉘 스크립트

경로는 알아서 수정할 것.

cold.sh

#!/bin/bash
dd if=/dev/raw/raw18 of=/data/close/raw18_undotbs1 bs=8k && \
dd if=/dev/raw/raw19 of=/data/close/raw19_undotbs2 bs=8k && \
dd if=/dev/raw/raw20 of=/data/close/raw20_ts_new bs=8k && \
dd if=/dev/raw/raw21 of=/data/close/raw21_users bs=8k && \
dd if=/dev/raw/raw6 of=/data/close/raw6_system bs=8k && \
dd if=/dev/raw/raw7 of=/data/close/raw7_sysaux bs=8k

re_cold.sh

!/bin/bash
dd if=/data/close/raw18_undotbs1 of=/dev/raw/raw18 bs=8k && \
dd if=/data/close/raw19_undotbs2 of=/dev/raw/raw19 bs=8k && \
dd if=/data/close/raw20_ts_new of=/dev/raw/raw20 bs=8k && \
dd if=/data/close/raw21_users of=/dev/raw/raw21 bs=8k && \
dd if=/data/close/raw6_system of=/dev/raw/raw6 bs=8k && \
dd if=/data/close/raw7_sysaux of=/dev/raw/raw7 bs=8k


open.sh

#!/bin/bash
sqlplus /nolog << EOF1
conn / as sysdba


set head off
set feedback off
set time off
set timing off
set echo off


alter tablespace undotbs1 begin backup;
alter tablespace undotbs2 begin backup;
alter tablespace ts_new  begin backup;
alter tablespace users begin backup;
alter tablespace system begin backup;
alter tablespace sysaux begin backup;


!dd if=/dev/raw/raw18 of=/data/open/raw18_undotbs1 bs=8k
!dd if=/dev/raw/raw19 of=/data/open/raw19_undotbs2 bs=8k
!dd if=/dev/raw/raw20 of=/data/open/raw20_ts_new bs=8k
!dd if=/dev/raw/raw21 of=/data/open/raw21_users bs=8k
!dd if=/dev/raw/raw6 of=/data/open/raw6_system bs=8k
!dd if=/dev/raw/raw7 of=/data/open/raw7_sysaux bs=8k


alter tablespace undotbs1 end backup;
alter tablespace undotbs2 end backup;
alter tablespace ts_new  end backup;
alter tablespace users end backup;
alter tablespace system end backup;
alter tablespace sysaux end backup;


exit EOF!



re_open.sh

#!/bin/bash
dd if=/data/open/raw18_undotbs1 of=/dev/raw/raw18 bs=8k && \
dd if=/data/open/raw19_undotbs2 of=/dev/raw/raw19 bs=8k && \
dd if=/data/open/raw20_ts_new of=/dev/raw/raw20 bs=8k && \
dd if=/data/open/raw21_users of=/dev/raw/raw21 bs=8k && \
dd if=/data/open/raw6_system of=/dev/raw/raw6 bs=8k && \
dd if=/data/open/raw7_sysaux of=/dev/raw/raw7 bs=8k

You may also like...

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 항목은 *(으)로 표시합니다