免费注册 查看新帖 |

Chinaunix

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

[Veritas NBU] 使用rman1.3脚本备份失败 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-10-15 16:02 |只看该作者 |倒序浏览
本帖最后由 yihe_zang 于 2012-10-15 16:13 编辑

前提说明,不是SAN(Lan-free),也不是磁带库,就是简单的磁盘,下面提到的可能有磁带库的问题,要改成什么呢?

下面是out输出文件
  1. ==== started on 2012/10/15 周一  15:39 ====
  2. Script name: "D:\rman\rman65hot.cmd"
  3. #                                       
  4.   RMAN  :  D:\app\Administrator\product\11.2.0\dbhome_1\bin\rman.exe                       
  5.   NLS_LANG  :  american               
  6.   ORACLE_HOME  :  D:\app\Administrator\product\11.2.0\dbhome_1         
  7.   ORACLE_SID  :  orcl           
  8.   NLS_DATE_FORMAT  :  YYYY-MM-DD:hh24:mi:ss
  9.   RMAN_LOG_FILE  :  "D:\rman\rman65hot.out"     
  10.   NB_ORA_SERV  :  be2012                     
  11.   NB_ORA_FULL  :  1                     
  12.   NB_ORA_INCR  :  0                     
  13.   NB_ORA_CINC  :  0                     
  14.   NB_ORA_CLASS  :  oracle65                  

  15. Recovery Manager: Release 11.2.0.1.0 - Production on Mon Oct 15 15:39:14 2012

  16. Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

  17. connected to target database: ORCL (DBID=1324015989)
  18. using target database control file instead of recovery catalog

  19. RMAN> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13> 14> 15> 16> 17> 18> 19> 20> 21> 22> 23>
  20. RMAN-00571: ===========================================================
  21. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
  22. RMAN-00571: ===========================================================
  23. RMAN-03009: failure of allocate command on ch00 channel at 10/15/2012 15:39:14
  24. ORA-19554: error allocating device, device type: SBT_TAPE, device name:
  25. ORA-27211: Failed to load Media Management Library

  26. RMAN>

  27. Recovery Manager complete.
  28. #   
复制代码
把备份用的rman脚本也贴出来给大家瞧瞧:
  1. @REM $Header: hot_database_backup.cmd,v 1.3 2005/11/28 19:01:53 $

  2. @REM bcpyrght
  3. @REM ***************************************************************************
  4. @REM * $VRTScprght: Copyright 1993 - 2007 Symantec Corporation, All Rights Reserved $ *
  5. @REM ***************************************************************************
  6. @REM ecpyrght
  7. @REM
  8. @REM ---------------------------------------------------------------------------
  9. @REM                          hot_database_backup.cmd
  10. @REM ---------------------------------------------------------------------------
  11. @REM This script uses Recovery Manager to take a hot (inconsistent) database
  12. @REM backup. A hot backup is inconsistent because portions of the database are
  13. @REM being modified and written to the disk while the backup is progressing.
  14. @REM You must run your database in ARCHIVELOG mode to make hot backups.
  15. @REM
  16. @REM NOTE information for running proxy backups has been included.  These
  17. @REM information sections begin with a comment line of PROXY
  18. @REM ---------------------------------------------------------------------------

  19. @setlocal ENABLEEXTENSIONS

  20. @REM ---------------------------------------------------------------------------
  21. @REM No need to echo the commands.
  22. @REM ---------------------------------------------------------------------------

  23. @echo off

  24. @REM ---------------------------------------------------------------------------
  25. @REM Put output in the same filename, different extension.
  26. @REM ---------------------------------------------------------------------------

  27. @set RMAN_LOG_FILE="%~dpn0.out"

  28. @REM ---------------------------------------------------------------------------
  29. @REM You may want to delete the output file so that backup information does
  30. @REM not accumulate.  If not, delete the following command.
  31. @REM ---------------------------------------------------------------------------

  32. @if exist %RMAN_LOG_FILE% del %RMAN_LOG_FILE%

  33. @REM ---------------------------------------------------------------------------
  34. @REM Replace H:\oracle\ora81, below, with the Oracle home path.
  35. @REM ---------------------------------------------------------------------------

  36. @set ORACLE_HOME=D:\app\Administrator\product\11.2.0\dbhome_1

  37. @REM ---------------------------------------------------------------------------
  38. @REM Replace ora81, below, with the Oracle SID.
  39. @REM ---------------------------------------------------------------------------

  40. @set ORACLE_SID=orcl

  41. @REM ---------------------------------------------------------------------------
  42. @REM Replace sys/manager, below, with the target connect string.
  43. @REM ---------------------------------------------------------------------------

  44. @set TARGET_CONNECT_STR=sys/redhat123

  45. @REM ---------------------------------------------------------------------------
  46. @REM Set the Oracle Recovery Manager.
  47. @REM ---------------------------------------------------------------------------

  48. @set RMAN=%ORACLE_HOME%\bin\rman.exe

  49. @REM ---------------------------------------------------------------------------
  50. @REM PROXY
  51. @REM For a PROXY backup, uncomment the line below and replace the value.
  52. @REM
  53. @REM       NB_ORA_PC_STREAMS - specifies the number of parallel backup streams
  54. @REM                           to be started.
  55. @REM ---------------------------------------------------------------------------
  56. @REM @set NB_ORA_PC_STREAMS=3


  57. @REM ---------------------------------------------------------------------------
  58. @REM Log the start of this scripts.
  59. @REM ---------------------------------------------------------------------------

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

  62. @echo ==== started on %DATE% ==== >> %RMAN_LOG_FILE%
  63. @echo Script name: %0 >> %RMAN_LOG_FILE%

  64. @REM ---------------------------------------------------------------------------
  65. @REM Several RMAN commands use time parameters that require NLS_LANG and
  66. @REM NLS_DATE_FORMAT to be set. This example uses the standard date format.
  67. @REM Replace below with the desired language values.
  68. @REM ---------------------------------------------------------------------------

  69. @set NLS_LANG=american
  70. @set NLS_DATE_FORMAT=YYYY-MM-DD:hh24:mi:ss

  71. @REM ---------------------------------------------------------------------------
  72. @REM Print out environment variables set in this script.
  73. @REM ---------------------------------------------------------------------------

  74. @echo #                                       >> %RMAN_LOG_FILE%
  75. @echo   RMAN  :  %RMAN%                       >> %RMAN_LOG_FILE%
  76. @echo   NLS_LANG  :  %NLS_LANG%               >> %RMAN_LOG_FILE%
  77. @echo   ORACLE_HOME  :  %ORACLE_HOME%         >> %RMAN_LOG_FILE%
  78. @echo   ORACLE_SID  :  %ORACLE_SID%           >> %RMAN_LOG_FILE%
  79. @echo   NLS_DATE_FORMAT  :  %NLS_DATE_FORMAT% >> %RMAN_LOG_FILE%
  80. @echo   RMAN_LOG_FILE  :  %RMAN_LOG_FILE%     >> %RMAN_LOG_FILE%

  81. @REM ---------------------------------------------------------------------------
  82. @REM PROXY
  83. @REM For a PROXY backup, uncomment the line below.
  84. @REM ---------------------------------------------------------------------------
  85. @REM @echo   NB_ORA_PC_STREAMS  :  %NB_ORA_PC_STREAMS%     >> %RMAN_LOG_FILE%

  86. @REM ---------------------------------------------------------------------------
  87. @REM Print out environment variables set in bphdb.
  88. @REM ---------------------------------------------------------------------------

  89. @echo   NB_ORA_SERV  :  %NB_ORA_SERV%                     >> %RMAN_LOG_FILE%
  90. @echo   NB_ORA_FULL  :  %NB_ORA_FULL%                     >> %RMAN_LOG_FILE%
  91. @echo   NB_ORA_INCR  :  %NB_ORA_INCR%                     >> %RMAN_LOG_FILE%
  92. @echo   NB_ORA_CINC  :  %NB_ORA_CINC%                     >> %RMAN_LOG_FILE%
  93. @echo   NB_ORA_CLASS  :  %NB_ORA_CLASS%                   >> %RMAN_LOG_FILE%

  94. @REM ---------------------------------------------------------------------------
  95. @REM We assume that the database is properly opened. If desired, this would
  96. @REM be the place to verify that.
  97. @REM ---------------------------------------------------------------------------

  98. @REM ---------------------------------------------------------------------------
  99. @REM If this script is executed from a NetBackup schedule, NetBackup
  100. @REM sets an NB_ORA environment variable based on the schedule type.
  101. @REM For example, when:
  102. @REM     schedule type is                BACKUP_TYPE is
  103. @REM     ----------------                --------------
  104. @REM Automatic Full                      INCREMENTAL LEVEL=0
  105. @REM Automatic Differential Incremental  INCREMENTAL LEVEL=1
  106. @REM Automatic Cumulative Incremental    INCREMENTAL LEVEL=1 CUMULATIVE
  107. @REM
  108. @REM For user initiated backups, BACKUP_TYPE defaults to incremental
  109. @REM level 0 (Full).  To change the default for a user initiated
  110. @REM backup to incremental or incrementatl cumulative, uncomment
  111. @REM one of the following two lines.
  112. @REM @set BACKUP_TYPE="INCREMENTAL LEVEL=1"
  113. @REM @set BACKUP_TYPE="INCREMENTAL LEVEL=1 CUMULATIVE"
  114. @REM
  115. @REM Note that we use incremental level 0 to specify full backups.
  116. @REM That is because, although they are identical in content, only
  117. @REM the incremental level 0 backup can have incremental backups of
  118. @REM level > 0 applied to it.
  119. @REM ---------------------------------------------------------------------------

  120. @REM ---------------------------------------------------------------------------
  121. @REM What kind of backup will we perform.
  122. @REM ---------------------------------------------------------------------------

  123. @if "%NB_ORA_FULL%" EQU "1" @set BACKUP_TYPE=INCREMENTAL Level=0
  124. @if "%NB_ORA_INCR%" EQU "1" @set BACKUP_TYPE=INCREMENTAL Level=1
  125. @if "%NB_ORA_CINC%" EQU "1" @set BACKUP_TYPE=INCREMENTAL Level=1 CUMULATIVE
  126. @if NOT DEFINED BACKUP_TYPE @set BACKUP_TYPE=INCREMENTAL Level=0

  127. @REM ---------------------------------------------------------------------------
  128. @REM Call Recovery Manager to initiate the backup. This example does not use a
  129. @REM Recovery Catalog. If you choose to use one, remove the option, nocatalog,
  130. @REM from the rman command line below and add a
  131. @REM 'rcvcat <userid>/<passwd>@<tns alias>' statement.
  132. @REM
  133. @REM  NOTE WHEN USING TNS ALIAS: When connecting to a database
  134. @REM  using a TNS alias, you must use a send command or a parms operand to
  135. @REM  specify environment variables.  In other words, when accessing a database
  136. @REM  through a listener, the environment variables set at the system level are not
  137. @REM  visible when RMAN is running.  For more information on the environment
  138. @REM  variables, please refer to the NetBackup for Oracle Admin. Guide.
  139. @REM
  140. @REM If you are getting an error that the input line is too long, you will need
  141. @REM to put the RMAN run block in a separate file.  Then use the "cmdfile"
  142. @REM option of RMAN.  For more information on the "cmdfile" options please
  143. @REM refer to the RMAN documentation.
  144. @REM ---------------------------------------------------------------------------

  145. @REM ---------------------------------------------------------------------------
  146. @REM PROXY
  147. @REM For a PROXY backup, you must use a send command to specify
  148. @REM the NB_ORA_PC_STREAMS environment variable. For example,
  149. @REM echo ALLOCATE CHANNEL ch01 TYPE 'SBT_TAPE';
  150. @REM echo SEND 'NB_ORA_PC_STREAMS=%%NB_ORA_PC_STREAMS%%';
  151. @REM
  152. @REM %BACKUP_TYPE% must also be removed and replaced with the PROXY parameter
  153. @REM in the RMAN section associated with the data files.  For example,
  154. @REM echo BACKUP
  155. @REM echo       PROXY
  156. @REM echo       FORMAT 'bk_u%%u_s%%s_p%%p_t%%t'
  157. @REM echo       DATABASE;
  158. @REM            .
  159. @REM            .
  160. @REM  Note that the controlfiles and archivelogs are not backed up using proxy
  161. @REM  copy method. Rman will initiate non-proxy copy sessions to backup the
  162. @REM  controlfile and archivelogs.
  163. @REM ---------------------------------------------------------------------------
  164. @(
  165. echo RUN {
  166. echo ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
  167. echo BACKUP
  168. echo       %BACKUP_TYPE%
  169. echo       FORMAT 'bk_u%%u_s%%s_p%%p_t%%t'
  170. echo       DATABASE;
  171. echo sql 'alter system archive log current';
  172. echo RELEASE CHANNEL ch00;
  173. echo # Backup all archive logs
  174. echo ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
  175. echo BACKUP
  176. echo       FILESPERSET 20
  177. echo       FORMAT 'arch-s%%s-p%%p'
  178. echo       ARCHIVELOG ALL DELETE INPUT;
  179. echo RELEASE CHANNEL ch00;

  180. echo # Control file backup

  181. echo ALLOCATE CHANNEL ch00
  182. echo     TYPE 'SBT_TAPE';
  183. echo BACKUP
  184. echo     FORMAT 'ctrl_u%%u_s%%s_p%%p_t%%t'
  185. echo     CURRENT CONTROLFILE;
  186. echo RELEASE CHANNEL ch00;
  187. echo }
  188. ) | %RMAN% target %TARGET_CONNECT_STR% nocatalog msglog '%RMAN_LOG_FILE%' append

  189. @set ERRLEVEL=%ERRORLEVEL%

  190. @REM ---------------------------------------------------------------------------
  191. @REM NetBackup (bphdb) stores the name of a file in an environment variable,
  192. @REM called STATUS_FILE. This file is used by an automatic schedule to
  193. @REM communicate status information with NetBackup's job monitor. It is up to
  194. @REM the script to write a 0 (passed) or 1 (failure) to the status file.
  195. @REM ---------------------------------------------------------------------------

  196. @if %ERRLEVEL% NEQ 0 @goto err

  197. @set LOGMSG=ended successfully
  198. @if "%STATUS_FILE%" EQU "" goto end
  199. @echo 0 > "%STATUS_FILE%"
  200. @goto end

  201. :err
  202. @set LOGMSG=ended in error
  203. @if "%STATUS_FILE%" EQU "" @goto end
  204. @echo 1 > "%STATUS_FILE%"

  205. :end

  206. @REM ---------------------------------------------------------------------------
  207. @REM Log the completion of this script.
  208. @REM ---------------------------------------------------------------------------

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

  211. @echo #  >> %RMAN_LOG_FILE%
  212. @echo %==== %LOGMSG% on %DATE% ==== >> %RMAN_LOG_FILE%
  213. @endlocal
  214. @REM End of Main Program -----------------------------------------------------
复制代码
独立调用rman脚本的错误提示,是不是2008r2不能用这个脚本啊?

论坛徽章:
0
2 [报告]
发表于 2012-10-15 17:01 |只看该作者
杯具啊,用be2010 r2都能备份Oracle 11g r2成功,为啥NBU7.5就是不行呢?

论坛徽章:
0
3 [报告]
发表于 2012-10-15 20:40 |只看该作者
这不是写的很明白那
ORA-27211: Failed to load Media Management Library
没有接管rman mml层。unix/linux没有执行oracle_config,替换libbobk.so,windows 查看windows/system32/orasbt.dll 是否存在。

论坛徽章:
0
4 [报告]
发表于 2012-10-15 21:43 |只看该作者
本帖最后由 yihe_zang 于 2012-10-15 22:26 编辑

已经加载那个配置文件了,可是还是报相同的错误呢!

难道是Oracle 11g安装的有问题吗?

论坛徽章:
0
5 [报告]
发表于 2012-10-15 22:28 |只看该作者
回复 3# heroesray


   
如何加载这个动态链接库文件呢?

论坛徽章:
0
6 [报告]
发表于 2012-10-16 12:51 |只看该作者
你把orasbt.dll拷贝到oracle_home/bin目录下,同时确保path变量里有oracle_home/bin,应该就可以了,
或者干脆分配通道指定orasbt.dll,像commvault就是这么干的,不用做mml层接管连接。

ALLOCATE CHANNEL ch1 TYPE 'SBT_TAPE' PARMS='ENV=(SBT_LIBRARY=c:\windows\system32\orasbt.dll,NB_ORA_CLIENT=client,NB_ORA_SERV=server)';

论坛徽章:
0
7 [报告]
发表于 2012-10-16 19:44 |只看该作者
回复 2# yihe_zang


    BE鼠标点点就好了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP