Linux Tips and Tricks for Oracle

January 11, 2007

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.

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.

Please note that you should have all of the RPMs that are related to the Send Mail utility properly installed to use the above command.

Some sites use the /etc/mail/relay-domains file to determine domains from which it will relay mail so we should configure this file to limit to trusted domains. I would not recommend this type of configuration due to the fact that it controls mail based on source domain only; instead, configure /etc/mail/access file, ensuring that the mail server will relay mail to those trusted PCs on your network that have email clients configured to use the mail server.

The /etc/mail/access file has two columns. The first is IP addresses and domains from which the mail is coming or going. The scond column lists the type of action to be taken when mail from these sources is received. Key words include RELAY, OK, and DISCARD.

File looks like below.

<<<<
root@linuxhost mail]# more /etc/mail/access
# Check the /usr/share/doc/sendmail/README.cf file for a description
# of the format of this file. (search for access_db in that file)
# The /usr/share/doc/sendmail/README.cf is part of the sendmail-doc
# package.
#
# by default we allow relaying from localhost...
localhost.localdomain RELAY
localhost RELAY
127.0.0.1 RELAY
>>>

Once we have configured the above files and a new sendmail.cf is generated, we have to restart the sendmail service using the following command.

Conclusion:

We will see some more commands in my next article, such as breaking root password , working with xinetd ,sshing your Linux server and more importantly how do you secure your Linux host running your critical database.