PL/SQL procedure is 10x slower when running from weblogic

Hi everyone,
we've developed a PL/SQL procedure performing reporting - the original solution was written in Java but due to performance problems we've decided to switch this particular piece to PL/SQL. Everything works fine as long as we execute the procedure from SQL Developer - the batch processing 20000 items finishes in about 80 seconds, which is a serious improvement compared to the previous solution.
But once we call the very same procedure (on exactly the same data) from weblogic, the performance seriously drops - instead of 80 seconds it suddenly runs for about 23 minutes, which is 10x slower. And we don't know why this happens :-(
We've profiled the procedure (in both environments) using DBMS_PROFILER, and we've found that if the procedure is executed from Weblogic, one of the SQL statements runs noticeably slower and consumes about 800 seconds (90% of the total run time) instead of 0.9 second (2% of the total run time), but we're not sure why - in both cases this query is executed 32742-times, giving 24ms vs. 0.03ms in average.
The SQL is
SELECT personId INTO v_personId FROM (            
        SELECT personId FROM PersonRelations
        WHERE extPersonId LIKE v_person_prefix || '%'
) WHERE rownum = 1;Basically it returns an ID of the person according to some external ID (or the prefix of the ID). I do understand why this query might be a performance problem (LIKE operator etc.), but I don't understand why this runs quite fast when executed from SQL Developer and 10x slower when executed from Weblogic (exactly the same data, etc.).
Ve're using Oracle 10gR2 with Weblogic 10, running on a separate machine - there are no other intensive tasks, so there's nothing that could interfere with the oracle process. According to the 'top' command, the wait time is below 0.5%, so there should be no serious I/O problems. We've even checked JDBC connection pool settings in Weblogic, but I doubt this issue is related to JDBC (and everything looks fine anyway). The statistics are fresh and the results are quite consistent.
Edited by: user6510516 on 17.7.2009 13:46

The setup is quite simple - the database is running on a dedicated database server (development only). Generally there are no 'intensive' tasks running on this machine, especially not when the procedure I'm talking about was executed. The application server (weblogic 10) is running on different machine so it does not interfere with the database (in this case it was my own workstation).
No, the procedure is not called 20000x - we have a table with batch of records we need to process, with a given flag (say processed=0). The procedure reads them using a cursor and processes the records one-by-one. By 'processing' I mean computing some sums, updating other table, etc. and finally switching the record to processed=1. I.e. the procedure looks like this:
CREATE PROCEDURE process_records IS
    v_record records_to_process%ROWTYPE;
     OPEN records_to_process;
          FETCH records_to_process INTO v_record;
          EXIT WHEN records_to_process%NOTFOUND;
          -- process the record (update table A, insert a record into B, delete from C, query table D ....)
          -- and finally mark the row as 'processed=1'
     END LOOP;
     CLOSE records_to_process;
END process_records;The procedure is actually part of a package and the cursor 'records_to_process' is defined in the body. One of the queries executed in the procedure is the SELECT mentioned above (the one that jumps from 2% to 90%).
So the only thing we actually do in Weblogic is
CallableStatement cstmt = connection.prepareCall("{call ProcessPkg.process_records}");
cstmt.execute();and that's it - there is only one call to the JDBC, so the network overhead shouldn't be a problem.
There are 20000 rows we use for testing - we just update them to 'processed=0' (and clear some of the other tables). So actually each run uses exactly the same data, same code paths and produces the very same results. Yet when executed from SQL developer it takes 80 seconds and when executed from Weblogic it takes 800 seconds :-(
The only difference I've just noticed is that when using SQL Developer, we're using PL/SQL notation, i.e. "BEGIN ProcessPkg.process_records; END;" instead of "{call }" but I guess that's irrelevant. And yet another difference - weblogic uses JDBC from 10gR2, while the SQL Developer is bundled with JDBC from 11g.

Similar Messages

  • Create trigger not audited when run from sql developer Version

    Creating or editing a trigger is not being stored in the audit table when run from sql developer.
    Here is a sample script to show the issue:
    Grant Connect,create table,create trigger To testuser Identified By testuser;
    create table testuser.testtab(t1 number);
    Select Count(*) From Dba_Audit_Trail Where Owner='TESTUSER';
    CREATE OR REPLACE TRIGGER testuser.testtab_bi_trg BEFORE
          ON testuser.testtab FOR EACH ROW
    Select Count(*) From Dba_Audit_Trail  Where Owner='TESTUSER';
    drop user testuser cascade;
    If I run the script from sql developer the CREATE TRIGGER statement does not get audited.
    If I run the script from sql plus or All Arround Automations PL/SQL Developer the CREATE TRIGGER statement does get audited.
    If I edit the trigger from sql developer the CREATE TRIGGER statement does not get audited.
    If I edit the trigger from  All Arround Automations PL/SQL Developer the CREATE TRIGGER statement does get audited.

    DoyleFreeman wrote:
    Not sure what you mean by "perform the audit".
    Have you tested my script? Does the "Select Count(*) From Dba_Audit_Trail  Where Owner='TESTUSER';" increment by 1 after each of the ddl statements or only after the Create table statement.
    Your question doesn't have ANYTHING to do with sql developer and should be posted in the Database General forum
    Yes - and it works just fine once you ENABLE AUDITING. Your scripIt  does NOT include the statements or code used to ENABLE auditing and, specifically, enable auditing for triggers.
    Auditing doesn't just 'happen'; you have to enable it and you have to specify any non-default auditing that you want to perform.
    Have you read any of the extensive documentation about auditing to learn how to use it?
    See the Database Security Guide
    Also see 'Auditing Functions, Procedures, Packages, and Triggers
    And see the AUDIT statement in the SQL language doc for how to specify auditing of specific operations.
    Select count(*) From Dba_Audit_Trail  Where (Owner='SCOTT' or username = 'SCOTT')
    and action_name = 'CREATE TRIGGER';
    audit create trigger by scott
          ON emp_copy FOR EACH ROW
    Select count(*) From Dba_Audit_Trail  Where (Owner='SCOTT' or username = 'SCOTT')
    and action_name = 'CREATE TRIGGER';

  • Opening Excel Workbook Fails when run from Scheduled Task on Windows Server 2008 Rw

    I have a little vbs script that instantiates the Excel.Application object and then opens a work book to perform some tasks on it. The script runs fine when run from the command line. When I attempt to run it as a scheduled task (it is supposed to update
    data that is pulled from a SQL Server at regular intervals), it fails with the following error:
    Microsoft Office Excel cannot access the file 'c:\test\SampleWorkbook.xlsm'. There are several possible reasons: .....
    The file does exist. The path reported in the error is correct. The account under which the task is running is the same account I use to run it from the command line. User Account Control is not enabled, and the task is set up to run with highest privileges.
    When I run the same script through the Task Scheduler from a Windows Server 2003 machine, it works without issue.
    I was just wondering if somebody on this forum has run into a similar issue in connection with Windows Server 2008 R2 and figured out what the magic trick is to make it work. I'm sure it is rights related, but I haven't quite figured out what which rights
    are missing.
    Thanks in advance for any advice you may have.

    This is truly killing me ... trying to get it working on Windows Server 2012 without success.
    I desperately need to automate running Excel macros in a "headless" environment, that is non-interactive, non-GUI, etc.
    I can get it to work using Excel.Application COM, either via VBScript or Powershell, successfully on many other Windows systems  in our environment - Windows Server 2008 R2, Windows 7 (32-bit), etc.,  -BUT-
    The two servers we built out for running our automation process are Windows Server 2012 (SE) - and it just refuses to run on the 2012 servers - it gives the messages below from VBScript and PowerShell, respectively- 
    I have tried uninstalling and re-installing several different versions of Microsoft Excel (2007 Standard, 2010 Standard, 2010 Professional Plus, 32-bit vs. 64-bit, etc.), but it makes no difference.
    Would be extremely grateful if any one out there has had any success in running Excel automation on Server 2012 in a non-interactive environment that they could share.
    ( I have tried adding the "%windir%\syswow64\config\systemprofile\desktop"
    folder, which did fix the issue for me when testing on Windows Server 2008 R2, but sadly did not resolve it on Windows Server 2012 )
    [VBScript error msg]
    Z:\TestExcelMacro.vbs(35, 1) Microsoft Office Excel: Microsoft Office Excel cannot
    access the file 'Z:\TestExcelMacro.xlsm'. There are several possible reasons:
    • The file name or path does not exist.
    • The file is being used by another program.
    • The workbook you are trying to save has the same name as a currently open work
    [Powershell error msg]
    Exception calling "Add" with "0" argument(s): "Microsoft Office Excel cannot open or save any more documents because th
    ere is not enough available memory or disk space.
     To make more memory available, close workbooks or programs you no longer need.
     To free disk space, delete files you no longer need from the disk you are saving to."
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : ComMethodTargetInvocation
    You cannot call a method on a null-valued expression.
        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
        + FullyQualifiedErrorId : InvokeMethodOnNull

  • My HP dv6 1030us laptop becomes slow when removed from AC power

    My HP DV6 laptop has windows 7 operating system and it behaves pretty weirdly .
    It becomes really slow when removed from AC Power and have to restart my system to bring it to normal speed don't know why its behaving like that and help to resolve the problem would be greatly appreciated and also my system gets overheated a lot and I have to use a cooling pad always to keep it cool and running properly along with AC power
    I would greatly appreciate any advice in resolving these issues.
    Thanks in advance.

    for how long have you had this laptop... If you had it for longer than a year you may be dealing with a dust bunny (acumulation of dust in the vent that's right beside the fan). Normally when that vent is clogged you get the type of overhetaing you may be experiencing, so i recomend you to open it up and give it a nice clean as soon as you can. As for your computer slowing down without the ac adapter.
    Do you know under what power option are you running ur computer?

  • Failed to initialize  Databank exception when run from OLT

    HI All,
    I've created a script with an associated databank,that runs perfectly fine when run from OpenScript. But when I run from OLT, the following waring is encountered.
    Start failure message from agent "OLT Server": oracle.oats.common.databank.DatabankException: Failed to initialize Databank 'Forms.forms'
    Stopped Autopilot because of error on agent "OLT Server".
    Name of my DB is : forms
    and Script name is :Forms
    Please let me know the solution for this.
    Edited by: user777720 on May 21, 2013 5:00 AM

    Have you tried changing the parameter in the Assets/Databank "Save Path" from "Relative to current script" to "Relative to a repository"?
    Regards, Ian.

  • Hizzing / bad sound when running from battery power (Ups)?:

    Why is my computer (Imac) emitting a hizzing sound when running from the UPS (battery)? I am testing a offline UPS type: POWERWARE Eaton Protection Station UPS 500VA 250W. My Imac is suppose to use max 200 watts of electrity (Imac 24 inch. intel 2.8 Ghz, 4 GB memory). When running from AC there is no sound. When testing (pulling out the cord on the UPS the Imac starts emitting a disturbing hizz / sound)???

    I solved it my self. It was OK (no buzz and fuzz) when it was plugged in (when the electicity line was down once and I was running on the UPS battery).....

  • Hyperlink in pdf is missing when run from server.

    I create a link for a field in a report (using Hyperlink tab Hyperlink information).  When I export the pdf from Crystal Report, I could see the link when mouse over the field.  But when I run the report from opendocumentfrom server) , the link is missing.  Does Crystal Report support hyperlink in pdf when run from server?  Or do I miss anything?
    Thanks for your help in advance.

    Moving to BusinessObject forum

  • Jdbc connection blocks when run from jar

    The following code establishes a connection EXCEPT when run from within a jar file:
    String jdbcDriverName = "oracle.jdbc.driver.OracleDriver";
    String dbConnectionURL = "jdbc:oracle:thin:@";
    String userName = "mdo";
    String password = "mdpass";
    // Load the JDBC driver and create a connection to the database
    Class.forName( jdbcDriverName );
    OracleDataSource dataSource = new OracleDataSource();
    dataSource.setURL( dbConnectionURL );
    dataSource.setUser( userName );
    dataSource.setPassword( password );
    connection = dataSource.getConnection();
    When run from a jar file, the application does not execute beyond the line:
    connection = dataSource.getConnection();
    No exceptions are thrown, it just appears that getConnection never returns.
    Do I need to do anything different to execute this code from within a jar file?
    Thanks in advance,

    When building the JAR file, I inadvertently included files from two Oracle JDBC driver versions (1.2 and 1.4). I was building a single jar file with all files in it.
    I am guessing same named files existed in both driver JARs and caused "confussion" when combined into the single JAR.
    Still, I would have expected an exception to be thrown or a null connection to be returned instead if the thread just blocking.
    Thanks for all replies,

  • Microsoft Dynamics AX WebSession() is null in Enterprise Portal when running from a List Page.

    Microsoft Dynamics AX WebSession() is null in Enterprise Portal (EP) when running from a List Page.  
    The WebSession() works for a detail page, but nor a list page in EP.
    Does anyone know of a workaround to this issue?

    You should ask in the Microsoft Dynamics Community Forums.
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book:
    Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

  • Scim makes leafpad take a while to load, except when run from terminal

    Leafpad normally loads up in an instant. But with scim running (More specifically with the required environment variables exported. Scim simply running without the environment variables does not cause the problem, but then scim does not work.), although it shows up immediately, the scrollbar, menubar etc are greyed out for a few seconds and the program cannot be used until it is fully loaded.
    I'm sure this is specifically a leafpad problem, because there is no noticable lag in other programs. (Mousepad for example is fine.) However, the fact that it loads immediately when run from a terminal scares me. Why doesn't gmrun (and the fvwm menu) work just like a terminal? Is there a possible fix to this problem?

    droog wrote:
    I'm not having this problem as far as i can see, I use fvwm and scim already so installed leafpad to test and it starts instantly from fvwm's menu or terminal.
    from gmrun leafpad starts instantly too so maybe i'm missing something.
    what are you exporting?
    Just the normal:
    export XMODIFIERS=@im=SCIM
    export GTK_IM_MODULE="scim"
    export QT_IM_MODULE="scim"

  • Subreport not displayed when Run from SAP Business One

    We have a crystal report that displays a subreport when it is run from within the Crystal 2008 Designer but not when run from within SAP. Has anybody else seen this error? We have tried importing it into SAP and checking the connections of the report and subreport etc but to no avail.

    The main report is a document layout with the sub report linked into it using the DocEntry key field from SAP. The subreport should display data based on that link.
    This main report only has the one sub report and when you preview in Crystal it returns data, when you preview using the same criteria but inside of SAP, it is not displayed.

  • Class not being created when running from jar

    Hi all,
    Tech info first:
    IDE: Sun Java Studio Enterprise 8
    Plaform: windows xp
    I have created a Swing app, that connects to a com port(using the RXTXcomm). now, when I run the app in the IDE, everything is fine and dandy, but, when I run the jar file, the application loads, but the class in the app which deals with the com port is not created. here is the code:
        private static void createAndShowGUI() {
            //Make sure we have nice window decorations.
            Main receiver = new Main();
            //Create and set up the window.
            frame = new JFrame("R�FILOG RFID Empf�nger");
            //Display the window.
            portListener = new RFIDReaderComm(receiver, "COM3");
        public static void main(String[] args) {
            //Schedule a job for the event-dispatching thread:
            //creating and showing this application's GUI.
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
    portListener in the createAndShowGUI() function is an interface level parameter and is the class that is not being created. There is no error message.
    If I move the two lines that deal with the port listener before the frame.pack() line, then the GUI is not even loaded, and when I view the processes in the task manager, the process starts and then quits without anything becoming visible. So from this I guess there is a problem with creating the class when running from a jar, but without any error messages, I have not a clue where to start...can anyone help?
    thanks in advance.

    Well, some more info, so maybe someone can come up with some tips for me...this is really important, and any help is greatly appreciated.
    This is obviously a classpath problem. After running the my jar file with java -jar I finally got the error NoClassDefFoundError
    Kind of obvious I suppose. But, I cannot seem to get the two jar files I need into the classpath. I have tried the following:
    Updating my computers CLASSPATH with the relevant paths - not working
    Trying to get the Sun Java Studio Enterprise to build the required jar files into the final package - cannot get this to work
    Tried updating the in the following way:
    Created a text file Manifest.txt with the lines:
    Class-Path: RXTXcomm.jar
    Class-Path: BrowserLauncher2-10rc4.jar
    ran the command (in the same directory as Manifest.txt):
    jar cfm RUFILOGScanner.jar Manifest.txt classes/*.class
    but this does not work either. When I run: jar tf RUFILOGScanner.jar all I get is:
    the classes I want added are not there. Plus, (I think this is because I am running SE8) the is not in a folder called META-INF. In fact, I have no folder called META-INF. Is this significant?
    Please, can anyone help me?

  • Java application behaving differently when run from netbeans

    When i run my program from netbeans it receives packets from ip addresses which are not in my subnet
    but when i run it from outside netbeans it doesn't receives packets from ip addresses which are not in my subnet.
    Can anybody explains why my application is showing different behavior when run from netbeans and when run independently?

    Bingo! My script started the rmiregistry and continued on to start the servers. Apparently, it was too quick. I put a 10 second delay after the rmiregistry startup and all is working as it should.
    Thanks for your help. You get the Duke dollars if I can figure out how that works.

  • ZBook 17 g2 - poor DPC Latency performance when running from z Turbo Drive PCIe SSD

    I'm setting up a new zBook 17 g2 and am getting very poor DPC latency performance (> 6000 us) when running from the PCIe SSD. I've re-installed the OS (Win 7 64 bit) on both the PCIe SSD and a SATA HDD and the DPC latency performance is fine when running from the HDD (50 - 100 us) but horrible when running from the PCIe SSD (> 6000 us).  I've updated the BIOS and tried every combination of driver and component enabling/disabling I can think of.  The DPC latency is extremely high from the initial Windows install with no drivers installed.  Adding drivers seems to have no effect on the DPC latency. Before purchasing the laptop I found this review: where the DPC latency measurement (middle of the page) looks OK.  Of course, this is the prior version of the laptop and I believe it does not have the PCIe SSD.  Combining that with the fact that I get fine performance when running from the HDD I am led to believe that the PCIe SSD is the cause of the problem. Has anyone found a solution to this problem?  As it stands right now my zBook is not usable for digital audio work when running from the PCIe SSD.  But it cost me a lot of money so I'd sure like to use it...! Thanks, rgames

    Hi mooktank, No solution yet but, as of about six weeks ago, HP at least acknowledged that it's a problem (finally).  I reproduced it perfectly on another zBook 17 g2 and another PCIe SSD in the same laptop and HP was able to reproduce the problem as well.  So the problem is clearly in the BIOS or with some driver related to the PCIe SSD.  It could also be with the firmware in the drive, itself, but I can't find any other PCIe drives in the 60 mm form factor.  So there's no way to see if a differnt type of drive would fix the problem. My suspicion is that it's related to the PCIe sleep states - those are known to cause exactly these types of problems because the drive takes quick "naps" to save power and there's a delay when it is told to wake back up.  That delay causes a delay in the audio buffer that results in pops/crackles/stutters that would never be noticed doing other tasks like video editing or CAD work .  So it's a problem specific to folks who need low-latency audio performance (very few apps require low latency audio - video editing, for example, uses huge buffers with relatively high latency).  A lot of desktops offer a BIOS option to disable those sleep states but no such option exists in HP's BIOS for that laptop.  In theory you can do it from within Windows but it doesn't have an effect on my system.  That might be one of those options that Windows allows you to change but that actually has no effect. One workaround is to disable CPU throttling.  That makes the CPU run at full speed all the time and, I believe, also disables the PCIe and other sleep states.  When I disable CPU throttling, DPC latency goes back to normal.  However, the CPU is then running full-speed all the time so your battery life basically goes to nothing and the laptop gets *very* hot. Clearly that is not necessary because the laptop runs fine from the SATA SSD.  HP needs to fix the latency problem associated with the PCIe drive. The next logical step is to provide a BIOS update that provides a way to disable the PCIe sleep states without disabling CPU throttling, like on many desktop systems.  The bad news is that HP tech support is not very technical, so it takes forever for them to figure out what I'm talking about.  It took a couple months for them to start using the DPC Latency checker. Hopefully there will be a fix at some point... in the meantime, I hope that HP sends me a check for spending so much time educating their techs on how computers work.  And for countless hours lost re-installing different OSes only to show that the performance is exactly the same as shown in the DPC Latency checker. rgames

  • Issue with Enter-PSSession when running from the shell and via script

    Can someone please help me with the following issue
    If I open the PowerShell console and do the following
    Enter-PSSession -computername Server1
    "This is a test" > C:\Log.txt
    It works e.g. the Log.txt file is create as expected on Server1
    However if I put the exact same command in a script and execute the script.
    The Log.txt file is created on my Client (e.g. PC) and not the Server1
    I also tried using $Session = New-PSSession -ComputerName Server1 etc.....
    then Enter-PSSession -Session $Session
    I also tried Enter-PSSession etc....
    Start-Sleep -seconds 60
    "This is a test" > C:\Log.txt
    Again no luck when running from shell all OK, then executing as a script (again from the command line) files is created on client
    Any ideas why this is happening please and how to resolve, I am using PowerShell v4 on the client and PowerShell v2 on the Server

    No, the command is explicitly designed for interactive use, not within a script. If you see you'll even see it clearly state that it "Starts an interactive session with a remote computer".
    There are quite a few threads elsewhere on the same subject, all of which say the same thing, for instance and and and
    So when you run it interactively, you've started the interactive connection to the remote computer and are now running the relevant commands on that machine. When you run it from the script it starts the remote connection, but crucially it doesn't use that
    new connection, the script is still being run in the current local session.
    When you think about it makes sense. Using the Invoke-command method you're connecting to a remote machine, sending the script block to the remote machine, and then running that block of code on the remote machine. The remote machine only knows about the
    code you send it, not the rest of the script (which is why if you use variables you have to pass them to invoke-command otherwise they won't be available to the script block on the remote machine. Conversely, when you use the Enter-PSSession method, you've
    connected to the remote machine, but you haven't passed any code to it. At that point you're on the remote machine, but it has no way to know what you want it to do since your script code is on the local machine. It can then either return to the local
    machine and run the next line of code locally (which it does), or sit there connected to the remote machine waiting input that will never come (which would be even less useful).

Maybe you are looking for

  • Error while opening a Data base view

    Iam getting error while opening  a database view saying view is not maintained at the database level. what i should do

  • What is stander width in html web page?

    Is there stander width for web pages? Sometimes I found who said it is should be 730px as max, is this right? If not then, how I should be chose a width of my page to clear and nice in difference browsers with difference resolution of monitor I wish

  • Error 4MEM/61/40000000: 0x8317eb18

    I everyone, I have some problems with my Macbook Pro late 2011, I ran the Hardware Test, and it tell me now that i have a error 4MEM/61/40000000: 0x8317eb18... Can anyone know how to fix this ? Thank you a lot. (Sorry for the english mistakes, I'm fr

  • Where have lib32-libxxf86vm lib32-gcc-libs and wine gone?

    Im just installed 64bit arch, as i couldnt get gpu folding to with with ubuntu, i had arch 64bit workin a few months ago no problems, this install, i cannot install wine or the foldingathome-gpu-nvidia packages because they have missing dependencies,

  • Why is capacity on my ipod classic is significantly lower than expected?

    I have a new 80 GB ipod classic. I loaded it with about 4 GB's or so of music in the first couple of days. Then on the the third day when I tried to add more music, it erased everything off the ipod that I had loaded previously and replaced it with t