NBU70forlinuxOracle异机恢复详解.docx
《NBU70forlinuxOracle异机恢复详解.docx》由会员分享,可在线阅读,更多相关《NBU70forlinuxOracle异机恢复详解.docx(16页珍藏版)》请在冰豆网上搜索。
![NBU70forlinuxOracle异机恢复详解.docx](https://file1.bdocx.com/fileroot1/2023-5/24/9b02ff8e-6a24-417e-a2cb-5411bf18fc19/9b02ff8e-6a24-417e-a2cb-5411bf18fc191.gif)
NBU70forlinuxOracle异机恢复详解
NBU7.0_forlinux_Oracle_异机恢复
1.在目标客户机安装NBUClient软件,运行/usr/openv/netbackup/bin/oracle_link.sh连接数据库;
2.编辑/usr/openv/netbackup/bp.conf文件,写入源客户机主机名
#catbp.conf
SERVER=waanbu1
CLIENT_NAME=p520-1
CLIENT_NAME=svc
3.编辑etc/hosts文件,写入MasterServer和源客户机的解析
4.在MasterServer上面创建文件/netbackup/db/altnames/No.Restriction,文件内容为空;
5.重启目标客户机的NBU服务;
6.数据库准备工作:
a.数据库版本一致;
b.数据库SID一致;
c.数据库ORACLE_HOME一致;
d.数据库监听服务,目录结构和pfile文件需要一致;
7.恢复控制文件:
打开MasterServer恢复控制台
选择File>SpecifyNetbackupMachinesandPolicyType。
。
。
点击编辑客户机列表;
添加目标和源客户机主机名
选择源客户机和目标客户机以及备份类型
点击SelectforRestore
选择最新的控制文件
点击Action>Restore
选择恢复目标文件目录
查看恢复状态。
控制文件恢复到异机磁盘完毕后:
a.进入oracle用户
$rman
RMAN>connecttarget/
Connectedtotargetdatabase:
DCTM(notmount)
RMAN>setdbid=3248879935
setdbid=702089904
b.使用RMANrestore已经恢复到本地磁盘的控制文件
RMAN>run{
2>allocatechannelch00typedisk;
3>restorecontrolfilefrom‘/usr/openv/script/control.ora’;
4>releasechannelch00;
5>}
c.将数据库置于mount状态:
RMAN>Alterdatabasemount;
d.使用RMAN恢复数据文件;
8.异机恢复数据文件
RMAN>run{
2>allocatechannelch00type'sbt_tape';
3>send'NB_ORA_CLIENT=eas02,NB_ORA_SERV=backup';
4>restoredatabase;
5>releasechannelch00;
6>}
以上执行的是将数据文件基本恢复到oradata中,然后执行recover
RMAN>run{
2>allocatechannelch00type'sbt_tape';
3>send'NB_ORA_CLIENT=svc,NB_ORA_SERV=waanbu1';
4>recoverdatabase;
5>releasechannelch00;
6>}
allocatedchannel:
ch00
channelch00:
sid=1639devtype=SBT_TAPE
channelch00:
VeritasNetBackupforOracle-Release7.0(2010010501)
sentcommandtochannel:
ch00
Startingrecoverat16-MAR-11
channelch00:
startingincrementaldatafilebackupsetrestore
channelch00:
specifyingdatafile(s)torestorefrombackupset
destinationforrestoreofdatafile00120:
/oraapp1/oradata/dctm/dm_CNPDC_PK_db.dbf
destinationforrestoreofdatafile00129:
/oraapp1/oradata/dctm/dm_CNPDC_XA_ind.dbf
destinationforrestoreofdatafile00131:
/oraapp1/oradata/dctm/dm_CNPDC_CQ_ind.dbf
destinationforrestoreofdatafile00133:
/oraapp1/oradata/dctm/dm_CNPDC_JA_ind.dbf
destinationforrestoreofdatafile00135:
/oraapp1/oradata/dctm/dm_CNPDC_LJ_ind.dbf
channelch00:
readingfrombackuppiecebk_789_1_745784966
channelch00:
restoredbackuppiece1
piecehandle=bk_789_1_745784966tag=HOT_DB_BK_LEVEL0
channelch00:
restorecomplete,elapsedtime:
00:
01:
05
channelch00:
startingincrementaldatafilebackupsetrestore
channelch00:
specifyingdatafile(s)torestorefrombackupset
destinationforrestoreofdatafile00009:
/oraapp1/oradata/dctm/dm_CNPDC_AC_db.dbf
destinationforrestoreofdatafile00023:
/oraapp1/oradata/dctm/dm_CNPDC_MX_ind.dbf
destinationforrestoreofdatafile00048:
/oraapp1/oradata/dctm/dm_CNPDC_BZ_db.dbf
destinationforrestoreofdatafile00089:
/oraapp1/oradata/dctm/dm_CNPDC_CK_ind.dbf
destinationforrestoreofdatafile00096:
/oraapp1/oradata/dctm/dm_CNPDC_HY_db.dbf
channelch00:
readingfrombackuppiecebk_798_1_745785550
channelch00:
restoredbackuppiece1
piecehandle=bk_798_1_745785550tag=HOT_DB_BK_LEVEL0
channelch00:
restorecomplete,elapsedtime:
00:
01:
05
channelch00:
startingincrementaldatafilebackupsetrestore
channelch00:
specifyingdatafile(s)torestorefrombackupset
destinationforrestoreofdatafile00058:
/oraapp1/oradata/dctm/dm_CNPDC_WA_db.dbf
destinationforrestoreofdatafile00082:
/oraapp1/oradata/dctm/dm_CNPDC_CG_db.dbf
destinationforrestoreofdatafile00109:
/oraapp1/oradata/dctm/dm_CNPDC_AZ_ind.dbf
destinationforrestoreofdatafile00116:
/oraapp1/oradata/dctm/dm_CNPDC_BN_db.dbf
destinationforrestoreofdatafile00128:
/oraapp1/oradata/dctm/dm_CNPDC_XA_db.dbf
channelch00:
readingfrombackuppiecebk_808_1_745786140
channelch00:
restoredbackuppiece1
piecehandle=bk_808_1_745786140tag=HOT_DB_BK_LEVEL0
channelch00:
restorecomplete,elapsedtime:
00:
01:
05
startingmediarecovery
channelch00:
startingarchivelogrestoretodefaultdestination
channelch00:
restoringarchivelog
archivelogthread=1sequence=14970
channelch00:
restoringarchivelog
archivelogthread=1sequence=14971
channelch00:
restoringarchivelog
archivelogthread=1sequence=14972
channelch00:
readingfrombackuppieceal_821_1_745786849
channelch00:
restoredbackuppiece1
piecehandle=al_821_1_745786849tag=TAG20110314T185921
channelch00:
restorecomplete,elapsedtime:
00:
00:
55
archivelogfilename=/oraapp1/archivelog/1_14970_727030399.dbfthread=1sequence=14970
archivelogfilename=/oraapp1/archivelog/1_14971_727030399.dbfthread=1sequence=14971
archivelogfilename=/oraapp1/archivelog/1_14972_727030399.dbfthread=1sequence=14972
channelch00:
startingarchivelogrestoretodefaultdestination
channelch00:
restoringarchivelog
archivelogthread=1sequence=14982
channelch00:
restoringarchivelog
archivelogthread=1sequence=14983
channelch00:
restoringarchivelog
archivelogthread=1sequence=14984
channelch00:
restoringarchivelog
archivelogthread=1sequence=14985
channelch00:
restoringarchivelog
archivelogthread=1sequence=14986
channelch00:
restoringarchivelog
archivelogthread=1sequence=14987
channelch00:
restoringarchivelog
archivelogthread=1sequence=14988
channelch00:
restoringarchivelog
archivelogthread=1sequence=14989
channelch00:
restoringarchivelog
archivelogthread=1sequence=14990
channelch00:
readingfrombackuppieceal_824_1_745808362
channelch00:
restoredbackuppiece1
piecehandle=al_824_1_745808362tag=TAG20110315T005922
channelch00:
restorecomplete,elapsedtime:
00:
01:
15
channelch00:
startingarchivelogrestoretodefaultdestination
channelch00:
restoringarchivelog
archivelogthread=1sequence=14973
channelch00:
restoringarchivelog
archivelogthread=1sequence=14974
channelch00:
restoringarchivelog
archivelogthread=1sequence=14975
channelch00:
restoringarchivelog
archivelogthread=1sequence=14976
channelch00:
restoringarchivelog
archivelogthread=1sequence=14977
channelch00:
restoringarchivelog
archivelogthread=1sequence=14978
channelch00:
restoringarchivelog
archivelogthread=1sequence=14979
channelch00:
restoringarchivelog
archivelogthread=1sequence=14980
channelch00:
restoringarchivelog
archivelogthread=1sequence=14981
channelch00:
readingfrombackuppieceal_823_1_745808362
channelch00:
restoredbackuppiece1
piecehandle=al_823_1_745808362tag=TAG20110315T005922
channelch00:
restorecomplete,elapsedtime:
00:
01:
05
archivelogfilename=/oraapp1/archivelog/1_14973_727030399.dbfthread=1sequence=14973
archivelogfilename=/oraapp1/archivelog/1_14974_727030399.dbfthread=1sequence=14974
archivelogfilename=/oraapp1/archivelog/1_14975_727030399.dbfthread=1sequence=14975
archivelogfilename=/oraapp1/archivelog/1_14976_727030399.dbfthread=1sequence=14976
archivelogfilename=/oraapp1/archivelog/1_14977_727030399.dbfthread=1sequence=14977
archivelogfilename=/oraapp1/archivelog/1_14978_727030399.dbfthread=1sequence=14978
archivelogfilename=/oraapp1/archivelog/1_14979_727030399.dbfthread=1sequence=14979
archivelogfilename=/oraapp1/archivelog/1_14980_727030399.dbfthread=1sequence=14980
archivelogfilename=/oraapp1/archivelog/1_14981_727030399.dbfthread=1sequence=14981
archivelogfilename=/oraapp1/archivelog/1_14982_727030399.dbfthread=1sequence=14982
archivelogfilename=/oraapp1/archivelog/1_14983_727030399.dbfthread=1sequence=14983
archivelogfilename=/oraapp1/archivelog/1_14984_727030399.dbfthread=1sequence=14984
archivelogfilename=/oraapp1/archivelog/1_14985_727030399.dbfthread=1sequence=14985
archivelogfilename=/oraapp1/archivelog/1_14986_727030399.dbfthread=1sequence=14986
archivelogfilename=/oraapp1/archivelog/1_14987_727030399.dbfthread=1sequence=14987
archivelogfilename=/oraapp1/archivelog/1_14988_727030399.dbfthread=1sequence=14988
archivelogfilename=/oraapp1/archivelog/1_14989_727030399.dbfthread=1sequence=14989
archivelogfilename=/oraapp1/archivelog/1_14990_727030399.dbfthread=1sequence=14990
unabletofindarchivelog
archivelogthread=1sequence=14991
releasedchannel:
ch00
RMAN-00571:
===========================================================
RMAN-00569:
===============ERRORMESSAGESTACKFOLLOWS===============
RMAN-00571:
===========================================================
RMAN-03002:
failureofrecovercommandat03/16/201112:
18:
06
RMAN-06054:
mediarecoveryrequestingunknownlog:
thread1seq14991lowscn403666149
以上报错是因为需要将数据库置于新的归档中
$sqlplus/nolog
SQL*Plus:
Release10.2.0.4.0-ProductiononWedMar1612:
23:
462011
Copyright(c)1982,2007,Oracle.AllRightsReserved.
SQL>conn/assysdba;
Connected.
SQL>shutdownimmediate
ORA-01109:
databasenotopen
Databasedismounted.
ORACLEinstanceshutdown.
SQL>startupmount
ORACLEinstancestarted.
TotalSystemGlobalArea2.3622E+10bytes
FixedSize2126584bytes
VariableSize1.4194E+10bytes
DatabaseBuffers9412018176bytes
RedoBuffers14647296bytes
Databasemounted.
SQL>recoverdatabaseusingbackupcontrolfileuntilcancel;
ORA-00279:
change403666149generatedat03/15/201100:
59:
22neededforthread
1
ORA-00289:
suggestion:
/oraapp1/archivelog/1_14991_727030399.dbf
ORA-00280:
change403666149forthread1isinsequence#14991
Specifylog:
{=suggested|filename|AUTO|CANCEL}
cancel
Mediarecoverycancelled.
SQL>alterdatabaseopenresetlogs;
Databasealtered.
SQL>
SQL>select*status,instance_namefromV$instance;
STATUSINSTANCE_NAME
----------------------------
OPENdctm
确认数据库可正常启动并能使用