异机恢复ORACLE数据库(NBU)

合集下载

NBU异机恢复Oracle操作步骤

NBU异机恢复Oracle操作步骤

NBU异机恢复Oracle操作步骤NBU 异机恢复Oracle操作步骤Hehuyi_In 于 2020-05-15 22:36:22 发布 1507 收藏 5分类专栏: Oracle 备份还原版权Oracle同时被 2 个专栏收录206 篇⽂章4 订阅订阅专栏备份还原31 篇⽂章0 订阅订阅专栏⼀、准备⼯作1. DBA恢复服务器安装与原库相同版本的数据库软件、NBU客户端双向开通到NBU备份服务器的1556、13724、13720、13782、13790端⼝的防⽕墙策略(应该只要1556和13724,但为避免还原时出现其他异常,建议都开)/etc/hosts⽂件添加NBU备份服务器主机名及原库主机名,ping 主机名测试能否解析成功确保恢复服务器磁盘空间⾜够2. NBU管理员/etc/hosts⽂件添加待恢复服务器主机名,ping 主机名测试能否解析成功,若不成功可使⽤bpclntcmd -clear_host_cache清除nbu端dns缓存配置恢复授权,确保备份机器和还原机器都在列表中,且允许还原Host Properties->Mater server->Client Attributes若是异机恢复,需在NBU给备份机器和恢复机器增加异机恢复的权限cd /usr/openv/netbackup/db/altnamestouch 主机名检查异机恢复参数NBUInstallPath/NetBackup/bin/admincmd/bpgetconfig | grep "DISALLOW_CLIENT"#输出DISALLOW_CLIENT_LIST_RESTORE = NODISALLOW_CLIENT_RESTORE = NO#若如上两个参数为YES,则表⽰禁⽌进⾏异机恢复,需要将两个参数改成NO,为保证参数⽣效,建议修改后重启主服务器上的NBU服务NBUInstallPath/NetBackup/bin/bp.kill_allNBUInstallPath/NetBackup/bin/bp.start_all⼆、数据恢复以下均在待恢复服务器操作1. 检查备份⽂件情况/usr/openv/netbackup/bin/bplist -C iZwz94g9fehswlnzd19jv2Z -t 4 -b -l -R /# -C后跟备份库主机名;-t后跟还原类型,4是oracle标志;-b指列出备份⽂件的⽇期和时间;-l指列出备份⽂件的详细信息;-R以递归的⽅式显⽰⼦⽬录。

nbu_异机oracle还原_自己实验

nbu_异机oracle还原_自己实验

要消除对所有客户端的限制,可在NetBackup主服务器上创建以下文件:UNIX/Linux: /usr/openv/netbackup/db/altnames/No.RestrictionsWindows: install_path\NetBackup\db\altnames\No.Restrictions要允许客户端仅从特定客户端还原,请在NetBackup主服务器上创建以下文件:UNIX/Linux: /usr/openv/netbackup/db/altnames/client_nameWindows: install_path\NetBackup\db\altnames\client_name在d:\app\oracle下面创建d:\app\oracle\admin\test\adump dpdumppfiled:\app\oracle\flash_recovery_aread:\app\oracle\oradata\testD:/>set ORACLE_SID=testD:/>oradim.exe -new -sid test -startmode m(后面还需要在我的电脑,属性--高级--环境变量---系统变量--新建,变量名=oracle_sid,变量值=XXXX,XXXX就是你的database SID,否则sqlplus /nolog,conn /as sysdba会报错)D:/>orapwd file=D:\app\oracle\product\11.2.0\dbhome_1\database\PWDtest.ora password=oracleRMAN> set DBID=2129635993 (查看SQL> select dbid from v$database)正在执行命令: SET DBIDRMAN> startup nomount已连接到目标数据库(未启动)启动失败: ORA-01078: failure in processing system parametersLRM-00109: ???????????????? 'D:\APP\ORACLE\PRODUCT\11.2.0\DBHOME_1\DATABASE\INIT TEST.ORA'在没有参数文件的情况下启动Oracle 实例以检索spfileOracle 实例已启动系统全局区域总计158662656 字节Fixed Size 2173840 字节Variable Size 88081520 字节Database Buffers 62914560 字节Redo Buffers 5492736 字节RMAN>run{ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';SEND 'NB_ORA_CLIENT=db1,NB_ORA_SID=test,NB_ORA_SERV=ibmx64server';restorespfile to pfile 'D:\app\oracle\product\11.2.0\dbhome_1\database\inittest.ora' from 'sp_u0roov8bs_s27_p1_t831496572';RELEASE CHANNEL ch00;}RMAN>shutdown abort;修改inittest.ora中的控制文件路径为新的路径。

NBU入门_异机恢复oracle_nocatalog

NBU入门_异机恢复oracle_nocatalog

NetBackup将Oracle数据库恢复到其它服务器(rman nocatalog)一、假设不使用rman catalog。

假设要将数据库恢复到new_host的不同文件系统/data上。

以oracle8i语法为例,Oracle9无svrmgrl,需用sqlplus “/ as sysdba”。

1. 在new_host上创建dba组和与old_host相同的Oracle用户。

将/data的可写权限给Oracle用户。

确定new_host上有足够的硬盘空间存放新的datafile及archive log file。

2. 修改.profile文件中相关的Oracle环境变量,ORACLE_SID保持与old_host中一致。

3. 安装与old_host相同版本的Oracle数据库软件,不创建数据库。

4. 将old_host中$ORACLE_HOME/dbs下的initSID.ora文件拷至new_host的$ORACLE_HOME/dbs下。

如果initSID.ora中有ifile=’xxx.ora’,则将xxx.ora也进行拷贝。

Oracle9也可能用spinitSID.ora。

5. 创建initSID.ora(及xxx.ora)中所用到的目录。

通常所需建立的目录为background_dump_dest、core_dump_dest、user_dump_dest、log_archive_dest。

常6. 在new_host上安装和配置NetBackup client和Oracle Agent。

注意在NetBackup Server的/usr/openv/netbackup/db/altnames目录下touch No.Restrictions (允许异机恢复)。

7. 从原机copy或从磁带异机恢复standard方式备份的最新的control file到new_host的/data目录下。

8. 修改initSID.ora(及xxx.ora),如果是OPS,将OPS相关的参数去掉:(1) control_files = (“/data/controlfile_name”)(2) log_archive_dest=”/data/arch”(3) sort_area_size=20000000# 如果sort_area_size不够大,恢复archive_log时可能出现ora-12209. svrmgrl> startup mount10. svrmgrl> select file# from v$datafile,记录file#11. svrmgrl> select * from v$logfile,记录log文件的目录。

NBU异机恢复windows oracle11g

NBU异机恢复windows oracle11g

2) 查看归档日志是否开启
archive log list
这里显示归档日志未开启。
3) 开启归档日志
关闭数据库:shutdown immediate;
启动数据库为 mount 状态:startup mount;
开启归档模式:alter database archivelog;
打开数据库查询:alter database open; archive log list;
2) 登录 RMAN rman target / nocatalog;
3) 关闭数据库 shutdown immediate;
4) 启动数据库为 nomount 状态 startup nom需要和源端 wxf-wos 的 dbid 一样:1763780182) set dbid=1763780182;
NBU 异机恢复 oracle
1. 相关信息表 一、网络信息
名称 NBU Master Server Oracle 源客户端 Oracle 目标客户端 主机名 wxf-wns wxf-wos wxf-wog IP 172.16.202.204 172.16.202.205 172.16.202.206 操作系统 Windows server 2008 R2 standard Windows server 2008 R2 standard Windows server 2008 R2 standard
二、 查看源端(wxf-wos)一些相关信息
查看 SID:select name from v$database;
查看 dbid:select dbid from v$database;
三、 查看目标端(wxf-wog)一些相关信息
1) 查看 oracle 的 SID

NBU NetBackup 恢复Oracle

NBU NetBackup 恢复Oracle

本机恢复以恢复172.16.7.103(主机名ylbi)上的oracle为例,进行说明。

1.查看数据文件的存放位置。

SQL> select * from dba_data_files;2.备份所有数据文件。

$ pwd/sapboe/oradata$ ls -ltotal 8drwxr-x--- 2 orabop dba 4096 Dec 18 11:10 BOP $ tar -cvf BOP.tar BOP/a BOP/a BOP/bo_temp01.dbf 1024016 blocks.a BOP/boe_data01.dbf 1024016 blocks.a BOP/boe_data02.dbf 1024016 blocks.a BOP/boe_data03.dbf 1024016 blocks.a BOP/control01.ctl 15072 blocks.a BOP/cre_eas.dbf 102416 blocks.a BOP/ds_ce_data01.dbf 1024016 blocks.a BOP/ds_ce_data02.dbf 1024016 blocks.a BOP/ds_lo_data01.dbf 1024016 blocks.a BOP/ds_lo_data02.dbf 1024016 blocks.a BOP/ds_temp01.dbf 1024016 blocks.a BOP/loc_eas.dbf 274832 blocks.a BOP/redo01.log 102401 blocks.a BOP/redo02.log 102401 blocks.a BOP/redo03.log 102401 blocks.a BOP/sysaux01.dbf 1986576 blocks.a BOP/system01.dbf 1495056 blocks.a BOP/temp01.dbf 59408 blocks.a BOP/undotbs01.dbf 204816 blocks.a BOP/users01.dbf 10256 blocks.3.将备份出的BOP.tar包放到其他路径。

NBU oracle rac 异机恢复到单机(11G)

NBU oracle rac 异机恢复到单机(11G)

oracle 11g rac 恢复到单机环境介绍:10.204.101.45和46是11.2.0.4.0的rac环境,变成单机恢复到测试环境10.204.16.155(双方都是linux系统)101.45-racdb1101.46-racdb2补充:通过查看v$db_transportable_platform可以看到跨平台恢复是否支持:AIX 支持的平台恢复:linux 支持的平台恢复:一、16.155环境准备1、安装数据库软件2、安装nbu:二、恢复1、新建参数文件:到101.45上面把参数文件down下来修改下,修改后内容如下:cd $ORACLE_HOME/dbs/vi initracdb.oraracdb.__db_cache_size=369098752racdb.__java_pool_size=16777216racdb.__large_pool_size=33554432racdb.__oracle_base='/oracle/app/oracle'racdb.__pga_aggregate_target=553648128racdb.__sga_target=1056964608racdb.__shared_io_pool_size=0racdb.__shared_pool_size=620756992racdb.__streams_pool_size=0*.audit_file_dest='/oracle/app/admin/racdb/adump'*.audit_trail='FALSE'#*.cluster_database=true //单机去掉*.compatible='11.2.0.4.0'*.control_files='/oracle/app/oradata/racdb/ctl01.ctl'*.db_block_size=8192*.db_create_file_dest='/oracle/app'*.db_domain=''*.db_name='racdb'*.diagnostic_dest='/oracle/app'*.dispatchers='(PROTOCOL=TCP) (SERVICE=racdbXDB)'racdb.instance_number=1racdb.log_archive_dest_1='LOCATION=/oracle/arch'*.memory_target=1606418432*.open_cursors=300*.processes=500*.remote_login_passwordfile='exclusive'*.sessions=555racdb.thread=1racdb.undo_tablespace='UNDOTBS1'注意事项:1>把racdb2的删除掉,把racdb1替换成racdb2>把涉及到路径的替换成实际环境的,有些目录得手工创建。

ORACLE_11G_HA__NBU异机恢复过程

ORACLE_11G_HA__NBU异机恢复过程

ORACLE 11G AIX HA ----NBU异机恢复过程恢复前提1.两台机器上NUB软件都已经安装好2.指定Master SERVER 上的/usr/openv/netbackup/bp.conf恢复源FORCE_RESTORE_MEDIA_SERVER = 生产库hostname 测试库hostname从生产库恢复到测试库。

操作目的节点POTLDB01 数据库恢复到POTLDB02即在节点POTLDB01上运行,并在节点POTLDB01上备份,恢复到POTLDB02上节点POTLDB01机器检查过程1.检查环境变量检查root@POTLDB01:/usr/openv/rmanscript#ps -ef |grep smonroot 385272 467274 0 10:40:22 pts/2 0:00 grep smonoracle 655484 1 0 Jul 25 - 0:06 ora_smon_portaldb机器名字root@POTLDB01:/usr/openv/rmanscript#hostnamePOTLDB01root@POTLDB01:/usr/openv/rmanscript#pwd ---rman脚本位置/usr/openv/rmanscriptroot@POTLDB01:/usr/openv/rmanscript#lshot_database_portaldb.sh hot_database_portaldb.sh.out hot_database_portaldb.sh_bak/etc/hosts文件172.16.3.115 POTLDB01_boot172.16.3.116 POTLDB02_boot172.16.3.116 POTLDB02172.16.3.115 POTLDB011.1.3.115 POTLDB01_stby1.1.3.116 POTLDB02_stby172.16.3.117 POTLDB_svc172.16.7.142 SHYQ-PS-MV-SV03-POTLDB01-nbu172.16.7.143 SHYQ-PS-MV-SV03-POTLDB02-nbu 网关IP10.11.233.124 nbumaster172.16.10.250 yqbf原备份脚本:$RMAN target $TARGET_CONNECT_STR nocatalog msglog $RMAN_LOG_FILE append << EOFRUN {ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';send 'NB_ORA_CLIENT=SHYQ-PS-MV-SV03-POTLDB01-nbu';BACKUP$BACKUP_TYPESKIP INACCESSIBLETAG hot_db_bk_level0FILESPERSET 5# recommended formatFORMAT 'bk_%s_%p_%t'DATABASE;sql 'alter system archive log current';RELEASE CHANNEL ch00;加入后的脚本如下:BACKUP# recommended formatFORMAT '/oradata/rman_bak/controlfile/ portal_bak _%s_%p_%t'CURRENT CONTROLFILE;在节点POTLDB01成功备份后发现控制文件如下:root@POTLDB02:/usr/openv/rmanscript#ls -l /oradata/rman_bak/controlfiletotal 131072-rw-r----- 1 oracle 1001 13402112 Jul 28 11:38 portal_bak_25_1_757683479-rw-r----- 1 oracle 1001 13434880 Jul 28 11:36 portal_control_c-603295704-20110728-03 -rw-r----- 1 oracle 1001 13434880 Jul 28 11:38 portal_control_c-603295704-20110728-04 -rw-r----- 1 oracle dba 13434880 Jul 28 13:46 portal_control_c-603295704-20110728-05 -rw-r----- 1 oracle 1001 13402112 Jul 28 11:36 portaldb_controlfile_bak_23_1_757683366 获取DBIDSQL> select dbid from v$database;DBID----------603295704查看备份记录root@POTLDB01:/usr/openv/netbackup/bin#./bplist -C SHYQ-PS-MV-SV03-POTLDB01-nbu -S nbumaster -t 4 -R //c-603295704-20110728-02/cntrl_21_1_757683165/c-603295704-20110728-01/al_bk_19_1_757682964/c-603295704-20110728-00/bk_17_1_757682762/bk_16_1_757682227/bk_603295704_11_1_757680386/cntrl_10_1_757680271/al_bk_603295704_8_1_757680166/bk_603295704_7_1_757680069/bk_603295704_6_1_757679974/cntrl_5_1_757679319/al_4_1_757679223/bk_3_1_757679124/bk_2_1_757678789模拟数据库文件被删掉root@POTLDB01:/oradata/datafiles/portaldb#pwd/oradata/datafiles/portaldbroot@POTLDB01:/oradata/datafiles/portaldb#lsarchives control02.ctl redo101.log redo201.log redo301.log redo401.log redo501.log sysaux01.dbf temp01.dbf users01.dbfcontrol01.ctl control03.ctl redo102.log redo202.log redo302.log redo402.log redo502.log system01.dbf undotbs01.dbfroot@POTLDB01:/oradata/datafiles/portaldb#cd ../root@POTLDB01:/oradata/datafiles#lsportaldbroot@POTLDB01:/oradata/datafiles#lsportaldbroot@POTLDB01:/oradata/datafiles#mv portaldb portal_colroot@POTLDB01:/oradata/datafiles#mkdir portaldbroot@POTLDB01:/oradata/datafiles#cd portaldbroot@POTLDB01:/oradata/datafiles/portaldb#lsroot@POTLDB01:/oradata/datafiles/portaldb#mkdir archivesroot@POTLDB01:/oradata/datafiles/portaldb#chown –R oracle:dba /oradata/datafiles异机恢复到POTLDB02过程root@POTLDB02:/#lspvhdisk0 00c5c5666830b3fa rootvg active hdisk1 00c5c5666c01952b rootvg active hdisk2 00c5c5366a63d937 datavghdisk3 00c5c5366a65b992 hbvgroot@POTLDB02:/#varyonvg datavgroot@POTLDB02:/#mount /dev/data_lv /oradataroot@POTLDB02:/#su - oracleoracle@POTLDB02:/home/oracle$sqlplus /nologconnSQL*Plus: Release 11.1.0.7.0 - Production on Thu Jul 28 13:32:28 2011Copyright (c) 1982, 2008, Oracle. All rights reserved.SQL> /as sysdba;Connected to an idle instance.SQL>SQL>SQL>SQL> exitDisconnectedoracle@POTLDB02:/home/oracle$rman target /Recovery Manager: Release 11.1.0.7.0 - Production on Thu Jul 28 13:32:49 2011 Copyright (c) 1982, 2007, Oracle. All rights reserved.connected to target database (not started)RMAN> startup nomount;Oracle instance startedTotal System Global Area 43025158144 bytesFixed Size 2156784 bytesVariable Size 20669531920 bytesDatabase Buffers 22280142848 bytesRedo Buffers 73326592 bytesRMAN> set dbid=603295704executing command: SET DBIDRMAN> restore controlfile from '/oradata/rman_bak/controlfile/portal_bak_25_1_757683479';Starting restore at 28-JUL-11using target database control file instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: SID=2188 device type=DISKchannel ORA_DISK_1: restoring control filechannel ORA_DISK_1: restore complete, elapsed time: 00:00:01output file name=/oradata/datafiles/portaldb/control01.ctloutput file name=/oradata/datafiles/portaldb/control02.ctloutput file name=/oradata/datafiles/portaldb/control03.ctlFinished restore at 28-JUL-11RMAN> alter database mount;database mountedRMAN>RMAN>RMAN> run2> {3> allocate channel t1 type 'sbt_tape' parms 'ENV=(NB_ORA_SERVER=nbumaster,NB_ORA_CLIENT=SHYQ-PS-MV-SV03-POTLDB01-nbu)';4> allocate channel t2 type 'sbt_tape' parms 'ENV=(NB_ORA_SERVER=nbumaster,NB_ORA_CLIENT=SHYQ-PS-MV-SV03-POTLDB01-nbu)';5> restore database;6> switch datafile all;7> recover database;8> sql 'alter database open resetlogs';9> release channel t1;10> release channel t2;11> }allocated channel: t1channel t1: SID=2187 device type=SBT_TAPEchannel t1: Veritas NetBackup for Oracle - Release 6.5 (2009050106)allocated channel: t2channel t2: SID=2188 device type=SBT_TAPEchannel t2: Veritas NetBackup for Oracle - Release 6.5 (2009050106)Starting restore at 28-JUL-11channel t1: starting datafile backup set restorechannel t1: specifying datafile(s) to restore from backup setchannel t1: restoring datafile 00001 to /oradata/datafiles/portaldb/system01.dbfchannel t1: restoring datafile 00002 to /oradata/datafiles/portaldb/sysaux01.dbfchannel t1: restoring datafile 00003 to /oradata/datafiles/portaldb/undotbs01.dbfchannel t1: restoring datafile 00004 to /oradata/datafiles/portaldb/users01.dbfchannel t1: reading from backup piece bk_16_1_757682227channel t1: piece handle=bk_16_1_757682227 tag=HOT_DB_BK_LEVEL0channel t1: restored backup piece 1channel t1: restore complete, elapsed time: 00:03:55Finished restore at 28-JUL-11Starting recover at 28-JUL-11starting media recoverychannel t1: starting archived log restore to default destinationchannel t1: restoring archived logarchived log thread=1 sequence=11channel t1: restoring archived logarchived log thread=1 sequence=12channel t1: reading from backup piece al_bk_19_1_757682964channel t1: piece handle=al_bk_19_1_757682964 tag=TAG20110728T112924channel t1: restored backup piece 1channel t1: restore complete, elapsed time: 00:01:25archived log file name=/oradata/datafiles/portaldb/archives/1_11_756554328.dbf thread=1 sequence=11 archived log file name=/oradata/datafiles/portaldb/archives/1_12_756554328.dbf thread=1 sequence=12 unable to find archived logarchived log thread=1 sequence=13released channel: t1released channel: t2RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of recover command at 07/28/2011 13:44:17RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 13 and starting SCN of 436680RMAN> alter database open;RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of alter db command at 07/28/2011 13:45:00ORA-01589: must use RESETLOGS or NORESETLOGS option for database open RMAN> sql 'alter database open resetlogs';sql statement: alter database open resetlogs成功检查oracle@POTLDB02:/home/oracle$sqlplus /nologSQL*Plus: Release 11.1.0.7.0 - Production on Thu Jul 28 14:04:12 2011Copyright (c) 1982, 2008, Oracle. All rights reserved.SQL> conn /as sysdba;Connected.SQL>SQL>SQL> select status,instance_name from v$instance;STATUS INSTANCE_NAME------------ ----------------OPEN portaldbSQL>。

异机恢复ORACLE数据库(NBU)

异机恢复ORACLE数据库(NBU)

异机恢复ORACLE数据库(NBU)ORACLE数据库异机恢复(NBU)一.恢复的前提条件.1.)日常备份都是成功的。

至少有一次全备份及全备份以来的增量备份和Archivelog.2.)原主机的OS及ORACLE版本与目标主机的OS及ORACLE版本保持一致.3.)需要原数据库的下列信息:1)IP Address, Hostname, Nbu media server/client2)Oracle DB version, SID,DBID,Datafile Path,Controlfile Path,Archivelog Path3)Catalog DB IP,SID/Service name ,user/password4.)在目标主机上安装与原数据库版本相同的oracle软件(Install type :Softwareonly)5.)在目标主机上安装Veritas 软件,安装类型与原主机一致(media server or client)二. 下面以aush49上的s1rel DB恢复到aush61为例对veritas 及oracle进行配置.1 )在目标主机上(aush61)配置veritas1) Edit $ORACLE_HOME/bp.conf file(aush61) s3pis> cd $ORACLE_HOME(aush61) s3pis> vi bp.confSERVER = aush06 /*master server host name*/CLIENT_NAME = aush49 /*source host name ,如果aush49是media server则写 SERVER = aush49*/CLINET_READ_TIMEOUT = 18002)Edit /usr/openv/netbackup/bp.conf ( aush61)aush61#vi bp.confSERVER = aush06 /*master servername*/CLIENT_NAME = aush49 /*source host name , 如果aush49是media server则写 SERVER = aush49*/CLIENT_NAME = aush61 /*target host name */VERBOSE = 5CLIENT_READ_TIMEOUT = 1800CLIENT_CONNECT_TIMEOUT = 18003) Touch a file on Master Server (aush06)aush06#cd /usr/openv/netbackup/db/altnamesaush06#touchaush61 /*target host name */2 ) 在master server (aush06)与目标主机(aush61)上配置/etc/hosts 文件aush61#vi /etc/hosts127.0.0.1 localhost10.5.15.61 aush6110.5.15.6 aush0610.5.15.49 aush4910.5.15.58 aush58aush06#vi /etc/hosts127.0.0.1 localhost10.5.15.61 aush6110.5.15.6 aush0610.5.15.49 aush4910.5.15.58 aush583) 在目标主机上(aush61)配置ORACLE.1 )创建于原数据库(aush49)相同的oracle user/group : s3pis/dba2 ) 配置s3pis环境变量(aush61) s3pis> more .profileORACLE_HOME=/u01/s3pis;export ORACLE_HOMEORACLE_SID=s3rel;export ORACLE_SIDPATH=$PATH:$ORACLE_HOME/bin;export PATHPS1="(`hostname`) `whoami`> "LD_LIBRARY_PATH=$ORACLE_HOME/lib;exportLD_LIBRARY_PATH3 ) 安装与原数据库相同版本的Oracle 软件,安装类型:SOFTWARE ONLY.4 ) 创建$ORACLE_HOME/network/admin/tnsnames.ora 文件连接catalog DB.(aush61) s3pis> more tnsnames.oracatalog =(description=(address_list=(address=(protocol=tcp)(host=10.5.13.178)(port=1521)))(connect_data=(service_name=catalog)))5 ) 创建pfile如果有原数据库(s1rel db)的pfile 或spfile ,可以直接使用;如果没有可以手动创建pfile !6 )创建与原数据库(s1rel db)相同的文件存放路径!1)根据对原数据库(s1rel )的日常维护信息,可以知道controlfile,datafile,archivelog file 的存取路径。

通过nbu恢复oracle数据库(恢复实例)

通过nbu恢复oracle数据库(恢复实例)

1、关闭开启的实例数据库(未关监听)shutdown immediate2、传NBU客户端3、安装NBU客户端/usr/openv/netbackup/bin ./oracle_link 建立连接新客户端必须启动这个命令,不然无法进行还原,需要在oracle用户下跑命令4、查询备份信息5、设置备份可强制恢复6、检查Oracle安装软件7、检查NBU客户端进程8、检查备份集cd /usr/openv/netbackup/bin./bplist -C cmccdb1_beifen -t 4-R -b -l /|more9、创建参数文件/u01/app/oracle/database/10R1/dbs oracle环境变量touch init bacdb.orachmod 777 initbacdb.orabacdb.__db_cache_size=1711276032bacdb.__java_pool_size=46976204bacdb.__large_pool_size=13421772bacdb.__oracle_base='/opt/oracle/app/oracle'#ORACLE_BASE set from environmentbacdb.__pga_aggregate_target=677799526bacdb.__sga_target=4019976806 ----服务器内存80%bacdb.__shared_io_pool_size=0bacdb.__shared_pool_size=228170137bacdb.__streams_pool_size=6710886*.audit_file_dest='/opt/oracle/app/oracle/admin/bacdb/adump'*.audit_trail='db'*.compatible='11.2.0.4.0'*.control_files='/opt/oracle/oradata/bacdb/controlfile/control01.ctl','/opt /oracle/oradata/bacdb/controlfile/control02.ctl'*.db_block_size=8192*.db_domain=''*.db_name='bacdb'*.diagnostic_dest='/opt/oracle/app/oracle'*.dispatchers='(PROTOCOL=TCP) (SERVICE=bacdbXDB)'bacdb.instance_number=1*.log_archive_dest_1='location=/opt/oracle/oradata/bacdb/arch'*.open_cursors=2000*.pga_aggregate_target=677799526*.processes=1000*.remote_login_passwordfile='exclusive'#*.sessions=4405*.sga_target=4019976806bacdb.thread=1bacdb.undo_tablespace='UNDOTBS1'10、创建文件目录mkdir -p /opt/oracle/app/oracle/admin/bacdb/adumpmkdir -p /opt/oracle/oradata/bacdb/controlfilemkdir -p /opt/oracle/oradata/bacdb/archmkdir -p /opt/oracle/oradata/bacdb/datafilemkdir -p /opt/oracle/oradata/bacdb/tempfilemkdir -p /opt/oracle/oradata/bacdb/onlinelog11、根据参数文件启动至nomountexport ORACLE_SID=bacdbsqlplus /as sysdbastartup nomount pfile='/opt/oracle/app/oracle/product/11.2.0/db_1/dbs/initbacdb.ora';12、根据参数文件创建spfile文件create spfile from pfile;13、重启至nomount状态startup force nomount;14、创建sys密码文件orapwd file=$ORACLE_HOME/dbs/orapwbacdb password=ERab3OC_4s entries=5 force=y15、恢复控制文件export ORACLE_SID=bacdbrman target /run{allocate channel ch0 type'sbt_tape';send 'NB_ORA_CLIENT= bac-db-01_beifen';send 'nb_ora_serv=NFJD-WHGLZY-NBU-1';restore controlfile from'/cntrl_7110_1_932480583'; release channel ch0;}16、启动至mount状态alter database mount;17、查询需要恢复的表空间select NAME,TS# from v$tablespace;因为我们这里只做部分表空间恢复,只需要恢复SYSTEM,SYSAUX,UNDOTBS1,TEMP,UNDOTBS2,USERS,DATA_SMSGW表空间,所以要分别找出这些表空间都包括那些数据文件:18、查询需要恢复的表空间对应的数据文件select file#,name from v$datafile where TS# in('0','1','2','3','4','5','6')19、恢复数据文件restore数据文件(执行脚本)$ nohup /opt/oracle/oradata/restore/restore.sh > restore.sh.out 2>&1 &rman target / nocatalog <<EOFrun {allocate channel ch00 type'SBT_TAPE';allocate channel ch01 type'SBT_TAPE';allocate channel ch02 type'SBT_TAPE';allocate channel ch03 type'SBT_TAPE';send 'NB_ORA_CLIENT=bac-db-01_beifen';send 'NB_ORA_SERV=NFJD-WHGLZY-NBU-1';set newname for datafile1to'/opt/oracle/oradata/bacdb/datafile/system.262.863641207';set newname for datafile2to'/opt/oracle/oradata/bacdb/datafile/sysaux.261.863641231';set newname for datafile3to'/opt/oracle/oradata/bacdb/datafile/undotbs1.260.863641255';set newname for datafile4to'/opt/oracle/oradata/bacdb/datafile/undotbs2.270.863641297';set newname for datafile5to'/opt/oracle/oradata/bacdb/datafile/users.269.863641331';set newname for datafile6to'/opt/oracle/oradata/bacdb/datafile/data_smsgw.276.863781045';set newname for datafile31to'/opt/oracle/oradata/bacdb/datafile/data_smsgw.301.884961611';set newname for datafile55to'/opt/oracle/oradata/bacdb/datafile/system.329.922185251';set newname for datafile60to'/opt/oracle/oradata/bacdb/datafile/undotbs1.334.925769101';set newname for datafile61to'/opt/oracle/oradata/bacdb/datafile/undotbs2.335.925769185';set newname for datafile62to'/opt/oracle/oradata/bacdb/datafile/system.336.926934061';restore database skip tablespaceTBS_ACS,TBS_UCMQ,TBS_BTS,WH_TS,TBS_MMCC,TBS_IAPMMWLAN,TBS_MMPG,TBS_SIMS20; switch datafile all;release channel ch00;release channel ch01;release channel ch02;release channel ch03;}EOF20、修改线日志文件路径select group#,member from v$logfile order by group#;alter database rename file'+DATA/bacdb/onlinelog/group_1.256.863641201'to'/opt/oracle/oradata/bacdb/onlinelog/group_1.256.863641201';alter database rename file'+DATA/bacdb/onlinelog/group_2.266.863641203'to'/opt/oracle/oradata/bacdb/onlinelog/group_2.266.863641203';alter database rename file'+DATA/bacdb/onlinelog/group_3.258.863643321'to'/opt/oracle/oradata/bacdb/onlinelog/group_3.258.863643321';alter database rename file'+DATA/bacdb/onlinelog/group_4.257.863643323'to'/opt/oracle/oradata/bacdb/onlinelog/group_4.257.863643323';alter database rename file'+DATA/bacdb/onlinelog/group_5.274.863641203'to'/opt/oracle/oradata/bacdb/onlinelog/group_5.274.863641203';alter database rename file'+DATA/bacdb/onlinelog/group_6.273.863641205'to'/opt/oracle/oradata/bacdb/onlinelog/group_6.273.863641205';alter database rename file'+DATA/bacdb/onlinelog/group_7.272.863641205'to'/opt/oracle/oradata/bacdb/onlinelog/group_7.272.863641205';alter database rename file'+DATA/bacdb/onlinelog/group_8.271.863641207'to'/opt/oracle/oradata/bacdb/onlinelog/group_8.271.863641207';alter database rename file'+DATA/bacdb/onlinelog/group_9.268.863643325'to'/opt/oracle/oradata/bacdb/onlinelog/group_9.268.863643325';alter database rename file'+DATA/bacdb/onlinelog/group_10.267.863643325'to'/opt/oracle/oradata/bacdb/onlinelog/group_10.267.863643325';alter database rename file'+DATA/bacdb/onlinelog/group_11.265.863643327'to'/opt/oracle/oradata/bacdb/onlinelog/group_11.265.863643327';alter database rename file'+DATA/bacdb/onlinelog/group_12.264.863643327'to '/opt/oracle/oradata/bacdb/onlinelog/group_12.264.863643327';21、recover数据库run {allocate channel ch00 type'SBT_TAPE';allocate channel ch01 type'SBT_TAPE';allocate channel ch02 type'SBT_TAPE';allocate channel ch03 type'SBT_TAPE';send 'NB_ORA_CLIENT=bac-db-01_beifen';send 'NB_ORA_SERV=NFJD-WHGLZY-NBU-1';recover database skip forever tablespaceTBS_ACS,TBS_UCMQ,TBS_BTS,WH_TS,TBS_MMCC,TBS_IAPMMWLAN,TBS_MMPG,TBS_SIMS20; release channel ch00;release channel ch01;release channel ch02;release channel ch03;}22、打开数据库alter database open resetlogs;select open_mode from v$database;23、创建临时表空间SQL> create temporary tablespace temp1 tempfile '/opt/products/oradata/temp1.dbf' size 500m;Tablespace created.SQL> select tablespace_name from dba_tablespaces where contents='TEMPORARY';TABLESPACE_NAME------------------------------TEMPUSSD2_TEMPTEMP1SQL> alter database default temporary tablespace temp1;Database altered.SQL> drop tablespace TEMP including contents and datafiles;Tablespace dropped.SQL> drop tablespace USSD2_TEMP including contents and datafiles;Tablespace dropped.注:Oracle的恢复需要注意。

NBU for SAP(Oracle-util模式)异机恢复测试

NBU for SAP(Oracle-util模式)异机恢复测试
sqlplus>select username,account_status from dba_user;
如果发现里面的saprs3用户是locked,就需要unlock它,如果unlock后又被lock,就需要修改一下他的密码
sqlplus>alter user saprs3 identified by sap;
8.)recover数据库((以oraptp数据库用户登录)
sql> recover database using backup controlfile until cancel;
或者
brrecover -seq3796
9.)恢复归档日志(以oraptp数据库用户登录)
根据提示,恢复归档日志
brrestore -d util_file -a 200
5.
与恢复最近一次完整备份不同,恢复制定日期的备份,要先通过NBU master GUI图形,找到指定日期的controlfile、backPTP.log、Anf文件,将其以文件方式恢复到测试机的临时目录里。
1.
SAP版本:7.2
Oracle数据库版本:11.2.0.3.064bit
备份软件版本:NetBackup 7.5.0.5
Master/Mediaserver操作系统:Windows2008
Source client:Linux操作系统RHEL_6.4_x86_64
Destination client:linux操作系统RHEL_6.4_x86_64
brrestore -d util_file -b2 "#NULL" -m/oracle/PTP/saparch/archPTP.log
brrestore -d util_file -b2 "#NULL" -m /oracle/PTP/sapbackup/bengybwu.anf

NBU备份oracle异机恢复没有catalog解决方案

NBU备份oracle异机恢复没有catalog解决方案

NetBackup备份oracle无nocatalog解决方案1. NetBackup通过RMAN nocatalog方式备份设置步骤当通过r man nocatalog方式备份Oracle,Oracle使用controlfile存放备份信息。

因此,当使用rman nocatalog方式备份时,备份controlfile是非常重要的。

有一个问题,当使用rman nocatalog恢复时,数据库必须是处于“mount”状态的。

而Oracle startup mount的前提条件是control必须存在。

因此,你必须在恢复datafile之前先恢复controlfile。

使用rman catalog方式时,能startup nomount然后restore control file;但使用rman nocatalog时,必须先用文件方式恢复controlfile。

下面对比一下rman nocatalog和rman catalog的恢复时的步骤,以便建立正确的备份策略(以下的恢复都是在online状态下的备份):rman nocatalog恢复:1) 建立oracle运行环境(包括init或sp文件)2) 文件方式恢复controlfile到init文件指定的位置3) startup mount4) rman,恢复datafile5) alter database open resetlogsrman catalog恢复:1) 建立oracle运行环境(包括init或sp文件)2) rman ,restore controfile3) alter database mount4) rman, restore datafile5) alter database open resetlogs能看出,rman nocatalog备份时,必须用文件方式备份controlfile。

另外,由于nocatalog时利用controlfile存放备份信息,建议将Oracle参数文件中的CONTROL_FILE_RECORD_KEEP_TIME值加大(缺省为7天), 该参数在$ORACLE_HOME/dbs/initSID.ora中(9i后也可能在spfile中,只能通过Oracle语句更改)。

Linux上NBU异机恢复Oracle测试

Linux上NBU异机恢复Oracle测试

目录Linux平台下的恢复测试 (2)1. Oracle数据库恢复测试环境 (2)2. 恢复spfile文件 (4)3. 恢复控制文件 (5)4. 恢复数据文件 (6)5. 还原数据库 (7)6. 检验数据库一致性 (8)Linux平台下的恢复测试1.Oracle数据库恢复测试环境Windows 7 上安装NBU Master Server端,两个虚拟机上分别为源端和测试端,oracle 版本为oracle10g,数据库实例名为test。

整个恢复测试分为数据库的全备,数据库的spfile文件恢复,控制文件controlfile的恢复,恢复数据库和还原数据库。

恢复前准备,做好远数据库端的数据库全备,查询清楚源端数据库的备份集信息,如下图,1.在备份服务器上使用bplist命令,查看ORACLE数据库备份文件。

bplist –C oa.localdomain –t 4 –R \2.在源端rman上查看list backupset;查询spfile文件和控制文件的备份集信息,在测试端安装好oracle 的数据库软件和监听,不需要建立实例;在测试端建立好几个文件路径:/u01/app/oracle/product/10.2.0/admin/test下建立adump、bdump、cdump、udump、dpdump和pfile文件夹;在/u01/oracle下建立oradata和其子目录test文件夹。

Rman noumount状态登陆,然后登录如下,退出重新登陆rman 登录后状态为DUMMY。

2.恢复spfile文件现在一起准备就绪,输入恢复脚本,在脚本中加入从备份集查询到的信息,如下:run{allocate channel ch01 type 'sbt_tape';allocate channel ch02 type 'sbt_tape'parms="ENV=(NB_ORA_CLIENT=win2003,NB_ORA_SID=test,NB_ORA_SERV=axelpc)";restore spfile to 'E:\oracle\product\10.2.0\db_1\dbs\spfiletest.ora' from 'bk_u0ap2bbh9_s10_p1_t841330217';release channel ch1;release channel ch2;}解析:1.NB_ORA_CLIENT=oratest,NB_ORA_SERV=axelpc分别是源端主机名,数据库实例名,备份服务器的主机名2./u01/app/oracle/product/10.2.0/db_1dbs/spfiletest.ora是spfile的文件路径3.bk_4_1_842413981是spfile备份集的句柄,也可在NBU服务端查询,查询指令为:bplist -C test -t 4 –R\ 输出结果如下图,恢复成功之后可以看到如下显示,3.恢复控制文件Sqlplus进入启动nomount状态:>startup nomount;然后进入rman下运行如下脚本:run{allocate channel ch01 type 'sbt_tape'parms="ENV=(NB_ORA_CLIENT=oratest,NB_ORA_SERV=axelpc)"; restore controlfile from ' cntrl_7_1_842414152';release channel ch01;}解析都一样,其中cntrl_7_1_842414152是控制文件的备份集句柄。

NBU-ORACLE-异机异路径恢复

NBU-ORACLE-异机异路径恢复

NBU_ORACLE_异机不同路径恢复详解恢复环境:NBU MASTER SERVER: as5NBU CLENET: e1, oracle源数据服务器,已做备份。

NBU CLIENT: e2, oracle目标服务器。

已装好跟e1同版本,同实例名,不同路径数据库,NBU AGENT已装好。

恢复内容:把e1备份的oracle恢复到e2上恢复过程:(下列过程只在as5和e2上操作)1. 把e2上安装的数据库开启归档,指定归档路径,归档路径在恢复时要使用,确保有足够的空间。

2. 在MASTER SERVER的C:\Program Files\Veritas\NetBackup\db\altnames目录下新建文件 No.Restrictions(允许异机恢复)。

3. 在e2上点击“开始”>打开backup,archive,restore程序4. 打开“File”>“Specify Netbackup Machines and Policy Type”第1页5. 点击“Edit Client List”按钮6. 添加e1进去。

第2页7. 在“Source client for restore”里改成e1(原来是e2)。

点击“OK”。

8. 然后点击菜单栏上的“Select for Restore”,然后选中要还原的e1的控制文件的备份,点击左边的恢复按钮(红圈处。

)9. 选择“Restore everything to a different location”,在“Destination”里定位到e2上控制文件所在的目录。

点击“Start Restore”开始恢复。

第3页10. 恢复成功后,关闭数据库C:\Documents and Settings\Administrator>sqlplus "/as sysdba"SQL> shutdown immediate; 关闭数据库11. 然后把恢复过来的e1的控制文件备份复制3份到该目录下,分别重命名为CONTROL01.CTL,CONTROL02.CTL,CONTROL03.CTL。

NBU恢复手册V10

NBU恢复手册V10

NBU集中备份系统恢复手册文档信息文档修订记录目录1.文档说明 (4)2.文件或文件系统恢复 (4)3.Oracle数据库恢复 (7)3.1准备环境描述 (7)3.2恢复测试步骤 (9)3.2.1检查备份信息 (9)3.2.2建立口令文件 (9)3.2.3恢复控制文件 (9)3.2.4恢复数据文件 (15)3.2.5恢复归档日志 (17)3.2.6Recover数据库 (17)3.2.7尝试打开数据库 (18)3.2.8重建临时表空间 (18)4.SQL Server恢复 (18)1. 文档说明本文档描述NBU集中备份系统的文件系统和Oracle数据库的恢复步骤,可作为备份系统管理员做恢复时的指导性文档。

2. 文件或文件系统恢复打开Netbackup java console,点击左侧树形下拉表中的”Backup,Archive and Restore”点击窗口中的Actions -> “Specify Netbackup Machines and Policy Type”在出现的小窗口中输入要恢复的原客户端主机名,目标客户端主机名,选择正确的策略类型,点击Ok选择备份数据的查找日期,或者从菜单中选择Action->“Set Data Range”下的Calender或者Backup History。

如果选择Calender,则选择想要恢复的数据的起始日期和时间,以及结束日期和时间。

在出来的结果列表中选择需要恢复的文件或者文件夹,然后点击Restore:在新窗口中选择恢复目录等,默认是恢复到原目录,也可以选择恢复到其它目录,然后点Start Restore:在Activity Monitor中查看Restore的任务,等该任务执行完毕,则文件成功完成。

去恢复的目标目录可看到恢复出来的文件。

3. Oracle数据库恢复3.1 准备环境描述为了将数据库从原来运行的主机,即源主机,恢复到另外一台主机,即目标主机,需要在目标主机建立基本的恢复环境,包括兼容的操作系统版本,ORACLE 软件,ORACLE数据库数据文件的存储设备,备份软件。

NBU重定向恢复Oracle数据库总结

NBU重定向恢复Oracle数据库总结

一、对源数据库进行一次完整、成功的备份;二、在NBU Master Server上建立C:\Program Files\Veritas\NetBackup\altnames\No.Restrictions文件;三、对于源服务器Media Server恢复到Client的情况下需要在Master Server上进行如下配置:四、目标客户端的bp.conf文件里CLIENT_NAME = orcldb04,client name要制定源服务器名称;五、在目标客户端上要可以用bplist命令列出源客户端所有的备份镜像.六、恢复步骤1、恢复控制文件(数据库nomount状态下,set DBID=1271924299)run{allocate channel ch01 type sbt_tape;send 'nb_ora_serv=s4pb02,nb_ora_client=orcldb04';restore controlfile from '/cntrl_474_1_747243121';release channel ch01;}2、恢复数据文件(数据库mount状态下)run{allocate channel ch00 type sbt_tape;send 'nb_ora_serv=s4pb02,nb_ora_client=vip_db1';restore database;release channel ch00;}ORrun{allocate channel ch00 type sbt_tape;allocate channel ch01 type sbt_tape;send 'nb_ora_serv=s4pb02,nb_ora_client=orcldb04';set newname for datafile 00003 to '/data/orcl/sysaux01.dbf';set newname for datafile 00007 to '/data/orcl/DRGN_DATA10.dbf'; set newname for datafile 00011 to '/data/orcl/DRGN_DATA06.dbf'; set newname for datafile 00015 to '/data/orcl/DRGN_DATA02.dbf'; set newname for datafile 00018 to '/data/orcl/DRGN_INDEX03.dbf'; set newname for datafile 00004 to '/data/orcl/users01.dbf';set newname for datafile 00008 to '/data/orcl/DRGN_DATA09.dbf'; set newname for datafile 00012 to '/data/orcl/DRGN_DATA05.dbf'; set newname for datafile 00016 to '/data/orcl/DRGN_INDEX05.dbf'; set newname for datafile 00017 to '/data/orcl/DRGN_INDEX04.dbf'; set newname for datafile 00001 to '/data/orcl/system01.dbf';set newname for datafile 00006 to '/data/orcl/DRGN_INDEX01.dbf'; set newname for datafile 00010 to '/data/orcl/DRGN_DATA07.dbf'; set newname for datafile 00014 to '/data/orcl/DRGN_DATA03.dbf'; set newname for datafile 00019 to '/data/orcl/DRGN_INDEX02.dbf'; set newname for datafile 00002 to '/data/orcl/undotbs01.dbf'; set newname for datafile 00005 to '/data/orcl/DRGN_DATA01.dbf'; set newname for datafile 00009 to '/var/orcl/DRGN_DATA08.dbf'; set newname for datafile 00013 to '/var/orcl/DRGN_DATA04.dbf'; restore database;switch datafile all;(如果数据文件路径修改,必须运行此命令)release channel ch00;release channel ch01;}set newname for datafile 00005 to '/data/orcl/DRGN_DATA01.dbf';set newname for datafile 00009 to '/var/orcl/DRGN_DATA08.dbf';set newname for datafile 00013 to '/var/orcl/DRGN_DATA04.dbf';restore database;switch datafile all;(如果数据文件路径修改,必须运行此命令)recover database;(如果恢复的时候指定的控制文件为最后一次增量备份的时候备份的,那么需要进行recover database的操作,否则会提示数据库恢复不完全)release channel ch00;release channel ch01;}3、恢复归档日志文件(mount状态下)SQL> recover using backup controlfile until cancel;4、打开数据库SQL> alter database open resetlogs;七、验证恢复是否成功1、关闭数据库2、打开数据库3、列出数据文件SQL> recover using backup controlfile until cancel;ORA-00279: change 59832031 generated at 03/31/2011 15:31:09 needed for thread 1ORA-00289: suggestion :/data/app/product/10.2.0/db_1/dbs/arch1_897_744143566.dbfORA-00280: change 59832031 for thread 1 is in sequence #897Specify log: {<RET>=suggested | filename | AUTO | CANCEL}cancelMedia recovery cancelled.SQL> alter database open resetlogs;Database altered.SQL> shutdown immediate;Database dismounted.ORACLE instance shut down.SQL> startupORACLE instance started.Total System Global Area 1610612736 bytesFixed Size 2084296 bytesVariable Size 1023410744 bytesDatabase Buffers 570425344 bytesRedo Buffers 14692352 bytesDatabase mounted.Database opened.SQL> select name from V$datafile;NAME-------------------------------------------------------------------------------- /data/orcl/system01.dbf/data/orcl/undotbs01.dbf/data/orcl/sysaux01.dbf/data/orcl/users01.dbf/data/orcl/DRGN_DATA01.dbf/data/orcl/DRGN_INDEX01.dbf/data/orcl/DRGN_DATA10.dbf/data/orcl/DRGN_DATA09.dbf/var/orcl/DRGN_DATA08.dbf/data/orcl/DRGN_DATA07.dbf/data/orcl/DRGN_DATA06.dbfNAME-------------------------------------------------------------------------------- /data/orcl/DRGN_DATA05.dbf/var/orcl/DRGN_DATA04.dbf/data/orcl/DRGN_DATA03.dbf/data/orcl/DRGN_DATA02.dbf/data/orcl/DRGN_INDEX05.dbf/data/orcl/DRGN_INDEX03.dbf /data/orcl/DRGN_INDEX02.dbf19 rows selected.SQL>。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

ORACLE数据库异机恢复(NBU)一.恢复的前提条件.1.)日常备份都是成功的。

至少有一次全备份及全备份以来的增量备份和Archivelog.2.)原主机的OS及ORACLE版本与目标主机的OS及ORACLE版本保持一致.3.)需要原数据库的下列信息:1)IP Address, Hostname, Nbu media server/client2)Oracle DB version, SID,DBID,Datafile Path,Controlfile Path,Archivelog Path3)Catalog DB IP,SID/Service name ,user/password4.)在目标主机上安装与原数据库版本相同的oracle软件(Install type :Softwareonly)5.)在目标主机上安装Veritas 软件,安装类型与原主机一致 (media server or client)二. 下面以aush49上的s1rel DB恢复到aush61为例对veritas及oracle进行配置.1 )在目标主机上(aush61)配置veritas1) Edit $ORACLE_HOME/bp.conf file(aush61) s3pis> cd $ORACLE_HOME(aush61) s3pis> vi bp.confSERVER = aush06 /*master server host name*/CLIENT_NAME = aush49 /*source host name ,如果aush49是media server则写 SERVER = aush49*/CLINET_READ_TIMEOUT = 18002)Edit /usr/openv/netbackup/bp.conf ( aush61)aush61#vi bp.confSERVER = aush06 /*master servername*/CLIENT_NAME = aush49 /*source host name , 如果aush49是media server则写 SERVER = aush49*/CLIENT_NAME = aush61 /*target host name */VERBOSE = 5CLIENT_READ_TIMEOUT = 1800CLIENT_CONNECT_TIMEOUT = 18003) Touch a file on Master Server (aush06)aush06#cd /usr/openv/netbackup/db/altnamesaush06#touchaush61 /*target host name */2 ) 在master server (aush06)与目标主机(aush61)上配置/etc/hosts 文件aush61#vi /etc/hosts127.0.0.1 localhost10.5.15.61 aush6110.5.15.6 aush0610.5.15.49 aush4910.5.15.58 aush58aush06#vi /etc/hosts127.0.0.1 localhost10.5.15.61 aush6110.5.15.6 aush0610.5.15.49 aush4910.5.15.58 aush583) 在目标主机上(aush61)配置ORACLE.1 )创建于原数据库(aush49)相同的oracle user/group : s3pis/dba2 ) 配置s3pis环境变量(aush61) s3pis> more .profileORACLE_HOME=/u01/s3pis;export ORACLE_HOMEORACLE_SID=s3rel;export ORACLE_SIDPATH=$PATH:$ORACLE_HOME/bin;export PATHPS1="(`hostname`) `whoami`> "LD_LIBRARY_PATH=$ORACLE_HOME/lib;export LD_LIBRARY_PATH3 ) 安装与原数据库相同版本的Oracle 软件,安装类型:SOFTWARE ONLY.4 ) 创建$ORACLE_HOME/network/admin/tnsnames.ora 文件连接catalog DB.(aush61) s3pis> more tnsnames.oracatalog =(description=(address_list=(address=(protocol=tcp)(host=10.5.13.178)(port=1521)))(connect_data=(service_name=catalog)))5 ) 创建pfile如果有原数据库(s1rel db)的pfile 或spfile ,可以直接使用;如果没有可以手动创建pfile !6 )创建与原数据库(s1rel db)相同的文件存放路径!1)根据对原数据库(s1rel )的日常维护信息,可以知道controlfile,datafile,archivelog file 的存取路径。

可以通过link 方式在目标主机(aush61)上创建相应的目录,并赋予oracle 用户(s1pis)读写权限.2)如果要将数据文件恢复到不同位置,需要在恢复语句上用set newname 及switch datafile 的参数!3)根据pfile或spfile 创建cdump ,bdump ,udump 目录三. 恢复步骤.1) 使用pfile或spfile在目标主机(aush61)上启动数据库(s1rel)到nomount 状态 (aush61) s3pis> sqlplus "/ as sysdba";SQL*Plus: Release 9.0.1.4.0 - Production on Thu Dec 9 11:00:24 2004(c) Copyright 2001 Oracle Corporation. All rights reserved.Connected to an idle instance.SQL> startup nomount pfile=/u01/s3pis/dbs/inits3rel.oraORACLE instance started.Total System Global Area 806283128 bytesFixed Size 436088 bytesVariable Size 268435456 bytesDatabase Buffers 536870912 bytesRedo Buffers 540672 bytesSQL>2.恢复控制文件(aush61) s3pis> rman catalog auss3pis/auss3pis@catalog;Recovery Manager: Release 9.0.1.4.0 - Production(c) Copyright 2001 Oracle Corporation. All rights reserved.connected to recovery catalog databaseRMAN> set dbid=4227459251 (aush49 s3rel dbid )executing command: SET DBIDRMAN> connect target /connected to target database: (not mounted)RMAN> run {2> allocate channel ch00 type 'sbt_tape';3> send 'nb_ora_serv=aush06';4> send 'nb_ora_client=aush49';5> restore controlfile;6> }allocated channel: ch00channel ch00: sid=11 devtype=SBT_TAPEchannel ch00: VERITAS NetBackup for Oracle - Release 4.5FP_3GA (2002121901) sent command to channel: ch00sent command to channel: ch00Starting restore at 09-DEC-04channel ch00: starting datafile backupset restorechannel ch00: restoring controlfileoutput filename=/u22/oradata/control01.ctlchannel ch00: restored backup piece 1piece handle=cntrl_3973_1_544399339 tag=null params=NULLchannel ch00: restore completereplicating controlfileinput filename=/u22/oradata/control01.ctloutput filename=/u22/oradata/control02.ctloutput filename=/u22/oradata/control03.ctlFinished restore at 09-DEC-04released channel: ch00RMAN> exit3.重新启动数据库到mount 状态SQL> shutdown immediate;ORA-01109: database not openDatabase dismounted.ORACLE instance shut down.SQL> startup mount pfile=/u01/s3pis/dbs/inits3rel.oraORACLE instance started.Total System Global Area 806283128 bytesFixed Size 436088 bytesVariable Size 268435456 bytesDatabase Buffers 536870912 bytesRedo Buffers 540672 bytesDatabase mounted.SQL>4.对数据库做基于时间点的恢复!(aush61) s3pis> rman catalog auss3pis/auss3pis@catalog;Recovery Manager: Release 9.0.1.4.0 - Production(c) Copyright 2001 Oracle Corporation. All rights reserved.connected to recovery catalog databaseRMAN> set dbid=4227459251executing command: SET DBIDRMAN> connect target /connected to target database: S3REL (DBID=4227459251)RMAN> run {2> allocate channel ch00 type 'sbt_tape';3> send 'nb_ora_serv=aush06';4> send 'nb_ora_client=aush49';5> set until time "to_date('12/8/2004 14:00:00','mm/dd/yyyy hh24:mi:ss')";6> restore database;7> recover database;8> sql "alter database open resetlogs";9> }注:如果将数据文件恢复到与原路径不同的位置则按照如下写法:\\RMAN> run {2> allocate channel ch00 type 'sbt_tape';3> send 'nb_ora_serv=aush06';4> send 'nb_ora_client=aush49';5> set until time "to_date('12/8/2004 14:00:00','mm/dd/yyyy hh24:mi:ss')";6> set newname for datafile ‘filename’ or filenumber to ‘newlocation’ ;7> restore database ;8> switch datafile all;}RMAN> run {2> allocate channel ch00 type 'sbt_tape';3> send 'nb_ora_serv=aush06';4> send 'nb_ora_client=aush49';5> set until time "to_date('12/8/2004 14:00:00','mm/dd/yyyy hh24:mi:ss')";6> set archivelog destination to ‘full path’ ;}//channel ch00: sid=11 devtype=SBT_TAPEchannel ch00: VERITAS NetBackup for Oracle - Release 4.5FP_3GA (2002121901)sent command to channel: ch00sent command to channel: ch00executing command: SET until clauseStarting restore at 09-DEC-04channel ch00: starting datafile backupset restorechannel ch00: specifying datafile(s) to restore from backup setrestoring datafile 00036 to /u23/oraindx/SMSR_I01.dbf.................................................... ....................................................restoring datafile 00051 to /u23/oraindx/SMS_AV_04092.dbfchannel ch00: restored backup piece 1piece handle=bk_3947_1_544370120 tag=HOT_DB_BK_LEVEL0 params=NULLchannel ch00: restore completeFinished restore at 09-DEC-04Starting recover at 09-DEC-04channel ch00: starting incremental datafile backupset restorechannel ch00: specifying datafile(s) to restore from backup setdestination for restore of datafile 00070: /u22/oradata/SMS_ID_04121.dbf channel ch00: restored backup piece 1piece handle=bk_3927_1_544280863 tag=HOT_DB_BK_LEVEL0 params=NULLchannel ch00: restore completechannel ch00: starting incremental datafile backupset restorechannel ch00: specifying datafile(s) to restore from backup set...................................................... ......................................................channel ch00: starting incremental datafile backupset restorechannel ch00: specifying datafile(s) to restore from backup set destination for restore of datafile 00025: /u22/oradata/SCS_T01.dbf destination for restore of datafile 00036: /u23/oraindx/SMSR_I01.dbf destination for restore of datafile 00043: /u23/oraindx/SCS_I02.dbf destination for restore of datafile 00059: /u23/oraindx/SMS_AV_04093.dbf channel ch00: restored backup piece 1piece handle=bk_3931_1_544281553 tag=HOT_DB_BK_LEVEL0 params=NULL channel ch00: restore completestarting media recoverychannel ch00: starting archive log restore to default destination channel ch00: restoring archive logarchive log thread=1 sequence=2562channel ch00: restoring archive log ..................................................... .....................................................archive log filename=/u21/s3rel/archive/1_2574.dbf thread=1 sequence=2574 archive log filename=/u21/s3rel/archive/1_2575.dbf thread=1 sequence=2575 archive log filename=/u21/s3rel/archive/1_2576.dbf thread=1 sequence=2576 archive log filename=/u21/s3rel/archive/1_2577.dbf thread=1 sequence=2577 media recovery completeFinished recover at 09-DEC-04sql statement: alter database open resetlogsreleased channel: ch00RMAN>恢复成功,数据库已经打开!。

相关文档
最新文档