Long Running SQL and ORDS Spawns Multiple Database Sessions

Hi all.
We have a strange situation when accessing a long running SQL Report (a single APEX Page).
The SQL takes about 15 mins to run but when I monitor what database sessions are spawned by the APEX Listener, I see multiple sessions all executing the same SQL. It appears that after 6 minutes, the APEX Listener spawns a new database session to execute the same SQL.
Has anyone seen this before and if so, is there a key setting I am missing as I don't want this to happen. I am new to the APEX Listener and WebLogic so apologies if this is the way it's meant to work but it seems odd that after a certain amount of time (6 minutes in my case) a new database session is spawned to do the same work.
We are running:
WebLogic: 10.3.0.6
APEX_LISTENER_VERSION 2.0.0.354.17.06
Datadate: 11.2.0.3.0 Production
APEX: 4.2.1.00.08
Cheers for any help.
Duncs

Hi Duncan,
With all respect, you should please rethink your interface.  I would never consider writing a Web application with a request that knowingly takes 15 minutes to return the results.  You can consider doing this asynchronously via DBMS_SCHEDULER and then alerting the user (via email, perhaps) that their results are ready.  Or if you can precompute this in advance, consider using materialized views so that the user's response time is sub-second.
In an era where the patience of the average end-user is measured in single-digit seconds, it is impractical to ever expect an end-user to wait 15 minutes for their resultant Web page.
Joel

Similar Messages

  • Running SQL and Reports in Multiple LMS's

    Hi,
    We have an Oracle ilearning implementation that covers a number of subjects. The Ilearning system/database is partioned for each subject with each subject having the same schema and database objects. The only thing that is different is the data within the tables etc... I occasionally have to run SQL reports on all these partitioned databases. The only I can do this is to switch context from subject partition to subject partition. I was wondering if there is a quick way (one time SQL execution) to run the SQL report against all the partitions we have in total 18 subject partitions. Not having this ability means I have to run the same SQL multiple times which is a very time consuming exercise. I would preferably like to do this at the database end using SQL developer.
    Your help and advice will be greatly appreciated.
    Thanks

    Hi Scott,
    Yes you are right I am referring to site. At the moment I have been created a 'user' that has access to the database objects in the ILEARN schema via synonyms. So this means having access to the ILEARN schema will allow me to use one single piece of SQL to report accross the 18 different sites we have and pull all the data into a single report. Currently, I have to report site by site and have 18 outputs for each SQL I run. We have to run 4 SQL statements and I'd rather have 4 outputs with all 18 site data in each of these outputs.
    Thanks

  • Is there a way to get long running SQL Agent jobs information using powershell?

    Hi All,
    Is there a way to get long running SQL Agent jobs information using powershell for multiple SQL servers in the environment?
    Thanks in Advance.
    --Hunt

    I'm running SQL's to fetch the required details and store it in centralized table. 
    foreach ($svr in get-content "f:\PowerSQL\Input\LongRunningJobsPowerSQLServers.txt"){
    $dt = new-object "System.Data.DataTable"
    $cn = new-object System.Data.SqlClient.SqlConnection "server=$svr;database=master;Integrated Security=sspi"
    $cn.Open()
    $sql = $cn.CreateCommand()
    $sql.CommandText = "SELECT
    @@SERVERNAME servername,
    j.job_id AS 'JobId',
    name AS 'JobName',
    max(start_execution_date) AS 'StartTime',
    max(stop_execution_date)AS 'StopTime',
    max(avgruntimeonsucceed),
    max(DATEDIFF(s,start_execution_date,GETDATE())) AS 'CurrentRunTime',
    max(CASE WHEN stop_execution_date IS NULL THEN
    DATEDIFF(ss,start_execution_date,stop_execution_date) ELSE 0 END) 'ActualRunTime',
    max(CASE
    WHEN stop_execution_date IS NULL THEN 'JobRunning'
    WHEN DATEDIFF(ss,start_execution_date,stop_execution_date)
    > (AvgRunTimeOnSucceed + AvgRunTimeOnSucceed * .05) THEN 'LongRunning-History'
    ELSE 'NormalRunning-History'
    END) 'JobRun',
    max(CASE
    WHEN stop_execution_date IS NULL THEN
    CASE WHEN DATEDIFF(ss,start_execution_date,GETDATE())
    > (AvgRunTimeOnSucceed + AvgRunTimeOnSucceed * .05) THEN 'LongRunning-NOW'
    ELSE 'NormalRunning-NOW'
    END
    ELSE 'JobAlreadyDone'
    END)AS 'JobRunning'
    FROM msdb.dbo.sysjobactivity ja
    INNER JOIN msdb.dbo.sysjobs j ON ja.job_id = j.job_id
    INNER JOIN (
    SELECT job_id,
    AVG
    ((run_duration/10000 * 3600) + ((run_duration%10000)/100*60) + (run_duration%10000)%100)
    +
    STDEV
    ((run_duration/10000 * 3600) + ((run_duration%10000)/100*60) + (run_duration%10000)%100) AS 'AvgRuntimeOnSucceed'
    FROM msdb.dbo.sysjobhistory
    WHERE step_id = 0 AND run_status = 1
    GROUP BY job_id) art
    ON j.job_id = art.job_id
    WHERE
    (stop_execution_date IS NULL and start_execution_date is NOT NULL) OR
    (DATEDIFF(ss,start_execution_date,stop_execution_date) > 60 and DATEDIFF(MINUTE,start_execution_date,GETDATE())>60
    AND
    CAST(LEFT(start_execution_date,11) AS DATETIME) = CAST(LEFT(GETDATE(),11) AS DATETIME) )
    --ORDER BY start_execution_date DESC
    group by j.job_id,name
    $rdr = $sql.ExecuteReader()
    $dt.Load($rdr)
    $cn.Close()
    $dt|out-Datatable
    Write-DataTable -ServerInstance 'test124' -Database "PowerSQL" -TableName "TLOG_JobLongRunning" -Data $dt}
    You can refer the below link to refer out-datatable and write-dataTable function.
    http://blogs.technet.com/b/heyscriptingguy/archive/2010/11/01/use-powershell-to-collect-server-data-and-write-to-sql.aspx
    Once we've the table details, I'm sending one consolidated email to automatically.
    --Prashanth

  • Long running sql

    Hi All,
    I have a long running sql which I am tuning for oltp environment.
    Here is the sql
    explain plan for
    SELECT a.* ,rownum as rnm
    FROM ( SELECT /*+ FIRST_ROWS(100) STAR_TRANSFORMATION PARALLEL(PLS,2) */
    /* End of Hint in Query Builder */
    PLD.PRVDR_LCTN_IID AS "ProviderLocationIid", PLD.PRVDR_LCTN_DTL_SID AS "ProviderLocationDetailSid",
    PLD.ENRLMNT_TYPE_CID AS "EnrollMentTypeCid", PLD.PRVDR_TYPE_CODE AS "ProviderTypeCode",
    PLD.MAINECARE_ID AS "Provider Id", PLD.PRVDR_NAME AS "Provider Name",
    PLD.PRVDR_TYPE_CODE || '-' || PLD.PRVDR_TYPE_NAME AS "Provider Type",
    TO_CHAR(PLS.FROM_DATE,'MM/dd/yyyy') AS "Start Date",
    TO_CHAR(PLS.TO_DATE,'MM/dd/yyyy') AS "End Date", PLD.COUNTY_NAME AS "County",
    PLD.CITY_TOWN_NAME AS "Town", PLD.ENRLMNT_TYPE_NAME AS "Enrollment Type",
    PLS.STATUS_CID AS "StatusCid", STSBS.STATUS_NAME AS "Business Status",
    PLD.LCTN_PHONE_NMBR AS "Phone Number", PLD.PRVDR_TYPE_NAME AS "PrvdrTypeName",
    SP.SPCLTY_CODE||'-'||SP.SPCLTY_NAME ||'/'|| SP1.SPCLTY_CODE||'-'||
    SP1.SPCLTY_NAME AS "Specialty/Subspecialty",
    UPPER(SP1.SPCLTY_CODE) AS "SubSpclty", UPPER(SP.SPCLTY_CODE) AS "Spclty"
    FROM /*Query Builder Clause*/
    STATUS STS,
    STATUS STSBS,
    SPECIALTY_SUBSPECIALTY SSP,
    (SELECT PRVDR_LCTN_STATUS_SID, PRVDR_LCTN_IID, PRVDR_LCTN_DTL_SID, FROM_DATE, TO_DATE,
    STATUS_TYPE_CID, STATUS_CID, OPRTNL_FLAG,
    FN_GETANCHORDT(FROM_DATE,TO_DATE) AS ANCHOR_DATE
    FROM PRVDR_LCTN_STATUS
    WHERE STATUS_TYPE_CID = 1
    AND OPRTNL_FLAG = 'A'
    ) PLS,
    PRVDR_LCTN_X_SPCLTY_SUBSPCLTY PXSP,
    PRVDR_LCTN_STATUS PLSBS,
    PROVIDER_LOCATION_DETAIL PLD,
    SPECIALTY SP1,
    SPECIALTY SP
    WHERE
    STS.STATUS_TYPE_CID = 1
    AND STS.STATUS_CID = 2
    AND STSBS.STATUS_TYPE_CID = 15
    AND PLSBS.OPRTNL_FLAG = 'A'
    --          UPPER(UPPER(SP1.SPCLTY_CODE)) LIKE UPPER('1%')
              AND SP1.SPCLTY_CODE LIKE '1%'
    -- AND UPPER(UPPER(SP.SPCLTY_CODE)) LIKE UPPER('1%')
    AND SP.SPCLTY_CODE LIKE '1%'
    AND PLS.OPRTNL_FLAG = 'A'
    AND SP1.OPRTNL_FLAG = 'A'
    AND PXSP.OPRTNL_FLAG = 'A'
    AND PXSP.STATUS_CID = 2
    AND SSP.OPRTNL_FLAG = 'A'
    AND SP.OPRTNL_FLAG = 'A'
    AND PLS.ANCHOR_DATE >= PLSBS.FROM_DATE
    AND PLS.ANCHOR_DATE <= PLSBS.TO_DATE
    AND PLS.STATUS_TYPE_CID = STS.STATUS_TYPE_CID
    AND PLS.STATUS_CID = STS.STATUS_CID
    AND PLD.PRVDR_LCTN_DTL_SID = PLS.PRVDR_LCTN_DTL_SID
    AND PLSBS.PRVDR_LCTN_IID = PLS.PRVDR_LCTN_IID
    AND PLSBS.STATUS_TYPE_CID = STSBS.STATUS_TYPE_CID
    AND PLSBS.STATUS_CID = STSBS.STATUS_CID
    AND PLS.ANCHOR_DATE >= SP1.FROM_DATE
    AND PLS.ANCHOR_DATE <= SP1.TO_DATE
    AND PXSP.PRVDR_LCTN_IID = PLS.PRVDR_LCTN_IID
    AND PXSP.SPCLTY_SUBSPCLTY_SID = SSP.SPCLTY_SUBSPCLTY_SID
    AND PLS.ANCHOR_DATE >= PXSP.FROM_DATE
    AND PLS.ANCHOR_DATE <= PXSP.TO_DATE
    AND SSP.SPCLTY_CODE = SP.SPCLTY_CODE
    -- AND SSP.SUBSPCLTY_CODE = SP1.SPCLTY_CODE
    AND SSP.SUBSPCLTY_CODE = SP1.SPCLTY_CODE
    AND PLS.ANCHOR_DATE >= SSP.FROM_DATE
    AND PLS.ANCHOR_DATE <= SSP.TO_DATE
    AND PLS.ANCHOR_DATE >= SP.FROM_DATE
    AND PLS.ANCHOR_DATE <= SP.TO_DATE
    ORDER BY /*Query Builder Clause*/
    "Provider Id" DESC
    ) A
    WHERE rownum < 101
    Here is the Emplain plan
    SQL> @c:\mohammed\tune\UTLXPLS
    Plan Table
    | Operation | Name | Rows | Bytes| Cost | Pstart| Pstop |
    | SELECT STATEMENT | | | | | | |
    | COUNT STOPKEY | | | | | | |
    | VIEW | | | | | | |
    | SORT ORDER BY STOPKEY | | 1 | 358 | 120 | | |
    | SORT ORDER BY STOPKEY | | | | | | |
    | NESTED LOOPS | | 1 | 358 | 117 | | |
    | NESTED LOOPS | | 1 | 313 | 116 | | |
    | NESTED LOOPS | | 1 | 268 | 115 | | |
    | NESTED LOOPS | | 1 | 240 | 114 | | |
    Plan Table
    | NESTED LOOPS | | 1 | 209 | 112 | | |
    | NESTED LOOPS | | 1 | 95 | 111 | | |
    | NESTED LOOPS | | 1 | 74 | 110 | | |
    | NESTED LOOPS | | 7 | 294 | 103 | | |
    | INDEX UNIQUE SCAN |SYS_C00489936 | 1 | 7 | | | |
    | TABLE ACCESS FULL |PRVDR_LCTN_STATUS | 1K| 53K| 102 | | |
    | TABLE ACCESS BY INDEX ROWID |PRVDR_LCTN_STATUS | 57K| 1M| 2 | | |
    | INDEX RANGE SCAN |TUNE_PNBS2_1 | 57K| | 1 | | |
    | TABLE ACCESS BY INDEX ROWID |STATUS | 5 | 105 | 1 | | |
    | INDEX UNIQUE SCAN |SYS_C00489936 | 5 | | | | |
    | TABLE ACCESS BY INDEX ROWID |PROVIDER_LOCATION_D | 40K| 4M| 1 | | |
    Plan Table
    | INDEX UNIQUE SCAN |XPKPROVIDER_LOCATIO | 40K| | | | |
    | TABLE ACCESS BY INDEX ROWID |PRVDR_LCTN_X_SPCLTY | 1M| 39M| 3 | | |
    | INDEX RANGE SCAN |TUNE_SARWAR_0503200 | 1M| | 2 | | |
    | TABLE ACCESS BY INDEX ROWID |SPECIALTY_SUBSPECIA | 549 | 15K| 1 | | |
    | INDEX UNIQUE SCAN |SYS_C00489888 | 549 | | | | |
    | TABLE ACCESS BY INDEX ROWID |SPECIALTY | 11 | 495 | 1 | | |
    | INDEX UNIQUE SCAN |SYS_C00489875 | 11 | | | | |
    | TABLE ACCESS BY INDEX ROWID |SPECIALTY | 11 | 495 | 1 | | |
    | INDEX UNIQUE SCAN |SYS_C00489875 | 11 | | | | |
    32 rows selected.
    I have tried with several hints and several driving tables and tires. Any help in this regard will be highly appreciated.
    Thanks a lot,
    Mohammed Sarwar
    ocp dba
    Email: [email protected]
    [email protected]
    Phone : 301-944-2029 w
    913-484-9204 cell

    This should be better. Any help on tuning the above sql statement using the following explain plan will be highly appreciated.
    Plan Table
    | Operation ------------------| Name -------------| Rows | Bytes| Cost | Pstart| Pstop |
    | SELECT STATEMENT -----------| ------------------| -----| -------|------| | |
    | COUNT STOPKEY --------------|-------------------|------|--------|------| | |
    | VIEW -----------------------|-------------------|----- | -------| -----| | |
    | SORT ORDER BY STOPKEY ------|------------------ |--- 1 | ---358 | 120 -| | |
    | SORT ORDER BY STOPKEY ------| ------------------|----- |------- | -----| | |
    | NESTED LOOPS ---------------|-------------------|--- 1 |--358 -|- 117 | | |
    | NESTED LOOPS ---------------|----------------- -|--- 1 | -313 -| -116 | | |
    | NESTED LOOPS ---------------|----------------- -|--- 1 | 268-- | 115 -| | |
    | NESTED LOOPS--------------- |-------------------| --1- | -240 -| -114 | | |
    Plan Table
    | NESTED LOOPS--------------- |------------------ | ---1 |- 209 -|- 112 | | |
    | NESTED LOOPS--------------- | ------------------|--- 1 |-- 95- | -111 | | |
    | NESTED LOOPS ---------------|----- -------------|--- 1 |-- 74 -| -110 | | |
    | NESTED LOOPS ---------------|----------------- -|--- 7 | -294- |- 103| | |
    | INDEX UNIQUE SCAN ----------|SYS_C00489936------| ---1 |--- 7--|-----| | |
    | TABLE ACCESS FULL ----------|PRVDR_LCTN_STATUS -| --1K | 53K-- | 102 | | |
    | TABLE ACCESS BY INDEX ROWID |PRVDR_LCTN_STATUS- | 57K -|---- 1M|-- 2 | | |
    | INDEX RANGE SCAN -----------|TUNE_PNBS2_1 ------| 57K- |------ |-- 1 | | |
    | TABLE ACCESS BY INDEX ROWID |STATUS------------ | 5 |105----|-- 1 | | |
    | INDEX UNIQUE SCAN---------- |SYS_C00489936 -----| 5--- | ------|-----| | |
    | TABLE ACCESS BY INDEX ROWID-|PROVIDER_LOCATION_D| 40K | 4M----|-- 1 | | |
    Plan Table
    | INDEX UNIQUE SCAN ----------|XPKPROVIDER_LOCATIO| 40K |----- |----- | | |
    | TABLE ACCESS BY INDEX ROWID-|PRVDR_LCTN_X_SPCLTY| 1M -|---39M|--- 3 | | |
    | INDEX RANGE SCAN -----------|TUNE_SARWAR_0503200| 1M -| -----|--- 2 | | |
    |TABLE ACCESS BY INDEX ROWID- |SPECIALTY_SUBSPECIA| 549 |---15K| ---1 | | |
    | INDEX UNIQUE SCAN ----------|SYS_C00489888 -----| 549 |----- | -----| | |
    |TABLE ACCESS BY INDEX ROWID- |SPECIALTY ---------| 11- |---495|--- 1 | | |
    | INDEX UNIQUE SCAN ----------|SYS_C00489875----- | 11 -|----- |----- | | |
    |TABLE ACCESS BY INDEX ROWID -|SPECIALTY ---------| 11- |---495|----1 | | |
    | INDEX UNIQUE SCAN-----------|SYS_C00489875----- | 11 -|----- |----- | | |
    --------------------------------------------------------------------------------

  • Long Running SQL Queries

    We have a customer that runs our Crystal Reports and they have complained that some of the reports cause long running sql queries and they have to kill these queries manually from SQL Management tools. We have changed the code so that we now dispose the report source and viewer objects as we call .dispose() function on them;
    reportSource.dispose();
    viewer.dispose();
    At first this seemed work but customer later complained that the issue still occurs. Can anyone help with why some of these CR queries are still running way after report is generated (with correct set of data), and based on the customer some of them running for more than 2 hours? What else can we do to make sure that all CR related queries cease to exist once report is generated? Appreciate all the help.

    1. Run the report from with Crystal designer. You should see the query being sent to DB server. After the report is viewed and you close it in designer, do you see the DB connection being dropped? If not, this may not be a SDK\ API related issue.
    2. Try using latest set of CRJ Jars [here|http://downloads.businessobjects.com/akdlm/crystalreportsforeclipse/2_0/crjava-runtime_12.2.213.zip] in your application. Also update the crystalreportviewers folder with the new viewer found at this link.
    3. Make sure that you are calling reportClientDocument.close() at the end when user is done viewing the report.
    4. When you say logn running queries are seen in DB, are you referring to a DB connection left open? or is it actually running any query and returning results?

  • Error running SQL and EXEC commands in parallel

    Dear Gurus,
    We are applying 3480000 and in process as soon as workers start it come out of adpatch session and give su the following error:
    ************* Start of AD Worker session *************
    AD Worker version: 11.5.0
    AD Worker started at: Sun Sep 02 2007 23:11:01
    APPL_TOP is set to /sgmtemp/prodappl
    Worker process 4 started.
    Checking if all jobs have their actual and symbolic arguments in sync....
    Done.
    Writing jobs to run to restart file.
    Reading jobs from FND_INSTALL_PROCESSES table ...
    Done reading jobs from FND_INSTALL_PROCESSES table ...
    Telling workers to read 'todo' restart file.
    Done.
    Starting phase 0 (A0): first
    There are now 98197 jobs remaining (current phase=A0):
    0 running, 123 ready to run and 98074 waiting.
    Assigned: file adsysapp2.sql on worker 1 for product admin username APPLSYS.
    Assigned: file cssruwq1.sql on worker 2 for product cs username CS.
    Connecting to CSD......Unable to connect.
    AutoPatch error:
    The following ORACLE error:
    ORA-01017: invalid username/password; logon denied
    occurred while executing the SQL statement:
    CONNECT CSD/*****
    AutoPatch error:
    Error while evaluating "Check Object"
    Telling workers to quit...
    3 workers have quit. Waiting for 1 more.
    All workers have quit.
    Error running SQL and EXEC commands in parallel
    You should check the file
    /sgmtemp/prodappl/admin/msbep004/log/3480000_sbm3.log
    for errors.
    applmgr@21:/sgmtemp/Oglupgr/3480000>
    What could be the issue, i tried to connect CSD/CSD in sql and it connected.
    Thanks in Advance
    Regards
    Kiran Rana

    Hi Gurus,
    Even i tried to recreate the FND_GLOBAL by performing the following, but still no luck:
    output for scripts hearder value in FND_TOP:
    applmgr@21:/sgmtemp/prodcomn/temp> cd $FND_TOP/patch/115/sql
    applmgr@21:/sgmtemp/prodappl/fnd/11.5.0/patch/115/sql> grep Header AFSCGBL*
    AFSCGBLB.pls:/* $Header: AFSCGBLB.pls 115.78 2005/03/21 11:40:02 vbalakri ship $ */
    AFSCGBLS.pls:/* $Header: AFSCGBLS.pls 115.33 2004/06/30 05:00:18 rsheh ship $ */
    Output for script header value in Database:
    SQL> select text from dba_source where name='FND_GLOBAL' and line <5;
    TEXT
    package FND_GLOBAL as
    /* $Header: AFSCGBLS.pls 115.33 2004/06/30 05:00:18 rsheh ship $ */
    package body FND_GLOBAL as
    /* $Header: AFSCGBLB.pls 115.78 2005/03/21 11:40:02 vbalakri ship $ */
    8 rows selected.
    We tried to re-apply 4 hours back when one of the support personnal ask use to run those
    scripts. one of them went with out any errors but second one went with errors
    as follows:
    First Script @AFSCGBLS.pls
    applmgr@21:/sgmtemp/prodappl/fnd/11.5.0/patch/115/sql> sapps @AFSCGBLS.pls
    SQL*Plus: Release 8.0.6.0.0 - Production on Mon Sep 3 03:24:10 2007
    (c) Copyright 1999 Oracle Corporation. All rights reserved.
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production
    With the Partitioning and Oracle Data Mining options
    JServer Release 9.2.0.7.0 - Production
    DOC> | Copyright (c) 1993 Oracle Corporation Redwood Shores, California, USA|
    DOC> | All rights reserved. |
    DOC> +=======================================================================+
    DOC> | FILENAME
    DOC> | AFSCGBLS.pls
    DOC> |
    DOC> | DESCRIPTION
    DOC> | PL/SQL specification for package: FND_GLOBAL
    DOC> |
    DOC> | NOTES
    DOC> | This module is called by AutoInstall (afplss.drv) on install and
    DOC> | upgrade. The WHENEVER SQLERROR and EXIT (at bottom) are required.
    DOC> |
    DOC> | HISTORY
    DOC> | June, 1999 - Added function AUDIT_ACTIVE, bug 879630. Jan Smith.
    DOC> | 11/19/01 MSkees - Added DBDrv line and 'SET VERIFY OFF' for ARU auto
    DOC> | generation bug 2047263 build
    DOC> |
    DOC> *=======================================================================*/
    Package created.
    Commit complete.
    Disconnected from Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production
    With the Partitioning and Oracle Data Mining options
    JServer Release 9.2.0.7.0 - Production
    Second Script AFSCGBLB.pls:
    applmgr@21:/sgmtemp/prodappl/fnd/11.5.0/patch/115/sql> sapps @AFSCGBLB.pls <
    SQL*Plus: Release 8.0.6.0.0 - Production on Mon Sep 3 03:27:15 2007
    (c) Copyright 1999 Oracle Corporation. All rights reserved.
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production
    With the Partitioning and Oracle Data Mining options
    JServer Release 9.2.0.7.0 - Production
    Warning: Package Body created with compilation errors.
    Commit complete.
    Disconnected from Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production
    With the Partitioning and Oracle Data Mining options
    JServer Release 9.2.0.7.0 -
    Production
    applmgr@21:/sgmtemp/prodappl/fnd/11.5.0/patch/115/sql>
    The second script (AFSCGBLB.pls) run's out with errors and changes status of almost 15000 objects as INVALID in database.
    Regards
    Kiran Rana

  • Adpatch: Error running SQL and EXEC commands in parallel

    Hi
    I am applying R12 RUP2 to an instance at the moment. I had an OS crash (I'm running R12 on Linux on VMWARE) and on reboot attempted to restart the patch.
    I now get an error as follows:
    Error running SQL and EXEC commands in parallel
    I must admit, I'm not a DBA, so if anyone has any ideas or has seen this before then it would be most appreciated!
    Thanks
    Chris

    Hi Adith
    The patch is 5484000, RUP 2 for E-Business Suite R12
    Here's the adpatch output:
    Start date: Wed Sep 12 2007 15:15:14
    0 "left over" javaupdates.txt files uploaded to DB: Wed Sep 12 2007 15:15:14
    0 patches uploaded from the ADPSV format patch history files: Wed Sep 12 2007 15:15:14
    Uploading information about files copied during the previous runs ...
    0 "left over" filescopied_<session_id>.txt files uploaded to DB: Wed Sep 12 2007 15:15:14
    ****************** E N D O F U P L O A D ******************
    End date: Wed Sep 12 2007 15:15:14
    Already asked for the name of the patch directory.
    (The answer was: /oracle/patches/5484000)
    Already asked for the name of the patch driver file.
    (The answer was: /oracle/patches/5484000/u5484000.drv)
    Reading release list save file...
    Done reading release list save file
    Log and Info File sync point:
    Wed Sep 12 2007 15:15:15
    Turning off actions that reference unrecognized products.
    Log and Info File sync point:
    Wed Sep 12 2007 15:15:15
    End of unrecognized products checking.
    (The number of parallel workers is: " 2 ")
    AutoPatch will run in parallel mode.
    Did not need to apply new applterr.txt.
    Skipping...
    Determine directories to create for Specified driver
    since no such action is present for this driver file
    Skipping...
    Determine Oracle Reports libraries to generate for Specified driver
    since no such action is present for this driver file
    Skipping...
    Determine if need to generate message files for Specified driver
    since no such action is present for this driver file
    Skipping...
    Create Directories for Specified driver
    since no such action is present for this driver file
    Number of invalid objects: 31057
    Running SQL scripts and EXEC commands...
    Determining which SQL and EXEC commands to run...
    Validating PL/SQL direct execute exceptions file ...
    Done validating PL/SQL direct execute exceptions file.
    SERVICE_NAME/INSTANCE_NAME : [VIS]
    connect_string : [(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ebusr12.chriseebee.me.uk)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=VIS)))]
    Done determining which SQL and EXEC commands to run.
    Running SQL and EXEC commands in parallel...
    Creating the AD_UTIL_PARAMS table...
    Table AD_UTIL_PARAMS already exists, so dropping the table and recreating it.
    Creating FND_INSTALL_PROCESSES table...
    Already created fnd_install_processes table
    Already created FND_INSTALL_PROCESSES_U1 index.
    Already created AD_DEFERRED_JOBS table
    Already created AD_DEFERRED_JOBS_U1 index.
    Writing dependencies of jobs to run to appldep.txt file...
    There are now 7569 jobs remaining (current phase=A0):
    0 running, 5 ready to run and 7564 waiting.
    Reading completed jobs from restart file (if any).
    There are now 3474 jobs remaining (current phase=A18):
    0 running, 1 ready to run and 3473 waiting.
    Determining which java executables are supported by adJavaWorker...
    Starting worker processes.
    Worker process 1 started.
    Worker process 2 started.
    Checking if all jobs have their actual and symbolic arguments in sync....
    Done.
    Writing jobs to run to restart file.
    Reading jobs from FND_INSTALL_PROCESSES table ...
    Running: file adobjcmp.sql on worker 1 for product ad username APPLSYS.
    AutoPatch error:
    The worker should not have status 'Running' or 'Restarted' at this point.
    Telling workers to quit...
    ************* Start of AD Worker session *************
    AD Worker version: 12.0.0
    AD Worker started at: Wed Sep 12 2007 15:15:34
    APPL_TOP is set to /oracle/VIS/apps/apps_st/appl
    ************* Start of AD Worker session *************
    AD Worker version: 12.0.0
    AD Worker started at: Wed Sep 12 2007 15:15:34
    APPL_TOP is set to /oracle/VIS/apps/apps_st/appl
    All workers have quit.
    AutoPatch error:
    Error running SQL and EXEC commands in parallel
    You should check the file
    /oracle/VIS/apps/apps_st/appl/admin/VIS/log/adpatch.log
    for errors.

  • Error running SQL and EXEC commands in parallel when adpatch

    Hi,
    AutoPatch error:
    aiprfp: product 'cle' not in release 'R120'
    AutoPatch error:
    Error running SQL and EXEC commands in parallel
    Freeing includes hash table
    Freeing fixes hash table
    Freeing basedons hash table
    Freeing entities hash table
    You should check the file
    /a02/prod/apps/apps_st/appl/admin/PROD/log/adpatch_7305220_1.log
    for errors.
    How to resolve this errror while applying patch 7305220.
    Regards,

    Hi,
    Please check logfile */a02/prod/apps/apps_st/appl/admin/PROD/log/adpatch_7305220_1.log* for any errors recoded.
    Post error messages from this logfile.This is the main patch log file and it should show the same error "aiprfp: product 'cle' not in release 'R120'".
    Thanks,
    Hussein

  • Call long running process and return immediately

    Hi everyone,
    Here' my problem : I am calling an onDemand application process when clicking on a button. It's a very long running process; and while waiting for the response my browser stops responding (white page).
    So, is there a way to call a process and return immediately to the javascript. The process will set a field to a given value when it finishes. In javascript side, I can then check in a while boucle the value of this field to know if the process has ended.But I dont know how to return just after the application process call ...
    Thanks and best regards,
    Othman

    I presume that you can achieve that by means of a batch job.
    You can use an automatic page reload every X seconds until a certain "flag" (or similar mechanism) changes state and check it in a before header process. In the meanwhile you can display some animated GIF for instance.
    Once the processing is completed you remove the reload timer from the header or you branch to a different page using a programmatic technique like procedure owa_util.redirect_url.
    Bye,
    Flavio
    http://www.oraclequirks.blogspot.com/search/label/Apex

  • Can join queries in Oracle 8i and above span multiple databases

    Hi,
    In Oracle 8i and above, can join queries span multiple databases??
    For eg., I have two databases A and B, and say database A has table A_T and
    database B has table B_T. Assume that both the databases are on the same
    server.
    Can I run a join query from my application using OCI calls that spans across
    tables from multiple databases, namely, A_T and B_T?
    My query probably looks like this - Select * from A.A_T, B.B_T;
    Thank you,
    Sashi

    In Oracle 8i and above, can join queries span multiple databases??
    For eg., I have two databases A and B, and say database A has table A_T and
    database B has table B_T. Assume that both the databases are on the same
    server.
    Can I run a join query from my application using OCI calls that spans across
    tables from multiple databases, namely, A_T and B_T?
    My query probably looks like this - Select * from A.A_T, B.B_T;If you create a database link from database A to B your SQL would look something like this:
    select * from A.A_T, B.B_T@dbB where A.A_T.PK = B.B_T.PK@dbB
    The Oracle manuals should have the information you need on creating a database link.

  • T-SQL: Manual Backup of Multiple Databases

    I am looking to change the way I do manual backups of multiple databases on the same instance of SQL Server 2008 R2.
    Currently I have T-SQL scripts for each database that look like this:
    BACKUP DATABASE [mydbname]
    TO DISK = N'D:\backup\manual\2014-01-01_1618\mydbname_2014-1-01_1618.bak'
    WITH NOFORMAT,
    NOINIT,
    NAME = N'mydbname-Full Database Backup',
    SKIP,
    NOREWIND,
    NOUNLOAD,
    STATS = 10
    GO
    But there are six of these scripts, one for each database. Now in another language and my past programming experience I would just use an array of database names and a loop, so that BACKUP DATABASE would only exist once in the script, but be executed multiple
    times, once for each database name in the array.
    I have such a very limited understanding of T-SQL, but I am guessing there is a completely different paradigm for the equivalent of, say, a for loop.
    I'd also like a solution where the date_time directory for the output of each backup to be dynamically generated. Instead of having to pre-create the dirs myself.
    Any help would be appreciated.

    I don't understand why you haven't been answered directly considering the simplicity of the question you are asking.  Maybe it's because I'm the only truly "old school" DBA left.  I don't use the GUI based maintenance or performance tools included
    with SQL Server not because I'm "old school" but because every time I've tried the results have been mediocre at best and in an environment where critical data is on the line mediocre doesn't cut it.
    Since I've had this type of tool in my "tool box" for more than a decade allow me to share what I typically do in this type of situation...
    declare @DatabaseName nvarchar(50),
    @DynamicSQL nvarchar(4000),
    @FileNameDate nvarchar(18)
    declare Database_Cursor
    cursor fast_forward for
    select d.name
    from sys.databases as d
    where d.name in ('MyDB1', 'MyDB2', 'MyDB3', 'MyDB4', 'MyDB5', 'MyDB6')
    open Database_Cursor
    fetch next
    from Database_Cursor
    into @DatabaseName
    while @@fetch_status = 0
    begin
    set @FileNameDate = cast(year(getdate()) as varchar(4)) + '-' +
    right('00' + cast(month(getdate()) as varchar(2)), 2) + '-' +
    right('00' + cast(day(getdate()) as varchar(2)), 2) + '_' +
    right('00' + cast(datepart(hour, getdate()) as varchar(2)), 2) +
    right('00' + cast(datepart(minute, getdate()) as varchar(2)), 2)
    set @DynamicSQL = '
    BACKUP DATABASE ' + quotename(@DatabaseName) + '
    TO DISK = N''D:\backup\manual\' + @FileNameDate + '\' + @DatabaseName + '_' + @FileNameDate + '.bak''
    WITH NOFORMAT,
    NOINIT,
    NAME = N''' + @DatabaseName + '-Full Database Backup'',
    SKIP,
    NOREWIND,
    NOUNLOAD,
    STATS = 10'
    print @DynamicSQL
    --execute sp_executesql
    -- @DynamicSQL
    fetch next
    from Database_Cursor
    into @DatabaseName
    end
    close Database_Cursor
    deallocate Database_Cursor
    There are two items you need to change in the above script to make it do precisely what you are asking...
    This should be obvious but you need to change the where clause in the cursor definition to include the 6 databases you want o backup instead of leaving it as "where d.name in ('MyDB1', 'MyDB2', 'MyDB3', 'MyDB4', 'MyDB5', 'MyDB6')"
    I've commented out two lines of code in the script.  Those lines actually run the backup statements which are built by the cursor.  The lines I'm referring to begin with the "execute sp_executesql" statement.  I've commented those lines out
    because you'll need to test the code prior to using it.  The code as designed will output the backup statements it procedures allowing you to verify it.
    I hope that helps.

  • Long-running transactions and the performance penalty

    If I change the orch or scope Transaction Type to "Long Running" and do not create any other transaction scopes inside, I'm getting this warning:
    warning X4018: Performance Warning: marking service '***' as a longrunning transaction is not necessary and incurs the performance penalty of an extra commit
    I didn't find any description of such penalties.
    So my questions to gurus:
    Does it create some additional persistence point(s) / commit(s) in LR orchestration/scope?
    Where are these persistence points happen, especially in LR orchestration?
    Leonid Ganeline [BizTalk MVP] BizTalk Development Architecture

    The wording may make it sound so but IMHO, if during the build of an orchestration we get carried away with scope shapes we end up with more persistence points which do affect the performance so one additional should not make soo much of a difference. It
    may have been put because of end-user feed back where people may have opted for long running transactions without realizing about performance overheads and in subsequent performance optimization sessions with Microsoft put it on the product enhancement list
    as "provide us with an indication if we're to incurr performance penalties". A lot of people design orchestration like they write code (not saying that is a bad thing) where they use the scope shape along the lines of a try catch block and what with
    Microsoft marketing Long Running Transactions/Compensation blocks as USP's for BizTalk, people did get carried away into using them without understanding the implications.
    Not saying that there is no additional persistence points added but just wondering if adding one is sufficient to warrant the warning. But if I nest enough scope shapes and mark them all as long-running, they may add up.
    So when I looked at things other than persistence points, I tried to think on how one might implement the long running transaction (nested, incorporating atomic, etc), would you be able to leverage the .Net transaction object (something the pipeline
    use and execute under) or would that model not handle the complexities of the Long Running Transaction which by very definiton span across days/months and keeping .Net Transaction objects active or serialization/de-serialization into operating context will
    cause more issues.
    Regards.

  • Run SQL developer to conect the database

    Trying to run SQL developer to connect to the database on a windows 7 laptop.
    I got the following message:
    status: failure: test failed. Listener refused the connection with the following error: ORA-12505. TNS: listener does not currently know of SID in connect descriptor

    937159 wrote:
    Trying to run SQL developer to connect to the database on a windows 7 laptop.
    I got the following message:
    status: failure: test failed. Listener refused the connection with the following error: ORA-12505. TNS: listener does not currently know of SID in connect descriptor
    >Trying to run SQL developer to connect to the database on a windows 7 laptop.
    I got the following message:
    status: failure: test failed. Listener refused the connection with the following error: ORA-12505. TNS: listener does not currently know of SID in connect descriptor
    open Command Window & issue OS commands below
    lsnrctl status
    lsnrctl service
    COPY commands & results then PASTE all back here

  • How to run SQL and export results to Excel

    My task is to run a custom SQL script and create Excel file via running SQL Developer from command line (invoked by a scheduled script). Is this possible using SQL Developer?
    The thing I'm trying first is to run a user-defined report in SQL Developer and save the results to an Excel file. Only 16000 result rows, but took 10 minutes to do the export and still cannot finish. Is there another way to do it?
    Many thanks.

    Thanks K for the update.
    I have done csv files before using pl/sql, no problem at all. It's just that in current work environment, we're using a 3rd party tool to make the Excels and I was asked to study the feasibility of using SQL Developer instead of our current commercial tool to do the job.

  • Why do i have a long running script and how to get rid of it ????

    My computor stalls with twc not responding due to long running script. Just rebooted  back to factory default.

    mrswalt wrote:
    It doesn't say what script. But when I go to shut down there is a window icon on screen BUT DOES NOT say which window.
    Plus just bought a hp deskjet 2540 printer that will not print. HP info person is of NO help.
    This will be hard since we have no scripts for myself or others to look at to backtrack where the problem is coming from?
    I am a Volunteer to help others on here-not a HP employee.
    Replies aren't online 24/7 because of Time Zone differences.
    Remember in this Day and Age of Computing the Internet is Knowledge at your fingertips if you choose understand it. -2015-

Maybe you are looking for

  • A Native Bridge for File Type Associations

    Im trying to write a mechanism where I can double-click on a file in Windows and have it processed by a Java application that is always running in the background. I know how to do file associations (and I know JDIC can create them) and I know how to

  • How do you know if your Iphone app is connecting to the internet?

    I'm a brand new Iphone user and I have a question about apps.  I only have the smallest data plan.  I'm wondering how do you know if your app (or any app you download) once opened connects to the internet? For instance I have a Netflix subscription. 

  • '500 Internal Server Error' when trying to connect to Music Store

    Does ANYBODY at Apple CARE that I've been writing posts for 2 WEEKS trying to get an answer to the reason why I can't connect to the Music Store? This is absurd! Since upgrading to iTunes 6.0.3 (and now 6.0.5), I get a 'Music Store termporarily unava

  • Macbook Pro 15 Inch, broken screen to external monitor

    I have a 15 inch macbook pro that was stepped on and the screen was broken. I took it to genius and they said it was toast. Great help guys. I took it home and plugged it in from the mini display to HDMI and my desktop appeared on the television scre

  • URLStream.readBytes always throw out of memory exception (errorID=1000)

    When I try to load a file as 180MBytes by using URLStream.readBytes().  In some PCs, it's OK. But in some PCs, there are always [out of memory] exception (errorID=1000) even such PC still had enough memory. For example:    Total memory is 2G, current