set showmode off set echo off -- File: backup_list.sql -- -- Description: Create the list of files for the current instance -- to be backed up. -- -- Set the sqlplus session parameters to only put the resulting file -- names into the backup_list.lst file, without headers or page breaks -- or showing the intermediate sqlplus results. -- set heading off set pagesize 0 set timing off set feedback off set termout off set linesize 80 set verify off -- -- Generate unix find commands to get the name of the init.ora file, -- along with the list of archive log files in the log_archive_dest -- directory, if archiving is turned on. ("!find" is the same as -- "host find". 2>/dummy just throws away any error messages from -- the find commands. The results of the commands are concatenated -- onto the end of the backup_list.lst file.) -- spool backup_list_do.sql select '!find / -name init' || value || '.ora >>backup_list.lst 2>/dummy' from v$parameter where name = 'db_name'; select '!find ' || substr(va.value,1,instr(va.value,'/',-1)-1) || ' -name ''*.arc'' >>backup_list.lst 2>/dummy' from v$parameter va where va.name = 'log_archive_dest' and exists (select 'x' from v$parameter vb where vb.name = 'log_archive_start' and vb.value = 'TRUE'); spool off -- -- Get the list of data files, followed by the list of redo log files, -- followed by the list of control files, and concatenate the list of -- archive log files, if any, onto the resulting list. -- spool backup_list.lst select file_name from dba_data_files; select member from v$logfile; select name from v$controlfile; spool off @backup_list_do !rm backup_list_do.sql -- -- Show the resulting list of files. -- !cat backup_list.lst -- -- Reset the sqlplus session parameters back to their defaults. -- set linesize 80 set termout on set heading on set pagesize 24 set timing on set feedback 6 set verify on set echo on set showmode both