Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Query to Generate aggregate on every 30 mins. Oracle
  • Configure ssh authentications for RAC Oracle
  • Oracle Identifiers Oracle
  • Debugging Shell FIles Linux/Unix
  • How to hide author name in WordPress BLOG PHP/MYSQL/Wordpress
  • To find all disk io ( EMC as well as local) Linux/Unix
  • DBMS_Shared_pool pinning triggers Oracle
  • executing Function from SQLPLUS prompt Oracle
  • Find total file sizes Linux/Unix
  • arch_configUOCIOTTO.ora Oracle
  • plan10g.sql good Oracle
  • VIvek Encryption Package and Its Usage Oracle
  • Oracle Metalink useful notes Oracle
  • Oracle vs MYSQL Architecture differences (For DBAs) MYSQL
  • Jai Shree Ram PHP/MYSQL/Wordpress

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

  • send email from unix mailx with attachment. Linux/Unix
  • changing kernel parameter in Oracle Enterpise Linux Linux/Unix
  • How to collect CPU usage on Linux using Shell script Linux/Unix
  • cif crons Linux/Unix
  • How to remove blank lines using vi editor command Linux/Unix
  • good linux notes 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)
  • Linux/Unix (149)
  • MYSQL (5)
  • Oracle (392)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (0)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (341)
  • SQL Server (6)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • SQL Server Vs Oracle Architecture difference25-Jul-2025
  • SQL Server: How to see historical transactions25-Jul-2025
  • SQL Server: How to see current transactions or requests25-Jul-2025
  • T-SQL Vs PL/SQL Syntax25-Jul-2025
  • Check SQL Server edition25-Jul-2025
  • Checking SQL Server Version25-Jul-2025
  • Oracle vs MYSQL Architecture differences (For DBAs)24-Jul-2025
  • V$INSTANCE of Oracle in MYSQL24-Jul-2025
  • Day to day MYSQL DBA operations (Compared with Oracle DBA)24-Jul-2025
  • MYSQL and Oracle Comparison for Oracle DBA24-Jul-2025

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Query to Generate aggregate on every 30 mins. Oracle
  • move_arch_files.ksh /* Good One */ Linux/Unix
  • To see only files and/or folders using LS command Linux/Unix
  • Multiple listeners Oracle
  • Settting up get_vmstat.sh for colletinf CPU Usage. Oracle
  • segment_wise_space.sql segspace.sql Segment wise space usage (allocated and used) Oracle
  • SQL Tracker by SID sqltrackerbysid.sql Oracle
  • How to find password change date for user Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme