wangyl1977 发表于 2011-12-22 08:54

aix/HP里勿设置用户的默认shell为 bash

<DIV>&nbsp;&nbsp;&nbsp;<A href="http://bbs.chinaunix.net/viewthread.php?tid=3556944&amp;page=1&amp;extra=#pid21139527">http://bbs.chinaunix.net/viewthread.php?tid=3556944&amp;page=1&amp;extra=#pid21139527</A></DIV>
<DIV>&nbsp; 同事用aix6.1+nbu7.1备份 oracle11gr1,结果出错,rman 无log,尝试直接用rman备份,</DIV>
<DIV>使用变量就会出问题, <BR>RMAN&gt; RUN {<BR>2&gt; ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';<BR>3&gt; SEND 'NB_ORA_SERV=$NB_ORA_SERV, NB_ORA_CLIENT=$NB_ORA_CLIENT';<BR>4&gt; backup TABLESPACE users;<BR>5&gt; SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT';<BR>6&gt; RELEASE CHANNEL ch00;<BR>7&gt; }<BR><BR>allocated channel: ch00<BR>channel ch00: sid=125 instance=jetdb1 devtype=SBT_TAPE<BR>channel ch00: Veritas NetBackup for <SPAN class=t_tag onclick=tagshow(event) href="tag.php?name=Oracle">Oracle</SPAN> - Release 7.1 (2011020322)<BR><BR>sent command to channel: ch00<BR>Starting backup at 24-JUN-11<BR>channel ch00: starting full datafile backupset<BR>channel ch00: specifying datafile(s) in backupset<BR>input datafile fno=00004 name=/oradata/jetdb/users01.dbf<BR>channel ch00: starting piece 1 at 24-JUN-11<BR>relea<SPAN class=t_tag onclick=tagshow(event) href="tag.php?name=sed">sed</SPAN> channel: ch00<BR>RMAN-00571: ===========================================================<BR>RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============<BR>RMAN-00571: ===========================================================<BR>RMAN-03009: failure of backup command on ch00 channel at 06/24/2011 16:35:30<BR>ORA-19506: failed to create sequential file, name="0hmfmtih_1_1", parms=""<BR>ORA-27028: skgfqcre: sbtbackup returned error<BR>ORA-19511: Error received from <SPAN class=t_tag onclick=tagshow(event) href="tag.php?name=media">media</SPAN> manager layer, error text:<BR>&nbsp; &nbsp;VxBSAValidateFeatureId: Failed with error:<BR>&nbsp; &nbsp;Server Status:&nbsp;&nbsp;cannot connect on socket<BR><BR>我发现我错了, 直接在RMAN里备份的话是不能用变量的。</DIV>
<DIV>折腾了下(记不清了怎么弄的),rman终于有输出log了<BR>&nbsp;&nbsp;&nbsp; 另外我这个错的最终原因是因为在于 oracle用户使用了bash. (AIX 6.1平台)。<BR>看我的rman log.</DIV>
<DIV>oracle用户的默认bash是bash时,<BR>…………………………………………………………………………………………………………………………………………………..<BR>Copyright (c) 1982, 2005, Oracle.&nbsp; All rights reserved.</DIV>
<DIV>RMAN-00571: ===========================================================<BR>RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============<BR>RMAN-00571: ===========================================================<BR>RMAN-00554: initialization of internal recovery manager package failed<BR>RMAN-04005: error from target database: <BR>ORA-12162: TNS:net service name is incorrectly specified</DIV>
<DIV>Recovery Manager: Release 10.2.0.1.0 - Production on Sat Jun 25 17:15:21 2011</DIV>
<DIV>Copyright (c) 1982, 2005, Oracle.&nbsp; All rights reserved.<BR>………………………………………………………………………………………………………………………………………………………….</DIV>
<DIV>通常,这种错误是由于错误设置 ORACLE_SID or ORACLE_HOME,但在我们的环境里,ORACLE_SID和 ORACLE_HOME设置没有问题。</DIV>
<DIV><A href="mailto:root@p5201/#su">root@p5201/#su</A> - oracle<BR>p5201:/opt/oracle # env <BR>AUTHSTATE=files<BR>SHELL=/usr/bin/bash<BR>TERM=vt100<BR>CRS_HOME=/opt/oracle/crs<BR>UMASK=022<BR>LOCPATH=/usr/lib/nls/loc<BR>USER=oracle<BR>ORACLE_SID=jetdb1<BR>ODMDIR=/etc/objrepos<BR>ORACLE_BASE=/opt/oracle<BR>MAIL=/usr/spool/mail/oracle<BR>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<BR>LOGIN=oracle<BR>PWD=/opt/oracle<BR>LANG=en_US<BR>TZ=Asia/Shanghai<BR>PS1=p5201:$PWD # <BR>SHLVL=1<BR>HOME=/opt/oracle<BR>LC__FASTMSG=true<BR>MAILMSG=<BR>LOGNAME=oracle<BR>DISPLAY=172.29.1.44:1.0<BR>ORACLE_HOME=/opt/oracle/db<BR>_=/usr/bin/env<BR>NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat<BR>LD_LIBRARY_PATH=/opt/oracle/db/lib:/usr/lib</DIV>
<DIV>当将oracle用户的shell设成ksh(default shell) , 备份 ok .<BR>.................................................</DIV>
<DIV><A href="mailto:root@p5201/var/tmp#tail">root@p5201/var/tmp#tail</A> -f rman1.log</DIV>
<DIV>Recovery Manager: Release 10.2.0.1.0 - Production on Sat Jun 25 17:47:29 2011<BR>Copyright (c) 1982, 2005, Oracle.&nbsp; All rights reserved.<BR>connected to target database: JETDB (DBID=2076786250)<BR>using target database control file instead of recovery catalog<BR>RMAN&gt; 2&gt; 3&gt; 4&gt; 5&gt; 6&gt; 7&gt; 8&gt; 9&gt; 10&gt; <BR>allocated channel: ch00<BR>channel ch00: sid=128 instance=jetdb1 devtype=SBT_TAPE<BR>channel ch00: Veritas NetBackup for Oracle - Release 7.1 (2011020322)<BR>sent command to channel: ch00<BR>Starting backup at 25-JUN-11<BR>channel ch00: starting incremental level 0 datafile backupset<BR>channel ch00: specifying datafile(s) in backupset<BR>input datafile fno=00004 name=/oradata/jetdb/users01.dbf<BR>channel ch00: starting piece 1 at 25-JUN-11<BR>channel ch00: finished piece 1 at 25-JUN-11<BR>piece handle=df_22_1_754768060 tag=TAG20110625T174740 comment=API Version 2.0,MMS Version 5.0.0.0<BR>channel ch00: backup set complete, elapsed time: 00:00:26<BR>Finished backup at 25-JUN-11</DIV>
<DIV>sql statement: ALTER SYSTEM ARCHIVE LOG CURRENT<BR>released channel: ch00<BR>RMAN&gt; <BR>Recovery Manager complete.<BR>....................................................</DIV>
<DIV><BR>很早之间就听我身边的资深同事说过不要在aix里设置默认shell为bash,说会导致很多莫名的原因,果不其然。大家引以为戒吧。<BR>实在想用bash,可安装,但不要将默认shell( /etc/passwd里对应的shell)改为bash,可直接bash后使用bashell.</DIV>

yeeek 发表于 2011-12-22 16:55

:oo
页: [1]
查看完整版本: aix/HP里勿设置用户的默认shell为 bash