set linesize 160
set pagesize 49999
/ set termout off
set trim on
set trimspool on
column file_name format a80
/ spool randy.log
/ prompt <pre>
prompt Filesize check
select /*+ rule; */
       enf.file_name,
       df.file_id,
       enf.file_size,
       df.file_size_in_bytes,
       df.create_date
from data_files df,
     data_file_locations dfl,
     data_storage_locations dsl,
     herber.en_files enf
where df.file_id = dfl.file_id
  and dfl.location_id = dsl.location_id
  and enf.file_name = (dsl.full_path||'/'||df.file_name)
  and enf.file_size != df.file_size_in_bytes
order by df.file_id
/
prompt CRC check
select * from (
  select /*+ rule; */
         enf.file_name,
         df.file_id,
         enf.file_crc,
         df.crc_value,
         df.create_date
  from data_files df,
       data_file_locations dfl,
       data_storage_locations dsl,
       herber.en_files enf
  where df.file_id = dfl.file_id
    and dfl.location_id = dsl.location_id
    and enf.file_name = (dsl.full_path||'/'||df.file_name)
    and df.crc_value != enf.file_crc||'L')
order by create_date
/
/ prompt <pre>
quit
