Setting max heap in Oracle JVM

Hello -
I'm having a problem with a Java stored procedure running out of heap memory in Oracle 10g running Java 1.4.
Normally (running Java in a standard context) I would just modify the -Xmx with a higher value, but for the life of me I can't figure out how to do it in a stored procedure context.
I have browsed Google and I have browsed the Oracle JVM installation stuff, all to no avail.
Can anyone help me with how to set my max heap size, or verify that it's impossible? I have taken all of the standard Oracle memory parameters (JAVA_POOL, UGA/PGA/SGA limits) out of the picture by jacking them up and keeping an eye on memory values up to the point that the procedure fails (at ~700m), so I'm pretty sure that this is my problem.
So far I have looked at:
Config files
Config tables
DB parameters
I haven't been able to find anything remotely related to JVM option configuration in any of the above.
It is worth noting that I ran across another forum where someone was wanting to set their minimum heap size, and they were told that it was not possible. I'm just having trouble believing that it's the same story with something as critical as max heap size.
Much obliged for any help.
Thanks,
Annaka

From Metalink Note 466112.1:
Applies to:
Oracle Server - Enterprise Edition - Version: 9.2.0.1 to 10.2.0.3
This problem can occur on any platform.
Symptoms
When attempting to execute a java class that works fine in a stand alone JVM, fails with Oracle JVM with the following error:
ERROR
ORA-29532: Java call terminated by uncaught Java exception:
java.lang.OutOfMemoryError
ORA-06512: at "IDS_SYS.POD", line 3
Cause
The MaxMemorySize was set 256M (the default values) where the JSO needs memory more than 256 MB to run.
This can be checked as following:
SQL> create or replace function getMaxMemorySize return number
2 is language java name
3 'oracle.aurora.vm.OracleRuntime.getMaxMemorySize() returns long';
4 /
Function created.
SQL> select getMaxMemorySize from dual;
GETMAXMEMORYSIZE
268435456
After increasing the MaxMemorySize to a larger value(1 GB), the problem was fixed
Solution
Please increase the MaxMemorySize to a larger values(i.e. 1GB), this can be done as following:
SQL> create or replace function setMaxMemorySize(num number) return number
2 is language java name
3 'oracle.aurora.vm.OracleRuntime.setMaxMemorySize(long) returns long';
4 /
Function created.
SQL> select setMaxMemorySize(1024*1024*1024) from dual;
SETMAXMEMORYSIZE(1024*1024*1024)
Then you can check if the value is set correctly using the following:
SQL> select getMaxMemorySize from dual;
GETMAXMEMORYSIZE
1073741824
In my case I had to set the parameter within a job's the session.
bye
TPD
Edited by: TPD on Sep 23, 2008 4:27 PM - tags added

Similar Messages

  • How to set  max-heap-size outside the jnlp file?

    Due to bug_id=6631056 It may not be possible to specify max-heap-size within
    the JNLP file for certain jnlp java applications.
    Are there other possibilities to specify this Jvm parameter?
    In the ControlPanel there is the possibility to specify Xmx for applets but not for jnlp.
    I have tried to add properties like
    "deployment.javaws.jre.0.args=Xmx\=128M" without success
    Many thanks

    Even in JNLP also you can specify the max heap size
    <j2se version="1.5+" initial-heap-size="128m" max-heap-size="512m"/>
    Thanks,
    Suresh
    [http://sureshdevi.co.in|http://sureshdevi.co.in]

  • How to set the heap size of JVM

    please let me know that how to set the heap size of JVM

    C:\>java -X
        -Xmixed           mixed mode execution (default)
        -Xint             interpreted mode execution only
        -Xbootclasspath:<directories and zip/jar files separated by ;>
                          set search path for bootstrap classes and resources
        -Xbootclasspath/a:<directories and zip/jar files separated by ;>
                          append to end of bootstrap class path
        -Xbootclasspath/p:<directories and zip/jar files separated by ;>
                          prepend in front of bootstrap class path
        -Xnoclassgc       disable class garbage collection
        -Xincgc           enable incremental garbage collection
        -Xbatch           disable background compilation
        -Xms<size>        set initial Java heap size
        -Xmx<size>        set maximum Java heap size
        -Xss<size>        set java thread stack size
        -Xprof            output cpu profiling data
        -Xrunhprof[:help]|[:<option>=<value>, ...]
                          perform JVMPI heap, cpu, or monitor profiling
        -Xdebug           enable remote debugging
        -Xfuture          enable strictest checks, anticipating future default
        -Xrs              reduce use of OS signals by Java/VM (see documentation)look at the -Xm? lines
        -Xms<size>        set initial Java heap size
        -Xmx<size>        set maximum Java heap sizeThis can be used e.g. like this:java -Xms8M -Xmx32M MyProgwhich runs MyProg in a java VM with the initial heap size of 8 MB and a maximum heap size of 32 MB.
    - Marcus

  • Upto how much I can set maximum Heap size for jvm?

    I am running application on 8GB RAM Windows 64 bits machine.
    I am running out of OutOfMemory (Heap Space). I want to increase the Heap Size for my jvm.
    But can anybody please tell me what is the limit by which I can set the maximum size for heap?
    Thanks in Advance,
    Jenish

    Max allowed memory per process is 2 raised to the 64th power. What maximum memory you can set depends on the memory available
    for your application. You may be able to set more than 8GB ram then it will use the swap space and it will slow down your application
    performance. So try different memory size and see which one works best for your application.

  • Max Heap size of j2ee web dispatcher ??

    Hello All,
                  Max Heap size of j2ee web dispatcher for our DEV BI 7.0 is 1024 MB.But our QA BI 7.0 system is 130 MB.I need to know in which sceanario we increase Max Heap size of j2ee web dispatcher??For BI 7.0 what should be the perfect heap size??

    Dear's about what you speaking, may be i do not know anything ?
    Max Heap size of j2ee web dispatcher for our DEV BI 7.0 is 1024 MB.But our QA BI 7.0 system is 130 MB.
    What are web dispatcher? it's about it -->
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/c6/0c2c79b9fc4e1c8548815bf56300f4/frameset.htm
    Where are her heap? If you say aboy dispatcher nodes in AS JAVA, when it is  not "web dispatcher" 
    Manoj Chintawar   wrote :
    You should be ok to set max heap size to 1024 MB since you have 16GB of RAM in your system.
    where you read abot it ? Per same Note 723909 - Java VM settings for J2EE 6.40/7.0 -->
    For dispatcher nodes it's sufficient to set the heap size to 171m on 32 bit and to 256m on 64 bit platforms. There is no need to apply the parameters mentioned under 4-9 below.
    Regards.

  • Strange: Mac screen menu-bar requires max-heap-size to be set.

    I planned to omit the max-heap-size attribute in the line of my jnlp file
    <j2se version="1.6+" max-heap-size="256m" />
    The idea was that with Java 1.6 the heap size is set automatically
    according to the client's RAM.
    Unfortunately, the Macintosh screen menu-bar works if and only if the max-heap-size attribute is present.
    It is a MacOsX=1.4 with Java1.5.
    Strange, since the Mac runs Java 1.5 and I am talking about settings for 1.6.
    The jnlp passed ValidateJNLP at http://mindprod.com/jgloss/jnlp.html#VALIDATION
    Here is another post stating that attributes in JNLP have side effects on Mac's screen menu-bar:
    http://lists.apple.com/archives/Java-dev/2008/Jul/msg00122.html
    Here is my jnlp:
    w3m -dump http://www.bioinformatics.org/strap/strap.jnlp
    Is there an explanation for this?
    Christoph

    user10289576 wrote:
    I would not blame Macintosh.
    The error might still be in the Sun's code.Could be. But to fix the Mac VM it would require the following.
    1. Find it in the Sun VM.
    2. Fix it in the Sun VM.
    3. Move the changes to the Mac VM...somehow.
    >
    If the jdk would be smaller, less redundant and clearer, then
    open JDK could be possibly compiled on a Mac.
    Not sure what that means since there are likely OS level calls that must be implemented in some place in the API. Which are specific to Mac.
    Just as there are differences between windows/solaris/linux which Sun accounted for.
    And that would be what Apple would have done to make it work on Mac. And what someone (someone who likes Mac) will need to continue to do with the public release (explusion?) which is the form that Java will have going forward.
    The main thing that should be improved on a Macintosh
    is to directly allow for Linux and Solaris executables such that the Linux JDK could directly work on a Mac.The main thing, again, is the Apple is no longer supporting Java on the Mac.
    And Apple, not Sun and certainly not Oracle, were the ones that created the Java VM.
    So the main thing at this point is that ALL future directions that Java take are dependent not on Apple but on the Macintosh community. That includes features as well as fixes.

  • Does the jvm allocate complete max heap size initially?

    Does the JVM allocate the memory for the entire max heap size up front, or does it start with the specified minimum size and increase and grab more later if needed?
    The reason this is being posted is because we have a number of jboss servers that are being run. Some don't require large heap sizes, others do. If we use the same large max heap size for all would all the memory get allocated up front, or possibly a smaller initialization portion?

    I have done the test with Solaris, Linux and WinXP.
    Test with -Xms512M
    Have written a simple java program to which the minimum heap size was set to -Xms512m then the program was executed on Solaris and WinXP platforms. The usage of memory of the Java process was 6 MB in WinXP and 9 MB in Solaris, rather than 512 MB. The JVM is not allocating the configured minimum size of 512 MB at the start of the process execution.
    Reason:
    If you ask the OS for 512 MB it'll say "here it is", but pages won't actually be allocated until your app actually touches them.
    If the allocation is not being made initially during the start of the process, the concept of minimum heap size is not required.
    But the garbage collection log shows the minimum heap size as what was configured using -Xms option.
    Test with -Xms1024M
    The JVM arguments was set to : -Xms1024m -Xmx1024m, but the used memory observed using Windows perfmon was 573M.
    6.524: [Full GC 6.524: [Tenured: 3081K->10565K(967936K), 0.1949291 secs] 52479K->10565K(1040512K), [Perm : 12287K->12287K(12288K)], 0.1950893 secs] Reason:
    Optimization is something that the operating systems do. The JVM allocates the memory in it's address space and initializes all data structures to your -Xms. In any way that the JVM can measure, the allocation from the OS is complete. But the OS doesn't physically assign a page to the app until the first store instruction. Almost all modern OSs do this.
    Hope this is helpful.

  • Setting System-Wide Max Heap Size

    We want to set the heap-size of Java-Plugin 1.5.0_14 for a company-wide rollout to a fixed size under Windows XP.
    In deployment.config under C:\Winnt\Sun\Java\deployment I am giving this:
    deployment.system.config=file:C:\\WINNT\\Sun\\Java\\Deployment\\deployment.properties
    deployment.system.config.mandatory=true
    In the respective deployment.properties I am giving
    #deployment.properties
    deployment.cache.max.size=50m
    deployment.javapi.jre.1.5.0_14.args=-Xmx256m -Xms75m
    While the cache-parameter is taking effect (visible in the Java Control Panel) there is no change in the Max Heap Size.
    Any idea how this could be achieved?
    Thank you
    Michael

    MaxHeapSize I determine with Runtime.getRuntime().maxMemory()
    Setting it manually in the javacpl via -Xmx works fine but....
    Problem is that we do not want each user to open his Java Control Panel and set this value manually.
    May be error prone and difficult to communicate in a scenario where you have hundreds of users in different locations, countries etc.
    Should be possible to set this value once installing the Java Plugin
    Thank You
    Michael

  • Java vm creation crashes if max heap is set too big

    I start the jvm from deep within a c / fortran app. If I give a "decent" max heap size w/ -Xmx option, everything is fine. However, the JNI_CreateJavaVM crashes w/
    Unhandled exception at 0x060b766b (jvm.dll) in tnapa.exe: 0xC0000005: Access violation reading location
    0x00000ff1.
    The violator being:
         jvm.dll!_findNonConsecutive() + 0x18b     if I give a large (e.g. -Xmx1g) max heap size. I first suspected that this is our own code that messes up some memory before the jvm gets into the picture (and still consider this a strong possibility). However, when trying to solve the problem, I looked at the reported memory location w/ MS Visual C++ debugger, and it showed ?? for values there. I could not find it in the documentation, but my coworker said it means that memory is outside of the scope of the process in question. This makes it sound like jvm is trying to access illegal memory areas. Could this be a jni bug?
    Environment:
    jdk 1.5.0_09
    win xp sp 2
    ms cl compiler (/MD flag is used in compilation)
    2GB of ram
    The jvm is loaded dynamically, i.e. the reference to the func JNI_CreateJavaVM is fetched from the jvm.dll, which is loaded lazily, i.e. just in time when needed for the first time. A proper typecast is done to ensure that JNICALL calling convention is used.
    -Antti-

    Sorry, blaming the wrong horse here... the jvm in use was actually jrockit (BEA JRockit(R) (build R26.4.0-63-63688-1.5.0_06-20060626-2259-win-ia32, jdk 1.5.0_06).
    W/ sun jdk everything is fine. Well, at least it does not crash, it just fails due to not enough memory.
    -Antti-

  • Setting up Oracle JVM and vendor Classes

    Hello All,
    I am trying to setup a Java Stored Procedure that
    writes messages to IBM MQSeries Queue. MQSeries has
    three client jar files (these jar files use CORBA
    classes which are part of the JDK installation).
    This Java client works well outside Oracle but
    we are getting exceptions such ClassNotFoundException.
    Does has experience on setting up such classes
    within Oracle JVM? Are there extra documenations
    we can use to guide us in setting up?
    Many thanks in advance.

    What version of the Oracle database are you using? What version of the JDK do IBM's classes require? My hunch is that IBM's classes may require a more recent version of the JDK than is currently installed in your database.
    Justin
    Distributed Database Consulting, Inc.
    www.ddbcinc.com/askDDBC

  • Set the heap size

    Hi,
    I am wondering what's the default heap size if I don't add -ms -mx opation? I
    set the two options and the following is the output from -verbosegc. what's it
    means?
    Thanks.
    [GC 2598K->2145K(2696K), 0.0035829 secs]
    [GC 2656K->2201K(2824K), 0.0036262 secs]
    [Full GC 2713K->2070K(4028K), 0.1933980 secs]
    [GC 2582K->2229K(4028K), 0.0046565 secs]
    [GC 2741K->2373K(4028K), 0.0061002 secs]
    [GC 2885K->2514K(4028K), 0.0064346 secs]
    [GC 3026K->2656K(4028K), 0.0061670 secs]
    [GC 3168K->2798K(4028K), 0.0054694 secs]
    [GC 3310K->2940K(4028K), 0.0054521 secs]
    [GC 3452K->3080K(4028K), 0.0058119 secs]
    [GC 3592K->3216K(4028K), 0.0059069 secs]
    [GC 3728K->3357K(4028K), 0.0057200 secs]
    [GC 3869K->3496K(4028K), 0.0055719 secs]
    [GC 4008K->3636K(4156K), 0.0057239 secs]
    [Full GC 4148K->3649K(6544K), 0.3064887 secs]
    [GC 4091K->3773K(6544K), 0.0412259 secs]
    [GC 4285K->3912K(6544K), 0.0052336 secs]
    [GC 4424K->4051K(6544K), 0.0055661 secs]
    [GC 4563K->4189K(6544K), 0.0055543 secs]
    [GC 4701K->4326K(6544K), 0.0055703 secs]
    [GC 4838K->4464K(6544K), 0.0055915 secs]
    [GC 4976K->4608K(6544K), 0.0059667 secs]
    [GC 5120K->4746K(6544K), 0.0053261 secs]
    [GC 5258K->4884K(6544K), 0.0053761 secs]
    [GC 5396K->5023K(6544K), 0.0059290 secs]
    [GC 5534K->5159K(6544K), 0.0054320 secs]
    [GC 5671K->5301K(6544K), 0.0114341 secs]
    [GC 5813K->5405K(6544K), 0.0103658 secs]
    [GC 5917K->5492K(6544K), 0.0053194 secs]
    [GC 6003K->5592K(6544K), 0.0107092 secs]
    [GC 6104K->5694K(6544K), 0.0096887 secs]
    [GC 6206K->5786K(6544K), 0.0037949 secs]
    [GC 6298K->5890K(6544K), 0.0101172 secs]
    [GC 6402K->5990K(6544K), 0.0041271 secs]
    [GC 6502K->6097K(6672K), 0.0040678 secs]
    [Full GC 6609K->6191K(10992K), 0.2664733 secs]
    Tue Dec 04 15:22:10 PST 2001:<I> <T3Services> CacheManagerImpl: EMAIL TEMPLATE
    C
    ACHE STARTING
    [GC 6849K->6361K(10992K), 0.0586387 secs]
    Tue Dec 04 15:22:10 PST 2001:<I> <T3Services> CacheManagerImpl: SCHEDULE CACHE
    S
    TARTING
    [GC 7129K->6530K(10992K), 0.0083019 secs]
    [GC 7298K->6678K(10992K), 0.0058533 secs]
    [GC 7446K->6807K(10992K), 0.0052940 secs]
    [GC 7575K->6920K(10992K), 0.0048598 secs]

    I think the default heap size is 16MB, as for the GC output:
    these [GC 2598K->2145K(2696K), 0.0035829 secs]
    show the collection of Objects within the eden area of the heap (Short lived Objects),
    the heap size before GC was 2598K and after GC was 2145K and the time taken was
    0.0035829 secs.
    These outputs:
    [Full GC 2713K->2070K(4028K), 0.1933980 secs]
    show the details for a full GC, these are the ones to watch out for, they will
    take longer and the JVM (no mater how many processors) will block during a full
    GC....I.E no server response at all.
    The smaller the heap size the more often a full GC will occur, however the larger
    the heap, the longer the full GC will take.
    One of the new options for jdk 1.3.1 is the -Xincgc option, this will do incremental
    Garbage Collection, overall it will take longer than normal, but the individual
    Full GCs will take less time....so the server is not hung for as long at any one
    time.
    Set -Xms (the minimum heap) to the same as -Xmx (max heap), this increases performance
    as the JVM does not have to repeatedly assign more memory to the heap.
    Gareth
    "Jen" <[email protected]> wrote:
    >
    Hi,
    I am wondering what's the default heap size if I don't add -ms -mx opation?
    I
    set the two options and the following is the output from -verbosegc.
    what's it
    means?
    Thanks.
    [GC 2598K->2145K(2696K), 0.0035829 secs]
    [GC 2656K->2201K(2824K), 0.0036262 secs]
    [Full GC 2713K->2070K(4028K), 0.1933980 secs]
    [GC 2582K->2229K(4028K), 0.0046565 secs]
    [GC 2741K->2373K(4028K), 0.0061002 secs]
    [GC 2885K->2514K(4028K), 0.0064346 secs]
    [GC 3026K->2656K(4028K), 0.0061670 secs]
    [GC 3168K->2798K(4028K), 0.0054694 secs]
    [GC 3310K->2940K(4028K), 0.0054521 secs]
    [GC 3452K->3080K(4028K), 0.0058119 secs]
    [GC 3592K->3216K(4028K), 0.0059069 secs]
    [GC 3728K->3357K(4028K), 0.0057200 secs]
    [GC 3869K->3496K(4028K), 0.0055719 secs]
    [GC 4008K->3636K(4156K), 0.0057239 secs]
    [Full GC 4148K->3649K(6544K), 0.3064887 secs]
    [GC 4091K->3773K(6544K), 0.0412259 secs]
    [GC 4285K->3912K(6544K), 0.0052336 secs]
    [GC 4424K->4051K(6544K), 0.0055661 secs]
    [GC 4563K->4189K(6544K), 0.0055543 secs]
    [GC 4701K->4326K(6544K), 0.0055703 secs]
    [GC 4838K->4464K(6544K), 0.0055915 secs]
    [GC 4976K->4608K(6544K), 0.0059667 secs]
    [GC 5120K->4746K(6544K), 0.0053261 secs]
    [GC 5258K->4884K(6544K), 0.0053761 secs]
    [GC 5396K->5023K(6544K), 0.0059290 secs]
    [GC 5534K->5159K(6544K), 0.0054320 secs]
    [GC 5671K->5301K(6544K), 0.0114341 secs]
    [GC 5813K->5405K(6544K), 0.0103658 secs]
    [GC 5917K->5492K(6544K), 0.0053194 secs]
    [GC 6003K->5592K(6544K), 0.0107092 secs]
    [GC 6104K->5694K(6544K), 0.0096887 secs]
    [GC 6206K->5786K(6544K), 0.0037949 secs]
    [GC 6298K->5890K(6544K), 0.0101172 secs]
    [GC 6402K->5990K(6544K), 0.0041271 secs]
    [GC 6502K->6097K(6672K), 0.0040678 secs]
    [Full GC 6609K->6191K(10992K), 0.2664733 secs]
    Tue Dec 04 15:22:10 PST 2001:<I> <T3Services> CacheManagerImpl: EMAIL
    TEMPLATE
    C
    ACHE STARTING
    [GC 6849K->6361K(10992K), 0.0586387 secs]
    Tue Dec 04 15:22:10 PST 2001:<I> <T3Services> CacheManagerImpl: SCHEDULE
    CACHE
    S
    TARTING
    [GC 7129K->6530K(10992K), 0.0083019 secs]
    [GC 7298K->6678K(10992K), 0.0058533 secs]
    [GC 7446K->6807K(10992K), 0.0052940 secs]
    [GC 7575K->6920K(10992K), 0.0048598 secs]

  • Setting the heap size

    Hi all,
    I wanted to ask you about setting the heap size value.
    How we can calculate the heap size?
    I had problems with the max heap size in my application.
    So I increased the max value to 2048 MB, but I am afraid that
    the same error may come up again some time depending upon the
    usage.
    So how I can find, say for a server having 2 GB RAM,
    how much heap size I should give? I read that there is no defined
    formula to calculate this. But I wanted to get the best way of doing it.
    Please advise,
    Sandeep

    As has already been said, you probably have a leak. However, when trying to gauge the maximum heap you can (not should, but can) use you have to take into account what the server is doing, and its operating system. You do not want your JVM to page. So, for a 2GB server, with no other app on it, I think the "usual" is something like 75% max? Though I really wouldn't take my word for it...it's not my field.

  • How do I avoid re-entrant problems in Oracle JVM

    I have a Java program called LanguageFunctions. This Java program has several methods that translate the data within a String or CLOB. I want to use this Java program as a stored procedure, and specifically the methods as Oracle functions. I want this function to be accessed simultaneously without either re-entrant, lock or performance concerns. I want to be able to use the functions something like this:
    SELECT TO_CHINESE(VARCHARCOL1) FROM DUAL;
    SELECT TO_FINISH(CLOBCOL1) FROM DUAL;
    I am having trouble understanding the Java requirements for these methods. I am greatly concerned about multi-user usage and issues with re-entrant code. Does this have to be a static class? If not, how when and where does it get instantiated (I hope not for every invocation of the function)? How to I avoid having one user accidentally changing the data within the method when executed in parallel?
    BTW: I have successfully moved these into the Oracle JVM, and executed them as a single user. My main concern is the re-entrant code issues.
    Thanks

    Thanks for the reply, I meant no disrespect, I was just trying to be a little funny...
    I did read that any method that you want to use as an Oracle function must be static. So I understand that as a given. However, the class I am converting uses static Class variables. You can see this in the example as the textOut variable.
    When two users are accessing this function in parallel, I could see the following series of events ocurring, and it is my concern. There is only one textOut, and I believe it can be modifed by both functions simultanesouly with unexpected results. I'm assuming my for loop is set to x < 2.
    SessionA issues: SELECT TO_DANISH('HELLO') FROM DUAL;
       A --> textOut = ""
       A --> textOut = "HELLO"
       A --> textOut = "HELLOxy"
       A --> textOut = "HELLOxyxy"
    SessionB issues: SELECT TO_DANISH('GOODBYE') FROM DUAL;
       B --> textOut = ""
       A --> textOut = "xy"
       B --> textOut = "GOODBYE"
       A --> textOut = "GOODBYExy"
    Session A returns: "GOODBYExy"     (expected "HELLOxyxy")
       B --> textOut = "GOODBYExyxy"
       B --> textOut = "GOODBYExyxyxy"
    Session B returns: "GOODBYExyxyxy" (expected "GOODBYExyxy")I'm I correct in my assumption that this is an issue? If so, what type of programm architecture would be best to use to manage this? I've tried to provide a simple working example of the issue, but the program that I'm working on actually alters the contents of textOut (as a static Class variable) in 5 or 6 different methods, including one method using recursion. I know I may need to make changes to the program architecture to make it work properly in a multi-user environment as an Oracle function. I'm just a little confused on what the appropriate architecture is. Once again any help is appreciated!
    Joel

  • ORACLE JVM (8.1.5 - 9.0.1)를 수동으로 설치하기

    제품 : ORACLE SERVER
    작성날짜 : 2002-09-27
    Oracle JVM (8.1.5 - 9.0.1)를 수동으로 설치하기
    ==============================================
    Purpose
    v 8.1.5, 8.1.6, 8.1.7 and 9.0.1에서 Oracle JVM의 모든 구성 요소
    를 설치하기 위해 실행해야 하는 sql script들을 설명하고,
    JVM이 성공적으로 설치되었는지 test program으로 확인해 봅니다.
    주의 : 이 script들은 반드시
    SYS 또는 INTERNAL 로 실행되어야만 합니다.
    'initjvm.sql' script는 JVM을 설치하기위해 필요합니다.
    그리고 그 외에 추가되는 script들은 각각에 설명된 추가적인
    기능을위해 실행되어야 하는 script들입니다.
    ("--"표시로 주석 처리가 되어 있습니다.)
    설치에 앞서 점검해야 할 사항
    다음은 권장되는 사항입니다.
    SHARED_POOL_SIZE >= 65 MB
    JAVA_POOL_SIZE >= 50 MB
    SYSTEM tablespace내에 50 MB 이상의 free space
    250 MB 이상의 rollback segment space
    주의 : 위 사항이 만족되지 않거나 부족한 경우 다음 에러가 발생하거나
    script실행 도중 hang이 걸릴 수 있습니다.
    ORA-3113 : end-of-file on communication channel
    ORA-4030 : out of process memory when trying to allocate %s bytes
    ORA-4031 : unable to allocate bytes of shared memory
    Explanation
    Oracle JVM을 수동으로 설치하기
    JVM version 8.1.5를 위한 script
    initjvm.sql 만 실행해 주면 됩니다.
    -------- Script jvm_install_815.sql start ------------------
    -- Setup a database for running Java and the ORB
    spool initjvm.log
    start @$ORACLE_HOME/javavm/install/initjvm.sql
    spool off
    -------- Script jvm_install_815.sql end ------------------
    JVM version 8.1.6를 위한 script
    -------- Script jvm_install_816.sql start ------------------
    -- Setup a database for running Java and the ORB
    spool initjvm.log
    start @$ORACLE_HOME/javavm/install/initjvm.sql
    spool off
    -- Initializes Java library needed by PL/SQL
    spool initplsj.log
    start @$ORACLE_HOME/rdbms/admin/initplsj.sql
    spool off
    -- Load AQ/JMS jar files into the database
    spool initaqjms.log
    start @$ORACLE_HOME/rdbms/admin/initaqjms.sql
    spool off
    -- Load RepAPI server classes and publish 'repapi' obj
    spool initrepapi.log
    start @$ORACLE_HOME/rdbms/admin/initrepapi.sql
    spool off
    -------- Script jvm_install_816.sql end ------------------
    Scripts needed for JVM version 8.1.7
    8.1.7에는 새로운 Java API와 component들이 추가되어
    수행해야 하는 script들이 더 많습니다.
    -------- Script jvm_install_817.sql start ------------------
    -- Setup a database for running Java and the ORB
    spool jvminst.log
    start @$ORACLE_HOME/javavm/install/initjvm.sql
    spool off
    -- Loads xml components into the JServer
    spool initxml.log
    start @$ORACLE_HOME/oracore/admin/initxml.sql
    spool off
    -- loads the XMLSQL Utility (XSU) into the database
    spool catxsu.log
    start @$ORACLE_HOME/rdbms/admin/catxsu.sql
    spool off
    -- JIS (OSE) installation
    spool init_jis.log
    start @$ORACLE_HOME/javavm/install/init_jis.sql
    spool off
    -- Turn on JAccelerator (ncomp) for JIS
    spool jisja.log
    start @$ORACLE_HOME/javavm/install/jisja.sql
    spool off
    -- Adds the set of default end points to the server
    -- with hardcoded values for the admin service
    spool jisaephc.log
    start @$ORACLE_HOME/javavm/install/jisaephc.sql
    spool off
    -- Load PLSQL Gateway Servlet jar files into the database
    spool initplgs.log
    start @$ORACLE_HOME/rdbms/admin/initplgs.sql
    spool off
    -- Install Oracle JSP
    spool initjsp.log
    start @$ORACLE_HOME/jsp/install/initjsp.sql
    spool off
    -- Turn on JAccelerator for JSP libs
    spool jspja.log
    start @$ORACLE_HOME/jsp/install/jspja.sql
    spool off
    -- Initializes Java library needed by PL/SQL
    spool initplsj.log
    start @$ORACLE_HOME/rdbms/admin/initplsj.sql
    spool off
    -- Load AQ/JMS jar files into the database
    spool initjms.log
    start @$ORACLE_HOME/rdbms/admin/initjms.sql
    spool off
    -- Load RepAPI server classes and publish 'repapi' obj
    spool initrepapi.log
    start @$ORACLE_HOME/rdbms/admin/initrepapi.sql
    spool off
    -- loads sql, objects, extensibility and xml related java
    spool initsoxx.log
    start @$ORACLE_HOME/rdbms/admin/initsoxx.sql
    spool off
    -- Configure OSE defauls admin Web Service
    spool jisaep.log
    start @$ORACLE_HOME/javavm/install/jisaep admin 8080 9090
    spool off
    -------- Script jvm_install_817.sql end ------------------
    JVM version 9.0.1 을 설치하기 위한 script
    Using the database configuration assistant, follwoing scripts will be
    executed:
    -- Setup a database for running Java and the ORB
    SQL>@$ORACLE_HOME/javavm/install/initjvm.sql;
    -- INITialize (load) XML components in JServer
    SQL>@$ORACLE_HOME/xdk/admin/initxml.sql;
    -- Loads NCOMP'ed XML Parser
    SQL>@$ORACLE_HOME/xdk/admin/xmlja.sql;
    -- loads the XMLSQL Utility (XSU) into the database.
    SQL>@$ORACLE_HOME/rdbms/admin/catxsu.sql;
    -- install the Oracle Servlet Engine (OSE)
    SQL>@$ORACLE_HOME/javavm/install/init_jis.sql <$ORACLE_HOME>;
    -- Adds the set of default end points to the server
    -- with hardcoded values for the admin service
    SQL>@$ORACLE_HOME/javavm/install/jisaephc.sql <$ORACLE_HOME>;
    -- turn on J Accelerator
    SQL>@$ORACLE_HOME/javavm/install/jisja.sql <$ORACLE_HOME>;
    -- register EJB/Corba Dynamic Registration Endpoint
    SQL>@$ORACLE_HOME/javavm/install/jisdr.sql 2481 2482;
    -- init Java server pages @$ORACLE_HOME@$ORACLE_HOME@$ORACLE_HOME
    SQL>@$ORACLE_HOME/jsp/install/initjsp.sql;
    -- turn on J Accelerator for JSP libs
    SQL>@$ORACLE_HOME/jsp/install/jspja.sql;
    -- script used to load AQ/JMS jar files into the database
    SQL>@$ORACLE_HOME/rdbms/admin/initjms.sql;
    -- load RepAPI server classes and publish 'repapi' obj
    SQL>@$ORACLE_HOME/rdbms/admin/initrapi.sql;
    -- loads sql, objects, extensibility and xml related java
    SQL>@$ORACLE_HOME/rdbms/admin/initsoxx.sql;
    -- Loads appctxapi.jar for JavaVm enabled Database.Called by jcoreini.tsc
    SQL>@$ORACLE_HOME/rdbms/admin/initapcx.sql;
    -- script used to load CDC jar files into the database
    SQL>@$ORACLE_HOME/rdbms/admin/initcdc.sql;
    -- Loads the Java stored procedures as required by the
    -- Summary Advisor.
    SQL>@$ORACLE_HOME/rdbms/admin/initqsma.sql;
    --Initialize sqlj type feature in 9i db
    SQL>@$ORACLE_HOME/rdbms/admin/initsjty.sql;
    --load java componenets for AQ HTTP Propagation
    SQL>@$ORACLE_HOME/rdbms/admin/initaqhp.sql;
    Test program으로 JVM test해보기
    Java Stored Procedure 만들기
    다음과 같은 순서로 Java Stored Procedure를 만들어 봅니다.
    1. Java program을 만듭니다.
    2. program을 database로 loading합니다.
    3. Java program을 SQL (PL/SQL Wrapper)로 publish합니다.
    4. SQL 또는 PL/SQL에서 만든 Java program을 호출합니다.
    Step 1: Java program을 만듭니다.
    ======
    EchoInput.java
    public class EchoInput {
    public static void main (String[] args){
    for (int i=0; i<args.length;i++)
    System.out.println(args);}}
    Step 2: program을 database로 loading합니다.
    ======
    UNIX prompt상에서 다음을 실행합니다:
    % loadjava -u scott/tiger -v -r EchoInput.java
    또는 SQL*Plus에서는 다음과 같이 할 수도 있습니다:
    CREATE OR REPLACE JAVA SOURCE NAMED "EchoInput" AS
    public class EchoInput { public static void main (String[] args) {
    for (int i=0; i<args.length;i++) System.out.println(args[i]);}}
    Step 3: Java program을 SQL (PL/SQL Wrapper)로 publish합니다.
    ======
    SQL 또는 PL/SQL에서 만든 Java program을 호출하기 위해서는
    Java program을 SQL (PL/SQL Wrapper)로 publish해야 합니다.
    이과정을 PL/SQL Wrapper를 만든다고도 합니다.
    일단 published/wrapped가 되면 SQL 또는 PL/SQL을 통해 호출될 수
    있습니다.
    예제 :
    create or replace procedure echo_input (
    s1 varchar2, s2 varchar2, s3 varchar2)
    as language Java
    name 'EchoInput.main(java.lang.String[])';
    Step 4: SQL 또는 PL/SQL에서 만든 Java program을 호출합니다.
    ======
    call dbms_java.set_output(5000);
    call echo_input('It', 'works', 'now!');
    주의 : SQL*Plus에서 실행할 경우 먼저 'set serveroutput on'을
    해주시기 바랍니다.
    결과 화면
    SQL> set serveroutput on
    SQL> call dbms_java.set_output(5000);
    Call completed.
    SQL> call echo_input('It', 'works', 'now!');
    It
    works
    now!
    Call completed.
    SQL>
    Example
    Reference Documents

    제품 : ORACLE SERVER
    작성날짜 : 2002-09-27
    Oracle JVM (8.1.5 - 9.0.1)를 수동으로 설치하기
    ==============================================
    Purpose
    v 8.1.5, 8.1.6, 8.1.7 and 9.0.1에서 Oracle JVM의 모든 구성 요소
    를 설치하기 위해 실행해야 하는 sql script들을 설명하고,
    JVM이 성공적으로 설치되었는지 test program으로 확인해 봅니다.
    주의 : 이 script들은 반드시
    SYS 또는 INTERNAL 로 실행되어야만 합니다.
    'initjvm.sql' script는 JVM을 설치하기위해 필요합니다.
    그리고 그 외에 추가되는 script들은 각각에 설명된 추가적인
    기능을위해 실행되어야 하는 script들입니다.
    ("--"표시로 주석 처리가 되어 있습니다.)
    설치에 앞서 점검해야 할 사항
    다음은 권장되는 사항입니다.
    SHARED_POOL_SIZE >= 65 MB
    JAVA_POOL_SIZE >= 50 MB
    SYSTEM tablespace내에 50 MB 이상의 free space
    250 MB 이상의 rollback segment space
    주의 : 위 사항이 만족되지 않거나 부족한 경우 다음 에러가 발생하거나
    script실행 도중 hang이 걸릴 수 있습니다.
    ORA-3113 : end-of-file on communication channel
    ORA-4030 : out of process memory when trying to allocate %s bytes
    ORA-4031 : unable to allocate bytes of shared memory
    Explanation
    Oracle JVM을 수동으로 설치하기
    JVM version 8.1.5를 위한 script
    initjvm.sql 만 실행해 주면 됩니다.
    -------- Script jvm_install_815.sql start ------------------
    -- Setup a database for running Java and the ORB
    spool initjvm.log
    start @$ORACLE_HOME/javavm/install/initjvm.sql
    spool off
    -------- Script jvm_install_815.sql end ------------------
    JVM version 8.1.6를 위한 script
    -------- Script jvm_install_816.sql start ------------------
    -- Setup a database for running Java and the ORB
    spool initjvm.log
    start @$ORACLE_HOME/javavm/install/initjvm.sql
    spool off
    -- Initializes Java library needed by PL/SQL
    spool initplsj.log
    start @$ORACLE_HOME/rdbms/admin/initplsj.sql
    spool off
    -- Load AQ/JMS jar files into the database
    spool initaqjms.log
    start @$ORACLE_HOME/rdbms/admin/initaqjms.sql
    spool off
    -- Load RepAPI server classes and publish 'repapi' obj
    spool initrepapi.log
    start @$ORACLE_HOME/rdbms/admin/initrepapi.sql
    spool off
    -------- Script jvm_install_816.sql end ------------------
    Scripts needed for JVM version 8.1.7
    8.1.7에는 새로운 Java API와 component들이 추가되어
    수행해야 하는 script들이 더 많습니다.
    -------- Script jvm_install_817.sql start ------------------
    -- Setup a database for running Java and the ORB
    spool jvminst.log
    start @$ORACLE_HOME/javavm/install/initjvm.sql
    spool off
    -- Loads xml components into the JServer
    spool initxml.log
    start @$ORACLE_HOME/oracore/admin/initxml.sql
    spool off
    -- loads the XMLSQL Utility (XSU) into the database
    spool catxsu.log
    start @$ORACLE_HOME/rdbms/admin/catxsu.sql
    spool off
    -- JIS (OSE) installation
    spool init_jis.log
    start @$ORACLE_HOME/javavm/install/init_jis.sql
    spool off
    -- Turn on JAccelerator (ncomp) for JIS
    spool jisja.log
    start @$ORACLE_HOME/javavm/install/jisja.sql
    spool off
    -- Adds the set of default end points to the server
    -- with hardcoded values for the admin service
    spool jisaephc.log
    start @$ORACLE_HOME/javavm/install/jisaephc.sql
    spool off
    -- Load PLSQL Gateway Servlet jar files into the database
    spool initplgs.log
    start @$ORACLE_HOME/rdbms/admin/initplgs.sql
    spool off
    -- Install Oracle JSP
    spool initjsp.log
    start @$ORACLE_HOME/jsp/install/initjsp.sql
    spool off
    -- Turn on JAccelerator for JSP libs
    spool jspja.log
    start @$ORACLE_HOME/jsp/install/jspja.sql
    spool off
    -- Initializes Java library needed by PL/SQL
    spool initplsj.log
    start @$ORACLE_HOME/rdbms/admin/initplsj.sql
    spool off
    -- Load AQ/JMS jar files into the database
    spool initjms.log
    start @$ORACLE_HOME/rdbms/admin/initjms.sql
    spool off
    -- Load RepAPI server classes and publish 'repapi' obj
    spool initrepapi.log
    start @$ORACLE_HOME/rdbms/admin/initrepapi.sql
    spool off
    -- loads sql, objects, extensibility and xml related java
    spool initsoxx.log
    start @$ORACLE_HOME/rdbms/admin/initsoxx.sql
    spool off
    -- Configure OSE defauls admin Web Service
    spool jisaep.log
    start @$ORACLE_HOME/javavm/install/jisaep admin 8080 9090
    spool off
    -------- Script jvm_install_817.sql end ------------------
    JVM version 9.0.1 을 설치하기 위한 script
    Using the database configuration assistant, follwoing scripts will be
    executed:
    -- Setup a database for running Java and the ORB
    SQL>@$ORACLE_HOME/javavm/install/initjvm.sql;
    -- INITialize (load) XML components in JServer
    SQL>@$ORACLE_HOME/xdk/admin/initxml.sql;
    -- Loads NCOMP'ed XML Parser
    SQL>@$ORACLE_HOME/xdk/admin/xmlja.sql;
    -- loads the XMLSQL Utility (XSU) into the database.
    SQL>@$ORACLE_HOME/rdbms/admin/catxsu.sql;
    -- install the Oracle Servlet Engine (OSE)
    SQL>@$ORACLE_HOME/javavm/install/init_jis.sql <$ORACLE_HOME>;
    -- Adds the set of default end points to the server
    -- with hardcoded values for the admin service
    SQL>@$ORACLE_HOME/javavm/install/jisaephc.sql <$ORACLE_HOME>;
    -- turn on J Accelerator
    SQL>@$ORACLE_HOME/javavm/install/jisja.sql <$ORACLE_HOME>;
    -- register EJB/Corba Dynamic Registration Endpoint
    SQL>@$ORACLE_HOME/javavm/install/jisdr.sql 2481 2482;
    -- init Java server pages @$ORACLE_HOME@$ORACLE_HOME@$ORACLE_HOME
    SQL>@$ORACLE_HOME/jsp/install/initjsp.sql;
    -- turn on J Accelerator for JSP libs
    SQL>@$ORACLE_HOME/jsp/install/jspja.sql;
    -- script used to load AQ/JMS jar files into the database
    SQL>@$ORACLE_HOME/rdbms/admin/initjms.sql;
    -- load RepAPI server classes and publish 'repapi' obj
    SQL>@$ORACLE_HOME/rdbms/admin/initrapi.sql;
    -- loads sql, objects, extensibility and xml related java
    SQL>@$ORACLE_HOME/rdbms/admin/initsoxx.sql;
    -- Loads appctxapi.jar for JavaVm enabled Database.Called by jcoreini.tsc
    SQL>@$ORACLE_HOME/rdbms/admin/initapcx.sql;
    -- script used to load CDC jar files into the database
    SQL>@$ORACLE_HOME/rdbms/admin/initcdc.sql;
    -- Loads the Java stored procedures as required by the
    -- Summary Advisor.
    SQL>@$ORACLE_HOME/rdbms/admin/initqsma.sql;
    --Initialize sqlj type feature in 9i db
    SQL>@$ORACLE_HOME/rdbms/admin/initsjty.sql;
    --load java componenets for AQ HTTP Propagation
    SQL>@$ORACLE_HOME/rdbms/admin/initaqhp.sql;
    Test program으로 JVM test해보기
    Java Stored Procedure 만들기
    다음과 같은 순서로 Java Stored Procedure를 만들어 봅니다.
    1. Java program을 만듭니다.
    2. program을 database로 loading합니다.
    3. Java program을 SQL (PL/SQL Wrapper)로 publish합니다.
    4. SQL 또는 PL/SQL에서 만든 Java program을 호출합니다.
    Step 1: Java program을 만듭니다.
    ======
    EchoInput.java
    public class EchoInput {
    public static void main (String[] args){
    for (int i=0; i<args.length;i++)
    System.out.println(args);}}
    Step 2: program을 database로 loading합니다.
    ======
    UNIX prompt상에서 다음을 실행합니다:
    % loadjava -u scott/tiger -v -r EchoInput.java
    또는 SQL*Plus에서는 다음과 같이 할 수도 있습니다:
    CREATE OR REPLACE JAVA SOURCE NAMED "EchoInput" AS
    public class EchoInput { public static void main (String[] args) {
    for (int i=0; i<args.length;i++) System.out.println(args[i]);}}
    Step 3: Java program을 SQL (PL/SQL Wrapper)로 publish합니다.
    ======
    SQL 또는 PL/SQL에서 만든 Java program을 호출하기 위해서는
    Java program을 SQL (PL/SQL Wrapper)로 publish해야 합니다.
    이과정을 PL/SQL Wrapper를 만든다고도 합니다.
    일단 published/wrapped가 되면 SQL 또는 PL/SQL을 통해 호출될 수
    있습니다.
    예제 :
    create or replace procedure echo_input (
    s1 varchar2, s2 varchar2, s3 varchar2)
    as language Java
    name 'EchoInput.main(java.lang.String[])';
    Step 4: SQL 또는 PL/SQL에서 만든 Java program을 호출합니다.
    ======
    call dbms_java.set_output(5000);
    call echo_input('It', 'works', 'now!');
    주의 : SQL*Plus에서 실행할 경우 먼저 'set serveroutput on'을
    해주시기 바랍니다.
    결과 화면
    SQL> set serveroutput on
    SQL> call dbms_java.set_output(5000);
    Call completed.
    SQL> call echo_input('It', 'works', 'now!');
    It
    works
    now!
    Call completed.
    SQL>
    Example
    Reference Documents

  • Setting max bean pool size in MDB

    Hi,
    I need to set the max bean pool size for my MDB to 1. This MDB is a part of my application and is packaged in an ear.
    I tried to set it with the following annotation -
    import javax.ejb.*;
    @MessageDriven
    (mappedName = "MyQueue",
    name = "MyMDB",
    activationConfig = {
    @ActivationConfigProperty(propertyName="maxBeansInFreePool",
    propertyValue="1"),
    @ActivationConfigProperty(propertyName="initialBeansInFreePool",
    propertyValue="1"),
    @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue")
    However, this does not seem to work since I see the Current pool count on the WLS console as 3 after processing is done.
    After looking at various posts in this forum, I also tried it with weblogic ejbgen as follows-
    import weblogic.ejbgen.*;
    @MessageDriven(ejbName = "MyMDB",
    destinationType = "javax.jms.Queue",
    initialBeansInFreePool = "1",
    maxBeansInFreePool = "1",
    destinationJndiName = "MyQueue")
    However, with this the MDB did not get deployed in WLS.
    I am using Weblogic 10.3 / EJB 3.0.
    Any help on this is greatly appreciated.
    Thanks
    Meera

    As far as I know, it currently isn't possible to set max-beans-in-free-pool via annotations. You can use a deployment plan (configurable from console and/or follow the link supplied by atheek1).
    I think you can also automatically generate descriptors based on javadoc text via ejb-gen, I'm not quite sure if this tooling can work in conjunction with EJB 3.0 annotations. See http://download.oracle.com/docs/cd/E12840_01/wls/docs103/ejb/EJBGen_reference.html
    Tom

Maybe you are looking for