Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RMAN Backup

Status
Not open for further replies.
Oct 12, 2005
204
GB
Hi,
I'm trying to script an RMAN backup, on a windows 2003 server, I'm using the following scripts to achieve this:

backup.bat
Code:
set output=d:\oracle_backup\logs
set logfile=d:\oracle_backup\logs\backup_ifsl.log
c:\oracle\product\10.2.0\db_1\bin\rman target user/pass@db
@d:\oracle_backup\script\backup.sql > %logfile% 2>&1
backup.sql
Code:
run {	sql 'alter system archive log current';
	backup database archivelog all not backed up;
	delete noprompt archivelog until time 'sysdate -2' backed up 1 times to device type disk;
	delete noprompt obsolete device type disk;	
	
}

the script runs fine until it gets to the line that calls the sql file, then it just hangs at the RMAN> prompt. I can type in a command eg. EXIT and RMAN shuts down, then the sql file opens ( but still won't run )

Does anyone know why this is happening and how to fix it?

Mick.
 
Mick,

I have batch files that run other jobs rather than RMAN, and my syntax is always something like this:
Code:
C:\oracle\product\10.2.0\client_1\BIN\sqlplus.exe user/pass@instance @script.sql
where this is all on one line of the batch file.

I'm not sure whether this helps at all, but maybe its worth a go!

Fee

"The cure for anything is salt water – sweat, tears, or the sea." Isak Dinesen
 
My friend you are correct, I put it all on one line and it works a treat.... Thanks for that, much appreciated.

Mick.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top