Need help how to get list of user by batch.

dopena

New Member
Hi,

I am in a process of automating DBA work. I want to capture all active users on a database by unix script but doesn't work properly if the number of concurrent users is more than 22.

Here is what I did, I create a file called "keystroke" which contain
1
1
q
q

The I create a script getid.ksh the contain this;
promon dbname < keystroke > user.list

The database have more than 100 users but if you vi the user.list
it captured only 22 users the rest are missed because you need to hit RETURN to get the rest of the list. Any help will be much appreciated.
 

bendaluz2

Member
Either add the control code for return to your keystroke file, as many times as you may need, or get the information through the virtual system tables (a much better way to go all round)
 

Progress Jr.

New Member
I found a better way which I would like to share if someone needs it.

I used SQL query;

"select _connect-name, _connect-type, _connect-pid from _connect"

and write output to a file.
 

bendaluz2

Member
Well, thats just using the virtual system tables, like I said, but you need to enable them first (well in V8 you do anyway)
 
Or you could set your page length to some ridiculous number!

Try the following in your "keystroke" file

m
1
9999
q
1
1
q
q

Which will modify your page size to 9999 lines and then do the user list (or at least it will in V9.1 - check the options in any other version!)

Alternately if this is to be initiated regularly you could write a piece of Progress Code to run in background which dumps the Virtual System Table details to a file somewhere and then sleep!

A background job could then ensure that this script is running or start it up.

Enjoy!
 
Top