Public Network Configuration
# chkconfig –-list | grep NetworkManager
# service NetworkManager stop# chkconfig NetworkManager off
Bonding Public Interface
# echo "alias bond0 bonding" > /etc/modprobe.d/bonding.conf
# cp /etc/sysconfig/network-scripts/ifcfg-em1 /etc/sysconfig/networkscripts/em1.bkup
# cp /etc/sysconfig/network-scripts/ifcfg-em2 /etc/sysconfig/networkscripts/em2.bkup
# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE="bond0"
BONDING_OPTS="mode=1 miimon=100 primary=em1"
NM_CONTROLLED="no"
IPADDR="10.16.142.51"
NETMASK="255.255.248.0"
GATEWAY="10.16.143.254"
ONBOOT="yes"
# cat /etc/sysconfig/network-scripts/ifcfg-em1
DEVICE="em1"
BOOTPROTO="none"
HWADDR="00:25:B3:A8:6F:18"
IPV6INIT="no"
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE="Ethernet"
UUID="3db45d28-e63c-401b-906a-ef095de4fc1e"
SLAVE="yes"
MASTER="bond0"
# cat /etc/sysconfig/network-scripts/ifcfg-em2
DEVICE="em2"
BOOTPROTO="none"
HWADDR="00:25:B3:A8:6F:19"
IPV6INIT="no”
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE="Ethernet"
UUID="7d29d87f-52bb-4dc6-88ca-d0857c7d7fd9"
SLAVE="yes"
MASTER="bond0"
# service network restart
Private Network Configuration
# cp /etc/sysconfig/network-scripts/ifcfg-em3 /etc/sysconfig/networkscripts/em3.bkup
# cp /etc/sysconfig/network-scripts/ifcfg-em4 /etc/sysconfig/networkscripts/em4.bkup
# cat /etc/sysconfig/network-scripts/ifcfg-em3
DEVICE="em3"
BOOTPROTO="static"
HWADDR="00:25:B3:A8:6F:18"
IPV6INIT="no"
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE="Ethernet"
UUID="3db45d28-e63c-401b-906a-ef095de4fc1e"
IPADDR=”192.11.142.51”
NETMASK=”255.255.255.0”
MTU=”9000”
# cat /etc/sysconfig/network-scripts/ifcfg-em4
DEVICE="em4"
BOOTPROTO="static"
HWADDR="00:25:B3:A8:6F:19"
IPV6INIT="no”
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE="Ethernet"
UUID="7d29d87f-52bb-4dc6-88ca-d0857c7d7fd9"
IPADDR=”192.12.142.51”
NETMASK=”255.255.255.0”
MTU=”9000”
NOTE: The MTU size is set to 9000 for the enablement of Jumbo Frames. Ensure Jumbo
Frames are enabled on the private Ethernet switches.
# service network restart
How to kill all similar processes with single command (in this case opmn)
ps -ef | grep opmn |grep -v grep | awk ‘{print $2}’ |xargs -i kill -9 {}
Locating Files under a particular directory
find . -print |grep -i test.sql
Using AWK in UNIX
To remove a specific column of output from a UNIX command – for example to determine the UNIX process Ids for all Oracle processes on server (second column)ps -ef |grep -i oracle |awk '{ print $2 }'
Changing the standard prompt for Oracle Users
Edit the .profile for the oracle userPS1="`hostname`*$ORACLE_SID:$PWD>"
Display top 10 CPU consumers using the ps command
/usr/ucb/ps auxgw | head -11
Show number of active Oracle dedicated connection users for a particular ORACLE_SID
ps -ef | grep $ORACLE_SID|grep -v grep|grep -v ora_|wc -l
Display the number of CPU’s in Solaris
psrinfo -v | grep "Status of processor"|wc -l
Display the number of CPU’s in AIX
lsdev -C | grep Process|wc -l
Display RAM Memory size on Solaris
prtconf |grep -i mem
Display RAM memory size on AIX
First determine name of memory devicelsdev -C |grep mem
then assuming the name of the memory device is ‘mem0’lsattr -El mem0
Swap space allocation and usage
Solaris : swap -s or swap -l Aix : lsps -a
Total number of semaphores held by all instances on server
ipcs -as | awk '{sum += $9} END {print sum}'
View allocated RAM memory segments
ipcs -pmb
Manually deallocate shared memeory segments
ipcrm -m '<ID>'
Show mount points for a disk in AIX
lspv -l hdisk13
Display amount of occupied space (in KB) for a file or collection of files in a directory or sub-directory
du -ks * | sort -n| tail
Display total file space in a directory
du -ks .
Cleanup any unwanted trace files more than seven days old
find . *.trc -mtime +7 -exec rm {} \;
Locate Oracle files that contain certain strings
find . -print | xargs grep rollback
Locate recently created UNIX files (in the past one day)
find . -mtime -1 -print
Finding large files on the server (more than 100MB in size)
find . -size +102400 -print
Crontab :
To submit a task every Tuesday (day 2) at 2:45PM45 14 2 * * /opt/oracle/scripts/tr_listener.sh > /dev/null 2>&1
To submit a task to run every 15 minutes on weekdays (days 1-5)
15,30,45 * 1-5 * * /opt/oracle/scripts/tr_listener.sh > /dev/null 2>&1
To submit a task to run every hour at 15 minutes past the hour on weekends (days 6 and 0)
15 * 0,6 * * opt/oracle/scripts/tr_listener.sh > /dev/null 2>&1
Additional:
find . -print | xargs grep -i dba_2pc_pending
find . -mtime -1 - print
find . -size +10000 -print
find . -mtime +7 -exec rm {} \;
cut -f1 -d ':' | wc -l
lsattr -El sys0
prtconf | grep -i mem
lsdev -C | grep mem
lsattr -El mem0
svmon -P 26060
lsdev -C | grep Process | wc -l









