Rem
Rem $Header: javavm/install/bug34854671_apply.sql /st_javavm_19.0.0.0.0ojvmru/1 2025/12/11 05:54:45 etucker Exp $
Rem
Rem bug34854671_apply.sql
Rem
Rem Copyright (c) 2025, Oracle and/or its affiliates.
Rem
Rem    NAME
Rem      bug34854671_apply.sql - <one-line expansion of the name>
Rem
Rem    DESCRIPTION
Rem      <short description of component this file declares/defines>
Rem
Rem    NOTES
Rem      <other useful comments, qualifications, etc.>
Rem
Rem    BEGIN SQL_FILE_METADATA
Rem    SQL_SOURCE_FILE: javavm/install/bug34854671_apply.sql
Rem    SQL_SHIPPED_FILE: javavm/install/bug34854671_apply.sql
Rem    SQL_PHASE: PATCH_POSTAPPLY
Rem    SQL_STARTUP_MODE: NORMAL
Rem    SQL_IGNORABLE_ERRORS: NONE
Rem    END SQL_FILE_METADATA
Rem
Rem    MODIFIED   (MM/DD/YY)
Rem    etucker     12/09/25 - apply to alter the trigger
Rem    etucker     12/09/25 - Created
Rem

@@?/rdbms/admin/sqlsessstart.sql
declare 
  stat    varchar2(30);
begin
  begin
    select status into stat from dba_registry where comp_id = 'JAVAVM';
  exception when no_data_found then
    stat := 'NOT FOUND';
  end;

  if stat != 'REMOVED' and stat != 'NOT FOUND'  then
   execute immediate ' 
     create or replace trigger OJDS$ROLE_TRIGGER$ after drop on database when (ora_dict_obj_type=''ROLE'')
      begin
        sys.ojds_context.role_dropped(sys.dictionary_obj_name);
      exception -- if not present then ignore 
      when others then
      if sqlcode not in (-00604, -04063, -06508) then raise; end if;
   end;';
  end if;
end;
/

@?/rdbms/admin/sqlsessend.sql
 
