Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • scp with ssh2 Linux/Unix
  • Drop tempfiles from database Oracle
  • find_du.ksh to find # of files, their sizes in current folder and its subdolder Linux/Unix
  • Remove DOS CR/LFs (^M) Linux/Unix
  • Test Case for Inserting Multiple (2.3 Million rows in 26 Seconds) Oracle
  • TABLE SIZING WITH DB_BLOCK ARCHITECTURE Reference : Metalink note : 10640.1 Oracle
  • Find nth max and min. Oracle
  • Global Unique Identifier Generation in Oracle 9.2 SYS_GUID() Oracle
  • useful dg links Oracle
  • Library cahe Latches and internal explaination Oracle
  • Processes parameter and its dependencies on OS kernel parameters Linux/Unix
  • .profile Linux/Unix
  • tblwopk.sql /* Find Tables Without PK */ Oracle
  • Mutating Table Error while using database trigger Oracle
  • Follwoing korn shell is used to move files from source folder to destination folder and gzip it in destination folder. mv_iotto.ksh 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

  • Generate SSH without password authentication. Linux/Unix
  • process id based files and processes Linux/Unix
  • scripts to take listener.log backup Linux/Unix
  • rm_backup_arch_file.ksh Linux/Unix
  • SAN Linux/Unix
  • find checksum of a file. Linux/Unix

Leave a Reply Cancel reply

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

Categories

  • Ansible (0)
  • AWS (2)
  • Azure (1)
  • Django (0)
  • GIT (1)
  • Linux/Unix (149)
  • MYSQL (5)
  • Oracle (402)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (1)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (18)
  • rman-dataguard (26)
  • shell (150)
  • SQL scripts (350)
  • SQL Server (6)
  • Uncategorized (5)
  • Videos (0)

Recent Posts

  • SAT Mathematics 10 questions and answer at the end.30-Apr-2026
  • top 10 AI news today30-Apr-2026
  • runon_allpdbs_show_conname.sh23-Apr-2026
  • runon_allcdbs_find_pdbs.sql23-Apr-2026
  • Running PDB on single node in RAC09-Apr-2026
  • find_arc.sql09-Apr-2026
  • pvm_pre_change.sql08-Apr-2026
  • find_encr_wallet.sql08-Apr-2026
  • find_pdbs.sql08-Apr-2026
  • Creating a Container Database using dbaascli08-Apr-2026

Archives

  • 2026
  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • compile_inv.sql Oracle
  • shr1.sql for MTS or Shared server configuration Oracle
  • currwaitobj.sql SQl_ID and SQL statement you can get from currwaitobj.sql Oracle
  • Move WordPress site from one hosting service to other. PHP/MYSQL/Wordpress
  • sid_wise_sql.sql Further explaination Oracle
  • Benefits and Usage of RMAN with Standby Databases Oracle
  • Reading config file from other folder inside class Python/PySpark
  • New Latest Param.sql for finding all hidden parameters also Oracle

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme