spool all_snap.rslt 

set linesize 130;
set pagesize 1000;
set long 50;
set echo on;

break on "OWNER" on "NAME" on "TABLE";

/* ****************************************************** */
/*                                                        */
/*  - will show all the snapshots for a given database    */
/*                                                        */
/*         @c:\oracle\sql\all_snap.sql                    */ 
/*                                                        */
/* ****************************************************** */

select 	substr(A.owner,1,10)              				"OWNER",
        	substr(A.name,1,15)               				"NAME",
        	substr(A.table_name,1,15)         				"TABLE",
		to_char(A.start_with, 'YYYY-MON-DD HH:MI:SS am')	"Last Successful Refresh",
             substr(A.next, 1,90)  					"Next Scheduled Refresh",
      		substr(to_char(A.error, '99999'),1,7)			"ERROR"
from 	dba_snapshots A
order by 1 asc, 2 asc;

set echo off;
spool off;
set long 80;
commit;









