||The SQL script above does that for you.
If you want to do it manually (less desirable) then use:
sdemon -o info -I users (see who is connected)
sdemon -o info -I locks (see who has locks)
In Oracle run :
a. SQL> select sid, process, substr(username,1,20) as username, status, substr(machine,1,20) as machine, substr(program,1,16) as program from v$session where program in ('gsrvr.exe', 'giomgr.exe');
b. SQL> select sde_id,server_id,start_time,substr(owner,1,20) as owner,direct_connect from sde.process_information;
c. SQL>select * from sde.table_locks
d. SQL>select * from sde.layer_locks
e. SQL>select * from sde.object_locks
f. SQL>select * from sde.state_locks
g. SQL>select a.owner||'.'||a.table_name locked_table,a.registration_id,
b.owner locked_by, b.start_time from sde.table_registry a, sde.process_information b, sde.table_locks c where a.registration_id = c.registration_id and b.sde_id = c.sde_id;
There should be enough info in all of this for you to find active connections.
Still the Code provided from TB should do what you need.