Hi
Try
Code:RMAN> delete noprompt expired backup completed before 'sysdate-30';
Printable View
Hi
Try
Code:RMAN> delete noprompt expired backup completed before 'sysdate-30';
noprompt worked like a charm. Thanks.
For the benefit of posterity...
run {
crosscheck backup completed before 'sysdate-30';
delete noprompt expired backup completed before 'sysdate-30';
}
exit;
Logging the output was a little screwey. The command line LOG didn't work at all, "spool log to" worked in the script, but .. and here's the weird part .. only AFTER the "exit;". If "spool log off" was before the "exit;", it created a 0 byte file.
Thanks for posting back your results.
Not exactly sure how you are executing the RMAN script, but two examples to get logging to occur are as follows:
If you have a file called rman.cmd as:
You can run the command with proper logging using:Code:run {
crosscheck backup completed before 'sysdate-30';
delete noprompt expired backup completed before 'sysdate-30';
}
For the spooling option, you can create a rman.cmd file as (notice NO 'spool log off'):Code:rman target / log=/tmp/rman.log @/tmp/rman.cmd
And run it as follows:Code:spool log to /tmp/rman.log;
run {
crosscheck backup completed before 'sysdate-30';
delete noprompt expired backup completed before 'sysdate-30';
}
Code:rman target / @/tmp/rman.cmd
Right. I tried it both ways, but in **this case only** spooling inside the script and with the exit prior to "spool log off" is the only way I can get it to spool the output.
This is not typical behavior. Must be something about the contents of the script .. like noprompt or something.
I have other rman scripts that behave as expected whether the logging is in the script or on the command line.