MINI MINI MANI MO
Rem BEGIN SQL_FILE_METADATA
Rem SQL_SOURCE_FILE: javavm/install/jvmupgrd.sql
Rem SQL_SHIPPED_FILE: javavm/install/jvmupgrd.sql
Rem SQL_PHASE: UPGRADE
Rem SQL_STARTUP_MODE: UPGRADE
Rem SQL_IGNORABLE_ERRORS: NONE
Rem END SQL_FILE_METADATA
-- jvmupgrd.sql is the common subscript shared by jvmdbmig.sql and jvmpatch.sql
-- These are called from rdbms/admin/cmpupjav.sql for the purpose of full
-- and patch set upgrade, resp, of the JAVAVM/OJVM component. The distinction
-- of full vs patch set upgrade here and in subscripts is determined by
-- whether the SQLPLUS variable jvmpatchset is set to 'TRUE' or not.
-- This script can not function properly in SVRMGR. The following
-- lines are intended to abort the script if it is being run with
-- SVRMGR, but will be interpreted simply as remarks by SQLPLUS.
rem -
set stoponerror on
rem -
jvmupgrd.sql must be run with SQLPLUS, not SVRMGRL
alter session set "_ORACLE_SCRIPT"=true;
select version, status, dbms_registry.status('JAVAVM') dbms_registry_status
from dba_registry where comp_id='JAVAVM';
-- truncate JIT tables prior to reloading initjvma to avoid ORA-02437
-- when adding unique constraints. These tables should satisfy the constraint
-- but in case they don't they are going to be truncated later anyway by CJS
-- in the current upgrade context so there is no harm in doing so now. The
-- use of initjvmaux.drp is to allow for the case where the JIT tables don't
-- yet exist and the execute immediate hair is to allow for the case where
-- initjvmaux itself isn't defined yet. This is all to fix bug 18049547
declare
procedure p(name varchar2) as
begin
execute immediate
'truncate table '|| name;
exception when others then
if sqlcode not in (-6550) then raise;end if;
end;
begin
p('java$mc$');
p('java$mc$deps');
p('java$method$metadata');
commit;
end;
/
-- (re)Define support packages
@@initjvma.sql
-- Do java long identifier translation if need be. This will do nothing
-- if transalation is not needed. If translation does happen it will drop
-- and recreate table javasnm$, which causes package initjvmaux (just
-- recreated above by initjvma.sql) to be invalidated. This in turn causes
-- loss of package state. Accordingly, name translation is explicitly done
-- here rather than being allowed to happen implicitly (during DROP_SROS)
-- later, when initjvmaux package state may have become meaningful.
-- The following reset_package is to avoid having the next use of
-- initjvmaux generate ORA-04068 etc in the case where initjvmaux has been
-- invalidated.
-- The exception wrapper is to hide an error that will occur if run in a
-- joxoff executable, which shouldn't happen and will most likely already
-- be causing other errors if it does.
--
declare junk varchar2(100);
begin
junk := dbms_java_test.funcall('-lid_translate_all', ' ');
exception when others then null;
end;
/
EXECUTE dbms_session.reset_package;
-- set up control variables for udjvmrm
variable jvmudaction varchar2(30)
execute :jvmudaction := 'UPGRADE';
variable jvmdownto varchar2(30)
begin if :jvmpatchset = 'TRUE' then
initjvmaux.startaction('PATCHSET');
if initjvmaux.startstep('SET_REGISTRY_LOADING') then
initjvmaux.setloading();
initjvmaux.endstep;
end if;
initjvmaux.set_alt_tablespace_limit(10000000);
update obj$ set status=5 where type#=29 and owner#!=0;
commit;
else
initjvmaux.startaction('UPGRADE');
if initjvmaux.startstep('SET_REGISTRY_GRADING') then
dbms_registry.upgrading('JAVAVM', NULL, 'INITJVMAUX.VALIDATE_JAVAVM');
initjvmaux.endstep;
end if;
end if; end;
/
-- call main system class removal/upgrade script
@@udjvmrm
begin if :jvmpatchset = 'TRUE' then
if initjvmaux.startstep('SETLOADED') then
initjvmaux.setloaded();
initjvmaux.endstep;
end if;
else
if initjvmaux.startstep('UPGRADED') then
dbms_registry.upgraded('JAVAVM');
if dbms_registry.count_errors_in_registry('JAVAVM') > 0 then
dbms_registry.invalid('JAVAVM');
end if;
initjvmaux.endstep;
end if;
end if; end;
/
call initjvmaux.endaction_asload();
select dbms_java.full_ncomp_enabled from dual;
OHA YOOOO