Dataguard 12c issue - workaround



To follow up on my earlier post about 12c dataguard

http://dbaharrison.blogspot.de/2015/03/12c-dataguard-issue.html

I've now developed a fix - it's just a one line addition to the startup trigger (in the case below EIDG_DG is my 'special' service that is only activated on the primary and is what all the client connect to.


create or replace trigger manage_service after startup on database 
declare 
role varchar2(40); 
begin 
select database_role into role from v$database; 
if role = 'PRIMARY' then 
dbms_service.start_service('EIDG_DG'); 
dbms_system.add_parameter_value('service_names','EIDG_DG','MEMORY');
else 
dbms_service.stop_service('EIDG_DG'); 
end if; 
end; 
/

The line

dbms_system.add_parameter_value('service_names','EIDG_DG','MEMORY');

fixes the issue where the start_service does not activate the service properly - so its an easy fix.

Oracle support still working on a proper fix though.

Hopefully this helps someone out who hits this as I'm sure lots of people will.

2 comments:

  1. Do you have the bug # for this? I have a similar scenario and would like to see if there's any progress. Would also like to avoid the DBMS_SYSTEM package since it seems to be undocumented.

    ReplyDelete
  2. Hi,
    See this follow up blog post on it

    http://dbaharrison.blogspot.de/2015/06/12c-dataguard-issue-follow-up.html

    Cheers,
    Rich

    ReplyDelete