Oracle兩種備份方式

abraham_dba_2013發表於2016-02-14
Oracle熱備份的步驟:
[oracle@dbbackup ~]$ rman target/
Recovery Manager: Release 11.2.0.3.0 - Production on Sun Feb 14 16:34:15 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
connected to target database: ORA11G (DBID=5034383)
RMAN> backup database plus archivelog delete input format '/home/oracle/backup/full_%U.bak';
Starting backup at 14-FEB-16
current log archived
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=141 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=6 RECID=1 STAMP=903801969
input archived log thread=1 sequence=7 RECID=2 STAMP=903803452
input archived log thread=1 sequence=8 RECID=3 STAMP=903803717
channel ORA_DISK_1: starting piece 1 at 14-FEB-16
channel ORA_DISK_1: finished piece 1 at 14-FEB-16
piece handle=/home/oracle/backup/full_01qttsq6_1_1.bak tag=TAG20160214T163518 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: deleting archived log(s)
archived log file name=/u01/app/oracle/fast_recovery_area/ORA11G/archivelog/2016_02_14/o1_mf_1_6_cd0fcknf_.arc RECID=1 STAMP=903801969
archived log file name=/u01/app/oracle/fast_recovery_area/ORA11G/archivelog/2016_02_14/o1_mf_1_7_cd0gswwg_.arc RECID=2 STAMP=903803452
archived log file name=/u01/app/oracle/fast_recovery_area/ORA11G/archivelog/2016_02_14/o1_mf_1_8_cd0h25o0_.arc RECID=3 STAMP=903803717
Finished backup at 14-FEB-16


Starting backup at 14-FEB-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/ora11g/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/ora11g/sysaux01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/ora11g/undotbs01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/ora11g/users01.dbf
channel ORA_DISK_1: starting piece 1 at 14-FEB-16
channel ORA_DISK_1: finished piece 1 at 14-FEB-16
piece handle=/u01/app/oracle/fast_recovery_area/ORA11G/backupset/2016_02_14/o1_mf_nnndf_TAG20160214T163520_cd0h28kc_.bkp tag=TAG20160214T163520 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:26
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 14-FEB-16
channel ORA_DISK_1: finished piece 1 at 14-FEB-16
piece handle=/u01/app/oracle/fast_recovery_area/ORA11G/backupset/2016_02_14/o1_mf_ncsnf_TAG20160214T163520_cd0h340m_.bkp tag=TAG20160214T163520 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 14-FEB-16


Starting backup at 14-FEB-16
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=9 RECID=4 STAMP=903803749
channel ORA_DISK_1: starting piece 1 at 14-FEB-16
channel ORA_DISK_1: finished piece 1 at 14-FEB-16
piece handle=/home/oracle/backup/full_04qttsr5_1_1.bak tag=TAG20160214T163549 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: deleting archived log(s)
archived log file name=/u01/app/oracle/fast_recovery_area/ORA11G/archivelog/2016_02_14/o1_mf_1_9_cd0h3528_.arc RECID=4 STAMP=903803749
Finished backup at 14-FEB-16


Oracle冷備份的通常步驟:
1  正常關閉資料庫
2  備份所有重要的檔案到備份目錄(資料檔案、控制檔案、重做日誌檔案等)
3  完成備份後啟動資料庫 
    用冷備份進行恢復時,只需要將所有檔案恢復到原有位置,就可以啟動資料庫了 。

1  進入資料庫
   #sqlplus "/as sysdba"
2  如果沒有啟動則要啟動:
   SQL>startup
3  查詢資料檔案datafile的所在目錄:
    SQL>SELECT name FROM v$datafile;
   NAME
    --------------------------------------------------------------------------------
    /u01/app/oracle/oradata/ora11g/system01.dbf
    /u01/app/oracle/oradata/ora11g/sysaux01.dbf
    /u01/app/oracle/oradata/ora11g/undotbs01.dbf
    /u01/app/oracle/oradata/ora11g/users01.dbf

    查詢控制檔案controlfile的所在目錄:
    SQL>SELECT name FROM v$controlfile;
   NAME
    --------------------------------------------------------------------------------
    /u01/app/oracle/oradata/ora11g/control01.ctl
    /u01/app/oracle/fast_recovery_area/ora11g/control02.ctl

    查詢重做日誌檔案的所在目錄:
    SQL>SELECT member FROM v$logfile;
   MEMBER
    --------------------------------------------------------------------------------
    /u01/app/oracle/oradata/ora11g/redo03.log
    /u01/app/oracle/oradata/ora11g/redo02.log
    /u01/app/oracle/oradata/ora11g/redo01.log

4  關閉資料庫
   SQL>shutdown immediate;
5  備份檔案到備份的目錄
    $ cp /u01/app/oracle/oradata/ora11g/*.dbf /home/oracle/backup/
    $ cp /u01/app/oracle/oradata/ora11g/*.log /home/oracle/backup/
    cp /u01/app/oracle/oradata/ora11g/control01.ctl /home/oracle/backup/
    $ cp /u01/app/oracle/fast_recovery_area/ora11g/control02.ctl /home/oracle/backup/
6  然後啟動資料庫
   #sqlplus "/as sysdba"
   SQL>startup
   冷備份完畢!!

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29439655/viewspace-1988549/,如需轉載,請註明出處,否則將追究法律責任。

相關文章