Today i will show how to use Linux commands And Useful for Oracle DBA.
man
To show command knowledge
man(manual):
To show contents
ls(list):
To show hiding contents
ls -a :
To show one under the other
ls -l :
To show size and more information's
ls -lh :
To show last update
ls -lrt :
Cd
To go other folder
cd :
/ : Linux above folder
To go above folder
Cd .. :
pwd
To show own folder
pwd :
To create folder
mkdir
To delete folder
rm
rm :
to delete all
rm -R :
rmdir
To delete empty folder
rmdir :
TO COPY FOLDER
cp
To move Folder
mv
To show file or text
cat | more
To Gzip Folder
gzip
TO GUNZIP FOLDER
gunzip
To find folder
find
TO GIVE ALIAS
Alias
alias Nick_name=”<command >”
mounting disk:
1- create a folder where to mounted.
mkdir /media/newdisk
mkdir /DATA
if we want to mount with FAT32:
mount -t vfat -o umask=ooo /dev/hdb1 /media/newdisk
if we want to mount with NTFS
mount -t ntfs -o umask=0222 /dev/hdb1 /media/newdisk
if we want to mount CDROM:
mount -t iso_name -r /dev/cdrom /media/cdrom
if we want to mount with OCFS2:
mount -t ocfs2 -o noatime,_netdev,datavolume,nointr /dev/emcpowera1 /DATA
if we want to mount with EXT3:
mount -t ext3 /dev/sdb1 /software
unmounting disk:
umount -l /dev/sdb1
umount /DATA
Partitioning
fdisk /dev/sdb
Formatting
if we want to format with EXT3:
mkfs -t ext3 /dev/sdb1
if we want to format with OCFS2:
mkfs.ocfs2 -b 4K -C 128K -N 5 -L /DATA /dev/emcpowera1
FILE SYSTEM CHECK
fsck.ocfs2 -n /dev/sdf2
fsck.ocfs2 -y /dev/sdf2 –>repair
List drives
df -h
tmpfs increase
mount -t tmpfs shmfs -o size=3g /dev/shm
Getting user id
id username
id oracle
Set user folder
chown -R oracle:dba /oracle
Change folder permission
chmod 775 file_name
Checking installed “rpm” packages
rpm -qa | grep “package name”
Rpm download
rpm -ivh package
Rpm update
rpm -Uvh package
Rpm Delete
rpm -e package
Checking Oracle installing requires packages
—————————————————————————————————————-
rpm -q binutils compat-db compat-libstdc++-33 libgcc glibc
glibc-devel glibc-headers gcc gcc-c++ libgcc libstdc++ cpp make libaio ksh
elfutils-libelf make sysstat libaio libaio-devel setarch libXp unixODBC –qf
“%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n”|sort
Date of rpm
rpm -qa –last | more
CPIO extract
cat cpio_file | cpio -idmv
Create MD5 In order To copy or move validate folder
md5sum file > file.md5
Checking moved MD5
md5sum -c file.md5
Folder transfer between servers
scp 192.168.192.168:oracle/veysi.pw /
scp /oracle/full.dmp
ora11g@192.168.192.166:/export #copy folder
Search folder
grep -ins 192.168.192.168(Text) -A2 -B1 list1.log
Get Process value
ps -ef |grep veysi|wc
Change Date
date -s “21 MAR 2010 02:04:00″
SEMAPHORE
ipcs -s
ipcrm
Trace OS process
strace -p pid
List Tar zip
tar -tf java_patch.tar
Add a file or folder to Tar zip
tar -rf java_patch.tar jre
Create Tar zip
tar -cf java_patch.tar jdk
Change user ID
usermod -u UID user
Delete folder after killed process
echo “”>veysi_ora_7001.trc
Give easy path to folder
ln -s path kısayol_adı
Show status SELinux
sestatus
To show version of download rmp package
echo ocfs2-`uname -r`
i/o static list
iostat 3
checking RAC node date:
ssh rac1 date; ssh rac2 date; date
without using root password to get information
/etc/SUDOERS
ora11g localhost=NOPASSWD:/bin/mount,/bin/umount
ora11g talipdb=NOPASSWD:/bin/mount,/bin/umount
Last log in
last | more
Send file to Via E-mail
mail -s “file_name” muh.veysi.47@hotmail.com < sqlnet.log
Finding word in folder
grep -ins word *
To kill more process using process_name
ps -ef |grep “process_name” |awk ‘{print ” kill -9 ” $2}’>/tmp/kill.sh
To watch process_name every 3 second
watch -n 2 “ps -ef | grep process_name | grep -v ps”
Open Log file
tail -f /var/log/messages