[관리] 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
8 Responses
… [Trackback]
[…] Here you will find 25860 additional Info on that Topic: nblog.syszone.co.kr/archives/563 […]
… [Trackback]
[…] Find More Info here on that Topic: nblog.syszone.co.kr/archives/563 […]
… [Trackback]
[…] Find More Information here on that Topic: nblog.syszone.co.kr/archives/563 […]
… [Trackback]
[…] Find More to that Topic: nblog.syszone.co.kr/archives/563 […]
… [Trackback]
[…] Information to that Topic: nblog.syszone.co.kr/archives/563 […]
… [Trackback]
[…] Find More here on that Topic: nblog.syszone.co.kr/archives/563 […]
… [Trackback]
[…] There you can find 50413 more Information to that Topic: nblog.syszone.co.kr/archives/563 […]
… [Trackback]
[…] Information to that Topic: nblog.syszone.co.kr/archives/563 […]