Wednesday, December 10, 2008

Unix commands

How do you find files that are greater than 3GB in HP unix?
find / -size +3000000000c -exec ls -l {} \;
Check all logs for ORA- errors
grep ^ORA- *log |cut -f2 -d"-"|cut -f1 -d:|awk '{print "ORA-" $1}'|sort –u
How to Find out Top 10 Memory consuming processes?
UNIX95=1 ps -eo vsz,pid,args | sort +0n -1 | grep oracle | tail -10
Pass Database Name in places of SID
Find out mount points starts with oracle which exceeds 80%?
bdf|grep -e oracle grep '[7-9].%
How do you delete 3 days old log files?
find /location -name "*.log" -mtime +3 -exec rm -rf{} \;
Eg : find ./ -name "*.req" -mtime +4 -exec ls -ltr {} \;
Display latest 20 largest files/directories in current directory?
du -ka sort -n tail -20
How do you display/remove Specifice Month files in Unix?
rm `ls -l grep Jun awk '{print $9}'`
How do you find the files which contains a specific Word?
find /home/ganesh \( -type f \) -exec grep -l test {} \;

how to find all the soft links?
find . -type l -exec ll {} \; | grep ERPPROD

soft link
ln -s
eg : ln -s /u01/app/oracle/monitor.sql /u01/app/oracle/test.sql
monitor.sql orginal file

eg: ln -s /u01/app/oracle/monitor.sql /u01/app/oracle/test.sql
monitor.sql orginal file

How to get the OS is 32 bit or 64 bit

getconf HARDWARE_BITMODE

How to get the version of the os

Uname –vr
Eg: O/P--- 3 5

3-release
5- version



No comments:

user level export and import

expdp parfile=PLCT170.par oracle@uslp123sd7dfcvxsza > more PLCT050.par userid= "/ as sysdba" dumpfile=T050.dmp logfile=expdpT0...