ORACLE:
/u01/app/oracle/product/10.2.0/asm/network/admin

TNS Listener

set shmsys:shminfo_shmmax=4294967295

==========================process logs
grep destructMsgHandle sns.log  >msgnum
grep buildAnd sns.log  >>msgnum
grep copyM sns.log >>msgnum

awk '{ printf("%s\n",$10)}' all_msg > msgnm
awk '{ printf("%s\n",$1)}' msgnm | sort | uniq -c >leak


ps -aux www
==========================REMOVE FILES=======
find . -name "*.o" -exec rm {} \;
find . -name "Sun*" -exec rm -rf {} \;
find ~ -name core -exec rm {} \;

==================DELETE FILES==================
for item in `find . -name "*.o" -exec ls {} \;`
do
rm -rf $item
done

=================DELETE SH-MEM SEGMENTS/SEMA===========
for item in `ipcs -s|grep csnrel33|awk '{print $2}'`
do
ipcrm -s $item
done

===============================tms kill
tms -P 39710 -s nse_sip2
llm -P39197 -s -B4 -L"TRACE(3)"


=====DEFUNC
ps -ef | grep -v \ \ root | grep -v pts/ | less
# now use /usr/proc/bin/ptree to find parent or child
## Linux users might try ps -ef --forest | less

clarion:/# /usr/proc/bin/ptree 13868
13868 <defunct>
  16596 a.out
clarion:/# kill -9 16596


# ta daa !
#
# or
#
bash# /usr/proc/bin/ptree `ps -ef | grep -v ^\ \ \ \ root | awk '/<defunct>/ {print $2}'` | less


==============DIAGNOSTIC===============
/usr/sbin/psrinfo
pstack <pid>
vmstat 5 10
truss -f <script> 2>truss.log
pfiles -F <pid>

diff -wb
==========================NDD================
#ndd Solaris
/usr/sbin/ndd -set /dev/tcp tcp_max_buf  10485760

==========Query NDD=========
#!/bin/ksh
#
# ndd.sh
#
PATH=/usr/sbin:$PATH
if [ -z "$1" ]; then
   echo "Usage: $0 [udp | tcp | ip | icmp | arp | ... ]"
   exit
fi

ndd /dev/$1 '?' | nawk -v c="ndd /dev/$1" '
/write/ {
  split($0,a,/[ \t(]/);
  n=c t " " a[1];
  printf "echo %s = ",a[1];
  printf "`%s`\n",n;


}' | sh
``````````````````````````````````````````````````````````
======================
SAR
=======================
sar -g 5 5
sar -urg 5 5
sar -urg 5 5 -o <filename>

read:
sar -f <filename>

===runSAR.sh=======
#!/usr/bin/sh
/usr/bin/sar -urg -o $HOME/logs/sarbin.log 5 200 1>/dev/null&
===========================
======NETSTAT===========
netstat -an |grep <port>
netstat -i #displays errors
netstat -i hme0
netstat -s -P ip  #shows statistics
netstat -rn   #shows routing tables


++++++++++++++++++++++++
nfsstat -rc\
===============================
VI
===============================
#vi
:%s/xxx/yyy/g

===============================
DBX
===============================
#dbx -----compile with -g flag
ignore SIGUSR1
stop in
stop at
print <expr>
dbx <bin> pid
where
examine <addr>
dump
detach


==========================================
Purify
========================================
start_lmgrd_on_torss001 stop
start_lmgrd_on_torss001 start
start_lmgrd_on_torss001 lmreread
/opt/Rational/releases/PurifyPlus.7.0.0.0-004/sun4_solaris2/bin/purify


==========================================
CRONTAB:
==============================================
root/root
csnd01:crontab -l root
crontab: you must be super-user to access another user's crontab file
csnd01:whoami
oracle
csnd01:su - root
Password:
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005
# crontab -l root
#ident  "@(#)root       1.21    04/03/23 SMI"
#
# The root crontab should be used to perform accounting data collection.
#
#
10 3 * * * /usr/sbin/logadm
15 3 * * 0 /usr/lib/fs/nfs/nfsfind
30 3 * * * [ -x /usr/lib/gss/gsscred_clean ] && /usr/lib/gss/gsscred_clean
#10 3 * * * /usr/lib/krb5/kprop_script ___slave_kdcs___
#
``````````````````````````````````````````````````````````
crontab -e = edits the crontab file to be used.

0 12 14 2 * mailx john%Happy Birthday!%Time for lunch.

Below is a table that represents what each of the above fields are for.

min hour dayofmonth monthofyear dayofweek command
0    12    14          2          *          mailx john%Happy Birthday!%Time for lunch.


  Options Explanation
* Is treated as a wild card. Meaning any possible value.
*/5 Is treated as ever 5 minutes, hours, days, or months. Replacing the 5 with another numerical value will change this option.
2,4,6 Treated as an OR, so if placed in the hours, this could mean at 2, 4, or 6 o-clock.
9-17 Treats for any value between 9 and 17. So if placed in day of month this would be days 9 through 17. Or if put in hours it would be between 9 and 5.

