Oracle兩種備份方式
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
冷備份完畢!!
[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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 兩種增量備份的區別!
- RMAN加密備份的三種方式加密
- MySQL多種需求的備份方式MySql
- 揭祕ORACLE備份之----RMAN之二(備份方式)Oracle
- 【RMAN】Oracle中如何備份控制檔案?備份控制檔案的方式有哪幾種?Oracle
- mysql備份的三種方式詳解MySql
- 建立oracle dblink 的兩種方式Oracle
- oracle兩種登陸認證方式Oracle
- MySql資料庫備份的幾種方式MySql資料庫
- MPLS-VPN的幾種備份方式——VecloudCloud
- 以sysdba角色登陸oracle的兩種認證方式測試備記Oracle
- oracle兩種認證方式總結(ZT)Oracle
- postgresql備份方式SQL
- 三種Oracle RMAN備份加密策略(上)Oracle加密
- 三種Oracle RMAN備份加密策略(下)Oracle加密
- Oracle資料庫三種備份方案Oracle資料庫
- MySQL 資料庫定時備份的幾種方式MySql資料庫
- oracle備份--離線備份Oracle
- Dedecms資料庫恢復與備份的兩種方法資料庫
- MYSQL資料匯出備份、匯入的幾種方式MySql
- oracle 備份Oracle
- oracle備份Oracle
- ChatTTS的兩種使用方式TTS
- 隱藏元素兩種方式
- 解析redis備份檔案rdb的兩種方法及對比Redis
- oracle的熱備份和冷備份Oracle
- Python訪問Oracle的兩種資料獲取方式PythonOracle
- Oracle資料庫伺服器的兩種連線方式Oracle資料庫伺服器
- Oracle備份及備份策略及基於Linux下 Oracle 備份策略(RMAN)OracleLinux
- Oracle資料庫的備份與恢復方式比較Oracle資料庫
- Oracle 冷備份Oracle
- Oracle 熱備份Oracle
- oracle rac 備份Oracle
- ORACLE備份策略Oracle
- ORACLE 備份表Oracle
- Oracle 聯機備份 離線備份 物理備份 恢復Oracle
- 兩套mysql備份指令碼MySql指令碼
- 循序漸進oracle第7章:備份與恢復之Nocatalog方式的備份方案制定Oracle