/* ************************************************ */
/*                                                  */
/* Script: Datafile backup                          */ 
/* Note: You must hard-code your specific init.ora  */
/*       parameter. This can be used to backup      */
/*       multiple control files                     */
/*                                                  */
/* name:    @/home/oracons/sql/backup.sql           */
/* date:    15-NOV-95                               */
/* creator: Rick Kupcunas                           */
/*                                                  */
/* ************************************************ */


 set heading off
 set feedback off
 set verify off
 prompt ' Please enter the name of your backup directory :'
 select '&&dir' from dual;

 prompt ' Please enter the name of your init.ora :'
 select '&&initora' from dual;
 
 spool backup_files.lst
 select 'cp $HOME/data/&&initora '|| ' &&dir/.' from dual;
 
 select 'cp ' || file_name || ' &&dir/. ' from sys.dba_data_files;
 
 select 'cp ' || member || ' &&dir/. ' from v$logfile;
 
 select 'cp ' || replace(value,',',' ') || ' &&dir/. ' from v$parameter
    where name = 'control_files';
    
 spool off
 set heading on
 set feedback on
 set verify on 
 undefine dir 
 undefine initora

REM *   END-OF-SCRIPT    *

