BEGIN
FOR t IN (select * from dba_tables where owner!='GGSTEST'
AND owner not like '%SYS%'
AND owner not like '%ORDDATA%'
AND owner not like '%ADMIN%'
AND owner not like '%APEX%'
AND owner not like '%XDB%'
AND owner not like '%FLOW_FILES%'
AND owner not like '%OE%' AND iot_type IS NULL)
LOOP
EXECUTE IMMEDIATE 'GRANT ALL PRIVILEGES ON '|| t.owner ||'.' || t.table_name ||' TO TIPTOPGP';
END LOOP;
END;