備份歸檔日誌檔案
備份歸檔有多種方法,有在全庫備份中新增備份歸檔,有備份控制檔案中新增備份
歸檔,有獨立備份歸檔的。以下只簡單介紹後兩種的備份歸檔方法。
----單獨備份歸檔日誌:
--檢視快速恢復區的目錄:
system@PROD>show parameter recover
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string /u01/app/FRA
db_recovery_file_dest_size big integer 4182M
db_unrecoverable_scn_tracking boolean TRUE
recovery_parallelism integer 0
#便於管理起見,一般把控制檔案的自動備份與歸檔日誌都放在快速恢復區,這也是為了
便於恢復。
--檢視歸檔日誌的存放路徑:
[oracle@enmo ~]$ cd /u01/app/FRA
[oracle@enmo FRA]$ ls
PROD
[oracle@enmo FRA]$ cd PROD/
[oracle@enmo PROD]$ ls
archivelog autobackup backupset onlinelog
[oracle@enmo PROD]$ cd archivelog/
[oracle@enmo archivelog]$ ls
2016_11_07 2016_11_10
[oracle@enmo archivelog]$ cd 2016_11_07
[oracle@enmo 2016_11_07]$ ll
total 10876
-rw-r----- 1 oracle oinstall 1977856 Nov 7 14:49 o1_mf_1_1_d2090khf_.arc
-rw-r----- 1 oracle oinstall 1977856 Nov 7 15:33 o1_mf_1_1_d20cknr8_.arc
-rw-r----- 1 oracle oinstall 2412032 Nov 7 16:33 o1_mf_1_1_d20h2h6h_.arc
-rw-r----- 1 oracle oinstall 2544640 Nov 7 17:32 o1_mf_1_1_d20ljx1s_.arc
-rw-r----- 1 oracle oinstall 2199552 Nov 7 15:33 o1_mf_1_2_d20ckovg_.arc
[oracle@enmo 2016_11_07]$ cd ..
[oracle@enmo archivelog]$ cd 2016_11_10
[oracle@enmo 2016_11_10]$ ll
total 49320
-rw-r----- 1 oracle oinstall 50445824 Nov 10 22:17 o1_mf_1_3_d290d550_.arc
[oracle@enmo 2016_11_10]$
---單獨備份歸檔日誌:
--檢視rman引數設定:
[oracle@enmo ~]$ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Fri Nov 11 10:44:00 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: PROD (DBID=338469376)
RMAN> show all;
RMAN configuration parameters for database with db_unique_name PROD are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/u01/app/backup/db_%U.rmn';
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_PROD.f'; # default
#可以看到備份檔案存放的路徑以及命名方式,還有控制檔案(和引數檔案)自動備份。
--單獨備份歸檔日誌檔案:
RMAN> backup as backupset archivelog all;
Starting backup at 11-NOV-16
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=44 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=1 RECID=3 STAMP=927307485
input archived log thread=1 sequence=2 RECID=4 STAMP=927307485
channel ORA_DISK_1: starting piece 1 at 11-NOV-16
channel ORA_DISK_1: finished piece 1 at 11-NOV-16
piece handle=/u01/app/FRA/PROD/backupset/2016_11_11/o1_mf_annnn_TAG20161111T110639_d2bfg03d_.bkp tag=TAG20161111T110639 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
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=1 RECID=1 STAMP=927304399
channel ORA_DISK_1: starting piece 1 at 11-NOV-16
channel ORA_DISK_1: finished piece 1 at 11-NOV-16
piece handle=/u01/app/FRA/PROD/backupset/2016_11_11/o1_mf_annnn_TAG20161111T110639_d2bfg3lf_.bkp tag=TAG20161111T110639 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
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=1 RECID=5 STAMP=927307933
channel ORA_DISK_1: starting piece 1 at 11-NOV-16
channel ORA_DISK_1: finished piece 1 at 11-NOV-16
piece handle=/u01/app/FRA/PROD/backupset/2016_11_11/o1_mf_annnn_TAG20161111T110639_d2bfg6o0_.bkp tag=TAG20161111T110639 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
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=3 RECID=6 STAMP=927584271
input archived log thread=1 sequence=4 RECID=7 STAMP=927630398
channel ORA_DISK_1: starting piece 1 at 11-NOV-16
channel ORA_DISK_1: finished piece 1 at 11-NOV-16
piece handle=/u01/app/FRA/PROD/backupset/2016_11_11/o1_mf_annnn_TAG20161111T110639_d2bfg7xd_.bkp tag=TAG20161111T110639 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 11-NOV-16
RMAN>
#備份完成。
--在作業系統檢視生成的備份檔案:
[oracle@enmo ~]$ cd /u01/app/FRA/PROD/backupset/
[oracle@enmo backupset]$
[oracle@enmo backupset]$ pwd
/u01/app/FRA/PROD/backupset
[oracle@enmo backupset]$ ll
total 8
drwxr-x--- 2 oracle oinstall 4096 Nov 7 18:09 2016_11_07
drwxr-x--- 2 oracle oinstall 4096 Nov 11 11:06 2016_11_11
[oracle@enmo backupset]$ cd 2016_11_11
[oracle@enmo 2016_11_11]$ ll
total 79108
-rw-r----- 1 oracle oinstall 4178432 Nov 11 11:06 o1_mf_annnn_TAG20161111T110639_d2bfg03d_.bkp
-rw-r----- 1 oracle oinstall 2413568 Nov 11 11:06 o1_mf_annnn_TAG20161111T110639_d2bfg3lf_.bkp
-rw-r----- 1 oracle oinstall 2546176 Nov 11 11:06 o1_mf_annnn_TAG20161111T110639_d2bfg6o0_.bkp
-rw-r----- 1 oracle oinstall 71767040 Nov 11 11:07 o1_mf_annnn_TAG20161111T110639_d2bfg7xd_.bkp
[oracle@enmo 2016_11_11]$
#可以檢視到生成4個備份檔案:
----備份控制檔案,加上備份歸檔日誌檔案:
RMAN> backup current controlfile plus archivelog;
Starting backup at 11-NOV-16
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=44 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=1 RECID=3 STAMP=927307485
input archived log thread=1 sequence=2 RECID=4 STAMP=927307485
channel ORA_DISK_1: starting piece 1 at 11-NOV-16
channel ORA_DISK_1: finished piece 1 at 11-NOV-16
piece handle=/u01/app/backup/db_0brkl2fr_1_1.rmn tag=TAG20161111T113107 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
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=1 RECID=1 STAMP=927304399
channel ORA_DISK_1: starting piece 1 at 11-NOV-16
channel ORA_DISK_1: finished piece 1 at 11-NOV-16
piece handle=/u01/app/backup/db_0crkl2fs_1_1.rmn tag=TAG20161111T113107 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
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=1 RECID=5 STAMP=927307933
channel ORA_DISK_1: starting piece 1 at 11-NOV-16
channel ORA_DISK_1: finished piece 1 at 11-NOV-16
piece handle=/u01/app/backup/db_0drkl2ft_1_1.rmn tag=TAG20161111T113107 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
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=3 RECID=6 STAMP=927584271
input archived log thread=1 sequence=4 RECID=7 STAMP=927630398
input archived log thread=1 sequence=5 RECID=8 STAMP=927631866
channel ORA_DISK_1: starting piece 1 at 11-NOV-16
channel ORA_DISK_1: finished piece 1 at 11-NOV-16
piece handle=/u01/app/backup/db_0erkl2fu_1_1.rmn tag=TAG20161111T113107 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 11-NOV-16
Starting backup at 11-NOV-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
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 11-NOV-16
channel ORA_DISK_1: finished piece 1 at 11-NOV-16
piece handle=/u01/app/backup/db_0frkl2gd_1_1.rmn tag=TAG20161111T113125 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 11-NOV-16
Starting backup at 11-NOV-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=6 RECID=9 STAMP=927631891
channel ORA_DISK_1: starting piece 1 at 11-NOV-16
channel ORA_DISK_1: finished piece 1 at 11-NOV-16
piece handle=/u01/app/backup/db_0grkl2gk_1_1.rmn tag=TAG20161111T113132 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 11-NOV-16
Starting Control File and SPFILE Autobackup at 11-NOV-16
piece handle=/u01/app/FRA/PROD/autobackup/2016_11_11/o1_mf_s_927631893_d2bgwplv_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 11-NOV-16
RMAN>
#備份完成。
--進入作業系統檢視生成的備份檔案:
[oracle@enmo ~]$ cd /u01/app
[oracle@enmo app]$ ls
backup FRA oracle oraInventory
[oracle@enmo app]$ cd backup/
[oracle@enmo backup]$ ll
total 1715432
-rw-r----- 1 oracle oinstall 675209216 Oct 31 22:46 db_01rjp9rn_1_1.rmn
-rw-r----- 1 oracle oinstall 4178432 Nov 11 11:31 db_0brkl2fr_1_1.rmn
-rw-r----- 1 oracle oinstall 310026240 Nov 7 13:23 db_0crkane1_1_1.rmn
-rw-r----- 1 oracle oinstall 2413568 Nov 11 11:31 db_0crkl2fs_1_1.rmn
-rw-r----- 1 oracle oinstall 2546176 Nov 11 11:31 db_0drkl2ft_1_1.rmn
-rw-r----- 1 oracle oinstall 72494080 Nov 11 11:31 db_0erkl2fu_1_1.rmn
-rw-r----- 1 oracle oinstall 677847040 Nov 7 14:34 db_0frkarjn_1_1.rmn
-rw-r----- 1 oracle oinstall 10125312 Nov 11 11:31 db_0frkl2gd_1_1.rmn
-rw-r----- 1 oracle oinstall 6144 Nov 11 11:31 db_0grkl2gk_1_1.rmn
[oracle@enmo backup]$
#已經生成相應的備份檔案:
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31392094/viewspace-2128322/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- rman全庫備份備份歸檔日誌檔案
- 備份歸檔日誌
- RMAN備份資料檔案+控制檔案+歸檔日誌
- 備份之歸檔重做日誌備份
- Oracle使用備份檔案集恢復歸檔日誌Oracle
- RMAN備份歸檔日誌多份 %c
- 用RMAN備份歸檔日誌時檢查歸檔日誌是否存在
- 誤刪歸檔日誌除導致備份歸檔日誌失敗
- RMAN備份歸檔日誌指令碼指令碼
- 手工rm刪除歸檔日誌對備份歸檔日誌的影響
- 不完全恢復(資料檔案備份--新建表空間--控制檔案備份--日誌歸檔檔案)
- Oracle設定多個歸檔路徑生成多份歸檔日誌,Rman備份時也只備份其中的一份歸檔日誌Oracle
- 冷備份+歸檔日誌的恢復
- 使用logmnr,在RMAN備份檔案中恢復備份的歸檔日誌檔案進行分析
- 【備份恢復】恢復 丟失已歸檔重做日誌檔案
- Backup And Recovery User's Guide-備份歸檔重做日誌檔案GUIIDE
- 歸檔日誌大小 與使用rman 備份後的歸檔日誌產生的備份集大小的關係
- Backup And Recovery User's Guide-只備份需要備份的歸檔重做日誌檔案GUIIDE
- Backup And Recovery User's Guide-備份資料庫-備份歸檔重做日誌檔案GUIIDE資料庫
- 控制檔案/歸檔日誌
- 沒備份,歸檔日誌存在,丟失資料檔案的恢復
- oracle rman備份歸檔日誌需要先切換日誌嗎Oracle
- Oracle RMAN 不完全恢復(只有資料檔案備份,丟失歸檔日誌備份)Oracle
- rman備份後為什麼要同時備份歸檔日誌
- DELETE OBSOLETE不刪除歸檔日誌以及歸檔的備份集delete
- RMAN備份與恢復(新舊控制檔案及歸檔日誌)測試
- 日誌檔案和歸檔管理
- 刪除歸檔日誌檔案
- RMAN備份整庫和歸檔日誌的方法
- RMAN備份與恢復(新舊控制檔案及歸檔日誌)測試(敘)
- 第5章:從開啟的資料庫備份與恢復之備份歸檔日誌檔案資料庫
- 日誌檔案和歸檔日誌檔案的關係以及如何切換日誌
- 恢復控制檔案後,沒有最後一個歸檔日誌的備份,也沒新增歸檔日誌資訊,怎麼恢復?
- logmnr挖掘歸檔日誌檔案
- 改變歸檔日誌檔案大小
- RMAN備份及恢復歸檔日誌的語法
- 老虎是如何從備份集中恢復歸檔日誌
- 聯機重做日誌、歸檔日誌、備用重做日誌