千家信息网

rman结合netbackup重定向恢复oracle数据库

发表于:2025-11-11 作者:千家信息网编辑
千家信息网最后更新 2025年11月11日,1.创建数据库目录2.从原来主机复制pfile文件,并更改oracle_sidvi .bash_profilesource .bash_profile3.启动数据到nomount状态$ sqlplus
千家信息网最后更新 2025年11月11日rman结合netbackup重定向恢复oracle数据库

1.创建数据库目录

2.从原来主机复制pfile文件,并更改oracle_sid

vi .bash_profilesource .bash_profile

3.启动数据到nomount状态

$ sqlplus / as sysdbaSQL> startup nomount pfile='pfile文件绝对位置';ORACLE instance started.SQL> exit


4.查看备份controlfile列表

$ /usr/openv/netbackup/bin/bplist -S 备份服务器 -C 备份客户端 -t 4 -s 09/10/2000 -e  09/11/2000 -R -l /该命令中-s参数后面接开始日期,-e参数接结束日期,表示获取该时间段内的控制文件列表


5.恢复controlfile文件

$ rman target /RMAN>run{allocate channel a0 type 'sbt_tape';allocate channel a1 type 'sbt_tape';send 'nb_ora_serv=备份服务器  , nb_ora_client=备份客户端';restore controlfile from ' cntrl_xxx_x_xxxxxxxxx';   #控制文件名由上一步骤中得到release channel a0;release channel a1;}RMAN> exit


注意:在这里报错

RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03009: failure of allocate command on a0 channel at 06/14/2011 11:45:03ORA-19554: error allocating device, device type: SBT_TAPE, device name: ORA-27211: Failed to load Media Management Libraryrace文件发现没有libobk.so所致,拷贝libobk.so至oracle安装目录下的lib/下面cp /usr/openv/netbackup/bin/libobk.so64.1 /opt/oracle/product/9.2/lib/libobk.so或者做一个软链接ln -s /usr/openv/netbackup/bin/libobk.so64  /opt/oracle/product/9.2/lib/libobk.so


6.启动数据库到mount状态

$ sqlplus / as sysdbaSQL> alter database mount;Database altered.SQL> exit


7.恢复数据库

$ rman target /run{allocate channel a0 type 'sbt_tape';allocate channel a1 type 'sbt_tape';allocate channel a2 type 'sbt_tape';allocate channel a3 type 'sbt_tape';send 'nb_ora_serv=备份服务器  , nb_ora_client=备份客户端';restore database;recover database;release channel a0;release channel a1;release channel a2;release channel a3;}

8.Reset log 打开数据库

$ sqlplus / as sysdbaSQL> alter database open resetlogs;


0