Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: RMAN: Syntax for including datestamp in output filename
On 6 Jan 2006 09:56:10 -0800, "BD" <bobby_dread_at_hotmail.com> wrote:
>Hi, all.
>
>I'm running 8.1.7.4 on AIX 5.2.
>
>I am trying to get my RMAN to include the date/time in its output
>filenames. It is not working.
>
>First I tried declaring a variable in the environment:
>NOW=`date '+%Y%m%d_%H:%M:%S'`; export NOW
>
>In the same script which declares that variable, I next call RMAN, and
>pass it the name of a script which contains the run{} string.
>
>Then, in the channel declaration of the RMAN script I assigned the
>following format:
>'/bkup01/RMAN/${ORACLE_SID}_full_${NOW}'
>
>I tried the NOW parameter with and without the parentheses.
>
>In both cases, the resulting error message was:
>ORA-07217: sltln: environment variable cannot be evaluated.
>
>As a second attempt, I tried to include the `date` string directly in
>the RMAN script, as in
>'/bkup01/RMAN/${ORACLE_SID}_full_`date +%Y%m%d_%H:%M:%S`'
>
>This ended up writing a file to the filesystem called
>DEV2_full_`date +%Y%mTACSDEV2_%H:%M:%S`
>
>Can someone venture a guess as to why that environment variable is not
>working? I've done some reading which suggests some library is not
>being accessed due to a missing environment variable, but I see no
>connection between the variable I'm creating and any libraries.
>
>Thanks for all assistance!!
>
>BD
1 The backup command has it own format modifiers to include date and
time.
2 You did make sure the rman command line runs like
rman ...... <<EOD
EOD Didn't you?
-- Sybrand Bakker, Senior Oracle DBAReceived on Sat Jan 07 2006 - 04:11:52 CST
![]() |
![]() |