been in existence for more than a decade and is one of the more
powerful development languages.
Oracle, for instance, has developed many tools utilizing
Oracle 11g comes with a lot of improvements in
the Java language such as having the best native Java compiles,
supporting Content Repository API for Java, having scalable Java
with the automatic creation of 100% native Java code and more.
package is available when
Oracle JVM is installed, which has been supported since Oracle 8i.
This package lets developers use Java to create, store and deploy
code within Oracle databases. we will highlight some of the more
common uses of the dbms_java package.
Functions and procedures will be demonstrated, and a brief
description will be noted about each command.
The first example grants
execute privileges to all
files located in the /bin directory to
the pkg user.
7.12 - dbms_java.sql
conn sys@ora11g as sysdba
Connected to Oracle 11g Enterprise Edition
conn / as sysdba
--Grant permission to execute any command on /bin
directory to pkg user
grantee => 'pkg',
permission_type => 'java.io.FilePermission',
permission_name => '/bin/*',
permission_action => 'execute');
the permission granted by consulting dba_java_policy view
"kind" for a8
col "type" for a25
col "name" for a10
"action" for a10
name "name" ,
-------- ---------- -------------------------
To change any native compiler option for a user
session, use the set_native_compile_option
procedure followed by the
native_compile_options function to get the results.
--Change a native compile option for user session
optionName => 'optimizerLoopPagedConversion',
value => 'false');
--Get current native compile
--Compile a java class
--Find the java to be
name like 'java/io/FilePermissionCollection';
using compile_class function!
classname => 'java/io/FilePermissionCollection')
In order to get the full name of a Java object,
use the longname function as shown in
the next example:
--Long object name
object_type ='java class'
status = 'valid'
and object_name like '%DelegateInvocationH%';
With more than 100
procedures and functions, the
dbms_java package cannot be fully covered in this book.
Most of the procedures and functions are executed by GUI or other
programs and the user usually will not need to run them manually.
This being said, it is wise to have at least a basic
understanding of it and be familiar with how they are working within
Inside the DBMS Packages
The DBMS packages form the foundation of
Oracle DBA functionality. Now, Paulo Portugal writes a landmark book
Advanced Oracle DBMS Packages: The Definitive Reference.
This is a must-have book complete with a code
depot of working examples for all of the major DBMS packages.
Order directly from Rampant and save 30%.
Burleson is the American Team
documentation was created as a support and Oracle training reference for use by our
DBA performance tuning consulting professionals.
Feel free to ask questions on our
considering using the services of an Oracle support expert should
independently investigate their credentials and experience, and not rely on
advertisements and self-proclaimed expertise. All legitimate Oracle experts
Oracle technology is changing and we
strive to update our BC Oracle support information. If you find an error
or have a suggestion for improving our content, we would appreciate your
and include the URL for the page.
Copyright © 1996 - 2020
All rights reserved by
is the registered trademark of Oracle Corporation.