Sponsored Content
Top Forums UNIX for Advanced & Expert Users Run only 3 sqlplus session at a time Post 303010849 by jgt on Monday 8th of January 2018 12:23:25 PM
Old 01-08-2018
Code:
count=0
for name in `cat abc.txt` do (sqlplus -s  usert/password@host <<-EOF>> error.txt
             SET LINESIZE 1000
             select '$name', TO_CHAR(current_timestamp(0),'DD-Mon-YYYY HH24:MI:SS') as start_time from dual;
             EXEC proc('$name');
             select '$name' ,TO_CHAR(current_timestamp(0),'DD-Mon-YYYY HH24:MI:SS') as end_time from dual;
             EOF  ) &
let count=$count+1
if [ $count -gt 2 ]
then
   wait
   count=0
fi
 done 
wait 
run the below part only if all the loops in the for has completed! echo "Complete"


Last edited by rbatte1; 01-09-2018 at 07:41 AM..
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

setting session time

Please lemme know how & where to set the session time for ftp connection in Wu-ftp . Regards Gambhi. (5 Replies)
Discussion started by: gambhi_s
5 Replies

2. UNIX for Dummies Questions & Answers

Session time out

Hi, We have a generic login id :- ship1 . There can be any number of sessions for this login ID. I'm working on a way to log off idle sessions ( not logins) . I searched the forum and found TMOUT. Is it at login level or session level ? ( looks like it is at login level) But I added it to... (2 Replies)
Discussion started by: newtoxinu
2 Replies

3. Shell Programming and Scripting

sqlplus session being able to see unix variables session within a script

Hi there. How do I make the DB connection see the parameter variables passed to the unix script ? The code snippet below isn't working properly. sqlplus << EOF user1@db1/pass1 BEGIN PACKAGE1.perform_updates($1,$2,$3); END; EOF Thanks in advance, Abrahao. (2 Replies)
Discussion started by: 435 Gavea
2 Replies

4. Shell Programming and Scripting

Is it possible..when ftp session disconnect and it can automatic run again?

Hi, Is is possible when ftp script disconnect by remote server and it can restart to tranfer (such as restart in 10 mins, etc)? Please help!!!! (1 Reply)
Discussion started by: happyv
1 Replies

5. UNIX for Dummies Questions & Answers

how to run who am i from remote session

I just moved from AIX 4 to AIX 5.3. the command `who am i` is essential to our logon scripts; but it does not work anymore, it says the process is not attached to a terminal. Is it possible to run this command remotely? It works for remote root sessions. If it is not is there another way to... (2 Replies)
Discussion started by: raidzero
2 Replies

6. UNIX for Advanced & Expert Users

Xserver connect and run CDE session from Windows PC

Hope someone can help. I have 5 Unix Tru64 ver 4.0/5.1B, boxes and I'm trying to connect and run CDE session from my PC. I have tried using Reflections, and Xming with no luck. Can someone tell me what exactly needs to be running on the Tru64 boxes in order for this to work. Along with what or how... (4 Replies)
Discussion started by: Troberts50
4 Replies

7. Shell Programming and Scripting

how to run a command as soon as user exits from session

I need to write a script, where I have to get names of files that are to be deleted from a user and have to delete those files when he exits session. How to set a particular command to be run as soon as user exits from a session? Can somebody help? I have to write a script on linux system.... (3 Replies)
Discussion started by: yashashri
3 Replies

8. Shell Programming and Scripting

How to run scripts within a telnet session?

I want to connect to a remote host using telnet there is no username/password verification just telnet remotehost then I need to input some commands for initialization and then I need to repeat the following commands: cmd argument argument is read from a local file, in this... (1 Reply)
Discussion started by: esolve
1 Replies

9. Shell Programming and Scripting

Need to track what Commands run in a login session

Hi I need to track what commands run in login session in solaris whether it is root or any normal users in bash shell. My actual requirement is that when a user (nomal/root) login into the system, whatever commands he run, it should log into file on specified path . I don't require command... (4 Replies)
Discussion started by: hb00
4 Replies
COUNT(3)								 1								  COUNT(3)

count - Count all elements in an array, or something in an object

SYNOPSIS
int count (mixed $array_or_countable, [int $mode = COUNT_NORMAL]) DESCRIPTION
Counts all elements in an array, or something in an object. For objects, if you have SPL installed, you can hook into count(3) by implementing interface Countable. The interface has exactly one method, Countable::count, which returns the return value for the count(3) function. Please see the Array section of the manual for a detailed explanation of how arrays are implemented and used in PHP. PARAMETERS
o $array_or_countable - An array or Countable object. o $mode - If the optional $mode parameter is set to COUNT_RECURSIVE (or 1), count(3) will recursively count the array. This is particu- larly useful for counting all the elements of a multidimensional array. Caution count(3) can detect recursion to avoid an infinite loop, but will emit an E_WARNING every time it does (in case the array contains itself more than once) and return a count higher than may be expected. RETURN VALUES
Returns the number of elements in $array_or_countable. If the parameter is not an array or not an object with implemented Countable inter- face, 1 will be returned. There is one exception, if $array_or_countable is NULL, 0 will be returned. Caution count(3) may return 0 for a variable that isn't set, but it may also return 0 for a variable that has been initialized with an empty array. Use isset(3) to test if a variable is set. EXAMPLES
Example #1 count(3) example <?php $a[0] = 1; $a[1] = 3; $a[2] = 5; $result = count($a); // $result == 3 $b[0] = 7; $b[5] = 9; $b[10] = 11; $result = count($b); // $result == 3 $result = count(null); // $result == 0 $result = count(false); // $result == 1 ?> Example #2 Recursive count(3) example <?php $food = array('fruits' => array('orange', 'banana', 'apple'), 'veggie' => array('carrot', 'collard', 'pea')); // recursive count echo count($food, COUNT_RECURSIVE); // output 8 // normal count echo count($food); // output 2 ?> SEE ALSO
is_array(3), isset(3), strlen(3). PHP Documentation Group COUNT(3)
All times are GMT -4. The time now is 04:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy