Sqlplus process count in Unix

I need to process 50 sqlplus scripts. At any point of time, the number of scripts running shouldn't exceed 6. If any one of the scripts completes successfully then another one needs to kick off, till all scripts are processed.
How do I do this?
I tried these, but it didn't work:
if [[ `ps -ef|grep "sqlplus -s scott"|grep -v "grep"|wc -l` -eq 6 ]] ; then
wait
fi

"Wait" waits for the job completion while "sleep" is basically a pause.
I guess there needs to be 2 loops. One looping through the sql list and another one checking the number sql sessions opened at any time.
Say, the first loop kicks off the first 6 sqls. Now the sqls read and running are the same : 6. After some time, 2 sqls get done. Now the sqls read is 6 but the sqls running is 4. So the first loop should read the next two sqls, 7 & 8, and execute them.
This is what I need to do.

Similar Messages

  • How to find out the process count for a database during a particular window

    Hi Team,
    I want to find out the maximum process count reached for a database for an interval. Say between 1:00 to 2:00 AM IST. Please help
    Database version:11.2.0.2
    OS:AIX 6.1

    Check DBA_HIST_RESOURCE_LIMIT. Your information will be there.
    Simialr information is available in DBA_HIST_SYSSTAT.
    Look for stat name logons cumulative/logons current - Total number of logons since the instance started/Total number of current logons
    You can joing dba_hist_snapshot with snap_id and give begin_interval_time and end_interval_time to know historic process utilization.
    Regards,
    Sreejith

  • Problem with starting a sqlplus-process via java.lang.Process

    Hi,
    I want to start a sqlplus-Process from a java-application via java.lang.Process. Works great with XP. On a W2K-Machine, the process is started (I can see it in the Taskmanager), but it doesn't connect to the db - the OS-process hangs, also the java-application which invoked the process.
    If I start a sqlplusw.exe-Process instead of sqlplus.exe, it works as well.
    Does anybody know what's going wrong ?
    I'm using java 1.5.0_11 and Oracle Database 10g Enterprise Edition Release 10.2.0.3.0
    Thanks in advance
    Jens

    java.lang.Process can be used to perform an OS Shell to launch specific tasks. But why are you interested in specifically launching sqlplus from here?
    ~ Madrid
    http://hrivera99.blogspot.com/

  • DISK,VM,NETWORk,PROCESS COUNTER INFO

    Hi,
    1. For VM I am using the cpu_vminfo_t to collect the VM counters? The value
    that I get for pages page in is 4605 (pages page in /lbolt_time). The values for pages paged out is 3881 again divided by lbolt time. Are these
    values correct? What is the command to verify these values?
    2. For Disk I am collecting the counters reads and writes , kilobytes read, kilobytes written from kstat_io_t. Is this the right structure to be used to collect the values? I am getting the disk reads as 213344 and disk writes as 0. Kilobytes read and written per sec are 0. I am using iostat
    to check these values. But the values do not match. So please suggest me
    if I am using the right structure to get the counter values.
    3. For networks which is the structure to be used to get the packets in, packets out, bytes in, bytes out, routes, socket open. etc.
    4. Again for process which is the structute to be used to get all the process counters?
    Any help or ideas on this is welcome.
    Thanks in advance,
    Charulatha.

    Forums > Forum: Kernel
    DISK,VM,NETWORk,PROCESS COUNTER INFO
    Hi,
    1. For VM I am using the cpu_vminfo_t to collect the VM counters? The value that I get for pages page in is 4605 (pages page in /lbolt_time). The values for pages paged out is 3881 again divided by lbolt time. Are these values correct? What is the command to verify these values?
    2. For Disk I am collecting the counters reads and writes , kilobytes read, kilobytes written from kstat_io_t. Is this the right structure to be used to collect the values? I am getting the disk reads as 213344 and disk writes as 0. Kilobytes read and written per sec are 0. I am using iostat to check these values. But the values do not match. So please suggest me if I am using the right structure to get the counter values.
    3. For networks which is the structure to be used to get the packets in, packets out, bytes in, bytes out, routes, socket open. etc.
    4. Again for process which is the structute to be used to get all the process counters?
    Any help or ideas on this is welcome.
    Thanks in advance,
    Charulatha.

  • Trigger process chains from UNIX

    Hi,
    I just wanted to know how can we trigger Process chains from UNIX Server.
    Any pointers will be appreciated.
    Thanks

    I suggest to use the sapevt.exe.
    With it you can trigger an event in the SAP system with the execution of a simple command file (.bat for ex.)
    So the event will start the chain as you require.
    You can find more info for sapevt in:
    http://help.sap.com/saphelp_nw04/helpdata/en/fa/096e6b543b11d1898e0000e8322d00/frameset.htm
    Regards,
    Sregio
    Did you try that?
    Message was edited by: Sergio Locatelli

  • Download Oracle client, instant client, sqlplus and isql for Unix sco6

    Can you please let me know where can I download 10g R2 Oracle client, instant client, sqlplus and isql for Unix sco6. Also if you can let me know if this all above is compatible with unix sco6.

    Hi,
    Check the link below.
    /R
    http://www.oracle.com/technology/software/index.html

  • How to find the max session count and process count for a database

    Hi All,
    How to find the maximum session count and process count reached for a database over a period of 15 days?
    DB version:11.2.0.2
    OS:AIX

    Thanks for the link.
    The output of the below query that is given in the link shows the results for the last 10 or 12 days.. Is there a query which gives a result for the last 30 days?
    col metric_unit for a30
    set pagesize 100
    Select trunc(end_time),max(maxval) as Maximum_Value,metric_unit
    from dba_hist_sysmetric_summary
    where metric_id in ( 2118,2119) group by trunc(end_time),metric_unit order by 1;

  • Discoverer 4i Processes Die on Unix

    Does anyone have this problem in the version of Discoverer that comes with 9iAS 1.0.2.2?
    I am starting my Discoverer processes using the three script files startall.sh, applypreferences.sh and registerall.sh. But when I log off the machine, all the Discoverer processes die and no Discoverer connections can be made. The only way I can keep Discoverer connectivity up is by remaining logged in as the user on the unix box who started the shells indefinitely. During this time all Discoverer connectivity is fine.
    I'm on Solaris 2.6 and my oracle user's $SHELL variable is /bin/sh. I have tried putting the jobs in the background and cron -- nothing works.
    Any ideas? Thanks..
    Kate

    I'm assuming because you're using 9iAS 1.0.2.2 that you are using Discoverer 4.1. I haven't had any problems with 4.1. I remember that Discoverer 3i did die when I logged out. I didn't bother to get it to work because we had so many other problems.

  • Process Id in Unix

    How can i get process id of the java program being executed in the unix environment programatically .

    Another suggestion was to exec an program which outputs its parent's PID. Something like this:
    #include <unistd.h>
    #include <stdio.h>
    int main() {
            printf("%d\n",getppid());
    }This works only if exec goes directly, that is, if there is no intermediate process.

  • To see the rman process running on UNIX

    Hi
    What is command on AIX / UNIX to see if we have any rman processes still running?
    Thanks.
    I tried ps -ef | grep oraprod (user) but see no rman processes.
    Many thanks

    There are 2 things what should be checked:
    1. from unix side as already pavan mentioned
    ps -ef | grep rman
    2. from oracle side to look for rman sessions:
    select * from v$session where program like 'rman%';
    If both requests return nothing - rman had finished his job and already from logfiles or with help of rman commands (list, report) You can understand īs the job done or not.

  • Finding C/Mgr Process Name on Unix

    Gurus,
    We have three environments on one HPUX box (PROD, TEST, DEV). Two of them are on 11i. One of them is now on 12. In the past, to determine the concurrent manager process, I grep for fndcpmbr, and also grep on the mountpoint. The reason why I grep on the mountpoint is because that shows the concurrent manager logfile location, so I can differentiate between PROD, TEST and DEV. (Each environment is on it's own mountpoint or filesystem, eg /u10, /u11 and /u12)
    In release 12, the fndcpmbr unix process does not show the logfile. So once all environments on this box are on release 12, how can I determine through ps-ef on unix, which concurrent manager belongs to which environment?
    So 11i looks like this:
    FNDLIBR FND CPMGR FNDCPMBR sysmgr="" diag=N logfile=/u10/or
    And 12 looks like this:
    FNDLIBR FND CPMGR FNDCPMBR sysmgr="" sleep=30 pmon=4 quesize=1 d (there is no logfile showing)
    Thanks ...colin

    Hi Srini,
    Because we have PROD, TEST and DEV on the same unix box. If I'm applying a patch to TEST, I need to shutdown the TEST application processes. AFter calling the script to shut it down, I always check for the unix process to ensure it is down (it's just easier than logging into the applications to the c/mgrs screen). The other reason: say if we need to shutdown the Test database - I always like to ensure that the TEST applications processes are completely shutdown, before I shutdown the TEST db - again, it's always been easier to run my ps -ef script on unix, that it is to log into the application and check the concurrent mgr screen.
    ..colin

  • Process locking while running the current process running in Unix

    Hi Guys,
    I am sorry to ask you the question here . I have a situtation like I am running one process using crontab which kicks of every 30 mins but due to database slow my another batch is overlapping the process . Could you please give me some suggetions in unix
    Process A is running at 10:30 but this process did not complete
    The same process is started 11:00 -- Both process are overlapping each other .
    Please suggest me any thing .
    Clark

    No Oracle version number
    No description of the process or the SQL or PL/SQL being run
    No explain plans
    No traces
    No timings
    Here are your choices in no particular order.
    1. Buy faster hardware
    2. Load less data into your tables
    3. Modify all SQL statements to contain "AND ROWNUM = 1"
    4. Improve the performance of the first job
    5. Start the second job later than 11:00
    6. Provide those trying to help you with sufficient information for them to do so
    Well you did ask for "anything." <g>
    Seriously ... I'd suggest you choose #6.

  • Exec sqlplus process error in character conversion

    Hello,
    Having problems loading data using sqlplus_exec_template.sql. I'm trying to load data by executing PROCESS
    REPO RT USER = Rtm_access
    repo rt OWNER = RTM
    locatie wf = WFM_RTM
    PROCESS = INI
    PROCESS FLOW PACKAGE = MIRO0
    this is the command from the dos prompt
    sqlplus rtm_access/rtm_access@miro @c:\owbdeploy\sqlplus_exec_template.sql RTM WFM_RTM PROCESS INI MIRO0 ","
    In a spool script I'll get the next output
    Session altered.
    Role set.
    ERROR:
    ORA-24365: error in character conversion
    I also tried the command with system_params = ",". Then I
    got the same output error.
    Can you help me ?
    My best regards
    Aad van der Kooij

    Mark,
    I also tried the command without the process flow package,
    sqlplus rtm_access/rtm_access@miro @c:\owbdeploy\sqlplus_exec_template.sql RTM WFM_RTM PROCESS INI "," ","
    The problem also exists when I want to execute a mapping in sqlplus:
    sqlplus rtm_access/rtm_access@miro @c:\owbdeploy\sqlplus_exec_template.sql RTM STG_TRG_LOC PLSQL SMA_REF_LAND "," ","
    I forget to tell you the versions of OWB (9.2.0.2.8) en
    SQLPLUS (8.0). Could this be the reason of the error.
    My best regards,
    Aad van der Kooij

  • *"Wrong process return code"* Unix Command

    Hi,
    I have created Package with Procedure having Unix command.Unix command is only to cp data file from one folder to another archive folder.
    we are defining variable FilePath and FileName.
    cp #FILE_PATH/#FILE_NAME.tag #FILE_PATH/archive/;
    But while running this we are getting following erorr.
    *"Wrong process return code"*
    Plz suggest.
    Thanks
    Ashwini

    Hi Aswini-
    You should not use # symbol for your variable pointers, it will take as a comment line. Please use the below syntax:
    FILE_PATH=c:\temp
    FILE_NAME=test.txt
    cp $FILE_PATH/$FILE_NAME.tag $FILE_PATH/archive/
    And also you can check the exact error by executing the script file in your unix command prompt like this:
    /home/test/test.sh
    Hope this will work for you.
    Thanks,
    Saravanan Rajavel

  • Abnormal increment in background processes on AIX unix (oracle8i)

    Hi
    We have a problem running oracle8i on AIX unix. Our system is having two
    parallel IBM RS6000 servers. Both running in HACMP env. We are using oracle8i with almost 350 clients.
    For the last few days we observed that total no of oracle background processes abnormally increasing and touches 400 on each server. We got this information from following command
    ps -ef |grep ora |wc -l
    The moment it reaches 400 no more sessions are able to connect to the database.
    One more thing we have observed that about 150 processes are defunct, which we get from using following commands
    ps -ef |grep defunct | wc -l
    On killing these processes using
    kill -9 <pid>
    system is unable to kill it.
    When we query from v$session connecting to each servers we hardly found total number of sessions more than 225 on each server.
    If anybody has any idea why so many processes are spawned and how to control them please mail me the solution. Or if u require some more information about the system and oracle parameters please let me know. My email_id is
    [email protected]
    Thanks
    SHAKEEL AHMAD

    You compare v$process with v$session.
    If you have any defunc process, they wont appear in the v$session. But, they resides in the v$process. You need to kill them from the os prompt.
    SELECT spid
    FROM v$process
    WHERE NOT EXISTS ( SELECT 1
    FROM v$session
    WHERE paddr = addr)
    This query gives the osid of all the defunc process and kill them using kill -9 on os.
    Are your connection coming from jdbc? Also, you can make use of DCD Dead Connection Detector.
    http://asktom.oracle.com/pls/ask/f?p=4950:8:8284822833477458404::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:1784142376742
    Jaffar
    Message was edited by:
    The Human Fly

Maybe you are looking for

  • OIM 11g Modify User Profile for Updating End Date

    Hi Gurus! We have an OIM implementation where users may request the creation of other users by means of a Create User request template. In this template we set the End Date to be 3 months after the request date. In order for the requester to extend t

  • Syncing to computer not computer to iPad.

    I want to update to IOS 5 but when I connect my ipad2 it tells me purchased items are not backup up. I have 2 iPhones and an iPad. How do I back up my iPad but not having those other apps, music and pictures put on my iPad?

  • Re-installing Adobe Lightroom with cd software after re-installing the operating system?

    i wiped my computer clean and re-installed the operating system on my macbook pro because it's old and i hadn't done it in a long time. now i'm putting all of my old software back onto the computer. everything else had no problem. adobe lightroom 2 w

  • I am new to mac can you tell me how to uninstall a program?

    I purchased Office for MAC and it's terrible. In order to get a refund I have to uninstall it from my computer. Being from a PC I am not sure how to completely uninstall the program. Can comeone tell me the steps to do this? Thanks

  • Create a function

    Hi all, I would like to understand what is my errors in this procedure : * I get : Warning: Procedure created with compilation errors. Anyone could help me please? * This procedure drop all the objects in the current schema. CREATE OR REPLACE PROCEDU