Bo's Oracle Station

查看: 1796|回复: 0

课程第29/30次

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2019-12-9 20:04:16 | 显示全部楼层 |阅读模式
  1. obtool  chdev -t library -o -a station76:/dev/sg12 lib01
复制代码
  1. obtool  chdev -t tape -o -a station76:/dev/sg6 -l lib01 -d 3 tape03
复制代码
  1. obtool  chdev -t tape -o -a station76:/dev/sg7 -l lib01 -d 4 tape04
复制代码
  1. RMAN>  run {
  2. 2>  sql "alter session set nls_date_format=''YYYY-MM-DD:HH24:MI:SS''";
  3. 3> set until time '2019-12-08:10:58:11';
  4. 4>  restore database;
  5. 5>  recover database;
  6. 6> }
复制代码



----------1. 所有备份操作只要2个数字的增量就可以:0,1
2. 生产环境没有人做full备份
3. 项目实施时候做0级增量备份,以后做普通(差分)增量备份,时间长了做累积增量备份,时间更长了再做0级。
    (restore (0)---> recover(1,1,1,1,1)/(1c  incremental level 1 cumulative))--->recover archivelog
4. 0不现实了, 0 image (backup as copy database)--->apply archivelog ---> 新0级
----
14实验如果用闪回6做:
  1. select  * from dba_data_files;
复制代码

2.png

-----NAME--------------------------------------------------------------------------------+DATA/orcl/tempfile/temp.267.1014724469*****************The values found:*****************select        * from hr.t30385                  *ERROR at line 1:ORA-00376: file 4 cannot be read at this timeORA-01110: data file 4: '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00004'SQL> Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit ProductionWith the Partitioning, Automatic Storage Management, OLAP, Data Miningand Real Application Testing options
-----------------
  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=station76)';
  8. allocate channel oem_sbt_backup2 type 'SBT_TAPE' format '%U' parms 'ENV=(OB_MEDIA_FAMILY=station76)';
  9. backup archivelog all not backed up;
  10. }
  11. allocate channel for maintenance device type 'SBT_TAPE' parms 'ENV=(OB_MEDIA_FAMILY=station76)';
  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=station76)';
  20. allocate channel oem_sbt_backup2 type 'SBT_TAPE' format '%U' parms 'ENV=(OB_MEDIA_FAMILY=station76)';
  21. backup recovery area;
  22. }
  23. allocate channel for maintenance device type 'SBT_TAPE' parms 'ENV=(OB_MEDIA_FAMILY=station76)';
  24. delete noprompt obsolete recovery window of 31 days device type 'SBT_TAPE';
复制代码

--------------------------------------------------------------
  1. RMAN>  list failure closed;

  2. List of Database Failures
  3. =========================

  4. Failure ID Priority Status    Time Detected       Summary
  5. ---------- -------- --------- ------------------- -------
  6. 28340      CRITICAL CLOSED    2019-12-08:11:12:41 System datafile 1: '+DATA/orcl/datafile/system.256.1014504215' needs media recovery
  7. 28337      CRITICAL CLOSED    2019-12-08:11:12:41 Control file needs media recovery
  8. 3715       CRITICAL CLOSED    2019-07-27:11:51:23 System datafile 1: '+DATA/orcl/datafile/system.256.1014504215' needs media recovery
  9. 3712       CRITICAL CLOSED    2019-07-27:11:51:23 Control file needs media recovery
  10. 3695       CRITICAL CLOSED    2019-07-27:11:38:34 Control file +FRA/orcl/controlfile/current.256.1014720107 is missing
  11. 3692       CRITICAL CLOSED    2019-07-27:11:38:34 Control file +DATA/orcl/controlfile/current.260.1014720105 is missing
  12. 3495       CRITICAL CLOSED    2019-07-27:10:39:59 Control file +FRA/orcl/controlfile/current.256.1013960969 is missing
  13. 3492       CRITICAL CLOSED    2019-07-27:10:39:58 Control file +DATA/orcl/controlfile/current.260.1013960967 is missing
  14. 3262       CRITICAL CLOSED    2019-07-24:22:32:20 System datafile 1: '+DATA/orcl/datafile/system.256.1013960881' is missing
  15. 28526      HIGH     CLOSED    2019-12-08:11:52:19 Datafile 4: '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00004' is missing
  16.   Impact: Some objects in tablespace USERS might be unavailable
  17. 28358      HIGH     CLOSED    2019-12-08:11:12:41 Datafile 4: '+DATA/orcl/datafile/users.259.1014330935' is missing
  18.   Impact: Some objects in tablespace USERS might be unavailable
  19. 1965       HIGH     CLOSED    2019-07-22:22:32:08 Datafile 4: '+DATA/orcl/datafile/users.259.1014330027' is missing
  20.   Impact: Some objects in tablespace USERS might be unavailable
  21. 1845       HIGH     CLOSED    2019-07-22:22:13:56 Datafile 4: '+DATA/orcl/datafile/users.259.1013960885' is missing
  22.   Impact: Some objects in tablespace USERS might be unavailable
  23. 28520      HIGH     CLOSED    2019-12-08:11:52:19 Datafile 4: '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00004' is offline
  24.   Impact: Some objects in tablespace USERS might be unavailable
  25. 28517      HIGH     CLOSED    2019-12-08:11:52:19 One or more non-system datafiles are offline
  26. 28406      HIGH     CLOSED    2019-12-08:11:12:41 Datafile 12: '+DATA/orcl/datafile/tbsaudit.283.1016750197' needs media recovery
  27.   Impact: Some objects in tablespace TBSAUDIT might be unavailable
  28. 28400      HIGH     CLOSED    2019-12-08:11:12:41 Datafile 11: '+DATA/orcl/datafile/tbs11g.282.1017141789' needs media recovery
  29.   Impact: Some objects in tablespace TBS11G might be unavailable
  30. 28394      HIGH     CLOSED    2019-12-08:11:12:41 Datafile 10: '+DATA/orcl/datafile/tbs10g.281.1017141731' needs media recovery
  31.   Impact: Some objects in tablespace TBS10G might be unavailable
  32. 28388      HIGH     CLOSED    2019-12-08:11:12:41 Datafile 9: '+DATA/orcl/datafile/tbslogical.265.1015349393' needs media recovery
  33.   Impact: Some objects in tablespace TBSLOGICAL might be unavailable
  34. 28382      HIGH     CLOSED    2019-12-08:11:12:41 Datafile 8: '/u01/app/oracle/oradata/orcl/TBSSOLARIS.DBF' needs media recovery
  35.   Impact: Some objects in tablespace TBSSOLARIS might be unavailable
  36. 28376      HIGH     CLOSED    2019-12-08:11:12:41 Datafile 7: '/u01/app/oracle/oradata/orcl/TBS05319X.DBF' needs media recovery
  37.   Impact: Some objects in tablespace TBS05319X might be unavailable
  38. 28370      HIGH     CLOSED    2019-12-08:11:12:41 Datafile 6: '/u01/app/oracle/oradata/orcl/TBS05319.DBF' needs media recovery
  39.   Impact: Some objects in tablespace TBS05319 might be unavailable
  40. 28364      HIGH     CLOSED    2019-12-08:11:12:41 Datafile 5: '+DATA/orcl/datafile/example.280.1015348375' needs media recovery
  41.   Impact: Some objects in tablespace EXAMPLE might be unavailable
  42. 28352      HIGH     CLOSED    2019-12-08:11:12:41 Datafile 3: '+DATA/orcl/datafile/undotbs1.258.1013960883' needs media recovery
  43.   Impact: Some objects in tablespace UNDOTBS1 might be unavailable
  44. 28346      HIGH     CLOSED    2019-12-08:11:12:41 Datafile 2: '+DATA/orcl/datafile/sysaux.257.1013960883' needs media recovery
  45.   Impact: Some objects in tablespace SYSAUX might be unavailable
  46. 6515       HIGH     CLOSED    2019-08-03:17:37:58 Datafile 9: '+DATA/orcl/datafile/tbslogical.265.1015349393' needs media recovery
  47.   Impact: Some objects in tablespace TBSLOGICAL might be unavailable
  48. 3739       HIGH     CLOSED    2019-07-27:11:51:23 Datafile 5: '+DATA/orcl/datafile/example.265.1013960987' needs media recovery
  49.   Impact: Some objects in tablespace EXAMPLE might be unavailable
  50. 3727       HIGH     CLOSED    2019-07-27:11:51:23 Datafile 3: '+DATA/orcl/datafile/undotbs1.258.1013960883' needs media recovery
  51.   Impact: Some objects in tablespace UNDOTBS1 might be unavailable
  52. 3721       HIGH     CLOSED    2019-07-27:11:51:23 Datafile 2: '+DATA/orcl/datafile/sysaux.257.1013960883' needs media recovery
  53.   Impact: Some objects in tablespace SYSAUX might be unavailable
  54. 3555       HIGH     CLOSED    2019-07-27:10:55:38 Datafile 4: '+DATA/orcl/datafile/users.259.1014330935' needs media recovery
  55.   Impact: Some objects in tablespace USERS might be unavailable
  56. 3552       HIGH     CLOSED    2019-12-08:11:12:41 One or more non-system datafiles need media recovery
  57. 1842       HIGH     CLOSED    2019-12-08:11:12:41 One or more non-system datafiles are missing
  58. 6435       HIGH     CLOSED    2019-08-03:17:13:33 Block 175 in datafile 5: '+DATA/orcl/datafile/example.280.1015348375' is media corrupt
  59.   Impact: Object DEPARTMENTS owned by HR might be unavailable
  60. 6432       HIGH     CLOSED    2019-08-03:17:13:33 Datafile 5: '+DATA/orcl/datafile/example.280.1015348375' contains one or more corrupt blocks
  61. 3512       HIGH     CLOSED    2019-07-27:10:43:10 Name for datafile 4 is unknown in the control file
  62. 1848       HIGH     CLOSED    2019-07-22:22:13:56 Tablespace 4: 'USERS' is offline

  63. RMAN>
复制代码
  1. select  * from v$ir_failure order by 5 desc;
复制代码

3.png

----------------------------------
  1. RMAN> CONFIGURE RETENTION POLICY TO recovery window of 7 days;
复制代码
  1. SQL> alter system set control_file_record_keep_time=7;
复制代码



回复

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-5-9 07:14 , Processed in 0.174068 second(s), 27 queries .

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