Skip to Main Content

Oracle Developer Tools for Visual Studio

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DOS scripting

happy10319Mar 26 2012 — edited Apr 17 2012
Hi,
sorry for disturbing you. I did not find proper Forum for my question.

I'm scripting in DOS . I want to generate three backup RMAN scripts for 3 DB. Then I use FOR :
FOR %%D in (DB1 DB2 DB3) DO SET  ORACLE_SID=%%D
echo ORACLE_SID=%ORACLE_SID%
CALL generate__sql %ORACLE_SID%
In generate__sql.bat I have :
echo %1
echo	run  >> al_%1.sql
echo	{  >> al_%1.sql
echo		allocate channel t1 type disk; >>  al_%1.sql
echo		backup as compressed backupset format 'M:\backup\%1%\full/df_%%d_%%T_%%s_%%p' database;  >>   al_%1.sql
echo		sql 'alter system switch logfile';  >>   al_%1.sql
echo		backup as compressed backupset format 'M:\backup\%1%\full/al_%%d_%%T_%%s_%%p' archivelog all delete input;  >>   al_%1.sql
echo		backup as compressed backupset format 'M:\backup\%1%\full/ctl_%%d_%%T_%%s_%%p' current controlfile;  >>   al_%1.sql
echo	}  >> al_%1.sql
echo	crosscheck backup;		  >>  al_%1.sql
echo	delete obsolete;		  >>  al_%1.sql
echo	delete expired backup of database;  >>  al_%1.sql
..................................................
......................................................
But it generate only one file (al_DB1.sql) in which I have only :
run  
{  
	allocate channel t1 type disk; 
	sql 'alter system switch logfile';  
}  
crosscheck backup;		  
delete obsolete;		  
delete expired backup of database;  
Thank for help
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 15 2012
Added on Mar 26 2012
3 comments
101 views