Dbms_schedular to use for 3 hours

Dear All,
We have oracle 10G R2 on windows.
I am trying to use dbms_scheduler create the schedule to run procedures.
My requirement is to run the job from 12.30 pm to 3.30 pm for the interval of every 10 minuts and 2.45 t0 3.45 for the interval of 5 minuts.
For the above requirement, Can you please suggest how can i create a job. I have created something like below :-
begin
DBMS_SCHEDULER.CREATE_JOB(
JOB_NAME          =>     'TEST_JOB',
JOB_TYPE          =>     'PLSQL_PROCEDURE',
JOB_ACTION          =>     'BEGIN TEST; END; ',
START_DATE          =>     SYSTIMESTAMP,
END_DATE          =>     NULL,
COMMENTS          =>     'JOB IS CREATED FOR TESTING PURPOSE',
ENABLED               =>     TRUE,
REPEAT_INTERVAL          =>     ‘freq=WEEKLY;BYDAY=MON,TUE,WED,THU,FRI; byhour=12.30 to 15; byminute=10; bysecond=0;’
)Can we do this.

Hi,
Check if below can help
begin
DBMS_SCHEDULER.CREATE_JOB(
JOB_NAME          =>     'TEST_JOB',
JOB_TYPE          =>     'PLSQL_PROCEDURE',
JOB_ACTION          =>     'BEGIN TEST; END; ',
START_DATE          =>     SYSTIMESTAMP,
END_DATE          =>     NULL,
COMMENTS          =>     'JOB IS CREATED FOR TESTING PURPOSE',
ENABLED               =>     TRUE,
REPEAT_INTERVAL          =>     ‘freq=WEEKLY;BYDAY=MON,TUE,WED,THU,FRI; byhour=12,13,14,15; byminute=10; bysecond=0;’
begin
DBMS_SCHEDULER.CREATE_JOB(
JOB_NAME          =>     'TEST_JOB1',
JOB_TYPE          =>     'PLSQL_PROCEDURE',
JOB_ACTION          =>     'BEGIN TEST; END; ',
START_DATE          =>     SYSTIMESTAMP,
END_DATE          =>     NULL,
COMMENTS          =>     'JOB IS CREATED FOR TESTING PURPOSE',
ENABLED               =>     TRUE,
REPEAT_INTERVAL          =>     ‘freq=WEEKLY;BYDAY=MON,TUE,WED,THU,FRI; byhour=2,3; byminute=5; bysecond=0;’
)Thanks,
Ajay More
http://moreajays.blogspot.com

Similar Messages

  • HP B210a goes into a sleep mode if not used for several hours,

    Running my B210a eprinter in windows vista. The printer goes into a sleep mode if not used for several hours.  The power button is slowly flashing dim then bright, and I need to manually touch the printer's screen to enable it to print. If printer not used for several days, the only way I can make it work is to unplug and plug. Any suggestions or help appreciated.  J Rice

    What OS?  Wired or wireless connection?
    Say thanks by clicking the Kudos Thumbs Up to the right in the post.
    If my post resolved your problem, please mark it as an Accepted Solution ...
    I worked for HP but now I'm retired!

  • My iphone 4 keeps switching off if not used for an hour or so and needs the reboot to turn it on

    My IPhone 4 keeps switching off if not used for an hour or so and needs the reboot to turn it back on again?

    Hi, DREWidz.  
    Thank you for visiting Apple Support Communities.  
    It sounds like you are experiencing an issue with your device unexpectedly restarts.  Here are some troubleshooting steps that may help.  
    iOS: Device unexpectedly restarts, displays Apple logo, or powers off
    http://support.apple.com/en-us/TS5356
    Cheers, 
    Jason H.  

  • How can I get firefox to shut down automatically when not in use for an hour

    How can I get firefox to shut down automatically when not in use for an hour

    Sorry, there is no feature for that built into Firefox, and I haven't seen an add-on to add that feature to Firefox.

  • New iPh 4s continuously Freezes unable to use for over several hours!!

    ok only had the iPh 4s going on 2 months (Oct 14, 2011 received) brand new!!  we all know about the famous hot battery and draining (which will still occur if you do NOT turn off all unnecessary notifications).  However, my new issue which started at the same time as the hot, draining battery is that the iPh 4s Freezes and unable to shut down, or restart by sticking a pin to the small hole on the right side (where the battery is located) will NOT respond for hours.  Only thing displays is the twirling power down icon on black background and the only goes away until the battery completely drains to 0%!  this has happened to me 5 times within 1 month!! 1st time it occurred, i got a text from my husband and then took a photos of some notes.  Not knowing what happened, figured, the battery had drained down and needed to just plug my iphon 4s in the car charger.  Well that was NOT the answer and was left stranded without anyway to contact my husband to pick up our kid from her daycare for 3 hours (5pm is closing time)!  i was ****** not able to find anyway to contact my husband due to this crazy issue.  my last time and 5th experience of the freezing of the device is when i tried to add a photo to tripadvisor and the freakin device again, freezes, not able to shut down and i had to wait 4 hours before it drained to 0%.  Apple Support these are hints to fix the photo app in the 4s it is NOT working properly and freezes the devices.
    So my questions is, has anyone had a similar issue like this and how did you resolve it?  this new iPh 4s has really made me very angry that nothing has been done to fix these CRITICAL (and health risk) issues..  Oh and yes, i am on the phone apple iphone support now (call started at 7:37p EST - it  has been over 40+mins for this young man to get me to the next level (tech support) to help on this issue... c'mon now; really; i have to wait until the phone mysteriously drops?!?!?!); i do not want the answer to be "we will send you a new iPh4s"!! i like my phone and a replacement is NOT going to fix the current serious issues that are occurring on this device.  so will they give me a new brain or ear or pay my health bill if later in the future it is discovered these issues are a TRUE health risk all because they did not FIX these critical iphone 4s issue??

    Neither the upgrade to Mavericks nor the upgrade of Pages will have removed Pages '09 from your computer. If you have not manually deleted it, you shuld find Pages '09 in a floder named iWork '09 in the Applications folder on your MBP.
    Both applications can coexist on your MBP, and you will need both to move back to Pages '09.
    Any document that has been opened and saved using Pages 5 (the new one) cannot be opened in Pages '09 unless you open it once more in Pages 5 and Export it as a Pages '09 (or iWork '09) document. Features not supported in Pages 5 at the time it was first opened in that application will not survive the import/export, and anything that used these features will need to be rebuilt in Pages '09.
    Once opened and saved in Pages '09, you need to be careful to not reopen the document in Pages 5, and if it is inadvertently opened in that version, to close it without saving (if you want to continue using it in Pages '09.
    You need Pages 5 at least until you have exported all documents back to Pages '09 format, and you need Mavericks for at least as long as you need Pages 5.
    Regards,
    Barry

  • HT1212 my daughter has a brand new ipod touch - never used - she entered a passcode then immediately forgot it and now she has tried to enter one too many times and ipod is locked for 1 hour - she has never synced with itunes HELP

    my daughter has a brand new ipod touch - latest one - she started to input a passcode then didn't finish the process then turned off ipod. she turned it back on and it is asking for a passcode - she doesn't remember what she typed. Ipod is now disabled for one hour. Can we override the disable. How do we reset passcode when we don't klnow the original. It has never been synced to Itunes. I am completely lost.

    If You Are Locked Out Or Have Forgotten Your Passcode
    iTunes 10 for Mac- Update and restore software on iPod, iPhone, or iPad
    iPhone, iPad, iPod touch: Wrong passcode results in red disabled screen
    iOS- Understanding passcodes
         If you have forgotten your Restrictions code, then follow the instructions
         below but DO NOT restore any previous backup. If you do then you will
         simply be restoring the old Restrictions code you have forgotten. This
         same warning applies if you need to restore a clean system.
    A Complete Guide to Restore or Recover Your iDevice (if You Forget Your Passcode)
    If you need to restore your device or ff you cannot remember the passcode, then you will need to restore your device using the computer with which you last synced it. This allows you to reset your passcode and re-sync the data from the device (or restore from a backup). If you restore on a different computer that was never synced with the device, you will be able to unlock the device for use and remove the passcode, but your data will not be present. Refer to Updating and restoring iPhone, iPad and iPod touch software.
    Try restoring the iOS device if backing up and erasing all content and settings doesn't resolve the issue. Using iTunes to restore iOS devices is part of standard isolation troubleshooting. Restoring your device will delete all data and content, including songs, videos, contacts, photos, and calendar information, and will restore all settings to their factory condition.
    Before restoring your iOS device, Apple recommends that you either sync with iTunes to transfer any purchases you have made, or back up new data (data acquired after your last sync). If you have movie rentals on the device, see iTunes Store movie rental usage rights in the United States before restoring.
    Follow these steps to restore your device:
         1. Verify that you are using the latest version of iTunes before attempting to update.
         2. Connect your device to your computer.
         3. Select your iPhone, iPad, or iPod touch when it appears in iTunes under Devices.
         4. Select the Summary tab.
         5. Select the Restore option.
         6. When prompted to back up your settings before restoring, select the Back Up
             option (see in the image below). If you have just backed up the device, it is not
             necessary to create another.
         7. Select the Restore option when iTunes prompts you (as long as you've backed up,
             you should not have to worry about restoring your iOS device).
         8. When the restore process has completed, the device restarts and displays the Apple
             logo while starting up:
               After a restore, the iOS device displays the "Connect to iTunes" screen. For updating
              to iOS 5 or later, follow the steps in the iOS Setup Assistant. For earlier versions of
              iOS, keep your device connected until the "Connect to iTunes" screen goes away or
              you see "iPhone is activated."
         9. The final step is to restore your device from a previous backup. If you do not have a
              backup to restore, then restore as New.

  • I use BB Bold 9790 and my battery which could at least,last for a day now at most,lasts for an hour

    I use BB Bold 9790 and my battery which could at least,last for a day now at most,lasts for an hour and half.
    The phone heats up so much that I am always forced to plug out the battery always.
    Please help cos I love the device!
    An more so can't afford to buy a new one cos its a little pricey.

    Oh, then reread Post 2 please, for the last paragraph gives you options to proceed with. Not knowing which you desire to use, I'll just give you a bunch and you can choose.
    The simplest way is to, on a PC (you cannot do this on MAC):
    1) Make sure you have a current and complete backup of your BB...you can find complete instructions via the link in my auto-sig below.
    2) Uninstall, from your PC, any BB OS packages
    3) Make sure you have the BB Desktop Software already installed
    http://us.blackberry.com/software/desktop.html
    4) Download and install, to your PC, the BB OS package you desire:
    http://us.blackberry.com/support/downloads/download_sites.jsp
    It is sorted first by carrier -- so if all you want are the OS levels your carrier supports, your search will be quick. However, some carriers are much slower than others to release updates. To truly seek out the most up-to-date OS package for your BB, you must dig through and find all carriers that support your specific model BB, and then compare the OS levels that they support.
    5) Delete, on your PC, all copies of VENDOR.XML...there will be at least one, and perhaps 2, and they will be located in or similarly to (it changes based on your Windows version) these folders:
    C:\Program Files (x86)\Common Files\Research In Motion\AppLoader
    C:\Users\(your Windows UserName)\AppData\Roaming\Research In Motion\BlackBerry\Loader XML
    6a) For changing your installed BB OS level (upgrade or downgrade), you can launch the Desktop Software and connect your BB...the software should offer you the OS package you installed to your PC.
    6b) Or, for reloading your currently installed BB OS level as well as for changing it, bypass the Desktop Software and use LOADER.EXE directly, by proceeding to step 2 in this process:
    http://supportforums.blackberry.com/t5/BlackBerry-Device-Software/How-To-Reload-Your-Operating-Syste...
    Note that while written for "reload" and the Storm, it can be used to upgrade, downgrade, or reload any BB device model -- it all depends on the OS package you download and install to your PC.
    If, during the processes of 6a or 6b, your BB presents a "507" error, simply unplug the USB cord from the BB and re-insert it...don't do anything else...this should allow the install to continue.
    You may also want to investigate the use of BBSAK (bbsak.org) to perform the wipe it is capable of.
    You may also want to try the "Bare Bones OS Reload Procedure" to attempt to narrow down the precise causal item:
    Load your OS "bare bones"...if anything is optional, do not install it.
    If the behavior presents immediately, then try a different OS with step 1
    If the behavior does not immediately present, then run for as long as it takes for you to be sure that the behavior will not present.
    Add one thing -- no matter how tempting, just one.
    If the behavior does not present immediately, then again run for long enough to be sure it will not have the same problem
    Repeat steps 4 and 5 until all things are loaded or the behavior presents
    When the behavior presents, you know the culprit...the last thing you loaded.
    If the behavior does not re-present, then you know that either step 1 or 2 cured it.
    If the behavior presents no matter what, then you likely have a hardware level issue for which no amount of OS or software can cure.
    You may also need the use of these tricks:
    KB10144 How to force the detection of the BlackBerry smartphone using Application Loader
    KB27956 How to recover a BlackBerry smartphone from any state
    http://crackberry.com/blackberry-101-lecture-12-how-reload-operating-system-nuked-blackberry
    If you are on MAC, you are limited to only your carriers sanctioned OS packages...but can still use any levels that they currently sanction. See this procedure:
    KB19915How to perform a clean reload of BlackBerry smartphone application software using BlackBerry Desktop Software
    Good luck and let us know!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • I'm using a 15" Macbook Pro running OSX6.8 and cannot upgrade. I have a subscription to Adobe CC but none of these work on this so I was on with Adobe for 5 hours trying to install and launch Illustrator, InDesign, Photoshop, Muse, and Acrobat Pro from CS

    I'm using a 15" Macbook Pro running OSX6.8 and cannot upgrade. I have a subscription to Adobe CC but none of these work on this so I was on with Adobe for 5 hours trying to install and launch Illustrator, InDesign, Photoshop, Muse, and Acrobat Pro from CS6. Well, InDesign is the only one that works and I have a ton of work due! I don't have a serial number for Photoshop or Illustrator except for CS3, and they don't work. InDesign gave me no problems. Illustrator says it can't work on this machine. Photoshop needs a serial number. I'm stumped and getting anxious and freaked out. Can anyone help? Adobe Chat is down right now.

    if you have a cc subscription, close ps > sign out and then back in to your cc desktop > open ps.
    ai cs6 requires:
    Multicore Intel processor with 64-bit support
    Mac OS X v10.6.8 or v10.7. Adobe Creative Suite 5, CS5.5, and CS6 applications support Mac OS X v10.8 and v10.9 when installed on Intel-based systems.*
    2 GB of RAM (8 GB recommended)
    2 GB of available hard-disk space for installation; additional free space required during installation (cannot install on a volume that uses a case-sensitive file system or on removable flash storage devices)
    1024 x 768 display (1280 x 800 recommended) with 16-bit video card

  • I am backing up my computer to an external hard drive using Time Machine.  It has been at 288.91 "used" for a while... should I just let it ride?  It's been going for about 7 hours now.

    I am backing up my computer to an external hard drive using Time Machine.  It has been at 288.91 "used" for a while... should I just let it ride?  It's been going for about 7 hours now

    It does not immediately delete the files that are missing.. it merely tries to backup the new files it has discovered on the external drive. Since you moved the files there, the backup at least for a while will contain both copies.. and that is why it doesn't have enough space to backup.
    Fixing the problem.. hmm pondini is the expert.. you should be able to delete the backup of the photos in existing backup.. there are instructions to do it.. but it is a very poor way to do things.
    Much better. .archive off the existing backup.. this is long and slow but worth it. you need a usb drive of the same size as the TC drive. Then erase the TC and start a fresh set of backups.
    The alternative is to use the USB drive as a new target.. but it is much slower than the TC internal drive.
    http://pondini.org/TM/12.html

  • Hi, I was using my iPod Touch and then all of a sudden, the screen went black. So I held the the on and menu button to reboot it and so it shut of and came back on and been on the loading screen for an hour. What can I do to fix it?

    Hi, I was using my iPod Touch and then all of a sudden, the screen went black. So I held the on/off button and menu button to reboot it. So it turned off then back on but it has been stuck on the loading page for an hour. What's wrong with it?

    - Let the battery fully drain. After charging for at least an hour try here:
    iOS: Not responding or does not turn on

  • My ipad 2's battery percentage is stuck at 95%!!! Eventhough I charge 5 hours, it is still 95%...After that, I unplugged the charger, I use my ipad for 3 hours, it is still 95%!!!!! What's wrong is it?! HELP ME

    My ipad 2's battery percentage is stuck at 95%!!! Eventhough I charge 5 hours, it is still 95%...After that, I unplugged the charger, I use my ipad for 3 hours, it is still 95%!!!!! What's wrong is it?! HELP ME

    You probably need to recalibrate the battery. See link below.
    Try this first - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.)
    The quickest way (and really the only way) to charge your iPad is with the included 10W or 12W (5W on Mini) USB Power Adapter. iPad will also charge, although more slowly, when attached to a computer with a high-power USB port (many recent Mac computers) or with an iPhone Power Adapter (5W). When attached to a computer via a standard USB port (2.5W, most PCs or older Mac computers) iPad will charge very slowly (but iPad indicates not charging). Make sure your computer is on while charging iPad via USB. If iPad is connected to a computer that’s turned off or is in sleep or standby mode, the iPad battery will continue to drain.
    Apple recommends that once a month you let the iPad fully discharge & then recharge to 100%.
    How to Calibrate Your Mac, iPhone, or iPad Battery
    http://www.macblend.com/how-to-calibrate-your-mac-iphone-or-ipad-battery/
    At this link http://www.tomshardware.com/reviews/galaxy-tab-android-tablet,3014-11.html , tests show that the iPad 2 battery (25 watt-hours) will charge to 90% in 3 hours 1 minute. It will charge to 100% in 4 hours 2 minutes. The new iPad has a larger capacity battery (42 watt-hours), so using the 10W charger will obviously take longer. If you are using your iPad while charging, it will take even longer. It's best to turn your new iPad OFF and charge over night. Also look at The iPad's charging challenge explained http://www.macworld.com/article/1150356/ipadcharging.html
    Also, if you have a 3rd generation iPad, look at
    Apple: iPad Battery Nothing to Get Charged Up About
    http://allthingsd.com/20120327/apple-ipad-battery-nothing-to-get-charged-up-abou t/
    Apple Explains New iPad's Continued Charging Beyond 100% Battery Level
    http://www.macrumors.com/2012/03/27/apple-explains-new-ipads-continued-charging- beyond-100-battery-level/
    New iPad Takes Much Longer to Charge Than iPad 2
    http://www.iphonehacks.com/2012/03/new-ipad-takes-much-longer-to-charge-than-ipa d-2.html
    Apple Batteries - iPad http://www.apple.com/batteries/ipad.html
    iPhone: Hardware troubleshooting (Power/Battery section also applies to iPad)
    http://support.apple.com/kb/TS2802
    Extend iPad Battery Life (Look at pjl123 comment)
    https://discussions.apple.com/thread/3921324?tstart=30
    iOS 7 Battery Life Draining Too Fast? It’s Easy to Fix
    http://osxdaily.com/2013/09/19/ios-7-battery-life-fix/
    New iPad Slow to Recharge, Barely Charges During Use
    http://www.pcworld.com/article/252326/new_ipad_slow_to_recharge_barely_charges_d uring_use.html
    iPad: Charging the battery
    http://support.apple.com/kb/HT4060
    Best Practices for iPad Battery Charging
    http://www.ilounge.com/index.php/articles/comments/best-practices-for-ipad-batte ry-charging/
    Tips About Charging for New iPad 3
    http://goodscool-electronics.blogspot.com/2012/04/tips-about-charging-for-new-ip ad-3.html
    How to Save and Prolong the battery life of your new ipad
    https://discussions.apple.com/thread/4480944?tstart=0
    Prolong battery lifespan for iPad / iPad 2 / iPad 3: charging tips
    http://thehowto.wikidot.com/prolong-battery-lifespan-for-ipad
    iPhone, iPod, Using the iPad Charger
    http://support.apple.com/kb/HT4327
    Install and use Battery Doctor HD
    http://itunes.apple.com/tw/app/battery-doctor-hd/id459702901?mt=8
    To Extend a Device’s Battery Life, Get to Know It Better
    http://tinyurl.com/b67c7xz
    iPad Battery Replacement
    http://www.apple.com/batteries/replacements.html
    In rare instances when using the Camera Connection Kit, you may notice that iPad does not charge after using the Camera Connection Kit. Disconnecting and reconnecting the iPad from the charger will resolve this issue.
     Cheers, Tom

  • 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

  • When i plug in my charger to my macbook and have it charged all the way i can only use it for an hour before it dies on me again. what is wrong with my macbook? what can i do to fix it?

    when i plug in my charger to my macbook and have it charged all the way i can only use it for an hour before it dies on me again. what is wrong with my macbook? what can i do to fix it?

    Go to the Apple in the upper left corner and select About This Mac, then click on More Info (and then System Report in 10.7), then select Power from the left hand column of the System Profiler. Copy and paste the Battery Information back here.
    Also it would help to know which one of the 9 different models of MacBook you have. To see which model you have go to the Apple in the upper left corner and select About This Mac, then click on More Info (and then System Report in 10.7).When System Profiler comes up check the Model Identifier.

  • HT1349 i have just bought an ipad2 from usa. now i am in dia. i am a first timer user of ipad. i have charged for three hours, when i start iti.e. on the device it shows a plug in icon with itunes. then the screen turns black. i am not able to use the dev

    i have just bought an ipad2 from usa. now i am in india. i am a first timer user of ipad. i have charged for three hours, when i start iti.e. on the device it shows a plug in icon with itunes. then the screen turns black. i am not able to use the device. kindly help

    You need to plug the iPad into your computer that has iTunes installed on it, and activate it.
    The User Guide would be good for you to read:
    http://support.apple.com/manuals/#ipad

  • When I use my iPad for an hour or more it gets really warm to the touch, what is wrong?

    WWhen I use my iPad for an hour or more it gets really warm to the touch, what is causing this?

    you using it.
    WHen batteries drain they generate heat, as does your screen and processor.
    Warm is normal. if it ever gets too hot to handle - literally - then stop using it and book an appiontment at your local apple store. But really, generating heat is no different from your computer getting warm as it's used.

Maybe you are looking for