Oracle数据库数据恢复、性能优化

找回密码
注册
搜索
热搜: 活动 交友 discuz
发新帖

11

积分

0

好友

14

主题
1#
发表于 2012-7-19 09:21:15 | 查看: 11887| 回复: 6
OS: Windows 2008 X64 Enterprise Server
DB: Oracle 11.2.0.1
VERITAS Client: Client for Oracle Version 7.0


allocated channel: ch00
channel ch00: SID=23 device type=SBT_TAPE
channel ch00: Veritas NetBackup for Oracle - Release 7.0 (20100104)

allocated channel: ch01
channel ch01: SID=976 device type=SBT_TAPE
channel ch01: Veritas NetBackup for Oracle - Release 7.0 (20100104)

Starting backup at 2012-07-19:08:55:08
channel ch00: starting incremental level 0 datafile backup set
channel ch00: specifying datafile(s) in backup set
input datafile file number=00005 name=D:\APP\ADMINISTRATOR\ORADATA\ORCL\JITE1.DBF
input datafile file number=00007 name=D:\APP\ADMINISTRATOR\ORADATA\ORCL\PDPS.DBF
input datafile file number=00003 name=D:\APP\ADMINISTRATOR\ORADATA\ORCL\UNDOTBS01.DBF
input datafile file number=00004 name=D:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS01.DBF
channel ch00: starting piece 1 at 2012-07-19:08:55:09
channel ch01: starting incremental level 0 datafile backup set
channel ch01: specifying datafile(s) in backup set
input datafile file number=00006 name=D:\APP\ADMINISTRATOR\ORADATA\ORCL\GYS.DBF
input datafile file number=00002 name=D:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSAUX01.DBF
input datafile file number=00001 name=D:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSTEM01.DBF
channel ch01: starting piece 1 at 2012-07-19:08:55:09
RMAN-03009: failure of backup command on ch00 channel at 07/19/2012 09:00:55
ORA-19513: failed to identify sequential file
ORA-27206: requested file not found in media management catalog
continuing other job steps, job failed will not be re-run
channel ch00: starting incremental level 0 datafile backup set
channel ch00: specifying datafile(s) in backup set
including current control file in backup set
channel ch00: starting piece 1 at 2012-07-19:09:00:56
RMAN-03009: failure of backup command on ch01 channel at 07/19/2012 09:01:42
ORA-19513: failed to identify sequential file
ORA-27206: requested file not found in media management catalog
continuing other job steps, job failed will not be re-run
channel ch01: starting incremental level 0 datafile backup set
channel ch01: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ch01: starting piece 1 at 2012-07-19:09:01:42
RMAN-03009: failure of backup command on ch00 channel at 07/19/2012 09:03:27
ORA-19513: failed to identify sequential file
ORA-27206: requested file not found in media management catalog
continuing other job steps, job failed will not be re-run
released channel: ch00
released channel: ch01
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ch01 channel at 07/19/2012 09:04:32
ORA-19513: failed to identify sequential file
ORA-27206: requested file not found in media management catalog

RMAN>

Recovery Manager complete.


脚本如下:

RUN {
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
ALLOCATE CHANNEL ch01 TYPE 'SBT_TAPE';
BACKUP
      %BACKUP_TYPE%
      FORMAT 'bk_u%%u_s%%s_p%%p_t%%t'
      DATABASE;
sql 'alter system archive log current';
RELEASE CHANNEL ch00;
RELEASE CHANNEL ch01;
# Backup all archive logs
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
BACKUP
      FILESPERSET 20
      FORMAT 'arch-s%%s-p%%p'
      ARCHIVELOG LIKE 'D:\archive_log\ARCHIVE%' DELETE INPUT;
RELEASE CHANNEL ch00;
# Backup controlfile
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
BACKUP
     FORMAT 'cntrl_s%%s_p%%p_t%%t'
     CURRENT CONTROLFILE;
RELEASE CHANNEL ch00;
}

注:上述脚本可以再本地备份成功,这个库只有10G,磁带也有空余!
nbu 管理界面,备份任务正常结束,无错误提示;
数据库服务器上用list backup of database;看不到备份到带库结果;
--参照过若干贴无果 - -,mos 上只有一个贴,就是建议更改policy里面,将IP地址改成主机,依旧无果!!请刘大拨云见日!

nbu SERVER (<home>\veritas\netbackup\logs\dbclient)无日志
2#
发表于 2012-7-19 09:39:03
不好意思较多无用内容:
  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 - 2009 Symantec Corporation, All Rights Reserved $ *
  5. @REM ***************************************************************************
  6. @REM ecpyrght
  7. @REM
  8. @REM ---------------------------------------------------------------------------
  9. @REM     hot_database_backup.cmd
  10. 。。。省略备份注释内容
  11. @setlocal ENABLEEXTENSIONS

  12. @REM ---------------------------------------------------------------------------
  13. @REM No need to echo the commands.
  14. @REM ---------------------------------------------------------------------------

  15. @echo off

  16. @REM ---------------------------------------------------------------------------
  17. @REM Put output in the same filename, different extension.
  18. @REM ---------------------------------------------------------------------------

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

  20. @REM ---------------------------------------------------------------------------
  21. @REM You may want to delete the output file so that backup information does
  22. @REM not accumulate.  If not, delete the following command.
  23. @REM ---------------------------------------------------------------------------

  24. @if exist %RMAN_LOG_FILE% del %RMAN_LOG_FILE%

  25. @REM ---------------------------------------------------------------------------
  26. @REM Replace H:\oracle\ora81, below, with the Oracle home path.
  27. @REM ---------------------------------------------------------------------------

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

  29. @REM ---------------------------------------------------------------------------
  30. @REM Replace ora81, below, with the Oracle SID.
  31. @REM ---------------------------------------------------------------------------

  32. @set ORACLE_SID=orcl

  33. @REM ---------------------------------------------------------------------------
  34. @REM Replace sys/manager, below, with the target connect string.
  35. @REM ---------------------------------------------------------------------------

  36. @set TARGET_CONNECT_STR=/

  37. @REM ---------------------------------------------------------------------------
  38. @REM Set the Oracle Recovery Manager.
  39. @REM ---------------------------------------------------------------------------

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

  41. @REM ---------------------------------------------------------------------------
  42. @REM PROXY
  43. @REM For a PROXY backup, uncomment the line below and replace the value.
  44. @REM
  45. @REM       NB_ORA_PC_STREAMS - specifies the number of parallel backup streams
  46. @REM                           to be started.
  47. @REM ---------------------------------------------------------------------------
  48. @REM @set NB_ORA_PC_STREAMS=3


  49. @REM ---------------------------------------------------------------------------
  50. @REM Log the start of this scripts.
  51. @REM ---------------------------------------------------------------------------

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

  54. @echo ==== started on %DATE% ==== >> %RMAN_LOG_FILE%
  55. @echo Script name: %0 >> %RMAN_LOG_FILE%

  56. 省略部分注释内容.....
  57. @set NLS_LANG=american
  58. @set NLS_DATE_FORMAT=YYYY-MM-DD:hh24:mi:ss

  59. @REM ---------------------------------------------------------------------------
  60. @REM Print out environment variables set in this script.
  61. @REM ---------------------------------------------------------------------------

  62. @echo #                                       >> %RMAN_LOG_FILE%
  63. @echo   RMAN  :  %RMAN%                       >> %RMAN_LOG_FILE%
  64. @echo   NLS_LANG  :  %NLS_LANG%               >> %RMAN_LOG_FILE%
  65. @echo   ORACLE_HOME  :  %ORACLE_HOME%         >> %RMAN_LOG_FILE%
  66. @echo   ORACLE_SID  :  %ORACLE_SID%           >> %RMAN_LOG_FILE%
  67. @echo   NLS_DATE_FORMAT  :  %NLS_DATE_FORMAT% >> %RMAN_LOG_FILE%
  68. @echo   RMAN_LOG_FILE  :  %RMAN_LOG_FILE%     >> %RMAN_LOG_FILE%

  69. @REM ---------------------------------------------------------------------------
  70. @REM PROXY
  71. @REM For a PROXY backup, uncomment the line below.
  72. @REM ---------------------------------------------------------------------------
  73. @REM @echo   NB_ORA_PC_STREAMS  :  %NB_ORA_PC_STREAMS%     >> %RMAN_LOG_FILE%

  74. @REM ---------------------------------------------------------------------------
  75. @REM Print out environment variables set in bphdb.
  76. @REM ---------------------------------------------------------------------------

  77. @echo   NB_ORA_SERV  :  %NB_ORA_SERV%                     >> %RMAN_LOG_FILE%
  78. @echo   NB_ORA_FULL  :  %NB_ORA_FULL%                     >> %RMAN_LOG_FILE%
  79. @echo   NB_ORA_INCR  :  %NB_ORA_INCR%                     >> %RMAN_LOG_FILE%
  80. @echo   NB_ORA_CINC  :  %NB_ORA_CINC%                     >> %RMAN_LOG_FILE%
  81. @echo   NB_ORA_CLASS  :  %NB_ORA_CLASS%                   >> %RMAN_LOG_FILE%

  82. @REM ---------------------------------------------------------------------------
  83. @REM We assume that the database is properly opened. If desired, this would
  84. @REM be the place to verify that.
  85. @REM ---------------------------------------------------------------------------

  86. @REM ---------------------------------------------------------------------------
  87. @REM If this script is executed from a NetBackup schedule, NetBackup
  88. @REM sets an NB_ORA environment variable based on the schedule type.
  89. @REM For example, when:
  90. @REM     schedule type is                BACKUP_TYPE is
  91. @REM     ----------------                --------------
  92. @REM Automatic Full                      INCREMENTAL LEVEL=0
  93. @REM Automatic Differential Incremental  INCREMENTAL LEVEL=1
  94. @REM Automatic Cumulative Incremental    INCREMENTAL LEVEL=1 CUMULATIVE
  95. @REM
  96. @REM For user initiated backups, BACKUP_TYPE defaults to incremental
  97. @REM level 0 (Full).  To change the default for a user initiated
  98. @REM backup to incremental or incrementatl cumulative, uncomment
  99. @REM one of the following two lines.
  100. @REM @set BACKUP_TYPE="INCREMENTAL LEVEL=1"
  101. @REM @set BACKUP_TYPE="INCREMENTAL LEVEL=1 CUMULATIVE"
  102. @REM
  103. @REM Note that we use incremental level 0 to specify full backups.
  104. @REM That is because, although they are identical in content, only
  105. @REM the incremental level 0 backup can have incremental backups of
  106. @REM level > 0 applied to it.
  107. @REM ---------------------------------------------------------------------------

  108. @REM ---------------------------------------------------------------------------
  109. @REM What kind of backup will we perform.
  110. @REM ---------------------------------------------------------------------------

  111. @if "%NB_ORA_FULL%" EQU "1" @set BACKUP_TYPE=INCREMENTAL Level=0
  112. @if "%NB_ORA_INCR%" EQU "1" @set BACKUP_TYPE=INCREMENTAL Level=1
  113. @if "%NB_ORA_CINC%" EQU "1" @set BACKUP_TYPE=INCREMENTAL Level=1 CUMULATIVE
  114. @if NOT DEFINED BACKUP_TYPE @set BACKUP_TYPE=INCREMENTAL Level=0

  115. @REM ---------------------------------------------------------------------------
  116. @REM Call Recovery Manager to initiate the backup. This example does not use a
  117. @REM Recovery Catalog. If you choose to use one, remove the option, nocatalog,
  118. @REM from the rman command line below and add a
  119. @REM 'rcvcat <userid>/<passwd>@<tns alias>' statement.
  120. @REM

  121. @REM ---------------------------------------------------------------------------
  122. @REM PROXY
  123. @REM For a PROXY backup, you must use a send command to specify
  124. @REM the NB_ORA_PC_STREAMS environment variable. For example,
  125. @REM echo ALLOCATE CHANNEL ch01 TYPE 'SBT_TAPE';
  126. @REM echo SEND 'NB_ORA_PC_STREAMS=%%NB_ORA_PC_STREAMS%%';
  127. @REM
  128. @REM %BACKUP_TYPE% must also be removed and replaced with the PROXY parameter
  129. @REM in the RMAN section associated with the data files.  For example,
  130. @REM echo BACKUP
  131. @REM echo       PROXY
  132. @REM echo       FORMAT 'bk_u%%u_s%%s_p%%p_t%%t'
  133. @REM echo       DATABASE;
  134. @REM            .
  135. @REM            .
  136. @REM  Note that the controlfiles and archivelogs are not backed up using proxy
  137. @REM  copy method. Rman will initiate non-proxy copy sessions to backup the
  138. @REM  controlfile and archivelogs.
  139. @REM ---------------------------------------------------------------------------
  140. @(
  141. echo RUN {
  142. echo ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
  143. echo ALLOCATE CHANNEL ch01 TYPE 'SBT_TAPE';
  144. echo BACKUP
  145. echo       %BACKUP_TYPE%
  146. echo       FORMAT 'd:\backup\bk_u%%u_s%%s_p%%p_t%%t'
  147. echo       DATABASE;
  148. echo sql 'alter system archive log current';
  149. echo RELEASE CHANNEL ch00;
  150. echo RELEASE CHANNEL ch01;
  151. echo # Backup all archive logs
  152. echo ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
  153. echo BACKUP
  154. echo       FILESPERSET 20
  155. echo       FORMAT 'arch-s%%s-p%%p'
  156. echo       ARCHIVELOG LIKE 'D:\archive_log\ARCHIVE%' DELETE INPUT;
  157. echo RELEASE CHANNEL ch00;
  158. echo # Backup controlfile
  159. echo ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
  160. echo BACKUP
  161. echo      FORMAT 'cntrl_s%%s_p%%p_t%%t'
  162. echo      CURRENT CONTROLFILE;
  163. echo RELEASE CHANNEL ch00;
  164. echo }
  165. ) | %RMAN% target %TARGET_CONNECT_STR% nocatalog msglog '%RMAN_LOG_FILE%' append

  166. @set ERRLEVEL=%ERRORLEVEL%
  167. @set LOGMSG=ended successfully
  168. @if "%STATUS_FILE%" EQU "" goto end
  169. @echo 0 > "%STATUS_FILE%"
  170. @goto end

  171. :err
  172. @set LOGMSG=ended in error
  173. @if "%STATUS_FILE%" EQU "" @goto end
  174. @echo 1 > "%STATUS_FILE%"

  175. :end

  176. @REM ---------------------------------------------------------------------------
  177. @REM Log the completion of this script.
  178. @REM ---------------------------------------------------------------------------

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

  181. @echo #  >> %RMAN_LOG_FILE%
  182. @echo %==== %LOGMSG% on %DATE% ==== >> %RMAN_LOG_FILE%
  183. @endlocal
  184. @REM End of Main Program -----------------------------------------------------
复制代码

回复 只看该作者 道具 举报

3#
发表于 2012-7-20 09:53:17

回复 2# 的帖子

1.上传客户端的bpcd、bphdb,服务端的bptm、bprd日志
2.检查客户端与备份服务器的时间差
3.客户端上执行bpclntcmd -pn、bpclntcmd -hn [Hostname]、bpclntcmd -ip [IP]
4.该服务器是否是多网卡?

回复 只看该作者 道具 举报

4#
发表于 2012-7-20 10:07:18

回复 3# 的帖子

备份到带库 FORMAT 'd:\backup\bk_u%%u_s%%s_p%%p_t%%t'?

回复 只看该作者 道具 举报

5#
发表于 2012-7-21 08:34:31

回复 4# 的帖子

额,这个备份到本地是我自己做得一个测试!因为开始在群里面有人要求贴出连接的内容,所以把脚本放上来了,具体的备份脚本1楼为准, 这么做只是不报错,但无法用 list backup of database 查出备份集!
另:我在服务器客户机上的..netbackup/logs/  都没找到所需要的目录!

[ 本帖最后由 wengtf 于 2012-7-21 08:54 编辑 ]

回复 只看该作者 道具 举报

6#
发表于 2012-7-22 13:44:15
ODM FINDING:


RMAN backup to SBT_TAPE using Legato Networker fails:

channel t1: starting piece 1 at 11-04-08
released channel: t1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on t1 channel at 04/08/2011 11:16:29
ORA-19513: failed to identify sequential file
ORA-27206: requested file not found in media management catalog

Changes
A new DNS alias was created on the Network for the Server or new
Cause
This error is raised whenever the Media Manager, Legato Networker in this case, is unable to write the file to tape.

The creation of new DNS alias can cause index corruption between TAPE and MNO interface inside Networker backup server.


Solution
Delete the host definition inside Networker and recreate it in order to flush bad index.
Also try using client hostname with domain extension instead of using client IP address in Netbackup Master Server while configuring backup policy for client

For further assistance please contact  your media manager vendor .




确认你的NBU 配置 乃至 NBU SERVER的  host是否可以正常ping ,  该问题与ORACLE数据库关系不大,  一般问题存在于NBU SERVER 与 CLIENT之间的配置:

也可以参考这篇文章:         
图文详解安装NetBackup 6.5备份恢复Oracle 10g rac 数据库(修订)  http://www.oracledatabase12g.com ... tabase-10g-rac.html

回复 只看该作者 道具 举报

7#
发表于 2012-7-24 08:47:11

回复 6# 的帖子

刘大,policy的配置跟我生产库的的配置是一样的,host ping正常,备份的policy我已将client 的ip换成hostname,问题依旧,生产库备份正常!我再仔细想想!

回复 只看该作者 道具 举报

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

QQ|手机版|Archiver|Oracle数据库数据恢复、性能优化

GMT+8, 2024-12-24 11:26 , Processed in 0.057404 second(s), 21 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部
TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569