Oracle - Apply SQL to all schema in database
DECLARE
v_sql varchar2(4000);
 cursor c1 is
    select o.owner,o.object_name from dba_users u,dba_objects o  WHERE u.account_status = 'OPEN' and u.DEFAULT_TABLESPACE not in ('SYSAUX','SYSTEM')
    and u.username=o.owner and o.object_name='ACCOUNTDETAILS' and o.object_type='TABLE';
BEGIN
    for REC in c1 loop
        v_sql := 'select * from '||REC.owner||'.'||REC.object_name;
        EXECUTE IMMEDIATE v_sql;
    end loop;
end;
/