Tuesday, September 2, 2008

Working with RMAN stored scripts

LIST SCRIPT NAMES;

PRINT SCRIPT full_backup;

PRINT GLOBAL SCRIPT full_backup TO FILE 'my_script_file.txt';

CREATE SCRIPT full_backup { BACKUP DATABASE PLUS ARCHIVELOG; DELETE OBSOLETE; }

CREATE GLOBAL SCRIPT global_full_backup COMMENT 'use only with ARCHIVELOG mode databases' { BACKUP DATABASE PLUS ARCHIVELOG; DELETE OBSOLETE; }

CREATE SCRIPT full_backup FROM FILE 'my_script_file.txt';

RUN { EXECUTE SCRIPT full_backup; }
RUN { EXECUTE GLOBAL SCRIPT global_full_backup; }

replace script delete_sl02sbt_archives
{ delete noprompt force archivelog LIKE '%sl02sbt%' completed before "sysdate-2"; }