1 package dbms_java_dump authid current_user is
2
3 -- Note: This package allows the user to request various Java VM
4 -- dumps from any active database session. No special privilege
5 -- is needed to do so other than the ability to invoke this package.
6 --
7 -- Oracle's installation deliberately does not grant EXECUTE
8 -- privilege on this package to anyone beyond SYS. A DBA can choose
9 -- to grant EXECUTE on this package to either specific users or
10 -- to PUBLIC, but should consider:
11 --
12 -- a) Heap dumps can contain sensitive data. Be sure the
13 -- dump destination directory area can only be read by a
14 -- sufficiently trustable audience.
15 --
16 -- b) Heap dumps can be large. Be sure having large files
17 -- written to the dump destination directory area won't risk
18 -- the stability of your server.
19 --
20 -- c) Writing dumps can noticably slow down program execution.
21 -- Permitting someone to request that a random session write
22 -- dumps can allow denial-of-service attacks.
23 --
24 --
25
26
27 -- DBMS_JAVA_DUMP.DUMP:
28
29 -- Request that the specified session dump info about its Java VM
30 -- when it is next able to do so.
31 --
32 -- To make a request to the current session itself, you can pass NULL
33 -- to both the session_id and session_serial parameters or just leave
34 -- them to default.
35 --
36 -- The request flags passed in each call will be ORed together with
37 -- those from any other pending requests to the same session. If
38 -- multiple requests are made to the same session before it has a
39 -- chance to act on the first, most likely the various requested dumps
40 -- will be written together.
41 --
42 -- Currently this routine returns after the request is made, not
43 -- after the dump is actually written. No feedback is available
44 -- currently as to whether or when the dump is successfully written.
45 --
46
47 procedure dump(request_flags pls_integer,
48 session_id pls_integer := NULL,
49 session_serial pls_integer := NULL);
50
51 -- Values for request_flags argument:
52 -- These may be added together to select multiple dump choices.
53
54 java_dump_db_interface_info constant pls_integer := 1;
55 java_dump_stack constant pls_integer := 2;
56 java_dump_memory_manager_state constant pls_integer := 4;
57 java_dump_heap constant pls_integer := 8;
58 java_dump_threads_and_monitors constant pls_integer := 16;
59
60 end;