I am trying to accomplish following case with PLSQL. We have 3 redolog groups(1,2,3).we added new 3 more redolog group (4,5,6). I am trying to drop (1,2,3) redolog groups by first making them INACTIVE and drop. I can do this manually but since we are in need to build a script which can do for us.
Is it possible to drop inactive redo log group using plsql block OR Plsql cursor?
Please share any code if anyone has done this kind code . I don;t have much experience in PLSQL.
Thanks in advance.
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.
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog
Who is online
Users browsing this forum: No registered users and 4 guests