Last Updated (Tuesday, 30 November 1999 07:00)
Wednesday, 14 January 2009 15:55
Introduction: Oracle committed to Linux in 1998, with its first database released on Linux. Now Oracle claims its database software is number one on Linux with a market share of more than 75%. Though Oracle provides low-cost deployment of Linux solutions, many skeptics still hesitate to deploy mission-critical databases on Linux. As a DBA, whenever you change a job, the employer first asks about your experience on Linux. In this article, I would like to discuss some of my favorite Linux commands and tricks that we should be familiar with.
Assign an IP address and configure bonding to your Linux Server:
Many DBAs that are working with Linux for some time are probably familiar with the list of TCP/IP network files involved.
a) File /etc/resolv.conf is the hostname resolver configuration file. This file tells which DNS server will be resolving domain names into an IP Addresses. An example of the file is below:
[root@linuxhost mail]# more /etc/resolv.conf
domain mycompany.com --- Name of your domain or ISP's domain if using their name server
nameserver 11.65.31.100 --- IP address of primary name server
nameserver 11.102.100.100 --- IP address of secondary name server
b) /etc/hosts – file is locally resolve node names to IP addresses. This informs your Linux server of local systems on the network which are not handled by the DNS server or for all systems in your LAN if you are not using DNS. File looks similar to what is displayed below. I do not have any servers added but you can see the columns.
[root@linuxhost mail]# more /etc/hosts
# Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 dbq11ykf hostname localhost.localdomain localhost
c) /etc/sysconfig/network-scripts/ifcfg-etho file: This is the Red Hat Linux network configuration file used by the system during the boot process. If you are not using bonding driver we can configure this file. File looks like below.
[root@linuxhost mail]# more /etc/sysconfig/network-scripts/ifcfg-eth0
d) If you would like your Linux server to use DHCP rather than a static IP address, configure /etc/sysconfig/network-scripts/ifcfg-eth0 file with BOOTPROTO to dhcp.
Network bonding is essential for high availability and especially so when setting up RAC. It also improves performance by sending packets from both NIC actively. Red Hat Linux allows binding multiple network interfaces into a single channel/NIC using a special kernel module called bonding.
To setup bonding involves simple four tasks.
TASK 1: First, you need to create bond0 config file:
# vi /etc/sysconfig/network-scripts/ifcfg-bond0 Append following lines to DEVICE=bond0 BOOTPROTO=static ONBOOT=yes IPADDR=11.65.21.82 NETMASK=255.255.255.0 GATEWAY=11.65.21.1 USERCTL=no
TASK 2: Modify eth0 and eth1 config files:
Open both configuration using VI text editor and make sure file read as follows for eth0 and eth1 interfaces.
[root@linuxhost network-scripts]# more ifcfg-eth0 DEVICE=eth0 ONBOOT=no MASTER=bond0 SLAVE=yes USERCTL=no [root@linuxhost network-scripts]# more ifcfg-eth1 DEVICE=eth1 ONBOOT=no MASTER=bond0 SLAVE=yes USERCTL=no
TASK 3: Load driver module: Make sure bonding module is loaded when the channel-bonding interface (bond0) is brought up. You need to modify the kernel modules configuration file so that it looks like the one below.
[root@linuxhost network-scripts]# more /etc/modprobe.conf alias bond0 bonding options bond0 mode=balance-alb miimon=100
TASK 4: Test configuration by modprobe and service network restart commands.
[root@linuxhost network-scripts]# modprobe bonding [root@linuxhost network-scripts]# service network restart