Check if a process is running

Hello

I had a procedure that should not be carried out simultaneously in several sessions.

That's what I coded to achieve:
CREATE PROCEDURE TEST_SIMUL_EXEC
IS
   v_count        INTEGER;
   my_exception   EXCEPTION;
BEGIN
   SELECT COUNT (1)
     INTO v_count
     FROM v$access a, v$session s
    WHERE a.SID = s.SID AND a.OBJECT = 'TEST_SIMUL_EXEC'
          AND s.status = 'ACTIVE';

   IF v_count > 0
   THEN
      RAISE my_exception;
   END IF;
--the procedure execution logic goes here.
EXCEPTION
   WHEN my_exception
   THEN
      DBMS_OUTPUT.put_line ('Multiple simultaneous execution is not allowed.');
END;
Don't you think it's a good and a foolproof approach?

Thank you
CJM

This requirement is exactly why Oracle provides us with the DBMS_LOCK package.

Go look it up in the documentation.

Tags: Database

Similar Questions

  • check the asynchronous process is running

    Hello

    A quick question: I have this program consisting of several state machines. The user interface can start these state machines (asynchronous) and send commands to them. Now, the problem is that I have to be able to check if a certain state machine runs or not. What is the best way to achieve this?

    Kind regards

    Wouter

    I would have the FGV or the variable include a timestamp as well.

    There is a property for VI node titled executiontate.  That will show you the status of a VI.  But I don't think I want to count on it.  He would tell you a VI is running, but maybe you are really stuck in a sort of endless loop which prevents effectively do what you expect it to do.  For your application, you would consider it's stuck, but according to LabVIEW, it is executed.

    I would appeal to this method of guard dog where you update a variable that would be a cluster of a timestamp and another useful piece of information such as your current state of machines.  Now you will know what is happening, and you will know if they are too old.

  • How to check remotely if the process is running or not?

    Is there a way we can check if the process is running or not?

    Thank you

    Afonso

    The following WSDL allows you to check the status of remote process:

    http://servername: 8080/SOAP/services/TaskManagerQueryService? WSDL

    Steps to follow:

    1. with the help of TaskManagerQueryService , you can search your Instance of Process (with some filter settings).

    2 get the ProcessInstanceRow from the result list

    3. check the status of the process of processInstanceStatus property

    Hope that helps!

    Nith

  • How to check an Application/process running using Labwindows

    Hello

    How can I check if a process or Application is running or not with CVI?

    I used to try this in Labview, and to check the application, it is a VI in the Web site of NOR. But I have no idea on the use of CVI for this.

    And also, how can I check if a file is opened or help? I want to rename foder in my code, if it is open (perhaps a file in the folder are open), the action to rename will go wrong.

    Thanks in advance

    Hello

    using forum search I found the following thread discuss your topic:

    http://forums.NI.com/T5/LabWindows-CVI/how-to-know-exe-is-running-and-close-the-exe/m-p/1040673

  • Erased all messages in my Inbox except 1 that I can't remove. ERR mess says disk is full, but I can't compact bec he told one another process is running

    An old message is stuck in my Inbox. No matter what I do it not delete and I can no longer receive email on this computer because I get this message: there is not enough disk space to download new messages. Try to delete old messages, empty the deleted folder and compacting of your e-mail folders, and then try again. I erased my delete and send files and greatly reduced my folders, but the same situation applies. I tried to compact manually, but then I get the message that it can not compact as another process is running. However, on my iphone, or on another computer, I can still get an email update.

    try to take the file offline Thunderbird (Alt + F) menu > offline > workoffline
    Close Thunderbird
    Restart your computer
    Restart Thunderbird and try compacting while Thunderbird is still offline.

  • Why my svchost.exe process constantly runs at 100% CPU usage?

    Recently, my computer was extremely slow.  I thought that was the cause of a worm or virus but after I used Norton to take care of that my system is still slow right too. When I checked my system process, its display svchost.exe using a massive amount of memory. Therefore, my CPU usage is constantly at 100%.  Is it still the result of a bug? Or do I have to look elsewhere as the source of the problem? Thank you

    It is possible that a recent update of Norton was faulty or caused one conflict with another program on the PC.

    Activity excessive svchost.exe is often linked to one of the following:

    1 resource hog like Norton or McAfee (sad but true)

    2 be linked in Microsoft Update instead of Windows Update

    3. after having been updated for Windows Search 4.0 and its endless reindexing

    4. the presence of malware

    Unless you have uninstalled Norton AND used their removal tool, I doubt you really deleted ALL occurrences of Norton!

    FWIW, I helped a neighbor recently with his performance problem. The culprit in his case was Windws Search 4.0. And since there is no entry in the Control Panel Add / Remove programs to KB940157, I needed to follow the instructions offered by Nepatsfan here:

    http://help.WUGNET.com/Windows/uninstall-Windows-search-Windows-XP-KB940157-ftopict624142.html

  • Check the disk continues to run when I turn on my computer

    Whenever I turn on my computer. Check the disc is still running. I have let it run before and I restart my computer and it works again. When I let the program run, he never finds anything and it's getting boring. Can anyone?

    Whenever I turn on my computer. Check the disc is still running. I have let it run before and I restart my computer and it works again. When I let the program run, he never finds anything and it's getting boring. Can anyone?

    1. click on the start menu and open the Run dialog box.

    2. Type "cmd" and back (Note: don't enter quotation marks)

    3. then type "fsutil dirty query c:."

    4. If the returned message indicates that the volume is dirty, proceed to step 5

    5. then type "chkdsk c:/f/x.

    6. after that finshes repeat step 3.

    7. If it is no longer dirty then reboot and the problem should be solved.

    If you continue to receive the drive guest check after completing the above steps follow the instructions HERE

  • How to check what Qt application is run for the first time?

    How to check what Qt application is run for the first time? I need for the creation of trial version of my application. Any help is greatly appreciated

    Probably use file data and put an I_ran_at_least_one_time file and verify its existence. This file is not accessible to the user and is not changed even if you upgrade the application.

  • How to check the MSDS 13.2 running MSD Agent (legacy mode) or TMS provisioning or extension of TMS provisioning services.

    Hello

    How to check the MSDS 13.2 running MSD Agent (legacy mode) or TMS provisioning or extension of TMS provisioning services.

    Kind regards

    Siva

    My TMS is strictly using Extension of Provisioning, because I am running 14.3.2 TMSPE is the only option for me, so I can't provide a screenshot.

    However check you by going to: administrative tools > Configuration > General settings, look for the commissioning Mode.

    That said, I suggest that you consider migrating to TMSPE if you have not already, that the recent version of TMS have removed TMS Agent legacy mode.  If you want to use the latest versions of TMS and take advantage of the features it provides, you will need to perform the migration, if not already done.

  • In Task Manager, how can I know which processes are running in the background?

    In Task Manager, how can I know which processes are running in the background?

    Hello.

    What exactly is your problem?

    Details please! Thank you.

    • When you open the Task Manager, go to processes
    • under the seat of tab CPU reading 01, 02, or higher... that's how you know what programs are underway on the bottom.

    Helped?

  • How to find what processes are running on my computer and use it from memory?

    * Original title: find running processes

    How to find what processes are running on my computer and use it from memory?

    You can press Ctrl-Shift-Escape to see which processes are underway and those who is using memory (and how much they use).  Although the memory usage is not as important as how they use lots of CPU, which is what can make your computer slow if there are too many programs use the CPU at the same time.  For memory, even if she says that he uses a lot, an inactive program ' pages on "memory to the hard disk and it frees room for other programs to use, is not as important as the CPU generally (unless you are very very low on memory).

  • I have to check if no job has run during the last five minutes.

    I have to check if no job has run during the last five minutes.
    I need to store five minutes in a table separate from five minutes can be changed to 10 minutes in the future.

    I will be pulling out of this table in the following query.

    SELECT CASE WHEN COUNT (ROW_WID) = 0 THEN 'NO JOBS RAN AFTER THE SPECIFIED TIME"END

    FROM W_ETL_RUN_SDTL WHERE START_TS > (SELECT sysdate - (SELECT * FROM XXAFL_MINUTES) the double);


    Start_TS - date and time of beginning of the tasks/jobs

    XXAFL_MINUTES - table, which keeps the number of minutes


    Can you please help me to create the query. I'm not able to store five minutes in the table. What format should be the column?

    The query above returns null, even if a job ran.

    If you want to store an interval may be the interval data type would be a reasonable choice. Maybe something like:

    create table check_intervals)

    my_interval days apart on the second

    );

    insert into check_intervals (my_interval) values ('5' minutes of interval);

    Select count (*)

    of dba_scheduler_jobs

    where start_date > (select sysdate - my_interval)

    of check_intervals);

  • Check if all tasks are running against a virtual machine in vCenter?

    I need to write some powercli to see if a virtual machine is being switched, vmotioned or possibly another operation.  How can I check if a task is running on the VM specified in vCenter?

    I know how to get the tasks running in vCenter:

    $task = get-task-status Running

    But how to determine what the target is tasks?

    Try something like this

    Get-job | where {$_.} {ObjectId-match ' ^ VirtualMachine'} |

    Select StartTime,State,@{N='VM'; E = {Get-View-Id $_.} ObjectId-the property name. {{Select - ExpandProperty name}}, Description

  • Process Scheduler running SQR report gets the Client HTTP response Code 401 Unauthorized error

    People,

    Hello. I'm under PeopleTools 8,53 Oracle Linux 5 with Oracle 11 g 1 material database.

    Process scheduler run reports SQR and get the error message as below:

    Error of the client Http Response Code: 401 - non authorized. Transfer HTTP error.

    My report node information is below:

    URLID: http://ip_address:port/p/psreports/ch

    Home directory: /psreports

    Resource URI: SchedulerTransfer/ch

    Login ID: PS

    Password: mypass

    PeopleTools > IntegrationBroker > Configuration of integration > nodes: authentication option is selected password.

    The 2 roles, ReportDistAdmin and ProcessSchedulerAdmin are granted to the user PS

    Someone tell the error above due to incorrect or misspelled path for report repository in the configuration.properties file.

    I see no error in my configuration.

    My question is:

    Can any help folk to solve 'Error Http 401 - transfer HTTP error response Code' unauthorized customer?

    Thanks in advance.

    I think there might help:

    E-RD: transfer report error: Client Error Code: 401 - Unauthorized (63.59) (Doc ID 623250.1)

    E-RD: what are the steps to configure basic authentication for the repository of reports on PT 8,4 x using Weblogic? (Doc ID 970572.1)

    Also if you use this with test the load on load balancer balancer.

    Kind regards

    RAM

  • Port is too long that the process that runs on there

    Platforms: 11.2.0.3 on AIX/Linux/Solaris

    This is a question about how software Oracle maintains sessions client connected after that the listener is stopped with elegance


    Scenario of
    =========
    You have a DB and its listener running on the DB server. The listener runs on port 3278.
    From your laptop, you start a sqlplus session to through the listener. After the session must be connected to the laptop. The process of listening to the DB server is reduced. But sql * more session connected to the laptop can still issue queries and get the results.sqlplus session is still connected to the DB via port 3728, even if the listener is down. ESTABLISHED for that port displays the following output of netstat on the Server DB (10.80.0.213)
    $ netstat -an | grep 3728
    10.80.0.213.3728   192.168.0.101.59001  17520    881 49640      0 ESTABLISHED
    A TCP/IP Port exists only when the process that runs / plays on it is. Right? Thus, after the listener is brought back is there another process that maintains this port so that the client session is served with what he needs the DB?

    As far as I KNOW, none of the two processes can share a port. Unless there is a mechanism in the listener that calls the port to another process, when it is worn down.

    Hello
    I think that explains very well at a level detailed - the way he manages the ports has changed slightly in the new versions of oracle - lsof does not look like it can in older versions.

    http://packetpushers.NET/SQLNET-a-k-a-Oracle-TNS-and-firewalls/

    See you soon,.
    Harry

Maybe you are looking for

  • No. sign $ on c7180 to join wifi

    my wifi has a $ sign in and there is not a $ sign of the HP C7180 keyboard, so I can't connect to wifi at reception - all ideas to work around the problem?

  • ERROR OF PR HP 15 C

    Hello, I just bought a HP 15 C which displays a message of ERROR when turned on. I have to press buttons at random to get past this message after which the calculator works normally. It can be power with no other ERROR PR display on and off. However,

  • Satellite Pro A210 DVD Drive not working no-error code 39

    Hi all My Satellite Pro A210 dvd player does not load.When I looked inside, he showed an error code 39.I tried uninstalling and reinstalling but it still doesn't work. Any ideas?

  • Tecra A7-248 does support look at a HARD drive?

    Hi all. I will buy a laptop at 1-2 next week, but I can not choose the Satellite A100-912 or Tecra A7-248.Would you advice one of them and don't look a Tecra A7-248 support HDD?

  • Clock and battery indicator went

    Hey, I've finally updated to OS X El Capitan last night. Everything goes a lot overall, I love the new features and the whole system runs a lot faster. The only problem I have is that since I've updated the clock and battery indicator are no longer v