[20180423]关于rman备份的问题2.txt

  1. 云栖社区>
  2. 博客>
  3. 正文

[20180423]关于rman备份的问题2.txt

lfreeali 2018-04-23 09:22:23 浏览514
展开阅读全文

[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';

--//我个人喜欢分开执行,备份数据库文件以及归档文件,分开执行.或者以前就遇到这个问题,当时不知道如何规避.^_^.

网友评论

登录后评论
0/500
评论
lfreeali
+ 关注