Scripts for killing blocking oracle processes?

We are having a problem in that when a user disconnects improperly, the oracle processes on our Oracle Apps box don't die properly and rows remain locked. For other terminal based versions, the script to kill the process is pretty simple, but for the web-based, java interface, it's unclear how I would go about doing this. Does anyone have scripts for doing this that could run via cron? The applications are running on solaris 2.6.
Thanks,
Nathan Olla
Unix Sys Admin

Take a look at note 130709.1 on Metalink. It contains configuration info for httpds.conf - your Apache configuration file. You can use this to time-out sessions properly. Hope this helps.

Similar Messages

  • Script to kill blocking sessions

    We use Oracle 10. We have a test database used solely for training and I need the give the trainer the ability to kill all the blocking sessions when a block(s) is holding up
    the entire class.
    My idea was to create a simple form on our Oracle menu- containing just a single button that when pressed would trigger the script. One press of the button
    to kill each and every blocking session. I have no clue as to how to write a script of this nature. Would appreciate any advice.
    Regards,
    Sandy

    This is easier said than done. Numerous reasons. Here's a couple:
    You cannot rely on using v$session to identifying blocked sessions.
    Some user sessions may be blocked by a system process (e.g. log writer), which means you cannot unblock the user sessions by killing the blocking session. (especially when running into an Oracle bug where a user session will spin on "+enq: RO - fast object reuse+" when dropping an object and then being shown as blocked by a system session/process).
    Killing a session in Oracle is a misnomer as the "+alter system kill session+" is a request and not a command. The relevant user session needs to terminate itself (kind of like assisted suicide). No other process actually kills the physical process (or thread) executing that user session. Thus if that user session is waiting on some external response or event, it will be unable (now and forever) to respond to that kill request. In such a case, the only alternative is killing the physical process instead. (or shutting down the database)
    A blocking session could be a job process that contains problematic code that leads to the blocking/serialisation. Killing that session will simply fail the job after which the job queue manager will restart the session again.. 16 times in succession. Only then will it mark that job entry as broken and cease trying to restart it.
    So killing blocking sessions? It is not easy to identify blocking processes, they cannot always be killed, and even when you do kill them, they may simply reincarnate as a new session.
    So what is the solution then?
    Blocking sessions are not "+A Bad Thing+". There are very good and technically sound reasons for serialisation. When it does become a problem, there's something more to it. And blindly killing blocking sessions in such a case is treating the symptom of a problem and ignoring the problem all together. Find the reason for this serialisation and address that.

  • Test Script for HR Off Cycle Process Model

    Hi,
    Does any one have the Test Script for Off cycle Process Model?
    Regards,
    Srini.

    Do you have any conditional breakpoint between second and third step?
    The red error is coming out of conditional breakpoint and it will work if you re-run the step. Generally, we put conditional breakpoint to make sure that we will start next process only after verfiying the result of the last step and thats why if you start manually it turns green.
    You can delete conditional breakpoint if you dont want.
    Arti

  • Script for checking the replication process in Netscape Directory Sever 4.1

    Hi,
    We are using Netscape Directory Server 4.1.6 in our production environment. Where we want to know is there any script available to check the replication process. Or can we write a script to check the process.
    Waiting for your replies at the earliest.
    Thanks,
    Syed A.

    Hi Syed,
    Replication state is very easy to see in 4.x and earlier. The last changenumber in the supplier changelog is visible (on the root DSE IIRC), and each consumer suffix has an operational attribute "copiedfrom" that tells you the name of the supplier, the database generation id, and the last change replayed from the supplier.
    So a script that compares the results of
    ldapsearch -h <supplier> -s base -b "" "objectclass=*" lastchangenumber
    and
    ldapsearch -h <consumer> -s base -b <base_suffix> "objectclass=*" copiedFrom
    will show you if a replica has fallen out of sync. It won't tell you more than how many changes behind the replica is, though, because pre-5.x changenumbers are sequential integers, not timestamps.
    However, the change that corresponds to the changenumber is clearly visible under the "cn=changelog" suffix. So if you look at the change itself you can see the timestamp on it.
    For more info on the status of replication, you should be able to query the agreements on the supplier. Those live under the "Netscape Machine Data Suffix", which you can also find on the supplier's root DSE:
    ldapsearch -h <supplier> -s base -b "" "objectclass=*" netscapemdsuffix
    And of course the error logs will usually tell you if replication is failing outright.
    I may be off on some of the attribute names, but if you do some investigating along these lines, you should be able to figure it out.

  • Udev bash script for autodialing usb huawei modem

    Hey
    I've got an interesting one here.
    I have scripted up a bash script to be triggered by a udev add event for my usb modem. As far as I can tell the udev event is firing correctly according to udevadm.
    ACTION=="add", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1003", RUN+="/bin/sh /usr/local/bin/huawei_key.sh add"
    ACTION=="remove", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1003", RUN+="/bin/sh /usr/local/bin/huawei_key.sh remove"
    And heres the code from the script
    #!/bin/bash
    #returns
    # 0 Successfully ran script for case
    # 1 wvdial process already running
    # 2 wvdial was not terminated
    # 3 script was not ran with ADD or REMOVE events
    function getpid #get process id of running program
    pidof wvdial
    if [ "$?" = 0 ];
    then
    pid=`pidof wvdial`
    running=1
    else
    running=0
    fi
    function checkrun #check for a running copy of the program
    pidof wvdial
    if [ "$?" == "0" ];
    then
    running=1
    else
    running=0
    fi
    function killloop #a set of time kill commands to let the program exit gracefully
    #two terms, one int and one kill with suitable gaps
    getpid
    checkrun
    if [ "$running" = "0" ];
    then
    return
    fi
    kill $pid
    sleep 10
    checkrun
    if [ "$running" = "0" ];
    then
    return
    fi
    kill $pid
    sleep 10
    checkrun
    if [ "$running" = "0" ];
    then
    return
    fi
    kill -INT $pid
    sleep 5
    checkrun
    if [ "$running" = "0" ];
    then
    return
    fi
    kill -KILL $pid
    sleep 5
    checkrun
    if [ "$running" = "1" ];
    then
    exit 2 #process fails to die
    fi
    function getlaststatus
    if [ -e "/var/run/huawie" ];
    then
    last=`cat /var/run/huawie`
    else
    last=0
    fi
    if [ "$1" = "add" ];
    then
    getlaststatus
    if [ "$last" = "1" ];
    then
    exit 1
    fi
    echo 1 > /var/run/huawie #block future udev events
    getpid
    if [ "$running" = "1" ];
    then
    exit 1
    fi
    modprobe usbserial
    sleep 6 #modem init time
    wvdial &
    exit 0
    elif [ "$1" = "remove" ];
    then
    getlaststatus
    if [ "$last" = "2" ];
    then
    exit 0
    fi
    echo 2 > /var/run/huawie
    killloop
    exit 0
    else
    echo 3 > /var/run/huawie
    exit 3
    fi
    I'd appreciate any ideas, this one has me stumped
    Edit:
    Forgot to add that when I call the script manually it works like a charm.
    Last edited by adamd (2009-08-25 15:04:06)

    Hey
    I've got an interesting one here.
    I have scripted up a bash script to be triggered by a udev add event for my usb modem. As far as I can tell the udev event is firing correctly according to udevadm.
    ACTION=="add", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1003", RUN+="/bin/sh /usr/local/bin/huawei_key.sh add"
    ACTION=="remove", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1003", RUN+="/bin/sh /usr/local/bin/huawei_key.sh remove"
    And heres the code from the script
    #!/bin/bash
    #returns
    # 0 Successfully ran script for case
    # 1 wvdial process already running
    # 2 wvdial was not terminated
    # 3 script was not ran with ADD or REMOVE events
    function getpid #get process id of running program
    pidof wvdial
    if [ "$?" = 0 ];
    then
    pid=`pidof wvdial`
    running=1
    else
    running=0
    fi
    function checkrun #check for a running copy of the program
    pidof wvdial
    if [ "$?" == "0" ];
    then
    running=1
    else
    running=0
    fi
    function killloop #a set of time kill commands to let the program exit gracefully
    #two terms, one int and one kill with suitable gaps
    getpid
    checkrun
    if [ "$running" = "0" ];
    then
    return
    fi
    kill $pid
    sleep 10
    checkrun
    if [ "$running" = "0" ];
    then
    return
    fi
    kill $pid
    sleep 10
    checkrun
    if [ "$running" = "0" ];
    then
    return
    fi
    kill -INT $pid
    sleep 5
    checkrun
    if [ "$running" = "0" ];
    then
    return
    fi
    kill -KILL $pid
    sleep 5
    checkrun
    if [ "$running" = "1" ];
    then
    exit 2 #process fails to die
    fi
    function getlaststatus
    if [ -e "/var/run/huawie" ];
    then
    last=`cat /var/run/huawie`
    else
    last=0
    fi
    if [ "$1" = "add" ];
    then
    getlaststatus
    if [ "$last" = "1" ];
    then
    exit 1
    fi
    echo 1 > /var/run/huawie #block future udev events
    getpid
    if [ "$running" = "1" ];
    then
    exit 1
    fi
    modprobe usbserial
    sleep 6 #modem init time
    wvdial &
    exit 0
    elif [ "$1" = "remove" ];
    then
    getlaststatus
    if [ "$last" = "2" ];
    then
    exit 0
    fi
    echo 2 > /var/run/huawie
    killloop
    exit 0
    else
    echo 3 > /var/run/huawie
    exit 3
    fi
    I'd appreciate any ideas, this one has me stumped
    Edit:
    Forgot to add that when I call the script manually it works like a charm.
    Last edited by adamd (2009-08-25 15:04:06)

  • Power Shell Script for getting the list of members of a particular collection group

    Hi Group
    I am looking for a powershell script for the below  manual process in sccm2012. please help
    Obtain the list of “All Users Group1” collection that have been defined as a Primary User of a device, and what that Users ShortName and Device name is
    Obtain the list of user from Active Directory that have their “Title” attribute equal to “Non-Employee” (samAccountName)
    For each user that is returned from AD, determine if they are assigned as a Primary User of a Device and write the Device name to a file
    Continue to append all of the applicable Device names to the file
    End Result = List of all Devices that have Users that have their AD Attribute “Title” equal to “Non-Employee”
    thanks
    VAR

    Hi,
    The Cmdlets below should be helpful for you to write the script. You could have a look.
    Get-CMUser
    Get-CMUserDeviceAffinity
    Get-ADUser
    Best Regards,
    Joyce Li
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • 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

  • Looking for a script to kill all inactive sessions

    Does anyone have a script to kill all INACTIVE sessions (with EXECUTE IMMEDIATE)?

    I suggest you to specify which OS you are talking about.
    The inactive status on the V$SESSION doesn't mean the user is not doing any thing, it only means the oracle server process is not processing any thing by the time it was queried. On OLTP systems Oracle Server Processes remain INACTIVE for more than 95% of the time, so it is advisable to configure shared servers.
    If you are really concerned about idle time, then I suggest you to configure profiles.
    On the pool mechanism you should address the microsoft side, if this, as far as I understood and guessed, application server is IIS.
    I suggest you further reading on the Killing sessions script and different session status (check the sniped status) here:
    Re: session inactive ??
    Re: make a job to delete the sniped sessions
    Re: How do I put a timeout in my DataBase?
    Re: Killing Session with Locks in Linux
    ~ Madrid

  • Random SP2 error when starting oracle process through SHELL script

    Hi All,
    I am trying to process data in n-Number of tables through a package. The package is called through a shell script to create start data processing. All calls to the package are in a sql script which is basically exec calls-
    exec package.process ('T1','some param');
    exec package.process ('T1','some param');
    exec package.process ('T..n','some param');
    I have a shell script which I use to execute commands from the sql script. There is a reason behind using shell script. For some strange reason, I keep on getting -
    ERROR: logon denied - check for valid user with valid privileges
    SP2-0640: Not connected
    SP2-0641: "EXECUTE" requires connection to server
    SP2-0640: Not connected
    for some EXEC calls. Problem is, errors are generated at random. So in one run, I get error for T10,T11 and then in next run I might get for some other tables.
    However, when I am running the sql script from the sql prompt, all calls to the package are executed without any problem.
    This makes me think, it is something to do with the way database connection being initiated through UNIX.
    Has anyone faced similar issue? Your help/gudence is much appreciated.
    DB: Oracle 10.2.0.5
    OS: SUN Solaris 10
    Thanks in advance.

    Login credentials are provided inside the shell script.
    I did put a sleep(10) after EOF but no help. As mentioned if I run script file from sql promt, it runs without any hiccup. So it is the connection through the UNIX that is causing issue.
    As pointed out by Sybrand, I agree that it does not make a sense to connect and commit after every sql statement. So decided to change the shell script and so far, the result from my initial tests on a sample data is quite encouraging. Hopefully I will have a solution.
    But it will be nice to know why SHELL is doing what it is doing!!
    Legacy prog are sometime big time eye-openers..;)

  • Oracle SQL template to create re-usable DDL/DML Scripts for Oracle database

    Hi,
    I have a requirement to put together a Oracle SQL template to create re-usable DDL/DML Scripts for Oracle databases.
    Only the Oracle DBA will be running the scripts so permissions is not an issue.
    The workflow for any DDL is as follows:-
    1) New Table
    a. Check if the table exists from the system/admin views.
    b. If table exists then give message "Table Exists"
    c. If table does not exist then execute DDL code
    2) Add Column
    a. Check if Column exists for a given table from system/admin views
    b. If column exists in the specified table,
    b1. backup table.
    b2. alter table to make changes to the column
    b3. verify data or execute dml script convert from backup to the new change.
    c. If Column does not exist
    c1. backup table
    c2. alter table to add column
    c3. execute dml to populate column with default value.
    The DML scripts are for populating base tables with data required for business operations.
    3) Add new row
    a. check if row exists by comparing old values of each column with new values to be added for the new record.
    b. If exists, give message row exists
    c. If not exists, add new record.
    4) Update existing record (We have createtime columns in these tables so changes can be tracked)
    a. check if row exists using primary key.
    b. If exists,
    b1. deactivate the record using the "active" column of the table
    b2. Add new record with the changes required.
    c. If does not exist, add new record with the changes required.
    Could you please help with some ideas which can get this done accurately?
    I have tried several ways, but I am not able to put together something that fulfills all requirements.
    Thank you,

    First let me address your question. (This is the easy part.)
    1. The existence of tables can be found in DBA_TABLES. Query it and and then use conditional logic and execute immediate to process the DDL.
    2. The existence of table columns is found in DBA_TAB_COLUMNS. Query it and then conditionally execute your DDL. You can copy the "before picture" of the table using that same dba view, or even better, use DBMS_METADATA.
    As for your DML scripts, they should be restartable, reversible, and re-run-able. They should "fail gracefully" on error, be written in such a way that they can run twice in a row without creating duplicate changes.
    3. Adding appropriate constraints can prevent invalid duplicate rows. Also, you can usually add to the where clause so that the DML does only what it needs to do without even relying on the constraint (but the constraint is there as a safeguard). Look up the MERGE statement to learn how to do an UPSERT (update/insert), which will let you conditionally "deactivate" (update) or insert a record. Anything that you cannot do in SQL can be done with simple procedural code.
    Now, to the heart of the matter...
    You think I did not understand your requirements?
    Please be respectful of people's comments. Many of us are professionals with decades of experience working with databases and Oracle technology. We volunteer our valuable time and knowledge here for free. It is extremely common for someone to post what they feel is an easy SQL or PL/SQL question without stating the real goal--the business objective. Experienced people will spot that the "wrong question" has been asked, and then cut to the chase.
    We have some good questions for you. Not questions we need answers from, but questions you need to ask yourself and your team. You need to reexamine this post and deduce what those questions are. But I'll give you some hints: Why do you need to do what you are asking? And will this construct you are asking for even solve the root cause of your problems?
    Then ponder the following quotations about asking the right question:
    Good questions outrank easy answers.
    — Paul Samuelson
    The only interesting answers are those which destroy the questions.
    — Susan Sontag
    The scientific mind does not so much provide the right answers as ask the right questions.
    — Claude Levi-Strauss
    You can tell whether a man is clever by his answers. You can tell whether a man is wise by his questions.
    — Mahfouz Naguib
    One hears only those questions for which one is able to find answers.
    — Friedrich Nietzsche
    Be patient towards all that is unresolved in your heart and try to love the questions themselves.
    — Rainer Maria Rilke
    What people think of as the moment of discovery is really the discovery of the question.
    — Jonas Salk
    Judge a man by his questions rather than his answers.
    — Voltaire
    The ability to ask the right question is more than half the battle of finding the answer.
    — Thomas J. Watson

  • User lock persists for killed process

    Hi,
    We have an app that acquires a user lock (using dbms_lock, release_on_commit FALSE).
    We needed to kill a session but it remained in v$session (KILLED), even after killing the OS process. Fine, I know it will clear up eventually.
    But the user lock (UL) persists. Does anyone know how it can be force-released?
    Calling dbms_lock.release (using handle in v$lock) fails, even as user SYS, the error being that the user does not own the lock. But the owning session is killed so who can release it?
    Eventually the session (and lock) disappers from v$session/v$lock but can the lock be removed before then, to avoid a DB bounce in an urgent case?
    Thanks

    If the process was truely KILLED and not MARKED FOR KILL then I do not know what could of happened. I cannot remember Oracle ever failing to release a user lock when the acquiring session was terminated. We use a fair number of UL; however, few of our processes have concurrent sessions that attempt to use the same UL. Mostly we just ensure that batch processes do not get submitted twice and that some on demand processes run single threaded or do not run if another customer has submitted the task.
    HTH -- Mark D Powell --

  • How to use a script to kill only forms sessions idle for over 30 minutes?

    We want to use a script to kill forms users idle for over 30 minutes, but we don't want to kill background concurrent processes waiting for resources. even though we set up the timeout but it won't work for users who exit forms ungracefully.
    thanks!

    Java runs at the serverside, while you need a clientside solution. Javascript is perfectly suitable. Pass the current maxInactiveInterval() value to a Javascript variable and write a function around it. You can use for example the onkeypress attribute of the body to clear the timeout counter.

  • Rational Robot Test Scripts for Oracle Application Vanilla Instance

    Hi,
    Does anybody have Rational Robot Test Scripts for Oracle Applications Vanilla Instance. We are in the process of automating testing. But for the same, we need to have the test scripts for the standard functionalities/flows.
    Any help would be highly appreciated.
    kanjurm

    Hi;
    I belive there is no sch a script as you mention. Please log a SR for your request
    Regard
    Helios

  • Unable to start Oracle Process Manager from the windows services for OBIEE

    Hi,
    I have OBIEE 11g installed on a 32-bit windows machine. Of the two windows services installed, I am unable to start the Oracle Process Manager. When I try to start it I get the following error:
    Error 1053: The service did not respond to the start or control request  in a timely fashion.
    At the back end, this service is calling the file opmn.exe which is placed at MIDDLEWAREHOME\Oracle_BI1\opmn\bin. On trying to execute this file the error we get is:
    The procedure entry point longjmp could not be located in the dynamic link library orauts.dll
    I have tried replacing the orauts.dll file, but to no avail.
    Please let me know if you have any clue regarding what is to be done.
    Thanks
    Naman

    Hi Naman,
    This error occurs for the following reasons,
    *Path variable is not set properly
    *Multiple Oracle homes exists in the same machine.
    Follow the below steps and let me know if it works,
    1. Select My Computer -> Right Click -> Properties
    2. In the System Properties screen go to Advanced Tab
    3. Click on Environment Variables
    4. In the System Variables section select PATH variable & Click edit
    5. Now you will find that it will contain invalid directories. Remove the incorrect entries. This may happen when you have multiple oracle homes in the same machine
    6. Restart the service.
    Rgds,
    Dpka

  • Payment block set for Down payment requests processed via F110

    When I process a vendor down payment request from F-47, it gets paid during F110. However it gets posted to Vendor a/c with special GL indicator and with a "payment block". I am not sure why the payment block is put automatically. Can this be functionality be changed.

    Hello Krishna,
    Can u pls elaborate the question.
    Step1: Post down payment request F-47
    Step2: Post down payment against request F110
    When your getting this payment block.
    however pls go through this path
    IMG/FA/ARAP/Business transactions/Outgoing payments/Outgoing Payments Global Settings/Payment Block Reasons/Define Payment Block Reasons or Define Default Values for Payment Block
    Regards
    Murali

Maybe you are looking for

  • Me and my wife have two iphone4 can we keep one apple id

    can we keep i acct. for both phones yet have difftert app and songs

  • Console/MBeans Slow In Clustered Environment

    Environemt is RH Linux 7.3 where we have a cluster consisting of one admin and two managed servers. Monitoring the cluster is difficult because the console response time is very poor, it seems to take forever to bring up the active JMS destinations f

  • Increase the SGA size!

    Hi, We are using EBS 12.0.6 and DB 10.2.0.3. Currentlly My SGA is 2 GB and we have 8 GB of RAM, and Swap area is 10 GB. Please recommemded us to SGA size and related DOC ID. thx.

  • ADSL Broadband Settings for Netgear DG834GT (no In...

    A few weeks ago my DG834GT had been working with BT ADSL (not Infinity) for a year before it died, so I bought another GT with the latest firmware, but I can't get Internet access. I am currently using a HomeHub 2.0 which works fine, so I know my lin

  • Invalid Session ID - cookie encode/decode

    Hello, I'm looking for the correct combination of cookie encode/decode parameters for my own setup. Machine am : AM Server 7.0 on WS6.1 Machine amc : my own webapps using AM client SDK & protected by a Policy agent. 2.2 Everything within a WS6.1 cont