43: if c = 0 then
44: commit;
45: initjvmaux.rollbackset;
46: if remove_all then
47: exec('insert into java$rmjvm$aux (select obj# from obj$ where ' ||
48: 'type#=28 or type#=29 or type#=30 or namespace=32)');
49: else
50: exec('insert into java$rmjvm$aux (select joxftobn from x$joxfc ' ||
51: 'where bitand(joxftflags,96)!=0)');
54: exec('insert into java$rmjvm$aux (select joxftobn from x$joxfr ' ||
55: 'where bitand(joxftflags,96)!=0)');
56: commit;
57: initjvmaux.rollbackset;
58: exec('insert into java$rmjvm$aux (select obj# from obj$ ' ||
59: 'where namespace=32)');
60: end if;
61: end if;
62: end;
104:
105: exec('delete from java$rmjvm$aux2');
106: if remove_all then
107: exec('insert into java$rmjvm$aux2 (select unique o1.name from ' ||
108: 'obj$ o1,obj$ o2 where o1.type#=5 and o1.owner#=1 and o1.name=o2.name and o2.type#=29)');
109: else
110: exec('insert into java$rmjvm$aux2 (select unique o1.name ' ||
111: 'from obj$ o1,obj$ o2, java$rmjvm$aux j ' ||
112: 'where o1.type#=5 and o1.owner#=1 and o1.name=o2.name and o2.obj#=j.obj#)');
107: exec('insert into java$rmjvm$aux2 (select unique o1.name from ' ||
108: 'obj$ o1,obj$ o2 where o1.type#=5 and o1.owner#=1 and o1.name=o2.name and o2.type#=29)');
109: else
110: exec('insert into java$rmjvm$aux2 (select unique o1.name ' ||
111: 'from obj$ o1,obj$ o2, java$rmjvm$aux j ' ||
112: 'where o1.type#=5 and o1.owner#=1 and o1.name=o2.name and o2.obj#=j.obj#)');
113: end if;
114:
115: -- To make sure we eventually stop, pick a max number of iterations
180: select count(*) into total_to_delete from dependency$
181: where p_obj# in (select obj# from java$rmjvm$aux);
182: else
183: select count(*) into total_to_delete from dependency$
184: where p_obj# in (select obj# from obj$ where (type#=29 or type#=56));
185: end if;
186: commit;
187:
188: loop
193: (select obj# from java$rmjvm$aux)
194: and rownum <= deletions_per_iteration;
195: else
196: delete from dependency$ where p_obj# in
197: (select obj# from obj$ where (type#=29 or type#=56))
198: and rownum <= deletions_per_iteration;
199: end if;
200: commit;
201: exit when total_to_delete <= deletions_per_iteration;
210: select count(*) into total_to_delete from error$
211: where obj# in (select obj# from java$rmjvm$aux);
212: else
213: select count(*) into total_to_delete from error$
214: where obj# in (select obj# from obj$
215: where type#=28 or type#=29 or type#=30 or type#=56);
216: end if;
217: commit;
218: loop
223: (select obj# from java$rmjvm$aux)
224: and rownum <= deletions_per_iteration;
225: else
226: delete from error$ where obj# in
227: (select obj# from obj$ where type#=28 or type#=29 or type#=30 or type#=56)
228: and rownum <= deletions_per_iteration;
229: end if;
230: commit;
231: exit when total_to_delete <= deletions_per_iteration;
250: end loop;
251:
252: initjvmaux.rollbackset;
253:
254: dbms_output.put_line('delete from javaobj$');
255:
256: select count(*) into total_to_delete from javaobj$
257: where obj# in (select obj# from java$rmjvm$aux);
258: commit;
252: initjvmaux.rollbackset;
253:
254: dbms_output.put_line('delete from javaobj$');
255:
256: select count(*) into total_to_delete from javaobj$
257: where obj# in (select obj# from java$rmjvm$aux);
258: commit;
259: loop
260: dbms_output.put_line(total_to_delete ||' remaining at ' || to_char(sysdate,'mm-dd hh:mi:ss'));
258: commit;
259: loop
260: dbms_output.put_line(total_to_delete ||' remaining at ' || to_char(sysdate,'mm-dd hh:mi:ss'));
261: initjvmaux.rollbackset;
262: delete from javaobj$ where obj# in (select obj# from java$rmjvm$aux)
263: and rownum <= deletions_per_iteration;
264: commit;
265: exit when total_to_delete <= deletions_per_iteration;
266: total_to_delete := total_to_delete - deletions_per_iteration;
356: exit when total_to_delete <= deletions_per_iteration;
357: total_to_delete := total_to_delete - deletions_per_iteration;
358: end loop;
359:
360: dbms_output.put_line('delete from obj$');
361: --
362: -- only delete from obj$ if all the java information was deleted
363: -- from the other tables correctly. Once we run this delete
364: -- there is no going back to remove the information from
358: end loop;
359:
360: dbms_output.put_line('delete from obj$');
361: --
362: -- only delete from obj$ if all the java information was deleted
363: -- from the other tables correctly. Once we run this delete
364: -- there is no going back to remove the information from
365: -- syn$, objauth$, javaobj$, access$ and dependency$ using this script.
366: --
361: --
362: -- only delete from obj$ if all the java information was deleted
363: -- from the other tables correctly. Once we run this delete
364: -- there is no going back to remove the information from
365: -- syn$, objauth$, javaobj$, access$ and dependency$ using this script.
366: --
367: DECLARE
368: c1 number;
369: c2 number;
373: c6 number;
374: BEGIN
375: if remove_all then
376: select count(*) into c1 from syn$ where obj# in
377: (select o1.obj# from obj$ o1,obj$ o2
378: where o1.name=o2.name and
379: o1.type#=5 and o1.owner#=1 and o2.type#=29);
380: select count(*) into c2 from dependency$ where p_obj# in
381: (select obj# from java$rmjvm$aux);
381: (select obj# from java$rmjvm$aux);
382: select count(*) into c4 from javasnm$;
383: else
384: select count(*) into c1 from syn$ where obj# in
385: (select o1.obj# from obj$ o1,obj$ o2,java$rmjvm$aux j
386: where o1.name=o2.name and o1.type#=5 and o1.owner#=1
387: and o2.obj#=j.obj#);
388: select count(*) into c2 from dependency$ where p_obj# in
389: (select obj# from obj$ where
385: (select o1.obj# from obj$ o1,obj$ o2,java$rmjvm$aux j
386: where o1.name=o2.name and o1.type#=5 and o1.owner#=1
387: and o2.obj#=j.obj#);
388: select count(*) into c2 from dependency$ where p_obj# in
389: (select obj# from obj$ where
390: type#=28 or type#=29 or type#=30 or type#=56);
391: c4 := 0;
392: end if;
393:
392: end if;
393:
394: select count(*) into c3 from objauth$ where obj# in
395: (select obj# from java$rmjvm$aux);
396: select count(*) into c6 from javaobj$ where obj# in
397: (select obj# from java$rmjvm$aux);
398: select count(*) into c5 from access$ where d_obj# in
399: (select obj# from java$rmjvm$aux);
400:
401: update java$jvm$status set rmjvmtime = (select startup_time from v$instance);
402:
403: IF c1 = 0 AND c2 = 0 AND c3 = 0 AND c4 = 0 AND c5 = 0 and c6 = 0 THEN
404: select count(*) into total_to_delete
405: from obj$ where obj# in (select obj# from java$rmjvm$aux);
406: commit;
407: loop
408: initjvmaux.rollbackset;
409: delete from obj$ where obj# in (select obj# from java$rmjvm$aux)
405: from obj$ where obj# in (select obj# from java$rmjvm$aux);
406: commit;
407: loop
408: initjvmaux.rollbackset;
409: delete from obj$ where obj# in (select obj# from java$rmjvm$aux)
410: and rownum <= deletions_per_iteration;
411: commit;
412: exit when total_to_delete <= deletions_per_iteration;
413: total_to_delete := total_to_delete - deletions_per_iteration;
414: end loop;
415:
416: initjvmaux.rollbackset;
417: if not remove_all then
418: update obj$ set status=5 where type#=28 or type#=29;
419: end if;
420:
421: commit;
422: initjvmaux.rollbackset;
425: commit;
426: initjvmaux.rollbackset;
427:
428: insert into java$rmjvm$aux
429: (select obj# from obj$ where type#=10 and owner#=1);
430: delete from java$rmjvm$aux
431: where obj# in (select p_obj# from dependency$);
432: delete from obj$ where obj# in (select obj# from java$rmjvm$aux);
433: commit;
428: insert into java$rmjvm$aux
429: (select obj# from obj$ where type#=10 and owner#=1);
430: delete from java$rmjvm$aux
431: where obj# in (select p_obj# from dependency$);
432: delete from obj$ where obj# in (select obj# from java$rmjvm$aux);
433: commit;
434: delete from java$rmjvm$aux;
435: commit;
436:
474: begin
475: -- check whether registry says startup is pending
476: if initjvmaux.startup_pending_p then raise foo; end if;
477: -- check whether there are any KGL handles for non fixed objects which
478: -- do not appear in obj$. This can indicate that rmjvm has run in the
479: -- current instance
480: -- Ignore SYS temp tables created during optimizer statstics
481: -- collection.
482: select count(*) into ct from x$kglob,obj$ where
478: -- do not appear in obj$. This can indicate that rmjvm has run in the
479: -- current instance
480: -- Ignore SYS temp tables created during optimizer statstics
481: -- collection.
482: select count(*) into ct from x$kglob,obj$ where
483: kglnacon=sys_context('USERENV', 'CON_NAME') and
484: kglnaobj=name(+) and name is null and kglobtyp in (28, 29, 30, 56);
485: if ct != 0 then raise foo; end if;
486: end;
521: already_done number := 0;
522: cursor C1(above number) is select
523: 'ALTER JAVA CLASS "' || u.name || '"."' || o.name || '" RESOLVE',
524: o.obj# from
525: obj$ o, user$ u, java$rmjvm$aux j where
526: o.obj#=j.obj# and u.user# = o.owner# and j.obj# > above
527: order by j.obj#;
528:
529: DDL_CURSOR integer;