I am performing a schema dump of certain tables. This accompanied by dropping the tables that will be dumped. For example I need to drop all tables that start with, let’s say, “SRC_”. You guys think of a more efficient way of dropping those tables than the script below? Thanks.
begin
for rec in (select TABLE_NAME
from ALL_TABLES
where TABLE_NAME like 'SRC|_%' escape '|'
and OWNER = 'SOME_SCHEMA')
loop
execute immediate 'drop table ' || rec.TABLE_NAME;
end loop;
end;
/