You can run DDL from within PL/SQL using the EXECUTE IMMEDIATE command.
- Code: Select all
EXECUTE IMMEDIATE 'PUT YOUR DDL HERE';
So yes, it is possible. The slight issue is that you will have to make sure the group is not currently being used before you can drop it. When I'm doing this manually, it often takes several log switches before the group is free to be dropped, So your code would have to make multiple attempts, trap errors and switch logs to free up the group.
I've never written code to do this, and to be fair redo is pretty important, so I would probably not script it.