Mechanism in HANA to kill runaway queries

Hello Everyone,
Sometimes we face issues with bad sqls hitting the DB and taking pretty long time to execute. Most of the times, these sqls are result of bad coding or incorrect index.
My question is : If there is any mechanism in HANA which would automatically kill such runaway queries or bad sqls running without having to restart the system or the DB?
Any advice is appreciated
Regards,
Vinay

Dear Vinay
There is a parameter that can help (since SPS8) which is designed to avoid having "wrong" queries consume massive amounts of memory. This could potentially help you also with the issue you are describing, if these statements do consume a lot of memory but I would assume they would.
Memory Tracking Parameters (New)
Statement memory tracking and statement memory limitation help you avoid uncontrolled statement memory
allocation
● The peak memory consumption of a statement can be tracked and displayed in Expensive Statements.
● Resource consumption collection has to be enabled manually:
Configuration file global.ini, parameters enable_tracking and memory_tracking
● Additionally the SAP HANA administrator is able to define a global statement memory limit in the
database:
Configuration file global.ini, parameter statement_memory_limit
● If a statement exceeds the memory limit, it will be canceled
Reference:
http://help.sap.com/hana/Whats_New_SAP_HANA_Platform_Release_Notes_en.pdf
Best regards
Tom

Similar Messages

  • Finding and killing runaways in Oracle

    I am very new to the DBA side of Oracle.
    I have several "Power Users" that are constantly kicking off outrageous queries without joins and then just killing their telnet sessions and reconnecting to correct the mistake and then complaining about performance. I think that this is leaving the query running in the background.
    Since neither removing their keyboards nor removing their fingers are options is there any way to check out resources and who is running what in the database and kill/or any runaway processes or queries?
    Any help would be appreciated,
    Chris S.

    The problem with resource limits is that you prevent ligitimate large queries.
    So the problem becomes identifying the large queries that cause the problems.
    I am currently looking at statistics so I do not have all the answers yet. One place to start looking for the sinners is v$session, v$sesstat and v$statname(?).
    Run this query every 5 minutes check the large queries and users with many queries. Users with more than one session are the ones you would be interested in. This is not perfect, but it is a start.
    If you are on Unix you can set this up in Crontab and create a shell script that checks for specifics in the result and send you an email.
    One thing I have found to cause big problems is when we use "default" for parallelism, one user can pretty much kill the server that way, if accessing a large table spanning many files I have seen up to 30 parallel queries running at once. If all the parallel processes are busy everybody else will be running non-parallel.

  • Isolating and Killing Runaway Processes

    How does one go about isolating and kiling a runaway PL/SQL process? I decided that it would be fun to call a
    procedure within a package that had an improperly coded loop, coded by yours truly. I called they package and
    then noticed that it seemed to be taking too long. Upon reviewing the code, I noticed that I my program was
    now stuck in an infinite loop. Since this process had run off on its own, I tried to complie it to fix the problem and
    much to my dismay I could not even complie the code, even though I was able to read the source to my screen.
    Where can one look to gleen some information as to how to kill the instance of the demon child without having to do
    what my DBA did and restart out database instance? Any v$ views etc?

    If you are in sqlplus when it locks up, you can simply enter <control> c
    that should kill the process. If you close your sqlplus session in any other way than standard exit procedures, depending on your setup, you either wait for pmon to find the defunct process or the administrator has to kill it for you.

  • How to kill Forms Runaway Process using 95% CPU and running for 2 hours.

    We had a situation at E-Business Suite customer (using Oracle VM server) where some of Form processes were not being cleared by form timeout settings automatically.
    Also when user exits the form session from front end, the linux form process (PID) and DB session did not exit properly, so they got hung.
    They were spiking CPU and memory usage and causing e-business suite to perform slowely and ultimately causing VM host to reboot the production VM guest (running on Linux).
    We could see the form processes (PIDs) using almost 100% cpu with "top" command and running for a long time.
    Also we verified those Form Sessions did not exist in the application itself.
    ie. Using from Grid Control -> OAM-> Site Map -> Monitoring (tab) -> "Form Sessions".
    It means that we could safely kill that form process from Linux using "kill -9 <PID>" command.
    But that required a continuous monitoring and manual DBA intervention as customer is 24x7 customer.
    So, I wrote a shell script to do the following;
    •     Cron job runs every half an hour 7 days a week which calls this shell script.
    •     Shell script runs and tries to find "top two" f60webmx processes (form sessions) using over 95% cpu with 2 minutes interval.
    •     If no process is found or CPU% is less than 95%, it exits and does nothing.
    •     If top process is found, it searches for its DB session using apps login (with hidden apps password file - /home/applmgr/.pwd).
    a.     If DB session is NOT found (which means form process is hung), it kills the process from unix and emails results to <[email protected]>
    b.     If DB session is found, it waits for 2 hours so that form process times automatically via form session timeout setting.
    It also emails the SQL to check the DB session for that form process.
    c.     If DB session is found and it does not timeout after 2 hours,
    it kills the process from unix (which in turn kills the DB session). Output is emailed.
    This are the files required for this;
    1. Cron job which calls the shell script looks like this;
    # Kill form runaway process, using over 95% cpu having no DB session or DB session for > 2hrs
    00,30 * * * * /home/applmgr/forms_runaway.sh 2>&1
    2. SQL that this script calls is /home/applmgr/frm_runaway.sql and looks like;
    set head off
    set verify off
    set feedback off
    set pagesize 0
    define form_client_PID = &1
    select count(*) from v$session s , v$process p, FND_FORM_SESSIONS_V f where S.AUDSID=f.audsid and p.addr=s.paddr and s.process='&form_client_PID';
    3. Actual shell script is /home/applmgr/forms_runaway.sh and looks like;
    # Author : Amandeep Singh
    # Description : Kills runaway form processes using more than 95% cpu
    # and Form Session with no DB session or DB session > 2hrs
    # Dated : 11-April-2012
    #!/bin/bash
    . /home/applmgr/.bash_profile
    PWD=`cat ~/.pwd`
    export PWD
    echo "`date`">/tmp/runaway_forms.log
    echo "----------------------------------">>/tmp/runaway_forms.log
    VAR1=`top -b -u applmgr -n 1|grep f60webmx|grep -v sh|grep -v awk|grep -v top|sort -nrk9|head -2|sed 's/^[ \t]*//;s/[ \t]*$//'| awk '{ if ($9 > 95 && $12 = "f60webmx") print $1 " "$9 " "$11 " "$12; }'`
    PID1=`echo $VAR1|awk '{print $1}'`
    CPU1=`echo $VAR1|awk '{print $2}'`
    TIME1=`echo $VAR1|awk '{print $3}'`
    PROG1=`echo $VAR1|awk '{print $4}'`
    PID_1=`echo $VAR1|awk '{print $5}'`
    CPU_1=`echo $VAR1|awk '{print $6}'`
    TIME_1=`echo $VAR1|awk '{print $7}'`
    PROG_1=`echo $VAR1|awk '{print $8}'`
    echo "PID1="$PID1", CPU%="$CPU1", Running Time="$TIME1", Program="$PROG1>>/tmp/runaway_forms.log
    echo "PID_1="$PID_1", CPU%="$CPU_1", Running Time="$TIME_1", Program="$PROG_1>>/tmp/runaway_forms.log
    echo " ">>/tmp/runaway_forms.log
    sleep 120
    echo "`date`">>/tmp/runaway_forms.log
    echo "----------------------------------">>/tmp/runaway_forms.log
    VAR2=`top -b -u applmgr -n 1|grep f60webmx|grep -v sh|grep -v awk|grep -v top|sort -nrk9|head -2|sed 's/^[ \t]*//;s/[ \t]*$//'| awk '{ if ($9 > 95 && $12 = "f60webmx") print $1 " "$9 " "$11 " "$12; }'`
    PID2=`echo $VAR2|awk '{print $1}'`
    CPU2=`echo $VAR2|awk '{print $2}'`
    TIME2=`echo $VAR2|awk '{print $3}'`
    PROG2=`echo $VAR2|awk '{print $4}'`
    PID_2=`echo $VAR2|awk '{print $5}'`
    CPU_2=`echo $VAR2|awk '{print $6}'`
    TIME_2=`echo $VAR2|awk '{print $7}'`
    PROG_2=`echo $VAR2|awk '{print $8}'`
    HRS=`echo $TIME1|cut -d: -f1`
    exprHRS=`expr "$HRS"`
    echo "PID2="$PID2", CPU%="$CPU2", Running Time="$TIME2", Program="$PROG2>>/tmp/runaway_forms.log
    echo "PID_2="$PID_2", CPU%="$CPU_2", Running Time="$TIME_2", Program="$PROG_2>>/tmp/runaway_forms.log
    echo " ">>/tmp/runaway_forms.log
    # If PID1 or PID2 is NULL
    if [ -z ${PID1} ] || [ -z ${PID2} ]
    then
    echo "no top processes found. Either PID is NULL OR CPU% is less than 95%. Exiting...">>/tmp/runaway_forms.log
    elif
    # If PID1 is equal to PID2 or PID1=PID_2 or PID_1=PID2 or PID_1=PID_2
    [ ${PID1} -eq ${PID2} ] || [ ${PID1} -eq ${PID_2} ] || [ ${PID_1} -eq ${PID2} ] || [ ${PID_1} -eq ${PID_2} ];
    then
    DB_SESSION=`$ORACLE_HOME/bin/sqlplus -S apps/$PWD @/home/applmgr/frm_runaway.sql $PID1 << EOF
    EOF`
    echo " ">>/tmp/runaway_forms.log
    echo "DB_SESSION ="$DB_SESSION >>/tmp/runaway_forms.log
    # if no DB session found for PID
    if [ $DB_SESSION -eq 0 ] then
    echo " ">>/tmp/runaway_forms.log
    echo "Killed Following Runaway Forms Process:">>/tmp/runaway_forms.log
    echo "-------------------------------------------------------------------">>/tmp/runaway_forms.log
    echo "PID="$PID1", CPU%="$CPU1", Running Time="$TIME1", Program="$PROG1>>/tmp/runaway_forms.log
    kill -9 $PID1
    #Email the output
    mailx -s "Killed: `hostname -a` Runaway Form Processes" [email protected] </tmp/runaway_forms.log
    cat /tmp/runaway_forms.log
    else
    # If DB session exists for PID
    if [ ${exprHRS} -gt 120 ]; then
    echo $DB_SESSION "of Database sessions exist for this forms process-PID="$PID1". But its running for more than 2 hours. ">>/tmp/runaway_forms.log
    echo "Process running time is "$exprHRS" minutes.">>/tmp/runaway_forms.log
    echo "Killed Following Runaway Forms Process:">>/tmp/runaway_forms.log
    echo "-------------------------------------------------------------------">>/tmp/runaway_forms.log
    echo "PID="$PID1", CPU%="$CPU1", Running Time="$TIME1", Program="$PROG1>>/tmp/runaway_forms.log
    kill -9 $PID1
    #Email the output
    mailx -s "`hostname -a`: Runaway Form Processes" [email protected] </tmp/runaway_forms.log
    cat /tmp/runaway_forms.log
    else
    echo "Process running time is "$exprHRS" minutes.">>/tmp/runaway_forms.log
    echo $DB_SESSION "of Database sessions exist for PID="$PID1" and is less than 2 hours old. Not killing...">>/tmp/runaway_forms.log
    echo "For more details on this PID, run following SQL query;">>/tmp/runaway_forms.log
    echo "-----------------------------------------------------------------------">>/tmp/runaway_forms.log
    echo "set pages 9999 lines 150">>/tmp/runaway_forms.log
    echo "select f.user_form_name, f.user_name, p.spid DB_OS_ID , s.process client_os_id,, s.audsid, f.PROCESS_SPID Forms_SPID,">>/tmp/runaway_forms.log
    echo "to_char(s.logon_time,'DD-Mon-YY hh:mi:ss'), s.seconds_in_wait">>/tmp/runaway_forms.log
    echo "from v\$session s , v\$process p, FND_FORM_SESSIONS_V f">>/tmp/runaway_forms.log
    echo "where S.AUDSID=f.audsid and p.addr=s.paddr and s.process='"$PID1"' order by p.spid;">>/tmp/runaway_forms.log
    mailx -s "`hostname -a`: Runaway Form Processes" [email protected] </tmp/runaway_forms.log
    cat /tmp/runaway_forms.log
    fi
    fi
    else
    #if PID1 and PID2 are not equal or CPU% is less than 95%.
    echo "No unique CPU hogging form processes found. Exiting...">>/tmp/runaway_forms.log
    cat /tmp/runaway_forms.log
    fi
    If you have the same problem with some other unix and DB processes, the script can be easily modified and used.
    But use this with thorough testing first (by commenting out <kill -9 $PID1> lines.
    Good luck.
    Edited by: R12_AppsDBA on 19/04/2012 13:10

    Thanks for sharing the script!
    Hussein

  • How to associate a submitted query with a sessionid (for kill by enduser)

    After submitting queries in batch mode through a (self-programmed) user interface, we would like to give the enduser the possibility of killing executing queries submitted by himself.
    I guess the keyword is to get hold of the session id, after starting/submitting the query.
    One way could be by retrieving information from V$SESSION after the job has been started (and before next job is started) and look for 'a new session id/serial#'. When identified, it is stored along with the query making it possible for the application to issue 'ALTER SYSTEM KILL SESSION (x,y);'.
    Does anyone see problems with this solution or have better suggestions ? A detailed description would be highly appriciated.
    We are using Oracle 8.1.6 (HP/Unix).
    Best regards
    Carsten

    The main problem to the suggested solution is you END USERS.
    I would never-ever give them an ability to kill sessions. Never!
    What will happend if they kill an Oracle session and immidiently start another one
    while the first session was only marked as killed. And even more. Sometimes I saw situations when it was not enough to kill Oracle sessions but Unix sessions also need to be killed.
    In another words, let your end user submit a request to a person (like DBA) who knows what he is doing and how to handle a "run-away" process.
    Best regards.

  • Native Queries in Netweaver 7.1

    Hello Forum,
    how do i convince the EntityManager that a select statement used for a native query is actually a select statement?  I tried to issue an SQL statement starting with the keyword "select", containing a few parameters (i used a bare "?" to denote them, would this be correct?), a subselect, and some grouping operations, but upon calling getResultList(), the entity manager threw an Exception stating that the select statement was not a select statement.
    Regards,
    - Thomas

    Rolf Paulsen wrote:
    In native queries, according to the JPA spec, using positional parameters like :"?1", "?2",... is the only way to add parameters. Neither named parameters like ":foo" nor plain "?" are supported according to JPA 1.0 spec.
    See JSR 220: Enterprise JavaBeansTM,Version 3.0, Java Persistence API, section 3.6.3 "Named parameters":
    Only positional parameter binding may be portably used for native queries.
    I only have (really good) experience with EclipsesLink where defining parameters in native queries works fine with ?1, ?2 like in the JPA spec. If in  SAP JPA parameters in native queries must be defined in the query string using plain ?, it will not be compliant with the spec.
    SAP JPA passes the SQL string specified in a native query raw (unparsed) to the database. This means that SAP JPA does make any assumption with respect to the syntax required by the underlying database with respect to paramter markers. In standard SQL, a plain ? character is used as a parameter marker. Standard SQL does not understand ?1 nor :foo.
    The only binding mechanism for parameter values in native queries supported by SAP JPA is positional (as in alignment with the spec). Example
    Query query = em.createNativeQuery("SELECT LAST_NAME FROM EMPLOYEE WHERE FIRST_NAME = ?");
    query.setParameter(1, "Tim");
    Rolf Paulsen wrote:
    > And in SAP JPA NetWeaver 7.30, we do not get fully transparent lazy loading like in EclipseLink but a weaker form using cglib with EntitiyManager.getReference(): Whenever you need lazy loading, you have to hand-code it into your code.
    This is  a misundersanding. In 7.30, lazy loading of single-valued relationships is supported as an automatic mechanism. You do not need to programatically use getReference. However, as lazy loading of single-valued relationships has been introduced onyl with 7.30, you need enabled it explicitly in order to preserve a downward compatible behavior:
    http://help.sap.com/saphelp_nw73/helpdata/en/68/f676ef36094f4381467a308a98fd2a/frameset.htm
    -Adrian

  • 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?

  • Kill OBIEE Session if it exceeds 15 mins in 10G

    I want to know the steps to be performed if i need to kill a long running report automatically. I am using OBIEE 10G version.
    I understand that ConnectionExpireMinutes is only for the sessions that are idle.
    Please tell me how to configure such that report if running beyond 15 mins, cancles at OBIEE and Database both.

    Another way to do this is to have a script running on the DB to kill any queries over (60*15) for that login. My experience with 10g, it is not good at killing queries when it hits the limit, the query might have run but the amount of time returning the data might cause an issue
    Better to do it at the DB and use a read only user for OBI to connect to the DB so it can be easily be identified by the DBA's and not kill any ETL sessions

  • Business Objects Explorer  on bex query on HANA

    Hi BI/BW/BO experts
    if we implement BW on HANA, and run bex queries.
    What are the pros and epecially the cons for running BO explorer.
    Can Explorer connect to a bex query?
    What about iput variables ?
    Can the bex query connect to multiproviders?
    Does it run on IOS ?
    Does it run on Android ?
    Hope for a clarifying answer.
    (These things changes so fast)
    very best regards
    Ingrid

    Hi Ingrid,
    We can create information space over BWA and here is the steps;-
    Login to BW system from SAP GUI.
    Run T-code RSDDB.
    Click Query as InfoProvider button.
    Select one BEx query and click Release Query as InfoProvider menu.
    Click Create button.
    Click Activate and Fill BWA Index and select Immediate > Save.
    Run T-code /nRSDDTPS. Find the BEx query.
    Right click it and select Create... menu.
    Click Yes from prompted dialog.
    Enter User name and select "0BI_ALL" as BW Authoriz.
    Click Activate menu and select Immediate > Save.
    Run T-code /nTrexAdmin.
    Select Program > Get BIA Rfc Destination and click Execute button.
    =>You can find hostname of BWA system and trex instance number in Location field.
    =>It is generally formated as "<host>:3<instance number>##".
    Use the two information to enable Business Warehouse Accelerator to BusinessObjects Explorer by referring KBA 1618815.
    Login to Explorer 4.0 and click Manage Spaces menu.
    Find the BEx query and click New button.
    You can connect bex query to multiprovider through JCO connection from IDT.
    Hope this helps
    Regards,
    Pranay

  • Statement.cancel() no longer works with WLS 8.1?

    Has anyone else had a problem with the cancel() method in oracle.jdbc.OracleCallableStatement
    on WLS 8.1 not doing a very good job of killing the thread in Oracle? We were
    using cancel() with weblogic.jdbc.pool.CallableStatement on WLS 6.1 and it does
    a very good job of killing the query on the Oracle side. But almost all of this
    package has been removed and we've been told we need to use the Oracle vendor
    package to get our stuff to work on 8.1. I decompiled both classes and they each
    have very different implementations of the cancel() method.
    I think I've managed to convert all of our DB access classes to the Oracle vendor
    package successfully, with the exception of this issue. We use cancel() let users
    cancel large queries and to cancel an existing query if a user tries to run a
    new one. Since we implemented it we've had a huge performance boost from the lack
    of runaway queries in the DB. It would be a real pain if we can't find a way to
    get the Oracle version to work. Any help or tales of similar experiences would
    be greatly appreciated.
    thx a lot,
    Matt Savino

    I did a search on Oracle MetaLink. I didn't see any Oracle-confirmed
    bugs related to cancel. I did see one user in the JDBC forum that
    was having a problem with a remote (not on the local machine)
    cancel. At this point, this case will need to be worked through
    support - they will need to generate a reproducer and assuming they
    do, file a tar with Oracle.
    "Stephen Felts" <[email protected]> wrote in message
    news:[email protected]...
    Regarding the wrappers - now I remember discussing this with you in thebeta newsgroup about a month ago.
    The goal was to make it transparent that everything was changed to bepassthrough in 8.1.
    The good news is that you can now use the vendor interface directly andget their extensions
    directly. That means that the wrapper for Oracle will be different fromthe wrapper for DB2.
    Further, any new excentions in the interface will become visible to theapplication.
    >
    The bad news is that this only works when the vendor has a definedinterface; it doesn't work
    if only a class is defined.
    This is a problem for some of the Oracle data type classes that don't havedefined interfaces
    and the reason why weblogic.vendor.oracle interfaces still need to be usedfor these classes.
    That also applies to BEA classes and weblogic.jdbc.pool only had classesdefined, not interfaces.
    >
    We should have documented change.
    Regarding the real problem of cancel(), the WLS JDBC code is not doinganything here
    except passing the cancel call through to the thin driver. My guess isthat this is
    a problem in the thin driver. I haven't had a chance to research this onthe Oracle site yet.
    >
    >
    "Matt Savino" <[email protected]> wrote in message
    news:[email protected]...
    >>
    Thanks a ton for your quick reply on this. On recommendation from yoursupport
    team (case 426562) here is the primary line that we had to change:
    [old] weblogic.jdbc.pool.CallableStatement cStat
    =(weblogic.jdbc.pool.CallableStatement)connection.prepareCall(call);
    >>
    [new] - oracle.jdbc.OracleCallableStatement cStat
    =(oracle.jdbc.OracleCallableStatement)connection.prepareCall(call);
    >>
    (FYI - We need this to take adavantage of some of the advanced Oraclefeatures
    like returning multiple ResultSets. We'd like to avoid using the OCIclient if
    possible, assuming that would even solve this.)
    Further down in the code, here is the cancel() method:
    public void cancelCall() {
    try {
    if (cStat != null) cStat.cancel();
    releaseConnection();
    catch (Exception e){ e.printStackTrace(); }
    In both cases the cancel() call throws no error, but only on the oldversion do
    we actually see the thread die promptly in Oracle.
    Thanks again for your help on this,
    Matt
    "Stephen Felts" <[email protected]> wrote:
    In versions prior to WLS 8.1, each Oracle extension had to be
    individually,
    explicitly wrapped
    (and not all extensions were supported).
    In WLS 8.1, it is a clean passthrough directly of all Oracle interfaces
    using a dynamic proxy so that
    all Oracle extensions show through. The only additional work that WLS
    is doing to to
    ensure that transactions are managed correctly (which shouldn't have
    an impact here).
    Note that in versions prior to WLS 8.1, you were using classes12.zip
    for the client and now you are using ojdbc14.jar. There are
    some big differences in this client implementation.
    Maybe you should try testing this standalone without WLS in the picture
    to see
    if this is a driver problem. WLS doesn't have the code that isresponsible
    for killing the thread in Oracle.
    I'm not sure I understand what code you are changing. The goal was to
    preseve the interfaces
    provided in releases prior to 8.1. Code you show me an old code line
    and what you are
    changing it to? Thanks.
    "Matt Savino" <[email protected]> wrote in message
    news:[email protected]...
    >>>>
    Has anyone else had a problem with the cancel() method inoracle.jdbc.OracleCallableStatement
    on WLS 8.1 not doing a very good job of killing the thread in Oracle?We were
    using cancel() with weblogic.jdbc.pool.CallableStatement on WLS 6.1and it does
    a very good job of killing the query on the Oracle side. But almostall of this
    package has been removed and we've been told we need to use the
    Oracle
    vendor
    package to get our stuff to work on 8.1. I decompiled both classesand they each
    have very different implementations of the cancel() method.
    I think I've managed to convert all of our DB access classes to theOracle vendor
    package successfully, with the exception of this issue. We use
    cancel()
    let users
    cancel large queries and to cancel an existing query if a user triesto run a
    new one. Since we implemented it we've had a huge performance boostfrom the lack
    of runaway queries in the DB. It would be a real pain if we can't
    find
    a way to
    get the Oracle version to work. Any help or tales of similar
    experiences
    would
    be greatly appreciated.
    thx a lot,
    Matt Savino

  • Monitoring sessions invoked by a user SQL Developer

    Hello Everyone ,
    I am a DBA and lot of developers use SQL Developer for their tasks. Off late we have been facing few issues with SQL Developer.
    Developers close the working session by "alt+f4" and strangely their sessions are active in the DB's. What is the cause for this ?
    Rollback of DML statements takes hours for statements submitted by SQL Developer.
    Does OCI driver help in any way ?
    Is there any way that I can allow individual users to monitor their sessions in SQL Developer?
    Suppose a user connects with a generic application username "xyz" , can I allow the user "xyz"  to monitor sessions invoked by him and also provide him privileges to kill his/her own session.
    We are facing lot of performance issues , so help in this regard would be highly appreciated.
    Even pointing me towards appropriate documentation would do.
    Thanks in anticipation.

    1006957 wrote:
    I am a DBA and lot of developers use SQL Developer for their tasks. Off late we have been facing few issues with SQL Developer.
    Developers close the working session by "alt+f4" and strangely their sessions are active in the DB's. What is the cause for this ?
    Rollback of DML statements takes hours for statements submitted by SQL Developer.
    Does OCI driver help in any way ?
    Is there any way that I can allow individual users to monitor their sessions in SQL Developer?
    Suppose a user connects with a generic application username "xyz" , can I allow the user "xyz"  to monitor sessions invoked by him and also provide him privileges to kill his/her own session.
    We are facing lot of performance issues , so help in this regard would be highly appreciated.
    Even pointing me towards appropriate documentation would do.
    Once the DB begins work on a task it will continue that work until: 1) the work is complete, 2) an exception occurs or 3) it discovers that the client is no longer there.
    If you begin a transaction (complex query, sorts, etc) that is lengthy it may be a while before the DB even tries to communicate with the client. Then all of that work must be rolled back and the rollback (e.g. for an update or delete) can take much longer than the query took to begin with. That is just the way Oracle works.
    If a user connects as "xyz" then the only 'sessions invoked by him' are that ONE session. Any other user might also create a session by connecting as "xyz"; Oracle has no way of knowing if ALL sessions connecting as "xyz" belong to the same person or not.
    The ALTER SYSTEM privilege must be granted to allow someone to 'kill his/her own session' but that privilege would allow them to kill any other session, including system sessions.
    You could write a procedure to try to control the privilige, as in the following thread, but that also has risks:
    https://forums.oracle.com/thread/256935
    It is a DBA responsibility to control sessions, not the developers. You should NOT give this ability to the developers IMHO. If your developers are abusing your system it indicates that they need more training in how to prevent runaway queries. A common cause of the problem you describe is when a developer submits a query and then thinks they can just cancel it and start over and they DO NOT UNDERSTAND the first statement I made above: Oracle will keep working.
    The proper solution to your problem is to begin logging your developer's requests for session termination so that you can properly monitor the problem and detect developers that need additional instruction or mentoring to keep the problem from happening. Although anyone, even experts, can accidentally let a query get out of control, your problem doesn't occur very frequently for experienced developers.
    The DISCONNECT option only politely requests Oracle to terminate the session so it make take considerable time to clean everything up.
    If you really need to terminate the session you need to use DISCONNECT IMMEDIATE. See the disconnect session clause of alter system in the sql language doc
    http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_2013.htm#sthref4725
    {quote}
    DISCONNECT SESSION Clause
    Use the DISCONNECT SESSION clause to disconnect the current session by destroying the dedicated server process (or virtual circuit if the connection was made by way of a Shared Sever). To use this clause, your instance must have the database open. You must identify the session with both of the following values from the V$SESSION view:
      For integer1, specify the value of the SID column.
      For integer2, specify the value of the SERIAL# column.
    If system parameters are appropriately configured, then application failover will take effect.
      The POST_TRANSACTION setting allows ongoing transactions to complete before the session is disconnected. If the session has no ongoing transactions, then this clause has the same effect described for as KILL SESSION.
      The IMMEDIATE setting disconnects the session and recovers the entire session state immediately, without waiting for ongoing transactions to complete.  If you also specify POST_TRANSACTION and the session has ongoing transactions, then the IMMEDIATE keyword is ignored.
      If you do not specify POST_TRANSACTION, or you specify POST_TRANSACTION but the session has no ongoing transactions, then this clause has the same effect as described for KILL SESSION IMMEDIATE.
    {quote}

  • How to use multiple visa read in one program

    hi
    i am working at Hameg HM8143 power supply i want to measure voltage and current simultaneiously and use the measured values for further calculations. for this i used two visa read blocks.
    >>>>>>the measured values are shown in the same visa read string however i want it to be shown sepetately,
    >>>>>>One of the VISA read block gives error. so i want to know how to use VISA read to get current and voltage simultaneously in seperate strings
    >>>>>>than how to convert strings to numbers  for using them for my calcultions.
    i am attaching screen shot as well
    Attachments:
    screenshot.JPG ‏164 KB

    you can not use a single serial to send 2 commands simultaniously?
    There is a single serial line so one command has to be before another.  This doesnt mena that you can not read from 2 seperate threads but will have to ensure that there is a locking mechanism to make sure that your queries are atomic.  In labview encapsulating all communications can be done with an action engine which will allow for concurrent execution with automatic blocking of your resource (serial device).
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

  • NI motion servo jerk/jump on enable

    we're having an issue with our servo motion control
    PCI-7354 + UMI
    Labview RT 8.6
    nimotion 73xx controller support 7.7.0
    we've got a mechanical safety switch that kills power to our servo amps (via the inhibit line)
    if we engage the safety switch while the motor is moving the motor stops ok thou when we reenagage it the motor "jumps" sometimes by hundreds of counts
    s/w process:
    as soon as the safety switch is detected we issue a kill stop command to both motors then disable the limit switches (as the motor carriage can fall onto the reverse switch)
    when a reset safety is requested the limit switches are reenabled, the 2 axis are reenabled (configure inhibit i/o - triggers the amp inhibit line) then a kill stop and halt stop are called to reenable the ni motion axis
    any thoughts as to why the motor would jump on re-enable?

    Hi,
    I don't know if you have solved this yet - so here are my thoughts:
    We used to use the Baldor NextMove ISA cards in one of our systems. We found that if the motion was disabled (in our case by opening the instrument's door), and the axis was subsequently moved (in your case it drops under gravity), upon re-enabling the controller, the controller would try to close the position loop to return the axis to the position it was at, when the system was disabled. It essentially did this by applying maximum DAC volts to the drive (dumb drive - voltage to current converter). On a long axis (approximately 1m, in our case), this would make you jump!!!!
    Could it be a similar phenomonen in your case?
    Regards,
    Laurence

  • ADO Object was Open error aka DB_E_OBJECTOPEN on Large Dataset in MS SQL 2012

    Hi I am running a query with a big result set in my Delphi application using tADOQuery.
    When I request 12 months data I get an error "Object was Open".
    But if I run the same query on 1 month of data it works fine.
    The mechanism I use to open all queries in my application is the same and has always worked for many years.  This is the first time I have hit this error.  My application has run thousands of different queries across many customer sites without ever
    hitting this error.
    In my research I found that this seems to correspond to an ADO Error DB_E_OBJECTOPEN.
    The 12 month query runs perfectly OK in SQL Mgmt Studio and takes about 1.5 minutes to start showing results.  But it is 4 minutes before it works out there are 3,810,979 rows.
    I am using a client cursor
    myADOQuery.CursorLocation:=clUseClient;
    And I am setting a large CommandTimeout = 600;
    So why does the query fail in the ADO client (but it works in SQL Mgmt Studio)?
    And what does this "Object was Open" error mean?

    Hi Justin,
    The below picture is the relationships between the Data Access component. ADO is based on OLEDB, the underlying provide is OLEDB.
    As you can see, ADO provider is based on OLE DB provider or ODBC Driver.
    And DB_E_OBJECTOPEN is the error you experence. It is returned by OLE DB provider (be it SQLOLEDB, SQLNCLI or any 3rd party provider) when it makes a call to ICommand::Execute without closing the result of the previous execution (see
    http://msdn.microsoft.com/en-us/library/ms718095(VS.85).aspx).
    Did anything change recently in your environment, a new version of the client application was deployed or client driver was upgraded?
    Usually this error occurs because of the problem in the client application, not the client provider. Application should do either of the following:
    Fully consume the result of the previous command execution prior to issuing a new command. If it doesn't, it might be leaking an object.
    If the result must be pending, it should turn set DBPROP_MULTIPLECONNECTIONS property to VARIANT_TRUE which will allow underlying OLE DB provider to establish additional connections under the hood. This must only be done if developer is absolutely sure
    that the application needs the previous result.
    Enable Multiple Active Result Sets on the connection which would allow running multiple queries on the same connection. This is also must be done consciously, as it may mask object leak.
    Besides, maybe you have known that the CommandTimeout is 30s by default. However, the reason that you can succeed when you use SSMS(SQL Server Management Studio) to run the query is because when using SSMS to create a new connetion,
    the commandTimeout is 0 by default. It means it has no limitation for the query command time.  But when you use ADO client to create a new connection to run the query, the time which is taken by the query may beyond the commandTimeout
    setting .So it failed to return the results in your ADO client.
    From a support perspective to further analize this issue is really beyond what we can do here in the forums. If you cannot determine your answer here or on your own, consider opening a support
    case with us. Visit this link to see the various support options that are available to better meet your needs: 
    http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone."
    Keep us posted.

  • Oracle 8i locking and timeout

    Hi,
    I am talking to an Oracle 8.1.7 db through Perl DBI for a certain Web Application.
    In the back-end, a script is invoked every hour to sync parts of this db, with the master db. The sync'ing script takes quite a while to complete and it consists of a single transaction ( several update statements followed by a single commmit at the very end).
    Now, I want to know what happens to any user who tries to modify something through the web-interface. If a query from the web-interface finds that a row is locked by the syncing script, how long will it wait before a timeout? ( if any timeout occurs at all, in the first place ! ). Can I control this timeout?
    Please repond ASAP.
    Thanks in advance,
    Rajesh

    How much control do you have over the SQL being generated? There is a keyword 'NOWAIT' that can be added to a statement indicating that it shouldn't wiat for resources-- if it can't lock them immediately, it returns an ORA-00054 (if memory serves) resource locked and NOWAIT specified. Otherwise, by default, the statement will wait indefinitely.
    In ODBC, you can specify a query timeout that will kill all queries after some amount of time.
    Justin

Maybe you are looking for

  • Having trouble connecting to wireless at home

    My router is a wireless one on our PC and I type in all the information but I feel like I'm going about it all wrong. My question is that do you need an Airport base to connect to a wireless router?? If you don't can you please like walk me through i

  • Problems with printdialog in linux

    I am creating an application under Ubuntu that will be able to print. But when I use the printDialog the program throws an exception under Ubuntu. But it works when I run the application under Windows 2000. It works in both OS:s if I don't use printD

  • Save cookie/session after login on web service client

    I am calling a web service that has a login method. It sets a session id in a cookie. Every subsequent call fails and says I'm not logged in. How do I save their cookie or session ID such that the server thinks I'm logged in? Here's the client code (

  • Why my minimized JFrame dosen't blink...

    Hi, i m trying to built a small local messenger where i am opening a new window by clicking on the user name as like normal messenger... no my problem is that if the chat window that appears after clicking on username is mimimized and some it receive

  • How to Access Word and Excel on my ipad

    I am going to Europe this month and I do NOT want to bring my PC. I need to have access to my Microsoft Word and Excel files. I will need to crete, edot and email these files.  I have heard that I need something called CloudOn and DropBox.  Does Appl