Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1196221
  • 博文数量: 245
  • 博客积分: 10185
  • 博客等级: 上将
  • 技术积分: 2744
  • 用 户 组: 普通用户
  • 注册时间: 2006-10-30 17:07
文章分类

全部博文(245)

文章存档

2015年(1)

2014年(1)

2013年(1)

2012年(1)

2011年(37)

2010年(20)

2009年(14)

2008年(38)

2007年(88)

2006年(44)

分类: Oracle

2011-08-05 16:06:18

   
  同事用aix6.1+nbu7.1备份 oracle11gr1,结果出错,rman 无log,尝试直接用rman备份,
使用变量就会出问题,
RMAN> RUN {
2> ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
3> SEND 'NB_ORA_SERV=$NB_ORA_SERV, NB_ORA_CLIENT=$NB_ORA_CLIENT';
4> backup TABLESPACE users;
5> SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT';
6> RELEASE CHANNEL ch00;
7> }

allocated channel: ch00
channel ch00: sid=125 instance=jetdb1 devtype=SBT_TAPE
channel ch00: Veritas NetBackup for Oracle - Release 7.1 (2011020322)

sent command to channel: ch00
Starting backup at 24-JUN-11
channel ch00: starting full datafile backupset
channel ch00: specifying datafile(s) in backupset
input datafile fno=00004 name=/oradata/jetdb/users01.dbf
channel ch00: starting piece 1 at 24-JUN-11
released channel: ch00
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ch00 channel at 06/24/2011 16:35:30
ORA-19506: failed to create sequential file, name="0hmfmtih_1_1", parms=""
ORA-27028: skgfqcre: sbtbackup returned error
ORA-19511: Error received from media manager layer, error text:
   VxBSAValidateFeatureId: Failed with error:
   Server Status:  cannot connect on socket

我发现我错了, 直接在RMAN里备份的话是不能用变量的。
折腾了下(记不清了怎么弄的),rman终于有输出log了
    另外我这个错的最终原因是因为在于 oracle用户使用了bash. (AIX 6.1平台)。
看我的rman log.
oracle用户的默认bash是bash时,
…………………………………………………………………………………………………………………………………………………..
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00554: initialization of internal recovery manager package failed
RMAN-04005: error from target database:
ORA-12162: TNS:net service name is incorrectly specified
Recovery Manager: Release 10.2.0.1.0 - Production on Sat Jun 25 17:15:21 2011
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
………………………………………………………………………………………………………………………………………………………….
通常,这种错误是由于错误设置 ORACLE_SID or ORACLE_HOME,但在我们的环境里,ORACLE_SID和 ORACLE_HOME设置没有问题。
- oracle
p5201:/opt/oracle # env
AUTHSTATE=files
SHELL=/usr/bin/bash
TERM=vt100
CRS_HOME=/opt/oracle/crs
UMASK=022
LOCPATH=/usr/lib/nls/loc
USER=oracle
ORACLE_SID=jetdb1
ODMDIR=/etc/objrepos
ORACLE_BASE=/opt/oracle
MAIL=/usr/spool/mail/oracle
PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java6_64/jre/bin:/usr/java6_64/bin:/opt/VRTSperl/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java6_64/jre/bin:/usr/java6_64/bin:/usr/sbin:/usr/local/bin:/usr/openv/netbackup/bin:/usr/openv/netbackup/bin/admincmd:/opt/VRTSat/bin:/opt/VRTSaz/bin:/opt/VRTS/bin:/opt/VRTSvcs/bin:/opt/oracle/crs/bin:/opt/oracle/db/bin:/opt/oracle/crs/bin:/opt/oracle/db/bin:/usr/openv/netbackup/bin:/opt/VRTS/bin:/opt/VRTSvcs/bin:/opt/VRTSvcs/rac/bin:/usr/openv/netbackup/bin:/usr/lib/vxvm/bin:/usr/sbin:/sbin:/sbin/init.d:/opt/VRTS/bin:/opt/VRTSvcs/bin:/lib/svc/method:/usr/lib/vxvm/bin::/lib/svc/method:/usr/sfw/bin:/opt/VRTSsfmh/bin:/usr/openv/netbackup/bin/goodies:/usr/openv/netbackup/bin:/opt/VRTSat/bin:/usr/openv/netbackup/bin/admincmd:/usr/openv/volmgr/bin:/opt/oracle/bin
LOGIN=oracle
PWD=/opt/oracle
LANG=en_US
TZ=Asia/Shanghai
PS1=p5201:$PWD #
SHLVL=1
HOME=/opt/oracle
LC__FASTMSG=true
MAILMSG=[YOU HAVE NEW MAIL]
LOGNAME=oracle
DISPLAY=172.29.1.44:1.0
ORACLE_HOME=/opt/oracle/db
_=/usr/bin/env
NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat
LD_LIBRARY_PATH=/opt/oracle/db/lib:/usr/lib
当将oracle用户的shell设成ksh(default shell) , 备份 ok .
.................................................
-f rman1.log
Recovery Manager: Release 10.2.0.1.0 - Production on Sat Jun 25 17:47:29 2011
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
connected to target database: JETDB (DBID=2076786250)
using target database control file instead of recovery catalog
RMAN> 2> 3> 4> 5> 6> 7> 8> 9> 10>
allocated channel: ch00
channel ch00: sid=128 instance=jetdb1 devtype=SBT_TAPE
channel ch00: Veritas NetBackup for Oracle - Release 7.1 (2011020322)
sent command to channel: ch00
Starting backup at 25-JUN-11
channel ch00: starting incremental level 0 datafile backupset
channel ch00: specifying datafile(s) in backupset
input datafile fno=00004 name=/oradata/jetdb/users01.dbf
channel ch00: starting piece 1 at 25-JUN-11
channel ch00: finished piece 1 at 25-JUN-11
piece handle=df_22_1_754768060 tag=TAG20110625T174740 comment=API Version 2.0,MMS Version 5.0.0.0
channel ch00: backup set complete, elapsed time: 00:00:26
Finished backup at 25-JUN-11
sql statement: ALTER SYSTEM ARCHIVE LOG CURRENT
released channel: ch00
RMAN>
Recovery Manager complete.
....................................................

很早之间就听我身边的资深同事说过不要在aix里设置默认shell为bash,说会导致很多莫名的原因,果不其然。大家引以为戒吧。
实在想用bash,可安装,但不要将默认shell( /etc/passwd里对应的shell)改为bash,可直接bash后使用bashell.
阅读(3313) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~