Bo's Oracle Station

查看: 2423|回复: 0

活动第21/22次(2018-05-26星期六上下午)

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2018-5-26 10:02:13 | 显示全部楼层 |阅读模式

tape.png


Handle和Media Family以及Volumn的关系:

Screenshot.png

定制备份,通常这么做:
  1. RMAN> backup tag '1T_WHOLE_INCR0' incremental level 0 database plus archivelog not backed up delete all input;
复制代码

Oracle-Suggested Backup strategy:
Use disk to store the most recent database backup and archived logs for fast complete recovery. Use tape to store older backups for an extended recovery window.
天备份:
  1. Daily Script:
  2. run {
  3. allocate channel oem_disk_backup device type disk;
  4. recover copy of database with tag 'ORA_OEM_LEVEL_0';
  5. backup incremental level 1 cumulative  copies=1 for recover of copy with tag 'ORA_OEM_LEVEL_0' database;
  6. release channel oem_disk_backup;
  7. allocate channel oem_sbt_backup1 type 'SBT_TAPE' format '%U' parms 'ENV=(OB_MEDIA_FAMILY=station87)';
  8. allocate channel oem_sbt_backup2 type 'SBT_TAPE' format '%U' parms 'ENV=(OB_MEDIA_FAMILY=station87)';
  9. backup archivelog all not backed up;
  10. }
  11. allocate channel for maintenance device type 'SBT_TAPE' parms 'ENV=(OB_MEDIA_FAMILY=station87)';
  12. delete noprompt obsolete recovery window of 31 days device type 'SBT_TAPE';
  13. Weekly Script:
  14. run {
  15. allocate channel oem_disk_backup device type disk;
  16. recover copy of database with tag 'ORA_OEM_LEVEL_0';
  17. backup incremental level 1 cumulative  copies=1 for recover of copy with tag 'ORA_OEM_LEVEL_0' database;
  18. release channel oem_disk_backup;
  19. allocate channel oem_sbt_backup1 type 'SBT_TAPE' format '%U' parms 'ENV=(OB_MEDIA_FAMILY=station87)';
  20. allocate channel oem_sbt_backup2 type 'SBT_TAPE' format '%U' parms 'ENV=(OB_MEDIA_FAMILY=station87)';
  21. backup recovery area;
  22. }
  23. allocate channel for maintenance device type 'SBT_TAPE' parms 'ENV=(OB_MEDIA_FAMILY=station87)';
  24. delete noprompt obsolete recovery window of 31 days device type 'SBT_TAPE';
复制代码
第一天:

A full database copy will be performed during the first backup.
(可选择每天备份archived logs、incremental backup或the full database copy 到磁带。 在磁盘上的备份会保留在1天之类,使你可以最远回到昨天。 )

  1. RMAN> list backup;

  2. using target database control file instead of recovery catalog

  3. List of Backup Sets
  4. ===================


  5. BS Key  Type LV Size       Device Type Elapsed Time Completion Time   
  6. ------- ---- -- ---------- ----------- ------------ -------------------
  7. 37      Full    9.52M      DISK        00:00:01     2018-05-26:23:06:50
  8.         BP Key: 37   Status: AVAILABLE  Compressed: NO  Tag: TAG20180526T230649
  9.         Piece Name: +FRA/orcl/autobackup/2018_05_26/s_977180809.282.977180811
  10.   SPFILE Included: Modification time: 2018-05-26:19:12:46
  11.   SPFILE db_unique_name: ORCL
  12.   Control File Included: Ckp SCN: 1205857      Ckp time: 2018-05-26:23:06:49

  13. BS Key  Size       Device Type Elapsed Time Completion Time   
  14. ------- ---------- ----------- ------------ -------------------
  15. 38      10.31M     SBT_TAPE    00:01:14     2018-05-26:23:08:10
  16.         BP Key: 38   Status: AVAILABLE  Compressed: NO  Tag: TAG20180526T230655
  17.         Handle: 1ct3t64g_1_1   Media: station87-000005

  18.   List of Archived Logs in backup set 38
  19.   Thrd Seq     Low SCN    Low Time            Next SCN   Next Time
  20.   ---- ------- ---------- ------------------- ---------- ---------
  21.   1    51      1200728    2018-05-26:22:00:20 1205937    2018-05-26:23:06:54

  22. BS Key  Size       Device Type Elapsed Time Completion Time   
  23. ------- ---------- ----------- ------------ -------------------
  24. 39      40.13M     SBT_TAPE    00:01:17     2018-05-26:23:08:13
  25.         BP Key: 39   Status: AVAILABLE  Compressed: NO  Tag: TAG20180526T230655
  26.         Handle: 1bt3t64g_1_1   Media: station87-000006

  27.   List of Archived Logs in backup set 39
  28.   Thrd Seq     Low SCN    Low Time            Next SCN   Next Time
  29.   ---- ------- ---------- ------------------- ---------- ---------
  30.   1    49      1185696    2018-05-26:19:44:29 1186124    2018-05-26:19:48:29
  31.   1    50      1186124    2018-05-26:19:48:29 1200728    2018-05-26:22:00:20

  32. BS Key  Type LV Size       Device Type Elapsed Time Completion Time   
  33. ------- ---- -- ---------- ----------- ------------ -------------------
  34. 40      Full    9.56M      SBT_TAPE    00:00:37     2018-05-26:23:08:58
  35.         BP Key: 40   Status: AVAILABLE  Compressed: NO  Tag: TAG20180526T230821
  36.         Handle: c-1359978017-20180526-03   Media: station87-000006
  37.   SPFILE Included: Modification time: 2018-05-26:23:06:53
  38.   SPFILE db_unique_name: ORCL
  39.   Control File Included: Ckp SCN: 1206041      Ckp time: 2018-05-26:23:08:21

  40. RMAN>
复制代码


  1. RMAN> list copy;

  2. specification does not match any control file copy in the repository
  3. List of Datafile Copies
  4. =======================

  5. Key     File S Completion Time     Ckp SCN    Ckp Time           
  6. ------- ---- - ------------------- ---------- -------------------
  7. 2       1    A 2018-05-26:23:05:58 1205713    2018-05-26:23:05:24
  8.         Name: +FRA/orcl/datafile/system.262.977180725
  9.         Tag: ORA_OEM_LEVEL_0

  10. 3       2    A 2018-05-26:23:06:21 1205768    2018-05-26:23:05:59
  11.         Name: +FRA/orcl/datafile/sysaux.263.977180761
  12.         Tag: ORA_OEM_LEVEL_0

  13. 4       3    A 2018-05-26:23:06:36 1205792    2018-05-26:23:06:25
  14.         Name: +FRA/orcl/datafile/undotbs1.315.977180785
  15.         Tag: ORA_OEM_LEVEL_0

  16. 6       4    A 2018-05-26:23:06:48 1205844    2018-05-26:23:06:47
  17.         Name: +FRA/orcl/datafile/users.310.977180809
  18.         Tag: ORA_OEM_LEVEL_0

  19. 5       5    A 2018-05-26:23:06:45 1205813    2018-05-26:23:06:40
  20.         Name: +FRA/orcl/datafile/example.314.977180801
  21.         Tag: ORA_OEM_LEVEL_0

  22. List of Archived Log Copies for database with db_unique_name ORCL
  23. =====================================================================

  24. Key     Thrd Seq     S Low Time           
  25. ------- ---- ------- - -------------------
  26. 50      1    49      A 2018-05-26:19:44:29
  27.         Name: +FRA/orcl/archivelog/2018_05_26/thread_1_seq_49.264.977168911

  28. 51      1    49      A 2018-05-26:19:44:29
  29.         Name: /home/oracle/1_49_832197286.dbf

  30. 52      1    50      A 2018-05-26:19:48:29
  31.         Name: +FRA/orcl/archivelog/2018_05_26/thread_1_seq_50.261.977176821

  32. 53      1    50      A 2018-05-26:19:48:29
  33.         Name: /home/oracle/1_50_832197286.dbf

  34. 54      1    51      A 2018-05-26:22:00:20
  35.         Name: +FRA/orcl/archivelog/2018_05_26/thread_1_seq_51.281.977180815

  36. 55      1    51      A 2018-05-26:22:00:20
  37.         Name: /home/oracle/1_51_832197286.dbf


  38. RMAN>
复制代码

第二天:
Subsequently, an incremental backup to disk will be performed every day.

list backup 增加了:
  1. BS Key  Type LV Size       Device Type Elapsed Time Completion Time   
  2. ------- ---- -- ---------- ----------- ------------ -------------------
  3. 41      Incr 1  12.73M     DISK        00:00:09     2018-05-27:23:05:34
  4.         BP Key: 41   Status: AVAILABLE  Compressed: NO  Tag: ORA_OEM_LEVEL_0
  5.         Piece Name: +FRA/orcl/backupset/2018_05_27/nnndn1_ora_oem_level_0_0.280.977267127
  6.   List of Datafiles in backup set 41
  7.   File LV Type Ckp SCN    Ckp Time            Name
  8.   ---- -- ---- ---------- ------------------- ----
  9.   1    1  Incr 1208369    2018-05-27:23:05:25 +DATA/orcl/datafile/system.256.832197063
  10.   2    1  Incr 1208369    2018-05-27:23:05:25 +DATA/orcl/datafile/sysaux.257.832197065
  11.   3    1  Incr 1208369    2018-05-27:23:05:25 +DATA/orcl/datafile/undotbs1.258.832197065
  12.   4    1  Incr 1208369    2018-05-27:23:05:25 +DATA/orcl/datafile/users.259.832197065
  13.   5    1  Incr 1208369    2018-05-27:23:05:25 +DATA/orcl/datafile/example.265.832197353

  14. BS Key  Type LV Size       Device Type Elapsed Time Completion Time   
  15. ------- ---- -- ---------- ----------- ------------ -------------------
  16. 42      Full    9.52M      DISK        00:00:02     2018-05-27:23:05:42
  17.         BP Key: 42   Status: AVAILABLE  Compressed: NO  Tag: TAG20180527T230540
  18.         Piece Name: +FRA/orcl/autobackup/2018_05_27/s_977267140.279.977267141
  19.   SPFILE Included: Modification time: 2018-05-26:23:06:53
  20.   SPFILE db_unique_name: ORCL
  21.   Control File Included: Ckp SCN: 1208412      Ckp time: 2018-05-27:23:05:40

  22. BS Key  Size       Device Type Elapsed Time Completion Time   
  23. ------- ---------- ----------- ------------ -------------------
  24. 43      7.56M      SBT_TAPE    00:01:01     2018-05-27:23:06:48
  25.         BP Key: 43   Status: AVAILABLE  Compressed: NO  Tag: TAG20180527T230547
  26.         Handle: 1gt3vqeb_1_1   Media: station87-000005

  27.   List of Archived Logs in backup set 43
  28.   Thrd Seq     Low SCN    Low Time            Next SCN   Next Time
  29.   ---- ------- ---------- ------------------- ---------- ---------
  30.   1    52      1205937    2018-05-26:23:06:54 1208507    2018-05-27:23:05:46

  31. BS Key  Type LV Size       Device Type Elapsed Time Completion Time   
  32. ------- ---- -- ---------- ----------- ------------ -------------------
  33. 44      Full    9.56M      SBT_TAPE    00:00:41     2018-05-27:23:07:34
  34.         BP Key: 44   Status: AVAILABLE  Compressed: NO  Tag: TAG20180527T230652
  35.         Handle: c-1359978017-20180527-01   Media: station87-000005
  36.   SPFILE Included: Modification time: 2018-05-26:23:06:53
  37.   SPFILE db_unique_name: ORCL
  38.   Control File Included: Ckp SCN: 1208592      Ckp time: 2018-05-27:23:06:53

  39. RMAN>
复制代码

list copy的输出中数据文件镜像拷贝没变化,只是多了一些归档日志。

第三天:
Subsequently, an incremental backup to disk will be performed every day.
把第2天合成到第1天里头去,然后自己做增量备份。

list backup 增加了:
  1. BS Key  Type LV Size       Device Type Elapsed Time Completion Time   
  2. ------- ---- -- ---------- ----------- ------------ -------------------
  3. 45      Incr 1  33.17M     DISK        00:00:11     2018-05-28:23:05:53
  4.         BP Key: 45   Status: AVAILABLE  Compressed: NO  Tag: ORA_OEM_LEVEL_0
  5.         Piece Name: +FRA/orcl/backupset/2018_05_28/nnndn1_ora_oem_level_0_0.277.977353547
  6.   List of Datafiles in backup set 45
  7.   File LV Type Ckp SCN    Ckp Time            Name
  8.   ---- -- ---- ---------- ------------------- ----
  9.   1    1  Incr 1217231    2018-05-28:23:05:43 +DATA/orcl/datafile/system.256.832197063
  10.   2    1  Incr 1217231    2018-05-28:23:05:43 +DATA/orcl/datafile/sysaux.257.832197065
  11.   3    1  Incr 1217231    2018-05-28:23:05:43 +DATA/orcl/datafile/undotbs1.258.832197065
  12.   4    1  Incr 1217231    2018-05-28:23:05:43 +DATA/orcl/datafile/users.259.832197065
  13.   5    1  Incr 1217231    2018-05-28:23:05:43 +DATA/orcl/datafile/example.265.832197353

  14. BS Key  Type LV Size       Device Type Elapsed Time Completion Time   
  15. ------- ---- -- ---------- ----------- ------------ -------------------
  16. 46      Full    9.52M      DISK        00:00:01     2018-05-28:23:05:59
  17.         BP Key: 46   Status: AVAILABLE  Compressed: NO  Tag: TAG20180528T230558
  18.         Piece Name: +FRA/orcl/autobackup/2018_05_28/s_977353558.276.977353559
  19.   SPFILE Included: Modification time: 2018-05-26:23:06:53
  20.   SPFILE db_unique_name: ORCL
  21.   Control File Included: Ckp SCN: 1217270      Ckp time: 2018-05-28:23:05:58

  22. BS Key  Size       Device Type Elapsed Time Completion Time   
  23. ------- ---------- ----------- ------------ -------------------
  24. 47      25.00M     SBT_TAPE    00:00:52     2018-05-28:23:06:57
  25.         BP Key: 47   Status: AVAILABLE  Compressed: NO  Tag: TAG20180528T230605
  26.         Handle: 1kt42eqt_1_1   Media: station87-000005

  27.   List of Archived Logs in backup set 47
  28.   Thrd Seq     Low SCN    Low Time            Next SCN   Next Time
  29.   ---- ------- ---------- ------------------- ---------- ---------
  30.   1    53      1208507    2018-05-27:23:05:46 1217366    2018-05-28:23:06:03

  31. BS Key  Type LV Size       Device Type Elapsed Time Completion Time   
  32. ------- ---- -- ---------- ----------- ------------ -------------------
  33. 48      Full    9.56M      SBT_TAPE    00:00:31     2018-05-28:23:07:32
  34.         BP Key: 48   Status: AVAILABLE  Compressed: NO  Tag: TAG20180528T230701
  35.         Handle: c-1359978017-20180528-01   Media: station87-000005
  36.   SPFILE Included: Modification time: 2018-05-26:23:06:53
  37.   SPFILE db_unique_name: ORCL
  38.   Control File Included: Ckp SCN: 1217452      Ckp time: 2018-05-28:23:07:01

  39. RMAN>
复制代码

list copy:
RMAN> list copy;

specification does not match any control file copy in the repository
List of Datafile Copies
=======================

Key     File S Completion Time     Ckp SCN    Ckp Time           
------- ---- - ------------------- ---------- -------------------
11      1    A 2018-05-28:23:05:37 1208369    2018-05-27:23:05:25
        Name: +FRA/orcl/datafile/system.262.977180725
        Tag: ORA_OEM_LEVEL_0

10      2    A 2018-05-28:23:05:37 1208369    2018-05-27:23:05:25
        Name: +FRA/orcl/datafile/sysaux.263.977180761
        Tag: ORA_OEM_LEVEL_0

9       3    A 2018-05-28:23:05:36 1208369    2018-05-27:23:05:25
        Name: +FRA/orcl/datafile/undotbs1.315.977180785
        Tag: ORA_OEM_LEVEL_0

7       4    A 2018-05-28:23:05:34 1208369    2018-05-27:23:05:25
        Name: +FRA/orcl/datafile/users.310.977180809
        Tag: ORA_OEM_LEVEL_0

8       5    A 2018-05-28:23:05:35 1208369    2018-05-27:23:05:25
        Name: +FRA/orcl/datafile/example.314.977180801
        Tag: ORA_OEM_LEVEL_0

List of Archived Log Copies for database with db_unique_name ORCL
=====================================================================

Key     Thrd Seq     S Low Time           
------- ---- ------- - -------------------
50      1    49      A 2018-05-26:19:44:29
        Name: +FRA/orcl/archivelog/2018_05_26/thread_1_seq_49.264.977168911

51      1    49      A 2018-05-26:19:44:29
        Name: /home/oracle/1_49_832197286.dbf

52      1    50      A 2018-05-26:19:48:29
        Name: +FRA/orcl/archivelog/2018_05_26/thread_1_seq_50.261.977176821

53      1    50      A 2018-05-26:19:48:29
        Name: /home/oracle/1_50_832197286.dbf

54      1    51      A 2018-05-26:22:00:20
        Name: +FRA/orcl/archivelog/2018_05_26/thread_1_seq_51.281.977180815

55      1    51      A 2018-05-26:22:00:20
        Name: /home/oracle/1_51_832197286.dbf

56      1    52      A 2018-05-26:23:06:54
        Name: +FRA/orcl/archivelog/2018_05_27/thread_1_seq_52.278.977267147

57      1    52      A 2018-05-26:23:06:54
        Name: /home/oracle/1_52_832197286.dbf

58      1    53      A 2018-05-27:23:05:46
        Name: +FRA/orcl/archivelog/2018_05_28/thread_1_seq_53.275.977353563

59      1    53      A 2018-05-27:23:05:46
        Name: /home/oracle/1_53_832197286.dbf




周备份:
All recovery related files on disk will be backed up to tape once a week.

周备份的输出:
View Data


Status
Succeeded
Exit Code
0
Step ID
236
Targets
orcl.example.com
Started
May 29, 2018 11:05:27 PM CST
Ended
May 29, 2018 11:11:54 PM CST
Step Elapsed Time
6 minutes, 27 seconds
Management Service
station87.example.com:1158_Management_Service
TIP Management Service from which the job step was dispatched.





Output Log
Recovery Manager: Release 11.2.0.1.0 - Production on Tue May 29 23:05:28 2018Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.RMAN> connected to target database: ORCL (DBID=1359978017)using target database control file instead of recovery catalogRMAN> echo set onRMAN> run {2> allocate channel oem_disk_backup device type disk;3> recover copy of database with tag 'ORA_OEM_LEVEL_0';4> backup incremental level 1 cumulative  copies=1 for recover of copy with tag 'ORA_OEM_LEVEL_0' database;5> release channel oem_disk_backup;6> allocate channel oem_sbt_backup1 type 'SBT_TAPE' format '%U' parms 'ENV=(OB_MEDIA_FAMILY=station87)';7> allocate channel oem_sbt_backup2 type 'SBT_TAPE' format '%U' parms 'ENV=(OB_MEDIA_FAMILY=station87)';8> backup recovery area;9> }allocated channel: oem_disk_backupchannel oem_disk_backup: SID=33 device type=DISKStarting recover at 2018-05-29:23:05:30channel oem_disk_backup: starting incremental datafile backup set restorechannel oem_disk_backup: specifying datafile copies to recoverrecovering datafile copy file number=00001 name=+FRA/orcl/datafile/system.262.977180725recovering datafile copy file number=00002 name=+FRA/orcl/datafile/sysaux.263.977180761recovering datafile copy file number=00003 name=+FRA/orcl/datafile/undotbs1.315.977180785recovering datafile copy file number=00004 name=+FRA/orcl/datafile/users.310.977180809recovering datafile copy file number=00005 name=+FRA/orcl/datafile/example.314.977180801channel oem_disk_backup: reading from backup piece +FRA/orcl/backupset/2018_05_28/nnndn1_ora_oem_level_0_0.277.977353547channel oem_disk_backup: piece handle=+FRA/orcl/backupset/2018_05_28/nnndn1_ora_oem_level_0_0.277.977353547 tag=ORA_OEM_LEVEL_0channel oem_disk_backup: restored backup piece 1channel oem_disk_backup: restore complete, elapsed time: 00:00:07Finished recover at 2018-05-29:23:05:39Starting backup at 2018-05-29:23:05:40channel oem_disk_backup: starting incremental level 1 datafile backup setchannel oem_disk_backup: specifying datafile(s) in backup setinput datafile file number=00001 name=+DATA/orcl/datafile/system.256.832197063input datafile file number=00002 name=+DATA/orcl/datafile/sysaux.257.832197065input datafile file number=00003 name=+DATA/orcl/datafile/undotbs1.258.832197065input datafile file number=00005 name=+DATA/orcl/datafile/example.265.832197353input datafile file number=00004 name=+DATA/orcl/datafile/users.259.832197065channel oem_disk_backup: starting piece 1 at 2018-05-29:23:05:40channel oem_disk_backup: finished piece 1 at 2018-05-29:23:05:55piece handle=+FRA/orcl/backupset/2018_05_29/nnndn1_ora_oem_level_0_0.274.977439943 tag=ORA_OEM_LEVEL_0 comment=NONEchannel oem_disk_backup: backup set complete, elapsed time: 00:00:15Finished backup at 2018-05-29:23:05:55Starting Control File and SPFILE Autobackup at 2018-05-29:23:05:56piece handle=+FRA/orcl/autobackup/2018_05_29/s_977439956.273.977439957 comment=NONEFinished Control File and SPFILE Autobackup at 2018-05-29:23:05:59released channel: oem_disk_backupallocated channel: oem_sbt_backup1channel oem_sbt_backup1: SID=33 device type=SBT_TAPEchannel oem_sbt_backup1: Oracle Secure Backupallocated channel: oem_sbt_backup2channel oem_sbt_backup2: SID=158 device type=SBT_TAPEchannel oem_sbt_backup2: Oracle Secure BackupStarting backup at 2018-05-29:23:06:01skipping archived log file +FRA/orcl/archivelog/2018_05_26/thread_1_seq_49.264.977168911; already backed up 1 time(s)skipping archived log file /home/oracle/1_49_832197286.dbf; already backed up 1 time(s)skipping archived log file +FRA/orcl/archivelog/2018_05_26/thread_1_seq_50.261.977176821; already backed up 1 time(s)skipping archived log file /home/oracle/1_50_832197286.dbf; already backed up 1 time(s)skipping archived log file +FRA/orcl/archivelog/2018_05_26/thread_1_seq_51.281.977180815; already backed up 1 time(s)skipping archived log file /home/oracle/1_51_832197286.dbf; already backed up 1 time(s)skipping archived log file +FRA/orcl/archivelog/2018_05_27/thread_1_seq_52.278.977267147; already backed up 1 time(s)skipping archived log file /home/oracle/1_52_832197286.dbf; already backed up 1 time(s)skipping archived log file +FRA/orcl/archivelog/2018_05_28/thread_1_seq_53.275.977353563; already backed up 1 time(s)skipping archived log file /home/oracle/1_53_832197286.dbf; already backed up 1 time(s)channel oem_sbt_backup1: starting full datafile backup setchannel oem_sbt_backup1: including datafile copy of datafile 00001 in backup setinput file name=+FRA/orcl/datafile/system.262.977180725channel oem_sbt_backup1: including datafile copy of datafile 00003 in backup setinput file name=+FRA/orcl/datafile/undotbs1.315.977180785channel oem_sbt_backup1: starting piece 1 at 2018-05-29:23:06:02channel oem_sbt_backup2: starting full datafile backup setchannel oem_sbt_backup2: including datafile copy of datafile 00002 in backup setinput file name=+FRA/orcl/datafile/sysaux.263.977180761channel oem_sbt_backup2: including datafile copy of datafile 00005 in backup setinput file name=+FRA/orcl/datafile/example.314.977180801channel oem_sbt_backup2: including datafile copy of datafile 00004 in backup setinput file name=+FRA/orcl/datafile/users.310.977180809channel oem_sbt_backup2: starting piece 1 at 2018-05-29:23:06:02channel oem_sbt_backup1: finished piece 1 at 2018-05-29:23:07:57piece handle=1ot4536q_1_1 tag=TAG20180529T230602 comment=API Version 2.0,MMS Version 10.3.0.2channel oem_sbt_backup1: backup set complete, elapsed time: 00:01:55channel oem_sbt_backup1: input backup set: count=42, stamp=977180809, piece=1channel oem_sbt_backup1: starting piece 1 at 2018-05-29:23:07:59channel oem_sbt_backup1: backup piece +FRA/orcl/autobackup/2018_05_26/s_977180809.282.977180811channel oem_sbt_backup2: finished piece 1 at 2018-05-29:23:08:14piece handle=1pt4536q_1_1 tag=TAG20180529T230602 comment=API Version 2.0,MMS Version 10.3.0.2channel oem_sbt_backup2: backup set complete, elapsed time: 00:02:12channel oem_sbt_backup2: input backup set: count=46, stamp=977267125, piece=1channel oem_sbt_backup2: starting piece 1 at 2018-05-29:23:08:14channel oem_sbt_backup2: backup piece +FRA/orcl/backupset/2018_05_27/nnndn1_ora_oem_level_0_0.280.977267127piece handle=c-1359978017-20180526-02 comment=API Version 2.0,MMS Version 10.3.0.2channel oem_sbt_backup1: finished piece 1 at 2018-05-29:23:08:49channel oem_sbt_backup1: backup piece complete, elapsed time: 00:00:50channel oem_sbt_backup1: input backup set: count=47, stamp=977267140, piece=1channel oem_sbt_backup1: starting piece 1 at 2018-05-29:23:08:49channel oem_sbt_backup1: backup piece +FRA/orcl/autobackup/2018_05_27/s_977267140.279.977267141piece handle=1et3vqdl_1_2 comment=API Version 2.0,MMS Version 10.3.0.2channel oem_sbt_backup2: finished piece 1 at 2018-05-29:23:08:49channel oem_sbt_backup2: backup piece complete, elapsed time: 00:00:35channel oem_sbt_backup2: input backup set: count=50, stamp=977353542, piece=1channel oem_sbt_backup2: starting piece 1 at 2018-05-29:23:08:49channel oem_sbt_backup2: backup piece +FRA/orcl/backupset/2018_05_28/nnndn1_ora_oem_level_0_0.277.977353547piece handle=c-1359978017-20180527-00 comment=API Version 2.0,MMS Version 10.3.0.2channel oem_sbt_backup1: finished piece 1 at 2018-05-29:23:09:44channel oem_sbt_backup1: backup piece complete, elapsed time: 00:00:55channel oem_sbt_backup1: input backup set: count=51, stamp=977353558, piece=1channel oem_sbt_backup1: starting piece 1 at 2018-05-29:23:09:44channel oem_sbt_backup1: backup piece +FRA/orcl/autobackup/2018_05_28/s_977353558.276.977353559piece handle=1it42eq6_1_2 comment=API Version 2.0,MMS Version 10.3.0.2channel oem_sbt_backup2: finished piece 1 at 2018-05-29:23:09:44channel oem_sbt_backup2: backup piece complete, elapsed time: 00:00:55channel oem_sbt_backup2: input backup set: count=54, stamp=977439940, piece=1channel oem_sbt_backup2: starting piece 1 at 2018-05-29:23:09:44channel oem_sbt_backup2: backup piece +FRA/orcl/backupset/2018_05_29/nnndn1_ora_oem_level_0_0.274.977439943piece handle=c-1359978017-20180528-00 comment=API Version 2.0,MMS Version 10.3.0.2channel oem_sbt_backup1: finished piece 1 at 2018-05-29:23:10:30channel oem_sbt_backup1: backup piece complete, elapsed time: 00:00:46channel oem_sbt_backup1: input backup set: count=55, stamp=977439956, piece=1channel oem_sbt_backup1: starting piece 1 at 2018-05-29:23:10:30channel oem_sbt_backup1: backup piece +FRA/orcl/autobackup/2018_05_29/s_977439956.273.977439957piece handle=1mt45364_1_2 comment=API Version 2.0,MMS Version 10.3.0.2channel oem_sbt_backup2: finished piece 1 at 2018-05-29:23:10:30channel oem_sbt_backup2: backup piece complete, elapsed time: 00:00:46piece handle=c-1359978017-20180529-00 comment=API Version 2.0,MMS Version 10.3.0.2channel oem_sbt_backup1: finished piece 1 at 2018-05-29:23:11:15channel oem_sbt_backup1: backup piece complete, elapsed time: 00:00:45Finished backup at 2018-05-29:23:11:15Starting Control File and SPFILE Autobackup at 2018-05-29:23:11:15piece handle=c-1359978017-20180529-01 comment=API Version 2.0,MMS Version 10.3.0.2Finished Control File and SPFILE Autobackup at 2018-05-29:23:11:50released channel: oem_sbt_backup1released channel: oem_sbt_backup2RMAN> allocate channel for maintenance device type 'SBT_TAPE' parms 'ENV=(OB_MEDIA_FAMILY=station87)';allocated channel: ORA_MAINT_SBT_TAPE_1channel ORA_MAINT_SBT_TAPE_1: SID=33 device type=SBT_TAPEchannel ORA_MAINT_SBT_TAPE_1: Oracle Secure BackupRMAN> delete noprompt obsolete recovery window of 31 days device type 'SBT_TAPE';no obsolete backups foundRMAN> exit;Recovery Manager complete.

list backup增加了以下:

  1. BS Key  Type LV Size
  2. ------- ---- -- ----------
  3. 49      Incr 1  33.63M
  4.   List of Datafiles in backup set 49
  5.   File LV Type Ckp SCN    Ckp Time            Name
  6.   ---- -- ---- ---------- ------------------- ----
  7.   1    1  Incr 1227015    2018-05-29:23:05:40 +DATA/orcl/datafile/system.256.832197063
  8.   2    1  Incr 1227015    2018-05-29:23:05:40 +DATA/orcl/datafile/sysaux.257.832197065
  9.   3    1  Incr 1227015    2018-05-29:23:05:40 +DATA/orcl/datafile/undotbs1.258.832197065
  10.   4    1  Incr 1227015    2018-05-29:23:05:40 +DATA/orcl/datafile/users.259.832197065
  11.   5    1  Incr 1227015    2018-05-29:23:05:40 +DATA/orcl/datafile/example.265.832197353

  12.   Backup Set Copy #1 of backup set 49
  13.   Device Type Elapsed Time Completion Time     Compressed Tag
  14.   ----------- ------------ ------------------- ---------- ---
  15.   DISK        00:00:10     2018-05-29:23:05:50 NO         ORA_OEM_LEVEL_0

  16.     List of Backup Pieces for backup set 49 Copy #1
  17.     BP Key  Pc# Status      Piece Name
  18.     ------- --- ----------- ----------
  19.     49      1   AVAILABLE   +FRA/orcl/backupset/2018_05_29/nnndn1_ora_oem_level_0_0.274.977439943

  20.   Backup Set Copy #2 of backup set 49
  21.   Device Type Elapsed Time Completion Time     Compressed Tag
  22.   ----------- ------------ ------------------- ---------- ---
  23.   SBT_TAPE    00:00:10     2018-05-29:23:10:27 NO         ORA_OEM_LEVEL_0

  24.     List of Backup Pieces for backup set 49 Copy #2
  25.     BP Key  Pc# Status      Media                   Piece Name
  26.     ------- --- ----------- ----------------------- ----------
  27.     58      1   AVAILABLE   station87-000006        1mt45364_1_2

  28. BS Key  Type LV Size
  29. ------- ---- -- ----------
  30. 50      Full    9.52M
  31.   SPFILE Included: Modification time: 2018-05-26:23:06:53
  32.   SPFILE db_unique_name: ORCL
  33.   Control File Included: Ckp SCN: 1227044      Ckp time: 2018-05-29:23:05:56

  34.   Backup Set Copy #1 of backup set 50
  35.   Device Type Elapsed Time Completion Time     Compressed Tag
  36.   ----------- ------------ ------------------- ---------- ---
  37.   DISK        00:00:02     2018-05-29:23:05:58 NO         TAG20180529T230556

  38.     List of Backup Pieces for backup set 50 Copy #1
  39.     BP Key  Pc# Status      Piece Name
  40.     ------- --- ----------- ----------
  41.     50      1   AVAILABLE   +FRA/orcl/autobackup/2018_05_29/s_977439956.273.977439957

  42.   Backup Set Copy #2 of backup set 50
  43.   Device Type Elapsed Time Completion Time     Compressed Tag
  44.   ----------- ------------ ------------------- ---------- ---
  45.   SBT_TAPE    00:00:02     2018-05-29:23:11:05 NO         TAG20180529T230556

  46.     List of Backup Pieces for backup set 50 Copy #2
  47.     BP Key  Pc# Status      Media                   Piece Name
  48.     ------- --- ----------- ----------------------- ----------
  49.     59      1   AVAILABLE   station87-000005        c-1359978017-20180529-00

  50. BS Key  Type LV Size       Device Type Elapsed Time Completion Time   
  51. ------- ---- -- ---------- ----------- ------------ -------------------
  52. 51      Full    613.25M    SBT_TAPE    00:01:55     2018-05-29:23:07:57
  53.         BP Key: 51   Status: AVAILABLE  Compressed: NO  Tag: TAG20180529T230602
  54.         Handle: 1ot4536q_1_1   Media: station87-000005
  55.   List of Datafiles in backup set 51
  56.   File LV Type Ckp SCN    Ckp Time            Name
  57.   ---- -- ---- ---------- ------------------- ----
  58.   1       Full 1217231    2018-05-28:23:05:43 +DATA/orcl/datafile/system.256.832197063
  59.   3       Full 1217231    2018-05-28:23:05:43 +DATA/orcl/datafile/undotbs1.258.832197065

  60. BS Key  Type LV Size       Device Type Elapsed Time Completion Time   
  61. ------- ---- -- ---------- ----------- ------------ -------------------
  62. 52      Full    522.00M    SBT_TAPE    00:02:05     2018-05-29:23:08:07
  63.         BP Key: 52   Status: AVAILABLE  Compressed: NO  Tag: TAG20180529T230602
  64.         Handle: 1pt4536q_1_1   Media: station87-000006
  65.   List of Datafiles in backup set 52
  66.   File LV Type Ckp SCN    Ckp Time            Name
  67.   ---- -- ---- ---------- ------------------- ----
  68.   2       Full 1217231    2018-05-28:23:05:43 +DATA/orcl/datafile/sysaux.257.832197065
  69.   4       Full 1217231    2018-05-28:23:05:43 +DATA/orcl/datafile/users.259.832197065
  70.   5       Full 1217231    2018-05-28:23:05:43 +DATA/orcl/datafile/example.265.832197353

  71. BS Key  Type LV Size       Device Type Elapsed Time Completion Time   
  72. ------- ---- -- ---------- ----------- ------------ -------------------
  73. 53      Full    9.56M      SBT_TAPE    00:00:31     2018-05-29:23:11:46
  74.         BP Key: 60   Status: AVAILABLE  Compressed: NO  Tag: TAG20180529T231115
  75.         Handle: c-1359978017-20180529-01   Media: station87-000005
  76.   SPFILE Included: Modification time: 2018-05-26:23:06:53
  77.   SPFILE db_unique_name: ORCL
  78.   Control File Included: Ckp SCN: 1227627      Ckp time: 2018-05-29:23:11:15

  79. RMAN>
复制代码

list copy:
RMAN> list copy;

specification does not match any control file copy in the repository
List of Datafile Copies
=======================

Key     File S Completion Time     Ckp SCN    Ckp Time           
------- ---- - ------------------- ---------- -------------------
16      1    A 2018-05-29:23:05:36 1217231    2018-05-28:23:05:43
        Name: +FRA/orcl/datafile/system.262.977180725
        Tag: ORA_OEM_LEVEL_0

15      2    A 2018-05-29:23:05:36 1217231    2018-05-28:23:05:43
        Name: +FRA/orcl/datafile/sysaux.263.977180761
        Tag: ORA_OEM_LEVEL_0

14      3    A 2018-05-29:23:05:34 1217231    2018-05-28:23:05:43
        Name: +FRA/orcl/datafile/undotbs1.315.977180785
        Tag: ORA_OEM_LEVEL_0

12      4    A 2018-05-29:23:05:33 1217231    2018-05-28:23:05:43
        Name: +FRA/orcl/datafile/users.310.977180809
        Tag: ORA_OEM_LEVEL_0

13      5    A 2018-05-29:23:05:34 1217231    2018-05-28:23:05:43
        Name: +FRA/orcl/datafile/example.314.977180801
        Tag: ORA_OEM_LEVEL_0

List of Archived Log Copies for database with db_unique_name ORCL
=====================================================================

Key     Thrd Seq     S Low Time           
------- ---- ------- - -------------------
50      1    49      A 2018-05-26:19:44:29
        Name: +FRA/orcl/archivelog/2018_05_26/thread_1_seq_49.264.977168911

51      1    49      A 2018-05-26:19:44:29
        Name: /home/oracle/1_49_832197286.dbf

52      1    50      A 2018-05-26:19:48:29
        Name: +FRA/orcl/archivelog/2018_05_26/thread_1_seq_50.261.977176821

53      1    50      A 2018-05-26:19:48:29
        Name: /home/oracle/1_50_832197286.dbf

54      1    51      A 2018-05-26:22:00:20
        Name: +FRA/orcl/archivelog/2018_05_26/thread_1_seq_51.281.977180815

55      1    51      A 2018-05-26:22:00:20
        Name: /home/oracle/1_51_832197286.dbf

56      1    52      A 2018-05-26:23:06:54
        Name: +FRA/orcl/archivelog/2018_05_27/thread_1_seq_52.278.977267147

57      1    52      A 2018-05-26:23:06:54
        Name: /home/oracle/1_52_832197286.dbf

58      1    53      A 2018-05-27:23:05:46
        Name: +FRA/orcl/archivelog/2018_05_28/thread_1_seq_53.275.977353563

59      1    53      A 2018-05-27:23:05:46
        Name: /home/oracle/1_53_832197286.dbf


RMAN>

-----------------------------自动探测故障,修复故障:

  1. RMAN> list failure;

  2. using target database control file instead of recovery catalog
  3. List of Database Failures
  4. =========================

  5. Failure ID Priority Status    Time Detected Summary
  6. ---------- -------- --------- ------------- -------
  7. 342        CRITICAL OPEN      27-MAY-18     System datafile 1: '+DATA/orcl/datafile/system.256.976686445' is missing
  8. 205        CRITICAL OPEN      27-MAY-18     System datafile 1: '/u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_fhzzfgb3_.dbf' is missing

  9. RMAN> advise failure 342;

  10. List of Database Failures
  11. =========================

  12. Failure ID Priority Status    Time Detected Summary
  13. ---------- -------- --------- ------------- -------
  14. 342        CRITICAL OPEN      27-MAY-18     System datafile 1: '+DATA/orcl/datafile/system.256.976686445' is missing

  15. analyzing automatic repair options; this may take some time
  16. allocated channel: ORA_DISK_1
  17. channel ORA_DISK_1: SID=68 device type=DISK
  18. allocated channel: ORA_DISK_2
  19. channel ORA_DISK_2: SID=131 device type=DISK
  20. allocated channel: ORA_DISK_3
  21. channel ORA_DISK_3: SID=192 device type=DISK
  22. allocated channel: ORA_DISK_4
  23. channel ORA_DISK_4: SID=8 device type=DISK
  24. allocated channel: ORA_DISK_5
  25. channel ORA_DISK_5: SID=69 device type=DISK
  26. allocated channel: ORA_DISK_6
  27. channel ORA_DISK_6: SID=132 device type=DISK
  28. allocated channel: ORA_DISK_7
  29. channel ORA_DISK_7: SID=193 device type=DISK
  30. allocated channel: ORA_DISK_8
  31. channel ORA_DISK_8: SID=9 device type=DISK
  32. allocated channel: ORA_SBT_TAPE_1
  33. channel ORA_SBT_TAPE_1: SID=70 device type=SBT_TAPE
  34. channel ORA_SBT_TAPE_1: Oracle Secure Backup
  35. allocated channel: ORA_SBT_TAPE_2
  36. channel ORA_SBT_TAPE_2: SID=133 device type=SBT_TAPE
  37. channel ORA_SBT_TAPE_2: Oracle Secure Backup
  38. analyzing automatic repair options complete

  39. Mandatory Manual Actions
  40. ========================
  41. no manual actions available

  42. Optional Manual Actions
  43. =======================
  44. 1. If file +DATA/orcl/datafile/system.256.976686445 was unintentionally renamed or moved, restore it

  45. Automated Repair Options
  46. ========================
  47. Option Repair Description
  48. ------ ------------------
  49. 1      Restore and recover datafile 1  
  50.   Strategy: The repair includes complete media recovery with no data loss
  51.   Repair script: /u01/app/oracle/diag/rdbms/orcl/orcl/hm/reco_2705808684.hm

  52. RMAN> repair failure preview;

  53. Strategy: The repair includes complete media recovery with no data loss
  54. Repair script: /u01/app/oracle/diag/rdbms/orcl/orcl/hm/reco_2705808684.hm

  55. contents of repair script:
  56.    # restore and recover datafile
  57.    restore datafile 1;
  58.    recover datafile 1;

  59. RMAN> repair failure;

  60. Strategy: The repair includes complete media recovery with no data loss
  61. Repair script: /u01/app/oracle/diag/rdbms/orcl/orcl/hm/reco_2705808684.hm

  62. contents of repair script:
  63.    # restore and recover datafile
  64.    restore datafile 1;
  65.    recover datafile 1;

  66. Do you really want to execute the above repair (enter YES or NO)? YES
  67. executing repair script

  68. Starting restore at 27-MAY-18
  69. using channel ORA_DISK_1
  70. using channel ORA_DISK_2
  71. using channel ORA_DISK_3
  72. using channel ORA_DISK_4
  73. using channel ORA_DISK_5
  74. using channel ORA_DISK_6
  75. using channel ORA_DISK_7
  76. using channel ORA_DISK_8
  77. using channel ORA_SBT_TAPE_1
  78. using channel ORA_SBT_TAPE_2

  79. channel ORA_SBT_TAPE_1: starting datafile backup set restore
  80. channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
  81. channel ORA_SBT_TAPE_1: restoring datafile 00001 to +DATA/orcl/datafile/system.256.976686445
  82. channel ORA_SBT_TAPE_1: reading from backup piece 04t3tfr6_1_1

复制代码




回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-11-23 17:46 , Processed in 0.052407 second(s), 27 queries .

快速回复 返回顶部 返回列表