Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • chk_space_SID.ksh Linux/Unix
  • purge_trc.sh Linux/Unix
  • How To Limit The Access To The Database So That Only One User Per Schema Are Connected (One Concurrent User Per Schema) Oracle
  • Handling LOB data in Oracle Oracle
  • before_trunc.sql Before Truncate table needs to execute following: Oracle
  • USER_TABLES.Freelists Oracle
  • oracle fast start failover best practice Oracle
  • Locally Managed Tablespace and Dictionary managed tablespace (LMT-DMT) Oracle
  • Query to Generate aggregate on every 30 mins. Oracle
  • ext#.sql Oracle
  • Find Multiple levels of object dependencies : depen.sql Oracle
  • How to collect CPU usage on Linux using Shell script Linux/Unix
  • oracle 11g RAC on vmware Oracle
  • Wait.sql Oracle
  • How does one overcome the Unix 2 Gig file limit? Linux/Unix

Session_info.ksh

Posted on 24-Apr-2007 By Admin No Comments on Session_info.ksh

/********* session_info.ksh ****************/

#!/bin/ksh

. /home/oracle/oraprocs/WEBP18F.env

USR_ID=vivek

USR_PASS=viv1ek

database=WEBP18F

a=`ps -ef|grep “session_info.ksh”|grep -v grep|wc -l`

if [ $a -gt 4 ]

then

echo “Exiting because of more than 1 process is running `date`”>>/db3/oradata/log/session_info.log

exit

fi

echo “—–Begin —– Date `date`——————————–” >> /db3/oradata/log/session_info.log

$ORACLE_HOME/bin/sqlplus -s <>/db3/oradata/log/session_info.log

$USR_ID/$USR_PASS@$database

set serverout on

set feedback off

SET PAGES 0

start /home/oracle/scripts/sess_server1.sql

EOF

/home/oracle/scripts/find_proc_mem_mts.sh >> /db3/oradata/log/session_info.log

free -t >>/db3/oradata/log/session_info.log

echo “—–End —– Date `date`——————————–” >> /db3/oradata/log/session_info.log

exit

/************ sess_server1.sql ***************/

column osuser format a10

column username format a30

column machine format a30

column program format a40

column sid format 99999999

column serial# format 99999999

column TOT format 999999 heading “Total Sessions”

break on report

compute sum of TOT on report

set lines 141

set pages 500

select machine, osuser, username, count(1) “TOT” from v$session

group by machine, osuser, username;

select username, status, count(1) “TOT” from v$session

group by username,status;

prompt ‘APPSERVER INACTIVE CONNECTIONS’

select username, status, count(1) “TOT” from v$session

where username like ‘APPSERVER%’ and status=’INACTIVE’

group by username,status

order by status, username;

prompt ‘APPSERVER ACTIVE CONNECTIONS’

select username, status, count(1) “TOT” from v$session

where username like ‘APPSERVER%’ and status=’ACTIVE’

group by username,status

order by status, username;

prompt ‘Total Server Processes’

!ps -ef | grep -v grep | grep WEBP18F |wc -l

Linux/Unix, shell

Post navigation

Previous Post: Facts about SCN and Rollback Segment
Next Post: TOP-N Sql to find Nth max or Top N rows

Related Posts

  • Finding last recovered file on DR and remove all chanracters before any “/” Linux/Unix
  • Important Solaris Commands Linux/Unix
  • tar and untar a dolder with all its subfolder. Linux/Unix
  • Running some SQL on multiple databases connecting using monitoring userid and password Linux/Unix
  • find checksum of a file. Linux/Unix
  • scp with ssh2 Linux/Unix

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • AWS (2)
  • Azure (1)
  • Linux/Unix (149)
  • Oracle (388)
  • PHP/MYSQL/Wordpress (10)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (337)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • findinfo.sql (SQL for getting CPU and Active session info)27-May-2025
  • SQL Tracker by SID sqltrackerbysid.sql22-Apr-2025
  • How to connect to Oracle Database with Wallet with Python.21-Mar-2025
  • JSON/XML Types in Oracle18-Mar-2025
  • CPU Core related projections12-Mar-2025
  • Exadata Basics10-Dec-2024
  • Reading config file from other folder inside class24-Sep-2024
  • Python class import from different folders22-Sep-2024
  • Transfer SQL Profiles from One database to other database.05-Sep-2024
  • Load testing on Oracle 19C RAC with HammerDB18-Jan-2024

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • currwait.sql Oracle
  • Important Script Method for tuning Oracle
  • _B_TREE_BITMAP_PLANS issue during 8.1.7 to 9.2.0.8 upgrade Oracle
  • reset Sequence Oracle
  • How To Limit The Access To The Database So That Only One User Per Schema Are Connected (One Concurrent User Per Schema) Oracle
  • Specify the Rollback segment to use in Transaction Oracle
  • Korn Shell Arithmatic Linux/Unix
  • get_ratio.sql get the ratio of users from v$session and this uses CASE-WHEN-THEN clause Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme