create table t as select * from
all_objects where rownum <= 5000;
set timing on
select object_name, object_id
from ( select object_name, object_id
from t
where object_name like '%%'
order by dbms_random.random )
where rownum <= 6;
select object_name, object_id
from ( select object_name, object_id
from t sample ( 1 )
where object_name like '%%'
order by dbms_random.random )
where rownum <= 6;