Issue:
Experience: is what you get soon after you need it.
GIAC Cloud Penetration Tester (GCPN)
GIAC Cloud Security Automation (GCSA)
GIAC Security Essentials (GSEC)
Certified Kubernetes Administrator (CKA)
Cloud Certified Security Professional (ISC2)
CyberSecurity Certified Professional (ISC2)
AWS Certified Solutions Architect Associate
Azure Certified Architect Expert
Azure Certified Architect
Azure Certified Administrator
Oracle Cloud Infrastructure 2018 Certified Architect Associate.
Oracle Cloud Infrastructure Classic 2018 Certified Architect Associate.
Oracle Database Cloud Administrator Certified Professional.
Oracle Database Cloud Service Operations Certified Associate.
Search This Blog
Thursday, August 13, 2015
Direct NFS: please check that oradism is setuid --> Enable/ Disable oradism ORADISM
Issue:
Setting up the oracle environment
Ex:-
1.ORCL
2.PROD1
3.GRID
Wrote a small crude shell script to run the env files.
[oracle@collabn1 ~]$ vi setup_ora_env.sh
#!/bin/bash
function unset1
{
echo "You are in func"
unset ORACLE_SID ORACLE_BASE TNS_ADMIN ORACLE_HOME
export PATH=/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/oracle/bin
}
k=1
echo -e "\n"
echo -e "You have below ENV files..."
array1=( $(ls ~/*.env) )
for i in "${array1[@]}";do
echo "Select $k for $i"
let "k=$k+1"
done
echo -e "\n"
#Unsetting the ORA ENV variables
unset1
echo -e "Enter your choince now: "
read input
if [ $input -eq 1 ];then
echo -e "\n"
echo -e "Running environment file... ${array1[0]}"
. ${array1[0]}
elif [ $input -eq 2 ];then
echo -e "\n"
echo -e "Running environment file... ${array1[1]}"
. ${array1[1]}
elif [ $input -eq 3 ];then
echo -e "\n"
echo -e "Running environment file... ${array1[2]}"
. ${array1[2]}
else
echo -e "Wrong choice...Plz try again"
fi
Thursday, November 6, 2014
rsync - scp to Copy files between servers
rsync
Use this command to transfer files remotely and locally in Linux based machines.
-v : verbose
-r : copies data recursively (but don’t preserve timestamps and permission while transferring data
-a : archive mode, archive mode allows copying files recursively and it also preserves symbolic links, file permissions, user & group ownerships and timestamps
-z : compress file data
-h : human-readable, output numbers in a human-readable format
example:
rsync -avzh source destination
rsync -avzh username@shaiksameer.com:/u0/db/oracle/oradata/ /u0/db/oracle/oradata
Saturday, April 27, 2013
Kill all the O.S process of a particular user | kill -9
UNIX$ ps -aef | grep -i shaik | awk '{print $2}' | sed 's/^/kill -9 /' > 1.txt
UNIX$./1.txt
Thursday, May 10, 2012
Copy file from source to destination when size > 0 bytes
wdate=`date '+%Y-%m-%d'`
wdate1=`date '+%m%d%y'`
logdate=`date '+%m%d%y%H%M%S'`
source=/your source/$wdate
destination=/yourdestination
log_dir=/loglocations/log
log=$log_dir/logfilename_$wdate1.log
while true
do
if [ -d "$source" ]
then
echo $source
echo $source/*.csv
if [ ! -s "$source/*.csv" ]
then
echo " File exists- copying the File to destination @$logdate" >> $log
cp $source/*.csv $destination/logfilename_$wdate1.csv
echo " copied the file..exiting now $logdate" >>$log
exit 0
else
echo "sleepping ..."
sleep 10
fi
fi
echo $wdate
done
Tuesday, May 1, 2012
find files within directories
find . -type f -exec grep -il "hello" {} \;
or if you know the file type
find . -type f -name "*.ext" -exec grep -il "hello" {} \
Thursday, September 15, 2011
Tuesday, August 23, 2011
use truss to find the process execution
$ truss -aefo logfile
$ truss -rall -wall -p
make sure the logfile is stored where enough size is available.
Tuesday, August 2, 2011
UNIX prstat vs top
prstat - report active process statistics
example:
Now
statistics are sorted by cpu high -low
prstat -s cpu
or -u for a particular user
prstat -u oracle -s cpu
or top 5 cpu events
prstat -s cpu -n 5
or
prstat -T (total)
Other options available to prstat are:-T Report information about processes and tasks.
-a Report information about processes and users
-u Report only processes whose effective user ID
-v Report verbose process usage
-s key Sort output lines (that is, processes, lwps, or users) by key in descending order. Only one key can be used as an argument. There are five possible key values: cpu Sort by process CPU usage. This is the default. pri Sort by process priority. rss Sort by resident set size. size Sort by size of process image.
-n ntop[,nbottom] (comes with ntop or nbottom)
Friday, July 29, 2011
Unix memory leak issues.
At any stage if you want to generate the core dump of an active process:
On Solaris:
-0 option is to manually give the path and filename for the core dump
gcore -o /obishared/obiqb/Lognode2/core.19199 19199
gcore: /obishared/obiqb/Lognode2/core.19199.19199 dumped
Start collecting memory consumption statistics.
Solaris
The prstat command can be used to gather basic performance data to help identify if there are any processes consuming a large amount
of memory. For example, the data below is sorted by the SIZE column. SIZE is the total virtual memory size of the process:
prstat -s size
AIX
The ps command can be used to show basic memory usage per process. For example, the data below is sorted by the VSZ column, the total
virtual memory size of the process in KB:
ps -efo "vsz,pid,user,cpu,thcount,comm" | sort –n
HP-UX
The top command can be used to show basic memory usage per process. For example, the SIZE column is the total virtual memory size of
the process in KB:
top
Linux
The ps command can be used to show basic memory usage per process. For example, the data below shows the memory being used by all the
siebmtshmw proceses in KB:
ps axo user,pid,vsz,thcount,cmd | grep siebmtshmw
If you are experiencing some of the symptoms described above or if you suspect a memory leak, it is particularly important that
performance data is captured so the memory leak can be confirmed. It is important to gather at least the following pieces of
information:
Process ID (PID)
Size of the process
The executing command
The timestamp information showing exactly when the data was captured.
One method of capturing this data is to use a shell script. The following are examples of shell scripts that can be used for the
various OS types:
Solaris
while true
do
for pid in `cat pids`
do var=`date|cut -d' ' -f4`
echo "$var :\c" >> ps.log.$pid
ps -eo pid,vsz,rss,pcpu,args | grep $pid |grep -v grep >> ps.log.$pid
done
sleep 30
done
AIX
while true
do
for pid in `cat pids`
do var=`date|cut -d' ' -f4`
echo "$var :\c" >> ps.log.$pid
ps -efo "pid,vsz,user,cpu,thcount,comm" | grep $pid |grep -v grep >> ps.log.$pid
done
sleep 30
done
HP-UX
while true
do
for pid in `cat pids`
do var=`date|cut -d' ' -f4`
echo "$var :\c" >> ps.log.$pid
ps -elf | grep $pid >> ps.log.$pid
done
sleep 30
done
Linux
while true
do
for pid in `cat pids`
do var=`date|cut -d' ' -f4`
echo "$var :\c" >> ps.log.$pid
ps axo pid,vsz,user,%cpu,thcount,cmd | grep $pid |grep -v grep >> ps.log.$pid
done
sleep 30
done
above are snippets from MOS.
References:
Note 477520.1 "How To Troubleshoot Siebel Server Component Crashes on UNIX". It is however possible for a process to crash as a result of a memory leak.
Note 477004.1 "How Can Users Prevent Core Files from Being Overwritten on UNIX Platforms?"