Bo's Oracle Station

查看: 2207|回复: 0

课程第13次(2018-06-19星期二)

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2018-6-19 20:07:31 | 显示全部楼层 |阅读模式
Oracle Suggested Backup策略:
a.png

b.png


要做实验,请把weekli备份放在第4天:

c.png

第一天:
  1. Recovery Manager: Release 11.2.0.1.0 - Production on Tue Jun 19 20:15:23 2018

  2. Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

  3. RMAN>
  4. connected to target database: ORCL (DBID=1359978017)
  5. using target database control file instead of recovery catalog

  6. RMAN>
  7. echo set on


  8. RMAN> run {
  9. 2> allocate channel oem_disk_backup device type disk;
  10. 3> recover copy of database with tag 'ORA_OEM_LEVEL_0';
  11. 4> backup incremental level 1 cumulative  copies=1 for recover of copy with tag 'ORA_OEM_LEVEL_0' database;
  12. 5> release channel oem_disk_backup;
  13. 6> allocate channel oem_sbt_backup1 type 'SBT_TAPE' format '%U' parms 'ENV=(OB_MEDIA_FAMILY=station86)';
  14. 7> allocate channel oem_sbt_backup2 type 'SBT_TAPE' format '%U' parms 'ENV=(OB_MEDIA_FAMILY=station86)';
  15. 8> backup archivelog all not backed up;
  16. 9> }
  17. allocated channel: oem_disk_backup
  18. channel oem_disk_backup: SID=197 device type=DISK

  19. Starting recover at 2018-06-19:20:15:24
  20. no copy of datafile 1 found to recover
  21. no copy of datafile 2 found to recover
  22. no copy of datafile 3 found to recover
  23. no copy of datafile 4 found to recover
  24. no copy of datafile 5 found to recover
  25. no copy of datafile 6 found to recover
  26. no copy of datafile 7 found to recover
  27. Finished recover at 2018-06-19:20:15:24

  28. Starting backup at 2018-06-19:20:15:25
  29. no parent backup or copy of datafile 1 found
  30. no parent backup or copy of datafile 2 found
  31. no parent backup or copy of datafile 3 found
  32. no parent backup or copy of datafile 5 found
  33. no parent backup or copy of datafile 4 found
  34. no parent backup or copy of datafile 6 found
  35. no parent backup or copy of datafile 7 found
  36. channel oem_disk_backup: starting datafile copy
  37. input datafile file number=00001 name=+DATA/orcl/datafile/system.256.978643425
  38. output file name=+FRA/orcl/datafile/system.304.979244125 tag=ORA_OEM_LEVEL_0 RECID=11 STAMP=979244151
  39. channel oem_disk_backup: datafile copy complete, elapsed time: 00:00:35
  40. channel oem_disk_backup: starting datafile copy
  41. input datafile file number=00002 name=+DATA/orcl/datafile/sysaux.258.978643425
  42. output file name=+FRA/orcl/datafile/sysaux.305.979244161 tag=ORA_OEM_LEVEL_0 RECID=12 STAMP=979244182
  43. channel oem_disk_backup: datafile copy complete, elapsed time: 00:00:25
  44. channel oem_disk_backup: starting datafile copy
  45. input datafile file number=00003 name=+DATA/orcl/datafile/undotbs1.259.978643423
  46. output file name=+FRA/orcl/datafile/undotbs1.357.979244187 tag=ORA_OEM_LEVEL_0 RECID=13 STAMP=979244197
  47. channel oem_disk_backup: datafile copy complete, elapsed time: 00:00:15
  48. channel oem_disk_backup: starting datafile copy
  49. input datafile file number=00005 name=+DATA/orcl/datafile/example.257.978643425
  50. output file name=+FRA/orcl/datafile/example.358.979244201 tag=ORA_OEM_LEVEL_0 RECID=14 STAMP=979244209
  51. channel oem_disk_backup: datafile copy complete, elapsed time: 00:00:15
  52. channel oem_disk_backup: starting datafile copy
  53. input datafile file number=00004 name=+DATA/orcl/datafile/users.265.978645015
  54. output file name=+FRA/orcl/datafile/users.356.979244217 tag=ORA_OEM_LEVEL_0 RECID=15 STAMP=979244216
  55. channel oem_disk_backup: datafile copy complete, elapsed time: 00:00:01
  56. channel oem_disk_backup: starting datafile copy
  57. input datafile file number=00006 name=+DATA/orcl/datafile/tbs1.267.978952849
  58. output file name=+FRA/orcl/datafile/tbs1.359.979244217 tag=ORA_OEM_LEVEL_0 RECID=16 STAMP=979244218
  59. channel oem_disk_backup: datafile copy complete, elapsed time: 00:00:01
  60. channel oem_disk_backup: starting datafile copy
  61. input datafile file number=00007 name=+DATA/orcl/datafile/tbs2.268.978952865
  62. output file name=+FRA/orcl/datafile/tbs2.352.979244219 tag=ORA_OEM_LEVEL_0 RECID=17 STAMP=979244219
  63. channel oem_disk_backup: datafile copy complete, elapsed time: 00:00:01
  64. Finished backup at 2018-06-19:20:16:59

  65. Starting Control File and SPFILE Autobackup at 2018-06-19:20:17:00
  66. piece handle=+FRA/orcl/autobackup/2018_06_19/s_979244220.351.979244221 comment=NONE
  67. Finished Control File and SPFILE Autobackup at 2018-06-19:20:17:03

  68. released channel: oem_disk_backup

  69. allocated channel: oem_sbt_backup1
  70. channel oem_sbt_backup1: SID=197 device type=SBT_TAPE
  71. channel oem_sbt_backup1: Oracle Secure Backup

  72. allocated channel: oem_sbt_backup2
  73. channel oem_sbt_backup2: SID=144 device type=SBT_TAPE
  74. channel oem_sbt_backup2: Oracle Secure Backup

  75. Starting backup at 2018-06-19:20:17:04
  76. current log archived
  77. channel oem_sbt_backup1: starting archived log backup set
  78. channel oem_sbt_backup1: specifying archived log(s) in backup set
  79. input archived log thread=1 sequence=3 RECID=104 STAMP=978944162
  80. channel oem_sbt_backup1: starting piece 1 at 2018-06-19:20:17:05
  81. channel oem_sbt_backup2: starting archived log backup set
  82. channel oem_sbt_backup2: specifying archived log(s) in backup set
  83. input archived log thread=1 sequence=12 RECID=113 STAMP=979244225
  84. channel oem_sbt_backup2: starting piece 1 at 2018-06-19:20:17:05
  85. channel oem_sbt_backup1: finished piece 1 at 2018-06-19:20:18:30
  86. piece handle=39t5s561_1_1 tag=TAG20180619T201705 comment=API Version 2.0,MMS Version 10.3.0.2
  87. channel oem_sbt_backup1: backup set complete, elapsed time: 00:01:25
  88. channel oem_sbt_backup2: finished piece 1 at 2018-06-19:20:18:30
  89. piece handle=3at5s561_1_1 tag=TAG20180619T201705 comment=API Version 2.0,MMS Version 10.3.0.2
  90. channel oem_sbt_backup2: backup set complete, elapsed time: 00:01:25
  91. Finished backup at 2018-06-19:20:18:30

  92. Starting Control File and SPFILE Autobackup at 2018-06-19:20:18:30
  93. piece handle=c-1359978017-20180619-01 comment=API Version 2.0,MMS Version 10.3.0.2
  94. Finished Control File and SPFILE Autobackup at 2018-06-19:20:19:06
  95. released channel: oem_sbt_backup1
  96. released channel: oem_sbt_backup2


  97. RMAN> allocate channel for maintenance device type 'SBT_TAPE' parms 'ENV=(OB_MEDIA_FAMILY=station86)';
  98. allocated channel: ORA_MAINT_SBT_TAPE_1
  99. channel ORA_MAINT_SBT_TAPE_1: SID=197 device type=SBT_TAPE
  100. channel ORA_MAINT_SBT_TAPE_1: Oracle Secure Backup


  101. RMAN> delete noprompt obsolete recovery window of 31 days device type 'SBT_TAPE';
  102. no obsolete backups found


  103. RMAN> exit;

  104. Recovery Manager complete.
复制代码
d.png
第二天:

  1. Recovery Manager: Release 11.2.0.1.0 - Production on Wed Jun 20 20:15:27 2018

  2. Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

  3. RMAN>
  4. connected to target database: ORCL (DBID=1359978017)
  5. using target database control file instead of recovery catalog

  6. RMAN>
  7. echo set on


  8. RMAN> run {
  9. 2> allocate channel oem_disk_backup device type disk;
  10. 3> recover copy of database with tag 'ORA_OEM_LEVEL_0';
  11. 4> backup incremental level 1 cumulative  copies=1 for recover of copy with tag 'ORA_OEM_LEVEL_0' database;
  12. 5> release channel oem_disk_backup;
  13. 6> allocate channel oem_sbt_backup1 type 'SBT_TAPE' format '%U' parms 'ENV=(OB_MEDIA_FAMILY=station86)';
  14. 7> allocate channel oem_sbt_backup2 type 'SBT_TAPE' format '%U' parms 'ENV=(OB_MEDIA_FAMILY=station86)';
  15. 8> backup archivelog all not backed up;
  16. 9> }
  17. allocated channel: oem_disk_backup
  18. channel oem_disk_backup: SID=12 device type=DISK

  19. Starting recover at 2018-06-20:20:15:29
  20. no copy of datafile 1 found to recover
  21. no copy of datafile 2 found to recover
  22. no copy of datafile 3 found to recover
  23. no copy of datafile 4 found to recover
  24. no copy of datafile 5 found to recover
  25. no copy of datafile 6 found to recover
  26. no copy of datafile 7 found to recover
  27. Finished recover at 2018-06-20:20:15:29

  28. Starting backup at 2018-06-20:20:15:29
  29. channel oem_disk_backup: starting incremental level 1 datafile backup set
  30. channel oem_disk_backup: specifying datafile(s) in backup set
  31. input datafile file number=00001 name=+DATA/orcl/datafile/system.256.978643425
  32. input datafile file number=00002 name=+DATA/orcl/datafile/sysaux.258.978643425
  33. input datafile file number=00003 name=+DATA/orcl/datafile/undotbs1.259.978643423
  34. input datafile file number=00005 name=+DATA/orcl/datafile/example.257.978643425
  35. input datafile file number=00004 name=+DATA/orcl/datafile/users.265.978645015
  36. input datafile file number=00006 name=+DATA/orcl/datafile/tbs1.267.978952849
  37. input datafile file number=00007 name=+DATA/orcl/datafile/tbs2.268.978952865
  38. channel oem_disk_backup: starting piece 1 at 2018-06-20:20:15:29
  39. channel oem_disk_backup: finished piece 1 at 2018-06-20:20:15:36
  40. piece handle=+FRA/orcl/backupset/2018_06_20/nnndn1_ora_oem_level_0_0.323.979330531 tag=ORA_OEM_LEVEL_0 comment=NONE
  41. channel oem_disk_backup: backup set complete, elapsed time: 00:00:07
  42. Finished backup at 2018-06-20:20:15:36

  43. Starting Control File and SPFILE Autobackup at 2018-06-20:20:15:36
  44. piece handle=+FRA/orcl/autobackup/2018_06_20/s_979330536.355.979330537 comment=NONE
  45. Finished Control File and SPFILE Autobackup at 2018-06-20:20:15:39

  46. released channel: oem_disk_backup

  47. allocated channel: oem_sbt_backup1
  48. channel oem_sbt_backup1: SID=12 device type=SBT_TAPE
  49. channel oem_sbt_backup1: Oracle Secure Backup

  50. allocated channel: oem_sbt_backup2
  51. channel oem_sbt_backup2: SID=17 device type=SBT_TAPE
  52. channel oem_sbt_backup2: Oracle Secure Backup

  53. Starting backup at 2018-06-20:20:15:41
  54. current log archived
  55. skipping archived log file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_3.346.978944161; already backed on 2018-06-19:20:18:28
  56. skipping archived log file +FRA/orcl/archivelog/2018_06_19/thread_1_seq_12.267.979244225; already backed on 2018-06-19:20:18:24
  57. channel oem_sbt_backup1: starting archived log backup set
  58. channel oem_sbt_backup1: specifying archived log(s) in backup set
  59. input archived log thread=1 sequence=13 RECID=114 STAMP=979330541
  60. channel oem_sbt_backup1: starting piece 1 at 2018-06-20:20:15:42
  61. channel oem_sbt_backup1: finished piece 1 at 2018-06-20:20:16:47
  62. piece handle=3et5upfe_1_1 tag=TAG20180620T201541 comment=API Version 2.0,MMS Version 10.3.0.2
  63. channel oem_sbt_backup1: backup set complete, elapsed time: 00:01:05
  64. Finished backup at 2018-06-20:20:16:47

  65. Starting Control File and SPFILE Autobackup at 2018-06-20:20:16:47
  66. piece handle=c-1359978017-20180620-01 comment=API Version 2.0,MMS Version 10.3.0.2
  67. Finished Control File and SPFILE Autobackup at 2018-06-20:20:17:22
  68. released channel: oem_sbt_backup1
  69. released channel: oem_sbt_backup2


  70. RMAN> allocate channel for maintenance device type 'SBT_TAPE' parms 'ENV=(OB_MEDIA_FAMILY=station86)';
  71. allocated channel: ORA_MAINT_SBT_TAPE_1
  72. channel ORA_MAINT_SBT_TAPE_1: SID=12 device type=SBT_TAPE
  73. channel ORA_MAINT_SBT_TAPE_1: Oracle Secure Backup


  74. RMAN> delete noprompt obsolete recovery window of 31 days device type 'SBT_TAPE';
  75. no obsolete backups found


  76. RMAN> exit;

  77. Recovery Manager complete.
复制代码

第三天(把0级镜像拷贝的时间向前推动):

d.png

  1. Recovery Manager: Release 11.2.0.1.0 - Production on Thu Jun 21 20:15:29 2018

  2. Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

  3. RMAN>
  4. connected to target database: ORCL (DBID=1359978017)
  5. using target database control file instead of recovery catalog

  6. RMAN>
  7. echo set on


  8. RMAN> run {
  9. 2> allocate channel oem_disk_backup device type disk;
  10. 3> recover copy of database with tag 'ORA_OEM_LEVEL_0';
  11. 4> backup incremental level 1 cumulative  copies=1 for recover of copy with tag 'ORA_OEM_LEVEL_0' database;
  12. 5> release channel oem_disk_backup;
  13. 6> allocate channel oem_sbt_backup1 type 'SBT_TAPE' format '%U' parms 'ENV=(OB_MEDIA_FAMILY=station86)';
  14. 7> allocate channel oem_sbt_backup2 type 'SBT_TAPE' format '%U' parms 'ENV=(OB_MEDIA_FAMILY=station86)';
  15. 8> backup archivelog all not backed up;
  16. 9> }
  17. allocated channel: oem_disk_backup
  18. channel oem_disk_backup: SID=79 device type=DISK

  19. Starting recover at 2018-06-21:20:15:30
  20. channel oem_disk_backup: starting incremental datafile backup set restore
  21. channel oem_disk_backup: specifying datafile copies to recover
  22. recovering datafile copy file number=00001 name=+FRA/orcl/datafile/system.304.979244125
  23. recovering datafile copy file number=00002 name=+FRA/orcl/datafile/sysaux.305.979244161
  24. recovering datafile copy file number=00003 name=+FRA/orcl/datafile/undotbs1.357.979244187
  25. recovering datafile copy file number=00004 name=+FRA/orcl/datafile/users.356.979244217
  26. recovering datafile copy file number=00005 name=+FRA/orcl/datafile/example.358.979244201
  27. recovering datafile copy file number=00006 name=+FRA/orcl/datafile/tbs1.359.979244217
  28. recovering datafile copy file number=00007 name=+FRA/orcl/datafile/tbs2.352.979244219
  29. channel oem_disk_backup: reading from backup piece +FRA/orcl/backupset/2018_06_20/nnndn1_ora_oem_level_0_0.323.979330531
  30. channel oem_disk_backup: piece handle=+FRA/orcl/backupset/2018_06_20/nnndn1_ora_oem_level_0_0.323.979330531 tag=ORA_OEM_LEVEL_0
  31. channel oem_disk_backup: restored backup piece 1
  32. channel oem_disk_backup: restore complete, elapsed time: 00:00:03
  33. Finished recover at 2018-06-21:20:15:34

  34. Starting backup at 2018-06-21:20:15:34
  35. channel oem_disk_backup: starting incremental level 1 datafile backup set
  36. channel oem_disk_backup: specifying datafile(s) in backup set
  37. input datafile file number=00001 name=+DATA/orcl/datafile/system.256.978643425
  38. input datafile file number=00002 name=+DATA/orcl/datafile/sysaux.258.978643425
  39. input datafile file number=00003 name=+DATA/orcl/datafile/undotbs1.259.978643423
  40. input datafile file number=00005 name=+DATA/orcl/datafile/example.257.978643425
  41. input datafile file number=00004 name=+DATA/orcl/datafile/users.265.978645015
  42. input datafile file number=00006 name=+DATA/orcl/datafile/tbs1.267.978952849
  43. input datafile file number=00007 name=+DATA/orcl/datafile/tbs2.268.978952865
  44. channel oem_disk_backup: starting piece 1 at 2018-06-21:20:15:35
  45. channel oem_disk_backup: finished piece 1 at 2018-06-21:20:15:42
  46. piece handle=+FRA/orcl/backupset/2018_06_21/nnndn1_ora_oem_level_0_0.345.979416935 tag=ORA_OEM_LEVEL_0 comment=NONE
  47. channel oem_disk_backup: backup set complete, elapsed time: 00:00:07
  48. Finished backup at 2018-06-21:20:15:42

  49. Starting Control File and SPFILE Autobackup at 2018-06-21:20:15:42
  50. piece handle=+FRA/orcl/autobackup/2018_06_21/s_979416942.286.979416943 comment=NONE
  51. Finished Control File and SPFILE Autobackup at 2018-06-21:20:15:45

  52. released channel: oem_disk_backup

  53. allocated channel: oem_sbt_backup1
  54. channel oem_sbt_backup1: SID=79 device type=SBT_TAPE
  55. channel oem_sbt_backup1: Oracle Secure Backup

  56. allocated channel: oem_sbt_backup2
  57. channel oem_sbt_backup2: SID=78 device type=SBT_TAPE
  58. channel oem_sbt_backup2: Oracle Secure Backup

  59. Starting backup at 2018-06-21:20:15:46
  60. current log archived
  61. skipping archived log file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_3.346.978944161; already backed on 2018-06-19:20:18:28
  62. skipping archived log file +FRA/orcl/archivelog/2018_06_19/thread_1_seq_12.267.979244225; already backed on 2018-06-19:20:18:24
  63. skipping archived log file +FRA/orcl/archivelog/2018_06_20/thread_1_seq_13.354.979330541; already backed on 2018-06-20:20:16:37
  64. channel oem_sbt_backup1: starting archived log backup set
  65. channel oem_sbt_backup1: specifying archived log(s) in backup set
  66. input archived log thread=1 sequence=14 RECID=115 STAMP=979416947
  67. channel oem_sbt_backup1: starting piece 1 at 2018-06-21:20:15:47
  68. channel oem_sbt_backup1: finished piece 1 at 2018-06-21:20:16:52
  69. piece handle=3it61drj_1_1 tag=TAG20180621T201547 comment=API Version 2.0,MMS Version 10.3.0.2
  70. channel oem_sbt_backup1: backup set complete, elapsed time: 00:01:05
  71. Finished backup at 2018-06-21:20:16:52

  72. Starting Control File and SPFILE Autobackup at 2018-06-21:20:16:52
  73. piece handle=c-1359978017-20180621-01 comment=API Version 2.0,MMS Version 10.3.0.2
  74. Finished Control File and SPFILE Autobackup at 2018-06-21:20:17:27
  75. released channel: oem_sbt_backup1
  76. released channel: oem_sbt_backup2


  77. RMAN> allocate channel for maintenance device type 'SBT_TAPE' parms 'ENV=(OB_MEDIA_FAMILY=station86)';
  78. allocated channel: ORA_MAINT_SBT_TAPE_1
  79. channel ORA_MAINT_SBT_TAPE_1: SID=79 device type=SBT_TAPE
  80. channel ORA_MAINT_SBT_TAPE_1: Oracle Secure Backup


  81. RMAN> delete noprompt obsolete recovery window of 31 days device type 'SBT_TAPE';
  82. no obsolete backups found


  83. RMAN> exit;

  84. Recovery Manager complete.
复制代码
第四天(周备份):
e.png

  1. Recovery Manager: Release 11.2.0.1.0 - Production on Fri Jun 22 20:15:27 2018

  2. Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

  3. RMAN>
  4. connected to target database: ORCL (DBID=1359978017)
  5. using target database control file instead of recovery catalog

  6. RMAN>
  7. echo set on


  8. RMAN> run {
  9. 2> allocate channel oem_disk_backup device type disk;
  10. 3> recover copy of database with tag 'ORA_OEM_LEVEL_0';
  11. 4> backup incremental level 1 cumulative  copies=1 for recover of copy with tag 'ORA_OEM_LEVEL_0' database;
  12. 5> release channel oem_disk_backup;
  13. 6> allocate channel oem_sbt_backup1 type 'SBT_TAPE' format '%U' parms 'ENV=(OB_MEDIA_FAMILY=station86)';
  14. 7> allocate channel oem_sbt_backup2 type 'SBT_TAPE' format '%U' parms 'ENV=(OB_MEDIA_FAMILY=station86)';
  15. 8> backup recovery area;
  16. 9> }
  17. allocated channel: oem_disk_backup
  18. channel oem_disk_backup: SID=135 device type=DISK

  19. Starting recover at 2018-06-22:20:15:28
  20. channel oem_disk_backup: starting incremental datafile backup set restore
  21. channel oem_disk_backup: specifying datafile copies to recover
  22. recovering datafile copy file number=00001 name=+FRA/orcl/datafile/system.304.979244125
  23. recovering datafile copy file number=00002 name=+FRA/orcl/datafile/sysaux.305.979244161
  24. recovering datafile copy file number=00003 name=+FRA/orcl/datafile/undotbs1.357.979244187
  25. recovering datafile copy file number=00004 name=+FRA/orcl/datafile/users.356.979244217
  26. recovering datafile copy file number=00005 name=+FRA/orcl/datafile/example.358.979244201
  27. recovering datafile copy file number=00006 name=+FRA/orcl/datafile/tbs1.359.979244217
  28. recovering datafile copy file number=00007 name=+FRA/orcl/datafile/tbs2.352.979244219
  29. channel oem_disk_backup: reading from backup piece +FRA/orcl/backupset/2018_06_21/nnndn1_ora_oem_level_0_0.345.979416935
  30. channel oem_disk_backup: piece handle=+FRA/orcl/backupset/2018_06_21/nnndn1_ora_oem_level_0_0.345.979416935 tag=ORA_OEM_LEVEL_0
  31. channel oem_disk_backup: restored backup piece 1
  32. channel oem_disk_backup: restore complete, elapsed time: 00:00:03
  33. Finished recover at 2018-06-22:20:15:32

  34. Starting backup at 2018-06-22:20:15:33
  35. channel oem_disk_backup: starting incremental level 1 datafile backup set
  36. channel oem_disk_backup: specifying datafile(s) in backup set
  37. input datafile file number=00001 name=+DATA/orcl/datafile/system.256.978643425
  38. input datafile file number=00002 name=+DATA/orcl/datafile/sysaux.258.978643425
  39. input datafile file number=00003 name=+DATA/orcl/datafile/undotbs1.259.978643423
  40. input datafile file number=00005 name=+DATA/orcl/datafile/example.257.978643425
  41. input datafile file number=00004 name=+DATA/orcl/datafile/users.265.978645015
  42. input datafile file number=00006 name=+DATA/orcl/datafile/tbs1.267.978952849
  43. input datafile file number=00007 name=+DATA/orcl/datafile/tbs2.268.978952865
  44. channel oem_disk_backup: starting piece 1 at 2018-06-22:20:15:34
  45. channel oem_disk_backup: finished piece 1 at 2018-06-22:20:15:41
  46. piece handle=+FRA/orcl/backupset/2018_06_22/nnndn1_ora_oem_level_0_0.337.979503335 tag=ORA_OEM_LEVEL_0 comment=NONE
  47. channel oem_disk_backup: backup set complete, elapsed time: 00:00:07
  48. Finished backup at 2018-06-22:20:15:41

  49. Starting Control File and SPFILE Autobackup at 2018-06-22:20:15:41
  50. piece handle=+FRA/orcl/autobackup/2018_06_22/s_979503341.336.979503341 comment=NONE
  51. Finished Control File and SPFILE Autobackup at 2018-06-22:20:15:44

  52. released channel: oem_disk_backup

  53. allocated channel: oem_sbt_backup1
  54. channel oem_sbt_backup1: SID=135 device type=SBT_TAPE
  55. channel oem_sbt_backup1: Oracle Secure Backup

  56. allocated channel: oem_sbt_backup2
  57. channel oem_sbt_backup2: SID=140 device type=SBT_TAPE
  58. channel oem_sbt_backup2: Oracle Secure Backup

  59. Starting backup at 2018-06-22:20:15:45
  60. skipping archived log file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_3.346.978944161; already backed up 1 time(s)
  61. skipping archived log file +FRA/orcl/archivelog/2018_06_19/thread_1_seq_12.267.979244225; already backed up 1 time(s)
  62. skipping archived log file +FRA/orcl/archivelog/2018_06_20/thread_1_seq_13.354.979330541; already backed up 1 time(s)
  63. skipping archived log file +FRA/orcl/archivelog/2018_06_21/thread_1_seq_14.338.979416947; already backed up 1 time(s)
  64. channel oem_sbt_backup1: starting full datafile backup set
  65. channel oem_sbt_backup1: including datafile copy of datafile 00002 in backup set
  66. input file name=+FRA/orcl/datafile/sysaux.305.979244161
  67. channel oem_sbt_backup1: including datafile copy of datafile 00003 in backup set
  68. input file name=+FRA/orcl/datafile/undotbs1.357.979244187
  69. channel oem_sbt_backup1: including datafile copy of datafile 00005 in backup set
  70. input file name=+FRA/orcl/datafile/example.358.979244201
  71. channel oem_sbt_backup1: starting piece 1 at 2018-06-22:20:15:46
  72. channel oem_sbt_backup2: starting full datafile backup set
  73. channel oem_sbt_backup2: including datafile copy of datafile 00001 in backup set
  74. input file name=+FRA/orcl/datafile/system.304.979244125
  75. channel oem_sbt_backup2: including datafile copy of datafile 00004 in backup set
  76. input file name=+FRA/orcl/datafile/users.356.979244217
  77. channel oem_sbt_backup2: including datafile copy of datafile 00006 in backup set
  78. input file name=+FRA/orcl/datafile/tbs1.359.979244217
  79. channel oem_sbt_backup2: including datafile copy of datafile 00007 in backup set
  80. input file name=+FRA/orcl/datafile/tbs2.352.979244219
  81. channel oem_sbt_backup2: starting piece 1 at 2018-06-22:20:15:46
  82. channel oem_sbt_backup2: finished piece 1 at 2018-06-22:20:17:41
  83. piece handle=3nt6427i_1_1 tag=TAG20180622T201545 comment=API Version 2.0,MMS Version 10.3.0.2
  84. channel oem_sbt_backup2: backup set complete, elapsed time: 00:01:55
  85. channel oem_sbt_backup2: input backup set: count=104, stamp=979244220, piece=1
  86. channel oem_sbt_backup2: starting piece 1 at 2018-06-22:20:17:42
  87. channel oem_sbt_backup2: backup piece +FRA/orcl/autobackup/2018_06_19/s_979244220.351.979244221
  88. channel oem_sbt_backup1: finished piece 1 at 2018-06-22:20:18:07
  89. piece handle=3mt6427h_1_1 tag=TAG20180622T201545 comment=API Version 2.0,MMS Version 10.3.0.2
  90. channel oem_sbt_backup1: backup set complete, elapsed time: 00:02:21
  91. channel oem_sbt_backup1: input backup set: count=108, stamp=979330529, piece=1
  92. channel oem_sbt_backup1: starting piece 1 at 2018-06-22:20:18:07
  93. channel oem_sbt_backup1: backup piece +FRA/orcl/backupset/2018_06_20/nnndn1_ora_oem_level_0_0.323.979330531
  94. piece handle=c-1359978017-20180619-00 comment=API Version 2.0,MMS Version 10.3.0.2
  95. channel oem_sbt_backup2: finished piece 1 at 2018-06-22:20:18:32
  96. channel oem_sbt_backup2: backup piece complete, elapsed time: 00:00:50
  97. channel oem_sbt_backup2: input backup set: count=109, stamp=979330536, piece=1
  98. channel oem_sbt_backup2: starting piece 1 at 2018-06-22:20:18:32
  99. channel oem_sbt_backup2: backup piece +FRA/orcl/autobackup/2018_06_20/s_979330536.355.979330537
  100. piece handle=3ct5upf1_1_2 comment=API Version 2.0,MMS Version 10.3.0.2
  101. channel oem_sbt_backup1: finished piece 1 at 2018-06-22:20:18:57
  102. channel oem_sbt_backup1: backup piece complete, elapsed time: 00:00:50
  103. channel oem_sbt_backup1: input backup set: count=112, stamp=979416935, piece=1
  104. channel oem_sbt_backup1: starting piece 1 at 2018-06-22:20:18:57
  105. channel oem_sbt_backup1: backup piece +FRA/orcl/backupset/2018_06_21/nnndn1_ora_oem_level_0_0.345.979416935
  106. piece handle=c-1359978017-20180620-00 comment=API Version 2.0,MMS Version 10.3.0.2
  107. channel oem_sbt_backup2: finished piece 1 at 2018-06-22:20:19:04
  108. channel oem_sbt_backup2: backup piece complete, elapsed time: 00:00:32
  109. channel oem_sbt_backup2: input backup set: count=113, stamp=979416942, piece=1
  110. channel oem_sbt_backup2: starting piece 1 at 2018-06-22:20:19:04
  111. channel oem_sbt_backup2: backup piece +FRA/orcl/autobackup/2018_06_21/s_979416942.286.979416943
  112. piece handle=3gt61dr7_1_2 comment=API Version 2.0,MMS Version 10.3.0.2
  113. channel oem_sbt_backup1: finished piece 1 at 2018-06-22:20:19:40
  114. channel oem_sbt_backup1: backup piece complete, elapsed time: 00:00:43
  115. channel oem_sbt_backup1: input backup set: count=116, stamp=979503333, piece=1
  116. channel oem_sbt_backup1: starting piece 1 at 2018-06-22:20:19:40
  117. channel oem_sbt_backup1: backup piece +FRA/orcl/backupset/2018_06_22/nnndn1_ora_oem_level_0_0.337.979503335
  118. piece handle=c-1359978017-20180621-00 comment=API Version 2.0,MMS Version 10.3.0.2
  119. channel oem_sbt_backup2: finished piece 1 at 2018-06-22:20:19:43
  120. channel oem_sbt_backup2: backup piece complete, elapsed time: 00:00:39
  121. channel oem_sbt_backup2: input backup set: count=117, stamp=979503341, piece=1
  122. channel oem_sbt_backup2: starting piece 1 at 2018-06-22:20:19:43
  123. channel oem_sbt_backup2: backup piece +FRA/orcl/autobackup/2018_06_22/s_979503341.336.979503341
  124. piece handle=3kt64275_1_2 comment=API Version 2.0,MMS Version 10.3.0.2
  125. channel oem_sbt_backup1: finished piece 1 at 2018-06-22:20:20:28
  126. channel oem_sbt_backup1: backup piece complete, elapsed time: 00:00:48
  127. piece handle=c-1359978017-20180622-00 comment=API Version 2.0,MMS Version 10.3.0.2
  128. channel oem_sbt_backup2: finished piece 1 at 2018-06-22:20:20:28
  129. channel oem_sbt_backup2: backup piece complete, elapsed time: 00:00:45
  130. Finished backup at 2018-06-22:20:20:28

  131. Starting Control File and SPFILE Autobackup at 2018-06-22:20:20:28
  132. piece handle=c-1359978017-20180622-01 comment=API Version 2.0,MMS Version 10.3.0.2
  133. Finished Control File and SPFILE Autobackup at 2018-06-22:20:21:03
  134. released channel: oem_sbt_backup1
  135. released channel: oem_sbt_backup2


  136. RMAN> allocate channel for maintenance device type 'SBT_TAPE' parms 'ENV=(OB_MEDIA_FAMILY=station86)';
  137. allocated channel: ORA_MAINT_SBT_TAPE_1
  138. channel ORA_MAINT_SBT_TAPE_1: SID=135 device type=SBT_TAPE
  139. channel ORA_MAINT_SBT_TAPE_1: Oracle Secure Backup


  140. RMAN> delete noprompt obsolete recovery window of 31 days device type 'SBT_TAPE';
  141. no obsolete backups found


  142. RMAN> exit;

  143. Recovery Manager complete.
复制代码

ASM迁移(学习使用控制文件脚本set 1进行恢复):
  1. select  name from v$datafile;

  2. select  * from v$controlfile;

  3. select  member from v$logfile;

  4. --------------------------------------
  5. select  * from v$log;

  6. alter database drop logfile group 1;

  7. alter database add logfile group 1 '/u01/app/oracle/oradata/orcl/redo01.log' size 50M;

  8. alter database drop logfile group 2;

  9. alter database add logfile group 2 '/u01/app/oracle/oradata/orcl/redo02.log' size 50M;

  10. alter system switch logfile;

  11. alter system checkpoint;

  12. alter database drop logfile group 3;

  13. alter database add logfile group 3 '/u01/app/oracle/oradata/orcl/redo03.log' size 50M;

复制代码
  1. RMAN>  run {
  2. 2> allocate channel c1 device type disk format '/u01/app/oracle/oradata/orcl/system01.dbf';
  3. 3> backup as copy datafile 1;
  4. 4> release channel c1;
  5. 5> allocate channel c1 device type disk format '/u01/app/oracle/oradata/orcl/sysaux01.dbf';
  6. 6> backup as copy datafile 2;
  7. 7> release channel c1;
  8. 8> allocate channel c1 device type disk format '/u01/app/oracle/oradata/orcl/undotbs1.dbf';
  9. 9> backup as copy datafile 3;
  10. 10> release channel c1;
  11. 11> allocate channel c1 device type disk format '/u01/app/oracle/oradata/orcl/users01.dbf';
  12. 12> backup as copy datafile 4;
  13. 13> release channel c1;
  14. 14> allocate channel c1 device type disk format '/u01/app/oracle/oradata/orcl/example01.dbf';
  15. 15> backup as copy datafile 5;
  16. 16> release channel c1;
  17. 17>  allocate channel c1 device type disk format '/u01/app/oracle/oradata/orcl/tbs1.dbf';
  18. 18> backup as copy datafile 6;
  19. 19> release channel c1;
  20. 20> allocate channel c1 device type disk format '/u01/app/oracle/oradata/orcl/tbs2.dbf';
  21. 21> backup as copy datafile 7;
  22. 22> release channel c1;
  23. 23> }
复制代码

Screenshot.png


Screenshot-1.png

  1. [oracle@station86 ~]$ sqlplus /nolog

  2. SQL*Plus: Release 11.2.0.1.0 Production on Fri Jun 22 21:14:30 2018

  3. Copyright (c) 1982, 2009, Oracle.  All rights reserved.

  4. SQL> conn / as sysdba
  5. Connected.
  6. SQL> alter database backup controlfile to trace as '/home/oracle/control8c.sql';

  7. Database altered.

  8. SQL>
复制代码

set 1 脚本:
  1. CREATE CONTROLFILE REUSE DATABASE "ORCL" NORESETLOGS  ARCHIVELOG
  2.     MAXLOGFILES 16
  3.     MAXLOGMEMBERS 3
  4.     MAXDATAFILES 100
  5.     MAXINSTANCES 8
  6.     MAXLOGHISTORY 292
  7. LOGFILE
  8.   GROUP 1 '/u01/app/oracle/oradata/orcl/redo01.log'  SIZE 50M BLOCKSIZE 512,
  9.   GROUP 2 '/u01/app/oracle/oradata/orcl/redo02.log'  SIZE 50M BLOCKSIZE 512,
  10.   GROUP 3 '/u01/app/oracle/oradata/orcl/redo03.log'  SIZE 50M BLOCKSIZE 512
  11. DATAFILE
  12.   '/u01/app/oracle/oradata/orcl/system01.dbf',
  13.   '/u01/app/oracle/oradata/orcl/sysaux01.dbf',
  14.   '/u01/app/oracle/oradata/orcl/undotbs1.dbf',
  15.   '/u01/app/oracle/oradata/orcl/users01.dbf',
  16.   '/u01/app/oracle/oradata/orcl/example01.dbf',
  17.   '/u01/app/oracle/oradata/orcl/tbs1.dbf',
  18.   '/u01/app/oracle/oradata/orcl/tbs2.dbf'
  19. CHARACTER SET AL32UTF8
  20. ;

  21. -- Configure RMAN configuration record 1
  22. VARIABLE RECNO NUMBER;
  23. EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('RETENTION POLICY','TO RECOVERY WINDOW OF 1 DAYS');
  24. -- Configure RMAN configuration record 2
  25. VARIABLE RECNO NUMBER;
  26. EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('BACKUP OPTIMIZATION','ON');
  27. -- Configure RMAN configuration record 3
  28. VARIABLE RECNO NUMBER;
  29. EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('CONTROLFILE AUTOBACKUP','ON');
  30. -- Configure RMAN configuration record 4
  31. VARIABLE RECNO NUMBER;
  32. EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('DEVICE TYPE','DISK PARALLELISM 8 BACKUP TYPE TO BACKUPSET');
  33. -- Configure RMAN configuration record 5
  34. VARIABLE RECNO NUMBER;
  35. EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('DEFAULT DEVICE TYPE TO','DISK');
  36. -- Configure RMAN configuration record 6
  37. VARIABLE RECNO NUMBER;
  38. EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('DEVICE TYPE','''SBT_TAPE'' PARALLELISM 2 BACKUP TYPE TO BACKUPSET');
  39. -- Configure RMAN configuration record 7
  40. VARIABLE RECNO NUMBER;
  41. EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('CHANNEL','1 DEVICE TYPE ''SBT_TAPE'' PARMS  ''ENV=(OB_MEDIA_FAMILY=station86)''');
  42. -- Configure RMAN configuration record 8
  43. VARIABLE RECNO NUMBER;
  44. EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('CHANNEL','2 DEVICE TYPE ''SBT_TAPE'' PARMS  ''ENV=(OB_MEDIA_FAMILY=station86)''');
  45. -- Configure RMAN configuration record 9
  46. VARIABLE RECNO NUMBER;
  47. EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('CHANNEL','DEVICE TYPE ''SBT_TAPE'' PARMS  ''ENV=(OB_MEDIA_FAMILY=station86)''');
复制代码
  1. [oracle@station86 ~]$ sqlplus /nolog

  2. SQL*Plus: Release 11.2.0.1.0 Production on Fri Jun 22 21:17:05 2018

  3. Copyright (c) 1982, 2009, Oracle.  All rights reserved.

  4. SQL> conn / as sysdba
  5. Connected.
  6. SQL> show parameter  control

  7. NAME                                     TYPE         VALUE
  8. ------------------------------------ ----------- ------------------------------
  9. control_file_record_keep_time             integer         7
  10. control_files                             string         +DATA/orcl/controlfile/current
  11.                                                  .260.832197281, +FRA/orcl/cont
  12.                                                  rolfile/current.256.832197283
  13. control_management_pack_access             string         DIAGNOSTIC+TUNING
  14. SQL> alter system set control_files='/u01/app/oracle/oradata/orcl/control01.ctl','/u01/app/oracle/oradata/orcl/control02.ctl','/u01/app/oracle/oradata/orcl/control03.ctl' scope=spfile;

  15. System altered.

  16. SQL> shutdown immmediate
  17. SP2-0717: illegal SHUTDOWN option
  18. SQL> shutdown immediate;
  19. ORA-01109: database not open


  20. Database dismounted.
  21. ORACLE instance shut down.
  22. SQL> startup nomount
  23. ORACLE instance started.

  24. Total System Global Area  820236288 bytes
  25. Fixed Size                    1339628 bytes
  26. Variable Size                  645926676 bytes
  27. Database Buffers          167772160 bytes
  28. Redo Buffers                    5197824 bytes
  29. SQL> @control8c.sql

  30. Control file created.


  31. PL/SQL procedure successfully completed.


  32. PL/SQL procedure successfully completed.


  33. PL/SQL procedure successfully completed.


  34. PL/SQL procedure successfully completed.


  35. PL/SQL procedure successfully completed.


  36. PL/SQL procedure successfully completed.


  37. PL/SQL procedure successfully completed.


  38. PL/SQL procedure successfully completed.


  39. PL/SQL procedure successfully completed.

  40. SQL> alter database open ;

  41. Database altered.

  42. SQL> alter tablespace temp add tempfile '/u01/app/oracle/oradata/orcl/temp01.dbf' size 30M autoextend on;

  43. Tablespace altered.

  44. SQL> show parameter db_recovery

  45. NAME                                     TYPE         VALUE
  46. ------------------------------------ ----------- ------------------------------
  47. db_recovery_file_dest                     string         +FRA
  48. db_recovery_file_dest_size             big integer 3852M
  49. SQL> alter system set db_recovery_file_dest='/u01/app/oracle/fast_recovery_area';

  50. System altered.

  51. SQL> show parameter db_create

  52. NAME                                     TYPE         VALUE
  53. ------------------------------------ ----------- ------------------------------
  54. db_create_file_dest                     string         +DATA
  55. db_create_online_log_dest_1             string
  56. db_create_online_log_dest_2             string
  57. db_create_online_log_dest_3             string
  58. db_create_online_log_dest_4             string
  59. db_create_online_log_dest_5             string
  60. SQL> alter system set db_create_file_dest='';

  61. System altered.

  62. SQL>
复制代码


回复

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-11-22 11:22 , Processed in 0.038805 second(s), 27 queries .

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