Windows, RMAN, Environmeent Variables - Help!
Date: Tue, 19 Apr 2016 10:08:28 +0100
Message-ID: <5E5DB225-09A8-43D3-8F6F-1BD6A44634FD_at_dunbar-it.co.uk>
Morning All,
I'm on a new contract and i have to use Windows in the cloud! I'm a Unix guy normally, but needs must. ;-)
I'm attempting to create a generic cmd script (I can't do Powershell, nor is it always guaranteed to be available on the servers I'm using) to run a level 0 or 1 incremental RMAN backup of the many 11.2.0.4 databases in my care.
Everything is Oracle 11.2.0.4 by the way.
I have a number of channels allocated with:
allocate channel xxx
device type disk
format '%BACKUP_LOCATION%\%ORACLE_SID%\%U';
When I run the script, I have defined at least the following:
set ORACLE_SID=xxdba01 set BACKUP_LOCATION=h:\backups set ORACLE_HOME=C:\ORACLEDATABASE\PRODUCT\11.2.0\DBHOME_1
Depending on which server this is run on, BACKUP_LOCATION changes. On some it's H:\BACKUPS on others it's O:\BACKUPS.
RMAN runs happily enough, allocates the channels, scans the list of data files but then barfs with the error:
ORA-19504: failed to create file "C:\ORACLEDATABASE\PRODUCT\11.2.0\DBHOME_1\DATABASE\%BACKUP_LOCATION%\XXDBA01\1DR3DOF6_1_1"
Where it appears to be creating the dump files in %ORACLE_HOME%\DATABASE\etc.
I'm puzzled as to why %BACKUP_LOCATION% is not being expanded, but %ORACLE_SID% is, in the above file name. I suspect that the reason it's heading off to %ORACLE_HOME%\DATABASE is down the the non expansion of %BACKUP_LOCATION%, but why?
Are there any Windows gurus out there who can give me a prod in the right direction please? If I can't get this to work in a generic format, I'm going to have to build a separate level 1 and level 0 script for each individual database.
I am as ever, much obliged for any information. Thanks.
Cheers,
Norm.
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
--
http://www.freelists.org/webpage/oracle-l
Received on Tue Apr 19 2016 - 11:08:28 CEST