Database Administration (MOSC)
MOSC Banner

RMAN backup script in Windows

edited May 2016 in Database Administration (MOSC) 13 commentsAnswered ✓

Hi Support,

Kindly advise how to append date/time in RMAN run block in Windows batch file?

In Linux we use "${TIMEDATE}" to create a directory with current date and time:

export TIMEDATE=$(date +%d-%m-%Y-%H-%M)

rman target / catalog rman/rman@catalog

run

{

BACKUP DATABASE tag='Database_Bkp' format '/u1/oracle/rman_bkp/test/backup_${TIMEDATE}/dbfiles_%d_piece-%p_set-%s_uid-%U_date-%D%M%Y';

}

The same thing we tried in Windows but we are facing the below error message:

set NLS_DATE_FORMAT=DD-MON-YYYY.HH24:MI:SS

set currdate=%date:~10%%date:~4,2%%date:~7,2%%time:~0,2%%time:~3,2%

Tagged:

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center