select 'select max(' || column_name || ') from ' || owner || '.' || name || ';'
from DBA_PART_KEY_COLUMNS
where name in (select distinct table_name
from dba_tab_partitions
where tablespace_name not in ('SYSAUX', 'SYSTEM'))
order by name

日积月累