[oracle@tyan147 ~]$ rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Mon Sep 24 15:45:44 2012
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: MDSTEST (DBID=3769760908)
RMAN> backup datafile 9 format '/backup/backup_$u.bak';
Starting backup at 24-SEP-12
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=38 instance=mdstest2 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00009 name=+DATA/mdstest/datafile/indx01.dbf
channel ORA_DISK_1: starting piece 1 at 24-SEP-12
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 09/24/2012 15:46:31
ORA-07217: sltln: environment variable cannot be evaluated.
原因是变量%u不存在,改写为%U即可
RMAN> backup datafile 9 format '/backup/back_%U.bak';
Starting backup at 24-SEP-12
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=222 instance=mdstest2 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00009 name=+DATA/mdstest/datafile/indx01.dbf
channel ORA_DISK_1: starting piece 1 at 24-SEP-12
channel ORA_DISK_1: finished piece 1 at 24-SEP-12
piece handle=/backup/back_0qnm0tao_1_1.bak tag=TAG20120924T155048 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 24-SEP-12
Starting Control File and SPFILE Autobackup at 24-SEP-12
piece handle=+ARCH/mdstest/autobackup/2012_09_24/s_794850650.613.794850653 comment=NONE
Finished Control File and SPFILE Autobackup at 24-SEP-12
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/24849178/viewspace-744937/
,如需转载,请注明出处,否则将追究法律责任。