replace DBA_DATA_FILES by USER_SEGMENTS to get database size to avoid error ORA-00942. Thanks to Pierre Boizot for the report.