nbu备份mysql_NBU备份windows系统数据库无法产生备份日志情况解决

这几天在巡检windows主机的数据库时,发现备份没有产生相关备份日志,这个虽然不是问题,但对于备份故障我们将缺少十分有用的诊断信息。

其实,这个问题很容易解决。我们先来看看备份脚本。

截取脚本的部分如下:

@(

echo RUN {

echo ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';

echo ALLOCATE CHANNEL ch01 TYPE 'SBT_TAPE';

echo SEND 'NB_ORA_POLICY=mss-db1_arch_bk';

echo sql 'alter system archive log current';

echo BACKUP

echo       FILESPERSET 20

echo       FORMAT 'arch-s%%s-p%%p-t%%t'

echo       ARCHIVELOG ALL DELETE INPUT;

echo RELEASE CHANNEL ch00;

echo RELEASE CHANNEL ch01;

echo }

) >c:\rman_cmd1.txt

#上面是把信息输入到c:\rman_cmd1.txt文件,然后通过下面的语句来调用。

@%RMAN% target %TARGET_CONNECT_STR% nocatalog msglog '%RMAN_LOG_FILE%' append

#检查c:\没有产生rman_cmd1.txt文件,这个是否是没有产生日志的原因呢?我还不确定,在别的机器也是同样的脚本是可以产生日志的,因此不确定是否这个原因。

其他机器是可以在C盘产生rman_cmd1.txt文件的。

下面测试了一个解决方案

设置一个指定本地的临时脚本变量

@set TMPFILE="%~dpn0.tmp"

脚本修改如下:

@(

echo RUN {

echo ALLOCATE CHANNEL ch00 TYPE 'disk';

echo BACKUP

@REM recommended format

echo       FORMAT 'G:\cntrl_%s_%p_%t'

echo       CURRENT CONTROLFILE;

echo RELEASE CHANNEL ch00;

echo }

) > %TMPFILE%

#将脚本信息输入到指定的临时文件

@%RMAN% target %TARGET_CONNECT_STR% nocatalog msglog '%RMAN_LOG_FILE%' append

经过测试,这样是可以产生备份日志的。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/11590946/viewspace-1063143/,如需转载,请注明出处,否则将追究法律责任。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Legal Notice Copyright © 2017 Veritas Technologies LLC. All rights reserved. Veritas and the Veritas Logo are trademarks or registered trademarks of Veritas Technologies LLC or its affiliates in the U.S. and other countries. Other names may be trademarks of their respective owners. This product may contain third party software for which Veritas is required to provide attribution to the third party (“Third Party Programs”). Some of the Third Party Programs are available under open source or free software licenses. The License Agreement accompanying the Software does not alter any rights or obligations you may have under those open source or free software licenses. Please see the Third Party Legal Notice Appendix to this Documentation or TPIP ReadMe File accompanying this product for more information on the Third Party Programs. The product described in this document is distributed under licenses restricting its use, copying, distribution, and decompilation/reverse engineering. No part of this document may be reproduced in any form by any means without prior written authorization of Veritas Technologies LLC and its licensors, if any. THE DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID. VERITAS TECHNOLOGIES LLC SHALL NOT BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES IN CONNECTION WITH THE FURNISHING, PERFORMANCE, OR USE OF THIS DOCUMENTATION. THE INFORMATION CONTAINED IN THIS DOCUMENTATION IS SUBJECT TO CHANGE WITHOUT NOTICE. The Licensed Software and Documentation are deemed to be commercial computer software as defined in FAR 12.212 and subject to restricted rights as defined in FAR Section 52.227-19 "Commercial Computer Software - Restricted Rights" and DFARS 227.7202, et seq. "Commercial Computer Software and Commercial Computer Software Documentation," as applicable, and any successor regulations, whether delivered by Veritas as on premises or hosted services. Any use, modification, reproduction release, performance, display or disclosure of the Licensed Software and Documentation by the U.S. Government shall be solely in accordance with the terms of this Agreement.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值