Recently encountered this error after a roll out in production. Several hundred procedures were invalid on the logical standby. I was unable to recompile and received an ORA-16224 Database Guard is enabled error.
I checked the guard_status in v$database. Usually this error is thrown when it is set to ALL, however, in this case it was set to Standby. I was interested in disabling the guard which could be done with:
alter database guard none; < other options include standby, which it was already set to and all, which wouldn’t have worked>
However, this can also be set at the session level:
alter session disable guard;
That turns it off for my session. I wiped up a quick anonymous block to recompile all invalid procedures.
for i in (select object_name from
dba_objects where owner = ‘MY_SCHEMA’
and status = ‘INVALID’
and object_type = ‘PROCEDURE’)
sSQL:=’alter procedure my_schema.’||i.object_name||’ compile’;
execute immediate sSQL;
Once that executed successfully and just turned the guard status back to standby in my session:
alter session enable guard;
Had the end user attempt to run report again. Success.
Tagged: Data Guard