Bo's Oracle Station

查看: 1679|回复: 0

Oracle Suggested Backup 3 天实践

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2020-11-10 21:37:00 | 显示全部楼层 |阅读模式
1. 配置:

2. 脚本:
  1. Daily Script:
  2. run {
  3. allocate channel oem_disk_backup1 type disk ;
  4. allocate channel oem_disk_backup2 type disk ;
  5. allocate channel oem_disk_backup3 type disk ;
  6. allocate channel oem_disk_backup4 type disk ;
  7. allocate channel oem_disk_backup5 type disk ;
  8. allocate channel oem_disk_backup6 type disk ;
  9. allocate channel oem_disk_backup7 type disk ;
  10. allocate channel oem_disk_backup8 type disk ;
  11. recover copy of database with tag 'ORA$OEM_LEVEL_0';
  12. backup incremental level 1 copies=1 for recover of copy with tag 'ORA$OEM_LEVEL_0' database;
  13. release channel oem_disk_backup1;
  14. release channel oem_disk_backup2;
  15. release channel oem_disk_backup3;
  16. release channel oem_disk_backup4;
  17. release channel oem_disk_backup5;
  18. release channel oem_disk_backup6;
  19. release channel oem_disk_backup7;
  20. release channel oem_disk_backup8;
  21. allocate channel oem_sbt_backup1 type 'SBT_TAPE' format '%d_%U' parms "ENV=(OB_MEDIA_FAMILY=classroom)";
  22. allocate channel oem_sbt_backup2 type 'SBT_TAPE' format '%d_%U' parms "ENV=(OB_MEDIA_FAMILY=classroom)";
  23. backup archivelog all not backed up;
  24. }
  25. allocate channel for maintenance device type 'SBT_TAPE' parms "ENV=(OB_MEDIA_FAMILY=classroom)";
  26. delete noprompt obsolete recovery window of 31 days device type 'SBT_TAPE';
  27. Weekly Script:
  28. run {
  29. allocate channel oem_disk_backup1 type disk ;
  30. allocate channel oem_disk_backup2 type disk ;
  31. allocate channel oem_disk_backup3 type disk ;
  32. allocate channel oem_disk_backup4 type disk ;
  33. allocate channel oem_disk_backup5 type disk ;
  34. allocate channel oem_disk_backup6 type disk ;
  35. allocate channel oem_disk_backup7 type disk ;
  36. allocate channel oem_disk_backup8 type disk ;
  37. recover copy of database with tag 'ORA$OEM_LEVEL_0';
  38. backup incremental level 1 copies=1 for recover of copy with tag 'ORA$OEM_LEVEL_0' database;
  39. release channel oem_disk_backup1;
  40. release channel oem_disk_backup2;
  41. release channel oem_disk_backup3;
  42. release channel oem_disk_backup4;
  43. release channel oem_disk_backup5;
  44. release channel oem_disk_backup6;
  45. release channel oem_disk_backup7;
  46. release channel oem_disk_backup8;
  47. allocate channel oem_sbt_backup1 type 'SBT_TAPE' format '%d_%U' parms "ENV=(OB_MEDIA_FAMILY=classroom)";
  48. allocate channel oem_sbt_backup2 type 'SBT_TAPE' format '%d_%U' parms "ENV=(OB_MEDIA_FAMILY=classroom)";
  49. backup recovery area;
  50. }
  51. allocate channel for maintenance device type 'SBT_TAPE' parms "ENV=(OB_MEDIA_FAMILY=classroom)";
  52. delete noprompt obsolete recovery window of 31 days device type 'SBT_TAPE';
复制代码
3. 运行输出:
  1. [oracle@classroom ~]$ rman target / catalog urcat/oracle_4U@rcat cmdfile=day1.rcv

  2. Recovery Manager: Release 12.1.0.2.0 - Production on 星期日 11月 15 14:34:47 2020

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

  4. connected to target database: ORCL (DBID=1574592120)
  5. connected to recovery catalog database

  6. RMAN> run {
  7. 2> allocate channel oem_disk_backup1 type disk ;
  8. 3> allocate channel oem_disk_backup2 type disk ;
  9. 4> allocate channel oem_disk_backup3 type disk ;
  10. 5> allocate channel oem_disk_backup4 type disk ;
  11. 6> allocate channel oem_disk_backup5 type disk ;
  12. 7> allocate channel oem_disk_backup6 type disk ;
  13. 8> allocate channel oem_disk_backup7 type disk ;
  14. 9> allocate channel oem_disk_backup8 type disk ;
  15. 10> recover copy of database with tag 'ORAOEM_LEVEL_0';
  16. 11> backup incremental level 1 copies=1 for recover of copy with tag 'ORAOEM_LEVEL_0' database;
  17. 12> release channel oem_disk_backup1;
  18. 13> release channel oem_disk_backup2;
  19. 14> release channel oem_disk_backup3;
  20. 15> release channel oem_disk_backup4;
  21. 16> release channel oem_disk_backup5;
  22. 17> release channel oem_disk_backup6;
  23. 18> release channel oem_disk_backup7;
  24. 19> release channel oem_disk_backup8;
  25. 20> allocate channel oem_sbt_backup1 type 'SBT_TAPE' format '%d_%U' parms "ENV=(OB_MEDIA_FAMILY=classroom)";
  26. 21> allocate channel oem_sbt_backup2 type 'SBT_TAPE' format '%d_%U' parms "ENV=(OB_MEDIA_FAMILY=classroom)";
  27. 22> backup archivelog all not backed up;
  28. 23> }
  29. 24> allocate channel for maintenance device type 'SBT_TAPE' parms "ENV=(OB_MEDIA_FAMILY=classroom)";
  30. 25> delete noprompt obsolete recovery window of 31 days device type 'SBT_TAPE';
  31. 26>
  32. 27>
  33. 28>
  34. starting full resync of recovery catalog
  35. full resync complete
  36. allocated channel: oem_disk_backup1
  37. channel oem_disk_backup1: SID=135 device type=DISK

  38. allocated channel: oem_disk_backup2
  39. channel oem_disk_backup2: SID=137 device type=DISK

  40. allocated channel: oem_disk_backup3
  41. channel oem_disk_backup3: SID=255 device type=DISK

  42. allocated channel: oem_disk_backup4
  43. channel oem_disk_backup4: SID=14 device type=DISK

  44. allocated channel: oem_disk_backup5
  45. channel oem_disk_backup5: SID=257 device type=DISK

  46. allocated channel: oem_disk_backup6
  47. channel oem_disk_backup6: SID=374 device type=DISK

  48. allocated channel: oem_disk_backup7
  49. channel oem_disk_backup7: SID=18 device type=DISK

  50. allocated channel: oem_disk_backup8
  51. channel oem_disk_backup8: SID=124 device type=DISK

  52. Starting recover at 15-11月-20
  53. no copy of datafile 1 found to recover
  54. no copy of datafile 2 found to recover
  55. no copy of datafile 3 found to recover
  56. no copy of datafile 4 found to recover
  57. no copy of datafile 5 found to recover
  58. no copy of datafile 6 found to recover
  59. no copy of datafile 7 found to recover
  60. no copy of datafile 8 found to recover
  61. no copy of datafile 9 found to recover
  62. no copy of datafile 10 found to recover
  63. no copy of datafile 11 found to recover
  64. no copy of datafile 12 found to recover
  65. no copy of datafile 13 found to recover
  66. no copy of datafile 14 found to recover
  67. no copy of datafile 15 found to recover
  68. no copy of datafile 16 found to recover
  69. Finished recover at 15-11月-20

  70. Starting backup at 15-11月-20
  71. no parent backup or copy of datafile 5 found
  72. no parent backup or copy of datafile 2 found
  73. no parent backup or copy of datafile 3 found
  74. no parent backup or copy of datafile 1 found
  75. no parent backup or copy of datafile 4 found
  76. no parent backup or copy of datafile 6 found
  77. no parent backup or copy of datafile 10 found
  78. no parent backup or copy of datafile 8 found
  79. no parent backup or copy of datafile 7 found
  80. no parent backup or copy of datafile 11 found
  81. no parent backup or copy of datafile 12 found
  82. no parent backup or copy of datafile 14 found
  83. no parent backup or copy of datafile 15 found
  84. no parent backup or copy of datafile 16 found
  85. no parent backup or copy of datafile 9 found
  86. no parent backup or copy of datafile 13 found
  87. channel oem_disk_backup1: starting datafile copy
  88. input datafile file number=00005 name=+DATA/ORCL/DATAFILE/example.279.1054329825
  89. channel oem_disk_backup2: starting datafile copy
  90. input datafile file number=00002 name=+DATA/ORCL/DATAFILE/sysaux.282.1054329823
  91. channel oem_disk_backup3: starting datafile copy
  92. input datafile file number=00003 name=+DATA/ORCL/DATAFILE/undotbs1.286.1054329823
  93. channel oem_disk_backup4: starting datafile copy
  94. input datafile file number=00001 name=+DATA/ORCL/DATAFILE/system.263.1054329825
  95. channel oem_disk_backup5: starting datafile copy
  96. input datafile file number=00004 name=+DATA/orcl/DATAFILE/users.262.1054329889
  97. channel oem_disk_backup6: starting datafile copy
  98. input datafile file number=00006 name=+DATA/ORCL/DATAFILE/tbs1.287.1050417229
  99. channel oem_disk_backup7: starting datafile copy
  100. input datafile file number=00010 name=+DATA/ORCL/DATAFILE/tbsuniform.278.1054763341
  101. channel oem_disk_backup8: starting datafile copy
  102. input datafile file number=00008 name=+DATA/ORCL/DATAFILE/tbs3.289.1050418001
  103. output file name=+FRA/ORCL/DATAFILE/tbs1.434.1056551709 tag=ORAOEM_LEVEL_0 RECID=1 STAMP=1056551712
  104. channel oem_disk_backup6: datafile copy complete, elapsed time: 00:00:05
  105. channel oem_disk_backup6: starting datafile copy
  106. input datafile file number=00007 name=+DATA/ORCL/DATAFILE/tbs2.288.1050417617
  107. output file name=+FRA/ORCL/DATAFILE/users.391.1056551707 tag=ORAOEM_LEVEL_0 RECID=2 STAMP=1056551714
  108. channel oem_disk_backup5: datafile copy complete, elapsed time: 00:00:10
  109. channel oem_disk_backup5: starting datafile copy
  110. input datafile file number=00011 name=+DATA/ORCL/DATAFILE/tbsbig.280.1054764585
  111. output file name=+FRA/ORCL/DATAFILE/tbsuniform.390.1056551711 tag=ORAOEM_LEVEL_0 RECID=3 STAMP=1056551714
  112. channel oem_disk_backup7: datafile copy complete, elapsed time: 00:00:09
  113. channel oem_disk_backup7: starting datafile copy
  114. input datafile file number=00012 name=+DATA/ORCL/DATAFILE/tbsuniform.277.1054764627
  115. output file name=+FRA/ORCL/DATAFILE/tbs2.432.1056551717 tag=ORAOEM_LEVEL_0 RECID=5 STAMP=1056551719
  116. channel oem_disk_backup6: datafile copy complete, elapsed time: 00:00:05
  117. channel oem_disk_backup6: starting datafile copy
  118. input datafile file number=00014 name=+DATA/ORCL/DATAFILE/tbs_nocompression.291.1054936255
  119. output file name=+FRA/ORCL/DATAFILE/tbs3.433.1056551713 tag=ORAOEM_LEVEL_0 RECID=4 STAMP=1056551716
  120. channel oem_disk_backup8: datafile copy complete, elapsed time: 00:00:11
  121. channel oem_disk_backup8: starting datafile copy
  122. input datafile file number=00015 name=+DATA/ORCL/DATAFILE/tbs_basic.292.1054936269
  123. output file name=+FRA/ORCL/DATAFILE/tbsbig.431.1056551719 tag=ORAOEM_LEVEL_0 RECID=6 STAMP=1056551721
  124. channel oem_disk_backup5: datafile copy complete, elapsed time: 00:00:07
  125. channel oem_disk_backup5: starting datafile copy
  126. input datafile file number=00016 name=+DATA/ORCL/DATAFILE/tbs_oltp.293.1054936567
  127. output file name=+FRA/ORCL/DATAFILE/tbsuniform.420.1056551723 tag=ORAOEM_LEVEL_0 RECID=7 STAMP=1056551724
  128. channel oem_disk_backup7: datafile copy complete, elapsed time: 00:00:07
  129. channel oem_disk_backup7: starting incremental level 1 datafile backup set
  130. channel oem_disk_backup7: specifying datafile(s) in backup set
  131. output file name=+FRA/ORCL/DATAFILE/tbs_nocompression.437.1056551725 tag=ORAOEM_LEVEL_0 RECID=8 STAMP=1056551725
  132. channel oem_disk_backup6: datafile copy complete, elapsed time: 00:00:06
  133. channel oem_disk_backup6: starting datafile copy
  134. input datafile file number=00009 name=+DATA/ORCL/DATAFILE/tbsocp05_test.284.1054152837
  135. output file name=+FRA/ORCL/DATAFILE/sysaux.338.1056551705 tag=ORAOEM_LEVEL_0 RECID=10 STAMP=1056551729
  136. channel oem_disk_backup2: datafile copy complete, elapsed time: 00:00:26
  137. channel oem_disk_backup2: starting datafile copy
  138. input datafile file number=00013 name=+DATA/ORCL/DATAFILE/tbs32k.259.1054931811
  139. output file name=+FRA/ORCL/DATAFILE/undotbs1.257.1056551705 tag=ORAOEM_LEVEL_0 RECID=11 STAMP=1056551729
  140. channel oem_disk_backup3: datafile copy complete, elapsed time: 00:00:26
  141. channel oem_disk_backup3: starting incremental level 1 datafile backup set
  142. channel oem_disk_backup3: specifying datafile(s) in backup set
  143. including current SPFILE in backup set
  144. channel oem_disk_backup3: starting piece 1 at 15-11月-20
  145. output file name=+FRA/ORCL/DATAFILE/tbs_basic.419.1056551727 tag=ORAOEM_LEVEL_0 RECID=9 STAMP=1056551728
  146. channel oem_disk_backup8: datafile copy complete, elapsed time: 00:00:08
  147. output file name=+FRA/ORCL/DATAFILE/system.389.1056551707 tag=ORAOEM_LEVEL_0 RECID=13 STAMP=1056551730
  148. channel oem_disk_backup4: datafile copy complete, elapsed time: 00:00:27
  149. output file name=+FRA/ORCL/DATAFILE/tbs_oltp.414.1056551729 tag=ORAOEM_LEVEL_0 RECID=12 STAMP=1056551729
  150. channel oem_disk_backup5: datafile copy complete, elapsed time: 00:00:06
  151. output file name=+FRA/ORCL/DATAFILE/tbsocp05_test.372.1056551731 tag=ORAOEM_LEVEL_0 RECID=14 STAMP=1056551731
  152. channel oem_disk_backup6: datafile copy complete, elapsed time: 00:00:02
  153. including current control file in backup set
  154. channel oem_disk_backup7: starting piece 1 at 15-11月-20
  155. output file name=+FRA/ORCL/DATAFILE/tbs32k.371.1056551731 tag=ORAOEM_LEVEL_0 RECID=15 STAMP=1056551732
  156. channel oem_disk_backup2: datafile copy complete, elapsed time: 00:00:02
  157. channel oem_disk_backup3: finished piece 1 at 15-11月-20
  158. piece handle=+FRA/ORCL/BACKUPSET/2020_11_15/nnsnn1_oraoem_level_0_0.418.1056551733 tag=ORAOEM_LEVEL_0 comment=NONE
  159. channel oem_disk_backup3: backup set complete, elapsed time: 00:00:02
  160. output file name=+FRA/ORCL/DATAFILE/example.395.1056551705 tag=ORAOEM_LEVEL_0 RECID=16 STAMP=1056551733
  161. channel oem_disk_backup1: datafile copy complete, elapsed time: 00:00:30
  162. channel oem_disk_backup7: finished piece 1 at 15-11月-20
  163. piece handle=+FRA/ORCL/BACKUPSET/2020_11_15/ncnnn1_oraoem_level_0_0.373.1056551733 tag=ORAOEM_LEVEL_0 comment=NONE
  164. channel oem_disk_backup7: backup set complete, elapsed time: 00:00:02
  165. Finished backup at 15-11月-20

  166. released channel: oem_disk_backup1

  167. released channel: oem_disk_backup2

  168. released channel: oem_disk_backup3

  169. released channel: oem_disk_backup4

  170. released channel: oem_disk_backup5

  171. released channel: oem_disk_backup6

  172. released channel: oem_disk_backup7

  173. released channel: oem_disk_backup8

  174. allocated channel: oem_sbt_backup1
  175. channel oem_sbt_backup1: SID=135 device type=SBT_TAPE
  176. channel oem_sbt_backup1: Oracle Secure Backup

  177. allocated channel: oem_sbt_backup2
  178. channel oem_sbt_backup2: SID=137 device type=SBT_TAPE
  179. channel oem_sbt_backup2: Oracle Secure Backup

  180. Starting backup at 15-11月-20
  181. current log archived
  182. channel oem_sbt_backup1: starting archived log backup set
  183. channel oem_sbt_backup1: specifying archived log(s) in backup set
  184. input archived log thread=1 sequence=16 RECID=5 STAMP=1056146653
  185. channel oem_sbt_backup1: starting piece 1 at 15-11月-20
  186. channel oem_sbt_backup2: starting archived log backup set
  187. channel oem_sbt_backup2: specifying archived log(s) in backup set
  188. input archived log thread=1 sequence=17 RECID=6 STAMP=1056550481
  189. input archived log thread=1 sequence=18 RECID=7 STAMP=1056551753
  190. channel oem_sbt_backup2: starting piece 1 at 15-11月-20
  191. channel oem_sbt_backup1: finished piece 1 at 15-11月-20
  192. piece handle=ORCL_0jvfjcqb_1_1 tag=TAG20201115T143555 comment=API Version 2.0,MMS Version 12.1.0.2
  193. channel oem_sbt_backup1: backup set complete, elapsed time: 00:00:26
  194. channel oem_sbt_backup2: finished piece 1 at 15-11月-20
  195. piece handle=ORCL_0kvfjcqc_1_1 tag=TAG20201115T143555 comment=API Version 2.0,MMS Version 12.1.0.2
  196. channel oem_sbt_backup2: backup set complete, elapsed time: 00:00:25
  197. Finished backup at 15-11月-20
  198. released channel: oem_sbt_backup1
  199. released channel: oem_sbt_backup2

  200. allocated channel: ORA_MAINT_SBT_TAPE_1
  201. channel ORA_MAINT_SBT_TAPE_1: SID=135 device type=SBT_TAPE
  202. channel ORA_MAINT_SBT_TAPE_1: Oracle Secure Backup

  203. no obsolete backups found

  204. Recovery Manager complete.
  205. [oracle@classroom ~]$
复制代码
  1. [oracle@classroom ~]$ crontab -l
  2. ORACLE_BASE=/u01/app/oracle
  3. ORACLE_SID=orcl
  4. ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_2


  5. 50  14  *  *  *   /u01/app/oracle/product/12.1.0/dbhome_2/bin/rman target / cmdfile=/home/oracle/day1.rcv
复制代码
  1. [root@classroom log]# tail -n 30 -f cron
  2. Nov 15 10:14:03 classroom run-parts[13422]: (/etc/cron.daily) finished logrotate
  3. Nov 15 10:14:03 classroom run-parts[13422]: (/etc/cron.daily) starting rhsmd
  4. Nov 15 10:14:03 classroom run-parts[13422]: (/etc/cron.daily) finished rhsmd
  5. Nov 15 10:14:03 classroom anacron[12552]: Job `cron.daily' terminated
  6. Nov 15 10:14:03 classroom anacron[12552]: Normal exit (1 job run)
  7. Nov 15 10:20:01 classroom CROND[13843]: (root) CMD (test -f /var/lock/subsys/ods-enforcerd && kill -s SIGHUP `cat /var/run/opendnssec/enforcerd.pid` > /dev/null 2> /dev/null)
  8. Nov 15 10:50:01 classroom CROND[15395]: (root) CMD (test -f /var/lock/subsys/ods-enforcerd && kill -s SIGHUP `cat /var/run/opendnssec/enforcerd.pid` > /dev/null 2> /dev/null)
  9. Nov 15 11:01:01 classroom CROND[15946]: (root) CMD (run-parts /etc/cron.hourly)
  10. Nov 15 11:01:01 classroom run-parts[15946]: (/etc/cron.hourly) starting 0anacron
  11. Nov 15 11:01:01 classroom run-parts[15946]: (/etc/cron.hourly) finished 0anacron
  12. Nov 15 11:20:01 classroom CROND[16701]: (root) CMD (test -f /var/lock/subsys/ods-enforcerd && kill -s SIGHUP `cat /var/run/opendnssec/enforcerd.pid` > /dev/null 2> /dev/null)
  13. Nov 15 11:50:01 classroom CROND[19042]: (root) CMD (test -f /var/lock/subsys/ods-enforcerd && kill -s SIGHUP `cat /var/run/opendnssec/enforcerd.pid` > /dev/null 2> /dev/null)
  14. Nov 15 12:01:01 classroom CROND[19824]: (root) CMD (run-parts /etc/cron.hourly)
  15. Nov 15 12:01:01 classroom run-parts[19824]: (/etc/cron.hourly) starting 0anacron
  16. Nov 15 12:01:01 classroom run-parts[19824]: (/etc/cron.hourly) finished 0anacron
  17. Nov 15 14:20:01 classroom CROND[27058]: (root) CMD (test -f /var/lock/subsys/ods-enforcerd && kill -s SIGHUP `cat /var/run/opendnssec/enforcerd.pid` > /dev/null 2> /dev/null)
  18. Nov 15 14:39:41 classroom crontab[32139]: (oracle) BEGIN EDIT (oracle)
  19. Nov 15 14:41:23 classroom crontab[32139]: (oracle) REPLACE (oracle)
  20. Nov 15 14:41:23 classroom crontab[32139]: (oracle) END EDIT (oracle)
  21. Nov 15 14:42:01 classroom crond[1269]: (root) BAD FILE MODE (/var/spool/cron/root)
  22. Nov 15 14:42:01 classroom crond[1269]: (oracle) RELOAD (/var/spool/cron/oracle)





  23. Nov 15 14:50:01 classroom CROND[1966]: (root) CMD (test -f /var/lock/subsys/ods-enforcerd && kill -s SIGHUP `cat /var/run/opendnssec/enforcerd.pid` > /dev/null 2> /dev/null)
  24. Nov 15 14:50:01 classroom CROND[1992]: (oracle) CMD (/u01/app/oracle/product/12.1.0/dbhome_2/bin/rman target / cmdfile=/home/oracle/day1.rcv)
  25. Nov 15 14:50:39 classroom crontab[2447]: (oracle) LIST (oracle)

复制代码

2020-11-15 15-15-58 的屏幕截图.png


回复

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-11-21 20:20 , Processed in 0.036213 second(s), 28 queries .

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