Thursday, July 25, 2013

ORACLE - Linux

ls -al | grep "May 10" | awk '{ print $9 }' | xargs rm  ==> For remove

find /path/files* -mtime +2 -exec rm {} \; ==> delete last 2 days

sudo du -s * |sort -nbr

version:
cat /etc/*-release
cat /etc/redhat-release

-- tar the dir dba
tar -cvf dba_new.tar dba/

ln -s {/path/to/file-name} {link-name}

cat /proc/cpuinfo | grep processor | wc -l ( Check Number of Processsors)

#Check 4903 port is open or not :
netstat -an | grep 4903
tcp        0      0 0.0.0.0:4903                0.0.0.0:*                   LISTEN

#Check 4903 port is listening from another server:
hpremdb01:
nc -v 172.19.160.38 4903

grep MemTotal /proc/meminfo

rpm -q package_name

=========================================================multipath
[root@npqntdb01 ~]# multipath -ll
mpathb (360a98000486e58624e6f6e752f624c6f) dm-0 NETAPP,LUN
size=10.0G features='3 queue_if_no_path pg_init_retries 50' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=4 status=active                                 ===> Active
| |- 4:0:1:0 sdd 8:48 active ready running
| `- 3:0:1:0 sde 8:64 active ready running
`-+- policy='round-robin 0' prio=1 status=enabled                                ===> Standby for failover
  |- 4:0:0:0 sdb 8:16 active ready running
  `- 3:0:0:0 sdc 8:32 active ready running

dmesg | grep multipath
2)hqmidb02 dev $  dmesg | grep HBA
qla2xxx [0000:00:00.0]-0005: : QLogic Fibre Channel HBA Driver: 8.04.00.03.39.0-k.
qla2xxx [0000:0c:00.0]-00fb:0: QLogic QLE2460 - PCI-Express Single Channel 4Gb Fibre Channel HBA.
3)dmesg
bnx2 0000:05:00.0: eth0: NIC Copper Link is Down
bnx2 0000:05:00.0: eth0: NIC Copper Link is Up, 100 Mbps full duplex, receive & transmit flow control ON
bnx2 0000:05:00.0: eth0: NIC Copper Link is Down
bnx2 0000:05:00.0: eth0: NIC Copper Link is Up, 100 Mbps full duplex, receive & transmit flow control ON
=================================================Check for b(block must be 0)
$ vmstat 5
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 0  1 847812  73724    984  17300  114   38   166    47    5    4  0  0 92  8  0
 0  0 844412  64464   1648  18144 1487    0  1769    14  372  391  1  1 52 47  0
 0  2 849668  68236   2268  17004 1329 1644  1862  1665  395  424  0  0 35 64  0
 0  2 855868  74936   2144  14980  802 1649   810  1653  332  283  0  0 32 68  0
==================================================Top High IO (%wa)
Cpu(s): 24.9%us,  0.1%sy,  0.0%ni, 74.8%id,  0.100%wa,  0.0%hi,  0.1%si,  0.0%st

            CPU      %user    %nice    %system  %iowait  %idle
08:01:19     1        0.00     0.00     0.00     100.00   0.00  >>> High IO and No CPU available for resource  
08:01:19     2        0.00     0.00     0.00     100.00   0.00
==================================================Duplex and speed
/sbin/ethtool eth0
Settings for eth0:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  Not reported
        Advertised pause frame use: No
        Advertised auto-negotiation: No
        Speed: 100Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: off
        MDI-X: Unknown
Cannot get wake-on-lan settings: Operation not permitted
Cannot get link status: Operation not permitted
==========================================================iptables
# disable Port 3306 for remote access
sudo /sbin/iptables -A INPUT -p tcp --dport 3306 -j DROP
# Enable Port 3306
sudo /sbin/iptables -F
#List port
sudo /sbin/iptables -L
========================================================CPU Utilization
sar -P ALL 5 2  ==>Find CPU utilization by CPU
iostat -dx 5 | grep dm-
vmstat 3





No comments:

Post a Comment