最近有時使用Database 10g R2(10.2.0.3) 的 RMAN(Recovery Manager) 超不順手,
因每次進入 RMAN 都會出現入以下這樣的訊息.
oracle@ora10g:~> rman target /
rman: can't open target
雖說可以用絕對入徑方式解決:
oracle@ora10g:~> $ORACLE_HOME/bin/rman target /
Recovery Manager: Release 10.2.0.3.0 - Production on Sat Apr 5 12:26:23 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: ORA10 (DBID=602137203)
RMAN> exit
Recovery Manager complete.
查了一下 看到了 環境變數擺放順序 PATH:
PATH=/home/oracle/bin:/usr/local/bin:/usr/bin:
/usr/X11R6/bin:/bin:/usr/games:
/opt/gnome/bin:/opt/kde3/bin:/usr/lib/jvm/jre/bin:
/u01/app/oracle/product/10.2.0/db_1/bin:
/usr/bin:/bin:/usr/bin/X11:/usr/local/bin:
/u01/app/oracle/product/10.2.0/db_1/common/oracle/bin:
/u01/app/oracle/product/10.2.0/db_1/OPatch
並做了 以下修改調整將oracle相關環境變數放到最前面,如下:
PATH=/u01/app/oracle/product/10.2.0/db_1/bin:
/usr/bin:/bin:/usr/bin/X11:/usr/local/bin:/u01
/app/oracle/product/10.2.0/db_1/common/oracle/bin:
/u01/app/oracle/product/10.2.0/db_1/OPatch:
/home/oracle/bin:/usr/local/bin:
/usr/bin:/usr/X11R6/bin:/bin:/usr/games:
/opt/gnome/bin:/opt/kde3/bin:/usr/lib/jvm/jre/bin
再一次使用RMAN 就順利的進去成功囉!
oracle@ora10g:~> rman target /
Recovery Manager: Release 10.2.0.3.0 - Production on Sat Apr 5 12:31:47 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: ORA10 (DBID=602137203)
RMAN>
RMAN> exit
Recovery Manager complete.
oracle@ora10g:~>