Useful Linux Command for Oracle DBA

I have listed herewith some useful Linux command for Oracle Database Administrator. All commands are tested with Red Hat Enterprise Linux 5.

List the partition tables for Hard Disk Capacity

[root@linuxbox ~]# fdisk -l

Disk /dev/sda: 160.0 GB, 160000000000 bytes
255 heads, 63 sectors/track, 19452 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000080

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          17      131072   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              17         539     4194304   82  Linux swap / Solaris
Partition 2 does not end on cylinder boundary.
/dev/sda3             539       19453   151922688   83  Linux
[root@linuxbox ~]# 

Linux System Info

How to get System Information for Linux from Command Line?

How to get Kernel Version and System Architecture for Linux from Command Line?
uname -a

[root@shlpaysil ~]# uname -a
Linux shlpaysil 2.6.18-8.el5 #1 SMP Fri Jan 26 14:15:21 EST 2007 i686 i686 i386 GNU/Linux

How to get Name and Version of Distribution for Linux from Command Line?
head -nl /etc/issue

[root@shlpaysil ~]# head -nl /etc/issue
Red Hat Enterprise Linux Server release 5 (Tikanga)

Display All Registered Partitions on the System
cat /proc/partitions

[root@shlpaysil ~]# cat /proc/partitions
major minor #blocks name
8 0 71687325 sda
8 1 32098 sda1
8 2 409657 sda2

Hard Drive Information:
fdisk -l

[root@shlpaysil ~]# fdisk -l
Disk /dev/sda: 73.4 GB, 73407820800 bytes
255 heads, 63 sectors/track, 8924 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Memory Information:
grep MemTotal /proc/meminfo

[root@shlpaysil ~]# grep MemTotal /proc/meminfo
MemTotal: 1035156 kB

Display CPU Information:
grep “model name” /proc/cpuinfo

[root@shlpaysil ~]#grep "model name" /proc/cpuinfo
model name : Intel(R) Xeon(TM) CPU 3.00GHz
model name : Intel(R) Xeon(TM) CPU 3.00GHz

Get System Manufacturer Name:
dmidecode -s system-manufacturer

[root@shlpaysil ~]# dmidecode -s system-manufacturer
Dell Computer Corporation

Display System Product Name:
dmidecode -s system-product-name

[root@shlpaysil ~]# dmidecode -s system-product-name
PowerEdge 1850

Display BIOS Release Date:
dmidecode -s bios-release-date

[root@shlpaysil ~]# dmidecode -s bios-release-date
01/19/2005

Get CD/DVD RW Info:
cat /proc/sys/dev/cdrom/info

[root@shlpaysil ~]# cat /proc/sys/dev/cdrom/info
CD-ROM information, Id: cdrom.c 3.20 2003/12/17