Saturday, November 14, 2009

Multiple session list of a user

declare
cursor csess is select
s.osuser pu,
s.username su,
s.status stat,
s.sid ssid,
s.serial# sser,
lpad(p.spid,7) spid,
s.program txt
from v$process p,
v$session s
where p.addr=s.paddr
and s.username = upper('&1');

begin
dbms_output.put_line ('The Following Sessions are Traced');
dbms_output.put_line ('=================================');
dbms_output.put_line ('OS USER ORA USER STATUS SID SER# UNIX ID PROGRAM NAME');
dbms_output.put_line ('-------- -------- -------- ------- ------- ------- ----------------------------');
for rsess in csess loop
sys.dbms_system.set_sql_trace_in_session(rsess.ssid, rsess.sser, true);
dbms_output.put_line (rpad(rsess.pu,9) || rpad(rsess.su,9) || rpad(rsess.stat,9) || rpad(rsess.ssid,8) || rpad(rsess.sser,8) || rpad(rsess.spid,8) || rsess.txt) ;
end loop;
end;
/


The Following Sessions are Traced
=================================
OS USER ORA USER STATUS SID SER# UNIX ID PROGRAM NAME
-------- -------- -------- ------- ------- ------- ----------------------------
applbkp APPS INACTIVE 321 63 15565 JDBC Thin Client
applbkp APPS INACTIVE 352 64 15567 JDBC Thin Client
applbkp APPS INACTIVE 314 12763 12827 STANDARD@kmctapp2 (TNS V1-V3)
applbkp APPS ACTIVE 332 29 15569 JDBC Thin Client
applbkp APPS ACTIVE 319 45 15571 JDBC Thin Client
applbkp APPS INACTIVE 343 62 15573 JDBC Thin Client
applbkp APPS INACTIVE 371 37 15368 ICM@kmctapp2 (TNS V1-V3)
applbkp APPS INACTIVE 372 138 15411 FNDSM@kmctapp2 (TNS V1-V3)
APPS INACTIVE 330 95 15577
applbkp APPS INACTIVE 373 25 15413 FNDSM@kmctapp2 (TNS V1-V3)
APPS INACTIVE 389 45 15579
applbkp APPS INACTIVE 363 15853 12868 STANDARD@kmctapp2 (TNS V1-V3)
applbkp APPS INACTIVE 339 29 15126 JDBC Thin Client
applbkp APPS INACTIVE 313 10787 12270 STANDARD@kmctapp2 (TNS V1-V3)
applbkp APPS INACTIVE 370 44 15130 JDBC Thin Client
applbkp APPS INACTIVE 374 44 15133 JDBC Thin Client
applbkp APPS INACTIVE 346 52 15135 JDBC Thin Client
applbkp APPS INACTIVE 286 4061 10267 STANDARD@kmctapp2 (TNS V1-V3)
applbkp APPS INACTIVE 290 13107 12882 INVMGR@kmctapp2 (TNS V1-V3)
applbkp APPS INACTIVE 365 185 15746 JDBC Thin Client
APPS INACTIVE 356 50 15748
applbkp APPS INACTIVE 315 2211 12815 STANDARD@kmctapp2 (TNS V1-V3)
applbkp APPS INACTIVE 302 3283 12708 STANDARD@kmctapp2 (TNS V1-V3)
applbkp APPS INACTIVE 362 16 15425 IEU_WL_CS@kmctapp2 (TNS V1-V3)
applbkp APPS INACTIVE 367 43 15423 IEU_SH_CS@kmctapp2 (TNS V1-V3)
applbkp APPS INACTIVE 333 28 15428 OAMCOLMGR@kmctapp2 (TNS V1-V3)
APPS INACTIVE 334 45 15581
applbkp APPS INACTIVE 354 9414 12737 STANDARD@kmctapp2 (TNS V1-V3)
applbkp APPS INACTIVE 308 6527 12855 STANDARD@kmctapp2 (TNS V1-V3)
applbkp APPS INACTIVE 284 3877 29831 JDBC Thin Client
applbkp APPS INACTIVE 292 2863 12595 STANDARD@kmctapp2 (TNS V1-V3)
applbkp APPS INACTIVE 353 19 15474 KMCRCVTP@kmctapp2 (TNS V1-V3)
applbkp APPS INACTIVE 355 25 15471 KMCRCVTP@kmctapp2 (TNS V1-V3)
applbkp APPS ACTIVE 318 18 15510 PODAMGR@kmctapp2 (TNS V1-V3)
applbkp APPS INACTIVE 357 51 15482 KMCRCVTP@kmctapp2 (TNS V1-V3)
applbkp APPS INACTIVE 364 20 15480 KMCRCVTP@kmctapp2 (TNS V1-V3)
applbkp APPS INACTIVE 320 19 15489 KMCALERTMGR@kmctapp2 (TNS V1-V3)
applbkp APPS INACTIVE 335 16 15491 KMCALERTMGR@kmctapp2 (TNS V1-V3)
applbkp APPS INACTIVE 328 24 15493 KMCALERTMGR@kmctapp2 (TNS V1-V3)
APPS INACTIVE 378 57 15585
applbkp APPS INACTIVE 329 13 15498 AMSDMIN@kmctapp2 (TNS V1-V3)
applbkp APPS ACTIVE 326 17 15500 CRPINQMGR@kmctapp2 (TNS V1-V3)
applbkp APPS ACTIVE 342 164 15502 INVTMRPM@kmctapp2 (TNS V1-V3)
applbkp APPS INACTIVE 348 75 15504 CRM@kmctapp2 (TNS V1-V3)
applbkp APPS ACTIVE 324 22 15506 RCVOLTM@kmctapp2 (TNS V1-V3)
APPS INACTIVE 379 27 15589
applbkp APPS INACTIVE 325 17 15514 PASMGR@kmctapp2 (TNS V1-V3)
applbkp APPS INACTIVE 317 7 15518 MRPMGR@kmctapp2 (TNS V1-V3)
applbkp APPS INACTIVE 316 6 15520 FNDSCH@kmctapp2 (TNS V1-V3)
AdministrAPPS INACTIVE 345 10244 8707 plsqldev.exe
applbkp APPS INACTIVE 289 4042 3980 JDBC Thin Client
applbkp APPS INACTIVE 331 15708 12516 STANDARD@kmctapp2 (TNS V1-V3)
AdministrAPPS ACTIVE 351 8847 12501 plsqldev.exe
AdministrAPPS INACTIVE 366 10745 12601 plsqldev.exe
applbkp APPS INACTIVE 358 1230 24690 JDBC Thin Client
applbkp APPS INACTIVE 359 4891 4709 JDBC Thin Client

No comments:

Post a Comment

Command to do active duplicate for Oracle Database

1. First login to target server 2. Validate tns connectivity between Source DB and Target DB 3. Prepare and validate space availability 4. S...