免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 5823 | 回复: 10
打印 上一主题 下一主题

[Veritas NBU] 新人请教NBU备份Oracle问题~!!谢谢 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-04-09 13:32 |只看该作者 |倒序浏览
环境:
Master A(win2003) :Windows 2003+NBU Server
Client B(nodeB) :Windows 2003+NBU for oracle Agent+Oracle10g
在主机A上建立磁盘storage unit (没有磁带机),名字为:环境:
Master A(win2003) :Windows 2003+NBU Server
Client B(nodeB) :Windows 2003+NBU for oracle Agent+Oracle10g
在主机A上建立磁盘storage_unit(没有磁带机),名字为:disk_oracle
策略名:orcl_control
备份过程:
1、做文件备份没问题
2、做Oracle备份时,在主机B上写了个cmd格式的脚本,如下:

RMAN TARGET sys/oracle@dgdemo nocatalog
RUN {
ALLOCATE CHANNEL t1 TYPE 'sbt_tape';
send 'NB_ORA_CLIENT=nodeB',NB_ORA_POLICY=orcl_control,NB_ORA_SERV=win2003';
BACKUP FORMAT '%d_%s' DATABASE;
sql 'alter system archive log current';
RELEASE CHANNEL t1;
}

在主机A上对主机B进行一次手动备份时,总会不成功,不知道是什么问题?
错误代码:
requesting resource disk_oracle
requesting resource win2003.NBU_CLIENT.MAXJOBS.nodeB
requesting resource win2003.NBU_POLICY.MAXJOBS.orcl_control
granted resource win2003.NBU_CLIENT.MAXJOBS.nodeB
granted resource win2003.NBU_POLICY.MAXJOBS.orcl_control
granted resource MediaID=@aaaacath=E:\storage_unit;MediaServer=win2003
granted resource disk_oracle
estimated 0 kbytes needed
started process bpbrm (3876)
connecting
connected; connect time: 00:00:01
end writing
failed trying to exec a command(29)

也许是我不会写,能不能哪位举个例子,就来个全备份的脚本就行。。谢谢啊。。

论坛徽章:
0
2 [报告]
发表于 2010-04-09 14:18 |只看该作者
有了新进展,我在主机B上RMAN里面手动运行这些命令,居然成功备份到了主机A上面去了,那为什么不能在主机A中通过NBU使用cmd脚本,让主机B的Oracle数据备份到主机A上呢?请教啊。。。

论坛徽章:
0
3 [报告]
发表于 2010-04-09 15:12 |只看该作者
在主机B上RMAN里面手动运行这些命令,居然成功备份到了主机A上面去了
是因为当前用户有oracle环境变量

想在主机A上运行,需要修改你的cmd 脚本,参考主机B上
veritas 安装目录/netbackup/ext/db_ext/oracle/samples/rman/hot_database_backup.sh

论坛徽章:
0
4 [报告]
发表于 2010-04-09 15:51 |只看该作者
veritas 安装目录/netbackup/ext/db_ext/oracle/samples/rman/hot_database_backup.sh

我看过了,好多内容,但起关键作用的是哪些啊,就是说哪些参数修改后,能在主机A上使用策略让主机B进行备份啊。。

论坛徽章:
0
5 [报告]
发表于 2010-04-09 16:40 |只看该作者
好!看不懂 我也是新人 还是新人中的新人

论坛徽章:
0
6 [报告]
发表于 2010-04-09 17:22 |只看该作者
那个脚本你在B机上测试过没?

模板的脚本主要修改home 和sid 权限
看下手册!

论坛徽章:
1
CU十二周年纪念徽章
日期:2013-10-24 15:41:34
7 [报告]
发表于 2010-04-09 21:15 |只看该作者
1. 先要在master server中创建Oracle类型的备份策略。
2. Oracle的 备份脚本必须是放在Oracle安装的机器上,也就是B机上。
3. 在master server的console中提交oracle的手东备份就行了。

论坛徽章:
0
8 [报告]
发表于 2010-04-10 01:06 |只看该作者
ALLOCATE CHANNEL t1 TYPE 'sbt_tape';
这句话执行了,所以会备到MEDIA SERVER,也就是你的master下。。。。

建议先看手册

论坛徽章:
1
CU十二周年纪念徽章
日期:2013-10-24 15:41:34
9 [报告]
发表于 2010-04-11 10:06 |只看该作者
LZ有时间还是看看手册吧。

不一定全看,把目录看一遍都有收获。

论坛徽章:
0
10 [报告]
发表于 2010-04-13 12:48 |只看该作者
@setlocal ENABLEEXTENSIONS
@REM -----------------------------------------------------------------
@REM Backup script generated on 12/01/07 12:55:10
@REM Shell Script name: hot_back.cmd
@REM
@REM Veritas NetBackup for oracle on Windows
@REM $VRTScprght: Copyright 1993 - 2007 Symantec Corporation, All Rights Reserved $
@REM -----------------------------------------------------------------

@set RMAN_LOG_FILE="%~dpn0.out"

@REM -----------------------------------------------------------------
@REM Log the start of this script.
@REM -----------------------------------------------------------------

@for /F "tokens=1*" %%p in ('date /T') do @set DATE=%%p %%q
@for /F %%p in ('time /T') do @set DATE=%DATE% %%p

@echo Script %0 > %RMAN_LOG_FILE%
@echo ==== started on %DATE% ==== >> %RMAN_LOG_FILE%

@set ORACLE_HOME=e:\oracle\ora92(根据实际写)
@set ORACLE_SID=ldl(根据实际写)
@set TARGET_CONNECT_STR=sys/pswd(sys密码)
@set RMAN=%ORACLE_HOME%\bin\rman.exe

@REM -----------------------------------------------------------------
@REM The NetBackup script generator determined that a NetBackup Policy
@REM configured for the standard Oracle backup would have been used
@REM when this script was generated.

@REM This script was generated for use with a Policy with the standard
@REM Oracle backup method (i.e. non-proxy).
@REM -----------------------------------------------------------------

@REM -----------------------------------------------------------------
@REM For NetBackup scheduled, or server initiated backups, NetBackup
@REM sets an NB_ORA environment variable based on the schedule type.
@REM The NB_ORA variable is then used to dynamically set BACKUP_TYPE.
@REM For example, when:
@REM     schedule type is                BACKUP_TYPE is
@REM     ----------------                --------------
@REM Automatic Full                     INCREMENTAL LEVEL=0
@REM Automatic Differential Incremental INCREMENTAL LEVEL=1
@REM Automatic Cumulative Incremental   INCREMENTAL LEVEL=1 CUMULATIVE

@REM For user initiated backups BACKUP_TYPE defaults to incremental
@REM level 0 (full). To change this default to incremental or
@REM incremental cumulative, replace INCREMENTAL LEVEL=0 with
@REM INCREMENTAL LEVEL=1 or INCREMENTAL LEVEL=1 CUMULATIVE in
@REM the line below that contains, "@if NOT DEFINED BACKUP_TYPE".

@REM Note that we use incremental level 0 to specify full backups.
@REM That is because, although they are identical in content, only
@REM the incremental level 0 backup can have incremental backups
@REM of level > 0 applied to it.
@REM -----------------------------------------------------------------

@if "%NB_ORA_FULL%" EQU "1"   @set BACKUP_TYPE=INCREMENTAL LEVEL=0
@if "%NB_ORA_INCR%" EQU "1"   @set BACKUP_TYPE=INCREMENTAL LEVEL=1
@if "%NB_ORA_CINC%" EQU "1"   @set BACKUP_TYPE=INCREMENTAL LEVEL=1 CUMULATIVE
@if NOT DEFINED BACKUP_TYPE   @set BACKUP_TYPE=INCREMENTAL LEVEL=0

@REM -----------------------------------------------------------------
@REM rman commands for database RMIS.

@REM If you are getting an error that the input line is too long, you will need
@REM to put the RMAN run block in a separate file.  Then use the "cmdfile"
@REM option of RMAN.  For more information on the "cmdfile" options please
@REM refer to the RMAN documentation.
@REM -----------------------------------------------------------------

@(

echo RUN {
echo ALLOCATE CHANNEL ch00
echo     TYPE 'SBT_TAPE';
echo BACKUP
echo     %BACKUP_TYPE%
echo     FORMAT 'bk_u%%u_s%%s_p%%p_t%%t'
echo     DATABASE;


echo RELEASE CHANNEL ch00;

echo # Backup Archived Logs

echo # For an offline backup, remove the following sql statement
echo sql 'alter system archive log current';

echo ALLOCATE CHANNEL ch00
echo     TYPE 'SBT_TAPE';
echo BACKUP
echo     FORMAT 'arch_u%%u_s%%s_p%%p_t%%t'
echo     ARCHIVELOG
echo         ALL
echo     DELETE INPUT;

echo RELEASE CHANNEL ch00;

echo # Control file backup

echo ALLOCATE CHANNEL ch00
echo     TYPE 'SBT_TAPE';
echo BACKUP
echo     FORMAT 'ctrl_u%%u_s%%s_p%%p_t%%t'
echo     CURRENT CONTROLFILE;
echo RELEASE CHANNEL ch00;
echo }
) | %RMAN% target %TARGET_CONNECT_STR% nocatalog msglog '%RMAN_LOG_FILE%' append

@set ERRLEVEL=%ERRORLEVEL%

@REM -----------------------------------------------------------------
@REM When this script is started as part of a scheduled
@REM backup, STATUS_FILE is used to communicate status
@REM information to the NetBackup job monitor.
@REM -----------------------------------------------------------------

@if %ERRLEVEL% NEQ 0    @goto err

@set LOGMSG=ended successfully

@if "%STATUS_FILE%" EQU ""    @goto end
@echo 0 > "%STATUS_FILE%"
@goto end

:err

@set LOGMSG=ended in error

@if "%STATUS_FILE%" EQU ""    @goto end
@echo 1 > "%STATUS_FILE%"

:end

@REM -----------------------------------------------------------------
@REM Log the completion of this script.
@REM -----------------------------------------------------------------

@for /F "tokens=1*" %%p in ('date /T') do @set DATE=%%p %%q
@for /F %%p in ('time /T') do @set DATE=%DATE% %%p

@echo Script %0 >> %RMAN_LOG_FILE%
@echo ==== %LOGMSG% on %DATE% ==== >> %RMAN_LOG_FILE%

@endlocal
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP