zoukankan      html  css  js  c++  java
  • RMAN Restore, Recovery

    Complete recovery:

    rman target / nocatalog

    startup mount;

    restore database;

    recover database;

    alter database open;   -- 在归档模式下

    恢复的之后, 更改的路径

    rman target / nocatalog

    startup mount;

    run {

      set newname for datafile 1 to ‘/<newdir>/system01.dbf’ …

      restore database;

      switch datafile all;

      recover database;

      alter database open; }

    tablespace 级别de :

    run {

      sql “alter tablespace users offline immediate”;

      restore tablespace users;

      recover tablespace users;

      sql “alter tablespace users online”; }

    使用 rman 重新定位 tablespace 的路径:

    1. 首先确认要转换路径的表空间的datafile. select file#, name, bytes from v$datafiles;

    2. run {

      sql “alter tablespace users offline immediate”;

      set newname for datafile ‘/oradata/u03/users01.dbf’ to ‘/oradata/u04/users01/dbf’ --这句用来指定 restore的路径

      restore(tablespace users);

      switch datafile 3;  -- update the control file and recovery catalog

      recover tablespace users; 

      sql “alter tablespace tbs1 online”; }

    Incomplete Recovery:

    1. Mount the database

    2. Allocate multiple channels for parallelization.

    3. Restore all datafiles.

    4. Recover the database by using UNTIL TIME, UNTIL SEQUENCE, or UNTIL SCN.

    5. Open the database by using RESETLOGS.

    6. Perform a whole database backup.

    run {

      allocate channel c1 type disk;

      allocate channel c2 type disk;

      set until time = ‘2000-12-09:14:44:44’;

      restore database;

      recover database;

      alter database open resetlogs; }

    这里要注意一下: NLS_DATE_FORMAT 这个参数所对应的时间格式.

    run {

      set until sequence 120 thread 1;

      alter database mount;

      restore database;

      recover database;

      sql “alter database open resetlogs”; }

    转载

    恢复的几种情形

    1.在mount 或open 阶段完成的灾难恢复

    非系统表空间,undo表空间,所有的数据文件

    2.在nomount 阶段完成的灾难恢复

    控制文件(controlfile)

    3.在mount 阶段完成的灾难恢复

    系统表空间,联机重做日志文件

  • 相关阅读:
    Web 性能优化
    js 校验身份证
    html5 输入框响应enter按键
    获取浏览器的可视窗口宽高
    js打开新标签
    Java数据脱敏框架
    Spring Boot中的事务管理
    运维监控知识体系
    git常用命令图解 & 常见错误
    安全团队不可错过的七个云安全开源工具(转载)
  • 原文地址:https://www.cnblogs.com/moveofgod/p/3605403.html
Copyright © 2011-2022 走看看