nbu怎样恢复oracle数据库

nbu怎样恢复oracle数据库,第1张

1、安装 *** 作系统

2、安装数据库系统

3、安装nbu软件及配置

--安装客户端

上传SYMCnbclient_Linux-RedHat2.6.18_7.5.0.2.tar编辑本机hosts

vi /etc/hosts

添加:192.168.99.252 hdnbu1

解压:

[root@scmtest u01]# tar -xvf SYMCnbclient_Linux-RedHat2.6.18_7.5.0.2.tar[root@scmtest u01]# cd SYMCnbclient_Linux-RedHat2.6.18_7.5.0.2[root@scmtest SYMCnbclient_Linux-RedHat2.6.18_7.5.0.2]# ./install过程当中要输入备份服务端:hdnbu1

然后再用oracle用户执行:

[root@scmtest bin]# su - oracle

[oracle@scmtest ~]$ cd /usr/openv/netbackup/bin[oracle@scmtest bin]$ ./oracle_link

Thu Feb 21 14:03:02 CST 2013

All Oracle instances should be shutdown before running this script.

Please log into the Unix system as the Oracle owner for running this scriptDo you want to continue? (y/n) [n] y

LIBOBK path: /usr/openv/netbackup/bin

ORACLE_HOME: /software/oracle/product/10.2.0/db1Oracle version: 10.2.0.5.0

Platform type: x86_64

Linking LIBOBK:

ln -s /usr/openv/netbackup/bin/libobk.so64 /software/oracle/product/10.2.0/db1/lib/libobk.soDone

Please check the trace file located in /tmp/make_trace.23602to make sure the linking process was successful.

4、编辑初始参数文件

这时候,需要进行修改,比如原来用的什么盘,现在用什么盘等编辑后如下:

*._addm_auto_enable=FALSE

*._b_tree_bitmap_plans=FALSE

*._db_block_numa=1

*._enable_NUMA_optimization=FALSE

*._optimizer_cartesian_enabled=FALSE

*._optimizer_skip_scan_enabled=FALSE

*.archive_lag_target=1800

*.audit_file_dest='/software/oracle/admin/ncerp/adump'

*.background_dump_dest='/software/oracle/admin/ncerp/bdump'

*.compatible='10.2.0.5.0'

*.control_files='/u01/ncerp/control/control01.ctl','/u01/ncerp/control/control02.ctl'

*.core_dump_dest='/software/oracle/admin/ncerp/cdump'

*.db_block_size=8192

*.db_cache_size=4294967296

*.db_create_file_dest='/u01/ncerp/flash_recover'

*.db_domain=''

*.db_file_multiblock_read_count=16

*.db_name='ncerp'

*.java_pool_size=33554432

*.job_queue_processes=10

*.large_pool_size=33554432

*.log_archive_dest_1='location=/u01/ncerp/arch'

*.log_archive_format='%s_%t_%r.log'

*.max_dump_file_size='1024'

*.open_cursors=1000

*.optimizer_dynamic_sampling=4

*.optimizer_index_cost_adj=40

*.parallel_max_servers=5

*.pga_aggregate_target=2147483648

*.processes=800

*.recyclebin='OFF'

*.shared_pool_size=838860800

*.undo_management='AUTO'

*.undo_tablespace='UNDOTBS1'

5、根据参数文件,建相应的目录

[oracle@scmtest ~]$ mkdir -p /u01/ncerp/control/[oracle@scmtest u01]$ mkdir -p /app/oracle/admin/ncerp/cdump[oracle@scmtest u01]$ mkdir -p /app/oracle/admin/ncerp/bdump[oracle@scmtest u01]$ mkdir -p /app/oracle/admin/ncerp/adump[oracle@scmtest u01]$ mkdir -p /app/oracle/admin/ncerp/pfile[oracle@scmtest u01]$ mkdir -p /u01/ncerp/flash_recover[oracle@scmtest u01]$ mkdir -p /u01/ncerp/arch[oracle@scmtest ncerp]$ mkdir oradata

注意:这些要与参数文件对应,要不然无法启动!

6、恢复控制文件

export ORACLE_SID=ncerp

[oracle@scmtest u01]$ rman target /

Recovery Manager: Release 10.2.0.5.0 - Production on Thu Feb 21 14:17:10 2013Copyright (c) 1982, 2007, Oracle. All rights reserved.

connected to target database (not started)RMAN>startup nomount pfile='/u01/ncpfile.ora'Oracle instance started

Total System Global Area5217714176 bytesFixed Size 2103536 bytesVariable Size905971472 bytesDatabase Buffers4294967296 bytesRedo Buffers 14671872 bytes从nbu的服务器上查询要恢复的控制文件

hdnbu1:/tmp # bplist -C RD162 -t 4 -R -b -l / | more-rw-rw---- oracledba 10747904 Mar 28 11:26 /c-3383507379-20130328-0b-rw-rw---- oracledba 11010048 Mar 28 11:25 /c-2177845250-20130328-0d-rw-rw---- oracledba 10747904 Mar 28 11:25 /cntrl_9202_1_811250475-rw-rw---- oracledba 10747904 Mar 28 11:25 /cntrl_7788_1_811250456-rw-rw---- oracledba 10747904 Mar 28 11:25 /c-3383507379-20130328-0a-rw-rw---- oracledba 11010048 Mar 28 11:24 /c-2177845250-20130328-0c-rw-rw---- oracledba 114032640 Mar 28 11:17 /al_7786_1_811249961-rw-rw---- oracledba 123207680 Mar 28 11:17 /al_7785_1_811249961-rw-rw---- oracledba 3670016 Mar 28 11:17 /al_9200_1_811249960-rw-rw---- oracledba 3932160 Mar 28 11:17 /al_9199_1_811249959-rw-rw---- oracledba 11010048 Mar 28 09:25 /c-2177845250-20130328-0b-rw-rw---- oracledba 10747904 Mar 28 09:25 /c-3383507379-20130328-09-rw-rw---- oracledba 10747904 Mar 28 09:25 /cntrl_9197_1_811243259-rw-rw---- oracledba 10747904 Mar 28 09:25 /cntrl_7783_1_811243253RMAN>run

2>{

3>allocate channel c1 type 'sbt_tape'

4>send 'NB_ORA_CLIENT=RD162'

5>restore controlfile from '/cntrl_24145_1_828414748'6>release channel c1

7>}

using target database control file instead of recovery catalogallocated channel: c1

channel c1: sid=874 devtype=SBT_TAPE

channel c1: Veritas NetBackup for Oracle - Release 7.5 (2012050902)sent command to channel: c1

Starting restore at 2013-03-28 12:41:30

channel c1: restoring control file

channel c1: restore complete, elapsed time: 00:05:16output filename=/u02/ncerp/control/control01.ctloutput filename=/u02/ncerp/control/control02.ctlFinished restore at 2013-03-28 12:46:47

released channel: c1

7、还原数据库文件

在这里要查一下数据库是否已经mount

SQL>select status from v$instance

STATUS

------------

MOUNTED

RMAN>run {

ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE'

send 'NB_ORA_CLIENT=RD162'

set newname for datafile '/backup/ncerp/oradata/system01.dbf' to '/u02/ncerp/oradata/system01.dbf' set newname for datafile '/backup/ncerp/oradata/system02.dbf' to '/u02/ncerp/oradata/system02.dbf' set newname for datafile '/backup/ncerp/oradata/nnc_index03_1.dbf' to '/u02/ncerp/oradata/nnc_index03_1.dbf'set newname for datafile '/backup/ncerp/oradata/undotbs1.dbf' to '/u02/ncerp/oradata/undotbs1.dbf' set newname for datafile '/backup/ncerp/oradata/sysaux01.dbf' to '/u02/ncerp/oradata/sysaux01.dbf' set newname for datafile '/backup/ncerp/oradata/users01.dbf' to '/u02/ncerp/oradata/users01.dbf' set newname for datafile '/backup/ncerp/oradata/nnc_data01_1.dbf' to '/u02/ncerp/oradata/nnc_data01_1.dbf' set newname for datafile '/backup/ncerp/oradata/nnc_data01_2.dbf' to '/u02/ncerp/oradata/nnc_data01_2.dbf' set newname for datafile '/backup/ncerp/oradata/nnc_data01_3.dbf' to '/u02/ncerp/oradata/nnc_data01_3.dbf' set newname for datafile '/backup/ncerp/oradata/nnc_data01_4.dbf' to '/u02/ncerp/oradata/nnc_data01_4.dbf' set newname for datafile '/backup/ncerp/oradata/nnc_data02_1.dbf' to '/u02/ncerp/oradata/nnc_data02_1.dbf' set newname for datafile '/backup/ncerp/oradata/nnc_data02_2.dbf' to '/u02/ncerp/oradata/nnc_data02_2.dbf' set newname for datafile '/backup/ncerp/oradata/nnc_data03_1.dbf' to '/u02/ncerp/oradata/nnc_data03_1.dbf' set newname for datafile '/backup/ncerp/oradata/nnc_data03_2.dbf' to '/u02/ncerp/oradata/nnc_data03_2.dbf' set newname for datafile '/backup/ncerp/oradata/nnc_data03_3.dbf' to '/u02/ncerp/oradata/nnc_data03_3.dbf' set newname for datafile '/backup/ncerp/oradata/nnc_data03_4.dbf' to '/u02/ncerp/oradata/nnc_data03_4.dbf' set newname for datafile '/backup/ncerp/oradata/nnc_index02_1.dbf' to '/u02/ncerp/oradata/nnc_index02_1.dbf'set newname for datafile '/backup/ncerp/oradata/nnc_index01_1.dbf' to '/u02/ncerp/oradata/nnc_index01_1.dbf'set newname for datafile '/backup/ncerp/oradata/nnc_index01_2.dbf' to '/u02/ncerp/oradata/nnc_index01_2.dbf'set newname for datafile '/backup/ncerp/oradata/nnc_index01_3.dbf' to '/u02/ncerp/oradata/nnc_index01_3.dbf'set newname for datafile '/backup/ncerp/oradata/nnc_index01_4.dbf' to '/u02/ncerp/oradata/nnc_index01_4.dbf'set newname for datafile '/backup/ncerp/oradata/iufo01.dbf'to '/u02/ncerp/oradata/iufo01.dbf' set newname for datafile '/backup/ncerp/oradata/iufo02.dbf'to '/u02/ncerp/oradata/iufo02.dbf' set newname for datafile '/backup/ncerp/oradata/nnc_data03_5.dbf' to '/u02/ncerp/oradata/nnc_data03_5.dbf' Restore database

Switch datafile all

}

vi res_test.sh 内容如下:

export ORACLE_SID=ncerp

rman target / <run {

ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE'

send 'NB_ORA_CLIENT=RD162'

做一次恢复测试看看

说明需要3556这个归档日志

所以恢复时,从这个日志进行恢复!

也可以采用后台运行方式

9、数据库恢复

SQL>

cancel

说明,如果上面日志可能有点大的时候,我们需要调整,比如说删除日志组等,然后还重新添加日志到新位置10、打开数据库

SQL>alter database open resetlogs

Database altered.

11、创建临时表空间

关于SQL数据库备份,先打开MS SQL Client——设置SQL Server 的连接—— 创建SQL备份脚本并且save到指定路径,然后在创建备份策略,前面的“属性、客户端都可以和文件备份一样设置”所不同的是“计划和备份路径”,计划中有一点和备份策略不同的就是,我们一创建计划就会有个默认的执行计划,那个要是没有其他要求就不用改,之后添加计划,要注意一点:数据保留周期要和默认的设置一样;至于后面的备份路径,只要选择我们刚刚创建的备份脚本路径就可以了。

另外一点就是创建脚本时候要注意的问题,那就是你要做的是全备份还是差分备份。意思就是说,创建备份策略类型时候,要建立数据库全备份还是差分备份,是在建立脚本时候做的。。。。我也是新人,说的不好的地方还望多多包涵~~~~~~~~

这要看你备份的方式了。

1、直接在Domino服务停止的情况下,COPY的文件目录;那么这种情况下你需要quit掉Domino服务,然后将需要替换的.nsf文件覆盖过去即可。

2、如果你用的NBU或者BE备份的,那么你直接使用NBU或者BE将备份过的.nsf文件恢复到原目录下,或者重定向恢复到其他路径也是可以的。

祝你成功!


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/sjk/6839707.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-03-29
下一篇 2023-03-29

发表评论

登录后才能评论

评论列表(0条)

保存