This forum is currently locked. You can't register or post questions at this time. (read more)

PLSQL Block to Drop Redolog group

All posts relating to Oracle PL/SQL development.

Moderator: Tim...

parkerjohn03
Senior Member
Posts: 107
Joined: Wed May 12, 2010 3:05 am

PLSQL Block to Drop Redolog group

Postby parkerjohn03 » Fri Jun 08, 2012 2:09 am

Hi All,

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.

Tim...
Site Admin
Posts: 18437
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK
Contact:

Re: PLSQL Block to Drop Redolog group

Postby Tim... » Fri Jun 08, 2012 9:36 am

Hi.

You can run DDL from within PL/SQL using the EXECUTE IMMEDIATE command.

Code: Select all

BEGIN
  EXECUTE IMMEDIATE 'PUT YOUR DDL HERE';
END;
/


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. :)

Cheers

Tim...
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
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


Return to “Oracle SQL and PL/SQL Development”

Who is online

Users browsing this forum: No registered users and 4 guests

cron