[20180423]關於rman備份的問題2.txt

lfree發表於2018-04-23

[20180423]關於rman備份的問題2.txt

--//別人問的問題,rman備份放在哪裡的問題.

SCOTT@book> @ ver1
PORT_STRING                    VERSION        BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

--//測試前刪除歸檔以及備份集.
delete backupset;
delete archivelog all ;

RMAN> backup database include current controlfile plus archivelog format ='/home/oracle/backup/full-%u_%s.bak';


Starting backup at 2018-04-23 09:17:06
current log archived
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=41 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=54 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=67 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=780 RECID=1405 STAMP=974193426
channel ORA_DISK_1: starting piece 1 at 2018-04-23 09:17:07
channel ORA_DISK_1: finished piece 1 at 2018-04-23 09:17:08
piece handle=/home/oracle/backup/full-fat120oj_490.bak tag=TAG20180423T091707 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2018-04-23 09:17:08

Starting backup at 2018-04-23 09:17:08
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00002 name=/mnt/ramdisk/book/sysaux01.dbf
input datafile file number=00005 name=/mnt/ramdisk/book/example01.dbf
channel ORA_DISK_1: starting piece 1 at 2018-04-23 09:17:08
channel ORA_DISK_2: starting full datafile backup set
channel ORA_DISK_2: specifying datafile(s) in backup set
input datafile file number=00001 name=/mnt/ramdisk/book/system01.dbf
input datafile file number=00004 name=/mnt/ramdisk/book/users01.dbf
channel ORA_DISK_2: starting piece 1 at 2018-04-23 09:17:08
channel ORA_DISK_3: starting full datafile backup set
channel ORA_DISK_3: specifying datafile(s) in backup set
input datafile file number=00003 name=/mnt/ramdisk/book/undotbs01.dbf
input datafile file number=00006 name=/mnt/ramdisk/book/tea01.dbf
channel ORA_DISK_3: starting piece 1 at 2018-04-23 09:17:08
channel ORA_DISK_3: finished piece 1 at 2018-04-23 09:17:09
piece handle=/u01/app/oracle/fast_recovery_area/BOOK/backupset/2018_04_23/o1_mf_nnndf_TAG20180423T091708_fftf0nwc_.bkp tag=TAG20180423T091708 comment=NONE
channel ORA_DISK_3: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_3: starting full datafile backup set
channel ORA_DISK_3: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_3: starting piece 1 at 2018-04-23 09:17:10
channel ORA_DISK_1: finished piece 1 at 2018-04-23 09:17:17
piece handle=/u01/app/oracle/fast_recovery_area/BOOK/backupset/2018_04_23/o1_mf_nnndf_TAG20180423T091708_fftf0nw0_.bkp tag=TAG20180423T091708 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:09
channel ORA_DISK_2: finished piece 1 at 2018-04-23 09:17:17
piece handle=/u01/app/oracle/fast_recovery_area/BOOK/backupset/2018_04_23/o1_mf_nnndf_TAG20180423T091708_fftf0nw6_.bkp tag=TAG20180423T091708 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:09
channel ORA_DISK_3: finished piece 1 at 2018-04-23 09:17:17
piece handle=/u01/app/oracle/fast_recovery_area/BOOK/backupset/2018_04_23/o1_mf_ncnnf_TAG20180423T091708_fftf0pyp_.bkp tag=TAG20180423T091708 comment=NONE
channel ORA_DISK_3: backup set complete, elapsed time: 00:00:07
Finished backup at 2018-04-23 09:17:18

Starting backup at 2018-04-23 09:17:18
current log archived
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
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=781 RECID=1407 STAMP=974193438
channel ORA_DISK_1: starting piece 1 at 2018-04-23 09:17:18
channel ORA_DISK_1: finished piece 1 at 2018-04-23 09:17:19
piece handle=/home/oracle/backup/full-fft120ou_495.bak tag=TAG20180423T091718 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2018-04-23 09:17:19

Starting Control File and SPFILE Autobackup at 2018-04-23 09:17:19
piece handle=/u01/app/oracle/fast_recovery_area/BOOK/autobackup/2018_04_23/o1_mf_s_974193439_fftf0z9q_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 2018-04-23 09:17:20


RMAN> list backupset summary;


List of Backups
===============
Key     TY LV S Device Type Completion Time     #Pieces #Copies Compressed Tag
------- -- -- - ----------- ------------------- ------- ------- ---------- ---
202     B  A  A DISK        2018-04-23 09:17:07 1       1       NO         TAG20180423T091707
203     B  F  A DISK        2018-04-23 09:17:08 1       1       NO         TAG20180423T091708
204     B  F  A DISK        2018-04-23 09:17:14 1       1       NO         TAG20180423T091708
205     B  F  A DISK        2018-04-23 09:17:14 1       1       NO         TAG20180423T091708
206     B  F  A DISK        2018-04-23 09:17:14 1       1       NO         TAG20180423T091708
207     B  A  A DISK        2018-04-23 09:17:18 1       1       NO         TAG20180423T091718
208     B  F  A DISK        2018-04-23 09:17:19 1       1       NO         TAG20180423T091719

--//許多備份集,而檢查/home/oracle/backup/目錄,僅僅發現

$ ll  full-*
-rw-r----- 1 oracle oinstall 95232 2018-04-23 09:17:07 full-fat120oj_490.bak
-rw-r----- 1 oracle oinstall 10240 2018-04-23 09:17:18 full-fft120ou_495.bak

RMAN> list backupset 202,207;


List of Backup Sets
===================


BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ -------------------
202     92.50K     DISK        00:00:00     2018-04-23 09:17:07
        BP Key: 203   Status: AVAILABLE  Compressed: NO  Tag: TAG20180423T091707
        Piece Name: /home/oracle/backup/full-fat120oj_490.bak

  List of Archived Logs in backup set 202
  Thrd Seq     Low SCN    Low Time            Next SCN   Next Time
  ---- ------- ---------- ------------------- ---------- ---------
  1    780     13277960229 2018-04-23 09:14:13 13277960522 2018-04-23 09:17:06

BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ -------------------
207     9.50K      DISK        00:00:00     2018-04-23 09:17:18
        BP Key: 208   Status: AVAILABLE  Compressed: NO  Tag: TAG20180423T091718
        Piece Name: /home/oracle/backup/full-fft120ou_495.bak

  List of Archived Logs in backup set 207
  Thrd Seq     Low SCN    Low Time            Next SCN   Next Time
  ---- ------- ---------- ------------------- ---------- ---------
  1    781     13277960522 2018-04-23 09:17:06 13277960553 2018-04-23 09:17:18

--//也就是備份集202,207 在/home/oracle/backup目錄的2個備份檔案,實際上僅僅是歸檔備份檔案.
--//而真正的資料檔案備份放在FAST_RECOVERY_AREA.

RMAN> list backupset 203,204,205;


List of Backup Sets
===================


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
203     Full    3.40M      DISK        00:00:00     2018-04-23 09:17:08
        BP Key: 204   Status: AVAILABLE  Compressed: NO  Tag: TAG20180423T091708
        Piece Name: /u01/app/oracle/fast_recovery_area/BOOK/backupset/2018_04_23/o1_mf_nnndf_TAG20180423T091708_fftf0nwc_.bkp
  List of Datafiles in backup set 203
  File LV Type Ckp SCN    Ckp Time            Name
  ---- -- ---- ---------- ------------------- ----
  3       Full 13277960539 2018-04-23 09:17:08 /mnt/ramdisk/book/undotbs01.dbf
  6       Full 13277960539 2018-04-23 09:17:08 /mnt/ramdisk/book/tea01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
204     Full    10.23M     DISK        00:00:05     2018-04-23 09:17:14
        BP Key: 205   Status: AVAILABLE  Compressed: NO  Tag: TAG20180423T091708
        Piece Name: /u01/app/oracle/fast_recovery_area/BOOK/backupset/2018_04_23/o1_mf_ncnnf_TAG20180423T091708_fftf0pyp_.bkp
  Control File Included: Ckp SCN: 13277960540   Ckp time: 2018-04-23 09:17:08

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
205     Full    673.10M    DISK        00:00:06     2018-04-23 09:17:14
        BP Key: 206   Status: AVAILABLE  Compressed: NO  Tag: TAG20180423T091708
        Piece Name: /u01/app/oracle/fast_recovery_area/BOOK/backupset/2018_04_23/o1_mf_nnndf_TAG20180423T091708_fftf0nw0_.bkp
  List of Datafiles in backup set 205
  File LV Type Ckp SCN    Ckp Time            Name
  ---- -- ---- ---------- ------------------- ----
  2       Full 13277960537 2018-04-23 09:17:08 /mnt/ramdisk/book/sysaux01.dbf
  5       Full 13277960537 2018-04-23 09:17:08 /mnt/ramdisk/book/example01.dbf


--//關於這個問題我連結:
http://blog.itpub.net/267265/viewspace-2089074/
http://blog.itpub.net/267265/viewspace-2130992/
--//提到,實際上前面寫的僅僅多歸檔有效.寫成類似如下,就ok了.具體就不測試了.這也是許多初學常見錯誤.

backup as compressed backupset full database tag='full 20161220' format '/home/oracle/backup/full20161220_%U'
       plus archivelog  not  backed up 2 times tag="archivelog 20161220" format '/home/oracle/backup/arch20161220_%U';

--//我個人喜歡分開執行,備份資料庫檔案以及歸檔檔案,分開執行.或者以前就遇到這個問題,當時不知道如何規避.^_^.

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

相關文章