Networker oracle备份恢复

Posted 阿西吧li

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Networker oracle备份恢复相关的知识,希望对你有一定的参考价值。

Oracle

备份恢复文档

(V1.0)

 

 

 

 

 

 

 

 

 

 

  1. 安装networker客户端

    在需要进行恢复的机器上,安装networker客户端,且在netwoker服务端添加client。

    详情参照《Oracle11.2.0.4安装手册》6.2章节。

  2. 恢复参数文件

    建一个简化版的spfile,名为initjxdsjkp.ora (init+实例名)

     

    将数据库启动到nomount状态

     

    从备份集中还原参数文件

    设置dbid:

    set dbid=1774519710;

     

    恢复spfile脚本:

    run

    {

    allocate channel t1 type \'SBT_TAPE\';

    send \'NSR_ENV=( NSR_CLIENT=jxdsjkdbp02,NSR_SERVER=networker,NSR_DATA_VOLUME_POOL=orapool)\';

    restore spfile to \'/u01/app/oracle/product/11.2.0/db/dbs/spfilejxdsjkp.ora\' from autobackup;

    release channel t1;

    }

     

    NSR_CLIENT需要指定你要恢复的数据库networker的client名。

     

    还原参数文件后,重启一下实例,启动到nomount;

    3.恢复控制文件

    Networker查看spfile所在的备份集(参数文件和控制文件都在同一个备份集c-打头)

    恢复脚本:

    set dbid=1774519710;

    run

    {

    allocate channel t1 type \'SBT_TAPE\';

    send channel t1 \'NSR_ENV=( NSR_CLIENT=jxdsjkdbp02,NSR_SERVER=networker,NSR_DATA_VOLUME_POOL=orapool)\';

    restore controlfile from \'c-1774519710-20210617-00\';

    release channel t1;

    }

     

  3. 恢复数据文件

    数据库启动到mount

     

    恢复脚本:

    因为是异机恢复,路径不一致所以需要SET NEWNAME FOR和SWITCH 等操作。

    RUN

    {

    allocate channel t1 type \'SBT_TAPE\';

    allocate channel t2 type \'SBT_TAPE\';

    allocate channel t3 type \'SBT_TAPE\';

    allocate channel t4 type \'SBT_TAPE\';

    send \'NSR_ENV=( NSR_CLIENT=jxdsjkdbp02,NSR_SERVER=networker,NSR_DATA_VOLUME_POOL=orapool)\';

    SET NEWNAME FOR DATAFILE 4 to \'/oradata/jxdsjkp/users01.dbf\';

    SET NEWNAME FOR DATAFILE 3 to \'/oradata/jxdsjkp/undotbs01.dbf\';

    SET NEWNAME FOR DATAFILE 2 to \'/oradata/jxdsjkp/sysaux01.dbf\';

    SET NEWNAME FOR DATAFILE 1 to \'/oradata/jxdsjkp/system01.dbf\';

    SET NEWNAME FOR DATAFILE 5 to \'/oradata/jxdsjkp/datahup01.dbf\';

    SET NEWNAME FOR DATAFILE 6 to \'/oradata/jxdsjkp/datahup02.dbf\';

    SET NEWNAME FOR DATAFILE 7 to \'/oradata/jxdsjkp/datahup03.dbf\';

    SET NEWNAME FOR DATAFILE 8 to \'/oradata/jxdsjkp/datahup04.dbf\';

    SET NEWNAME FOR DATAFILE 9 to \'/oradata/jxdsjkp/datahup05.dbf\';

    SET NEWNAME FOR DATAFILE 10 to \'/oradata/jxdsjkp/datahup06.dbf\';

    set newname for tempfile 1 to \'/oradata/jxdsjkp/temp01.dbf\';

    RESTORE DATABASE;

    SWITCH DATAFILE ALL;

    SWITCH TEMPFILE ALL;

    RECOVER DATABASE;

    release channel t1;

    release channel t2;

    release channel t3;

    release channel t4;

    }

     

    本机恢复脚本:

    Run{

    allocate channel t1 type \'SBT_TAPE\';

    allocate channel t2 type \'SBT_TAPE\';

    allocate channel t3 type \'SBT_TAPE\';

    allocate channel t4 type \'SBT_TAPE\';

    send \'NSR_ENV=( NSR_CLIENT=jxdsjkdbp02,NSR_SERVER=networker,NSR_DATA_VOLUME_POOL=orapool)\';

    RESTORE DATABASE;

    RECOVER DATABASE;

    release channel t1;

    release channel t2;

    release channel t3;

    release channel t4;

    }

  4. 修改redo文件位置

    异机恢复(路径不同):

    alter database rename file \'/oracle/database/oradata/jxdsjkp/redo01.log\' to \'/oradata/jxdsjkp/redo01.log\';

    alter database rename file \'/oracle/database/oradata/jxdsjkp/redo02.log\' to \'/oradata/jxdsjkp/redo02.log\';

    alter database rename file \'/oracle/database/oradata/jxdsjkp/redo03.log\' to \'/oradata/jxdsjkp/redo03.log\';

     

    原机恢复不需要上述操作。

  5. 启动数据库

    Alter database open resetlogs;

以上是关于Networker oracle备份恢复的主要内容,如果未能解决你的问题,请参考以下文章

如何Oracle 数据库备份与恢复

oracle rman备份与恢复 全量备份、增量备份

ORACLE备份恢复问题,请帮忙解析

oracle如何备份单表并在新数据库恢复?

oracle rac rman 备份 怎么恢复到另外的rac

oracle有多个整个数据库备份集 如何选择恢复的备份集