Building an Oracle Database Server

Fixing your IP Address

A couple of thing remain to be sorted. The first is that your Oracle server is currently configured to get its IP address via DHCP, and that’s a no-no. It means that, potentially, every time you reboot the server, it will acquire a new IP address… which makes connecting to it a bit of a guessing game!

You can fix this by configuring your DHCP server (if you have one) so that the same MAC address is always assigned the same IP address. Such ‘lease reservations’ mean that even though you’re using DHCP, the IP address of the Oracle server is effectively  static, which is what counts.

Here, I’m going to suggest the obvious alternative fix: to set a fixed IP address in the first place. First, we need to know what IP address your server has already been assigned -since that obviously works and we might as well stick with that. In a new terminal session, therefore, type this:

/sbin/ifconfig

You’ll see this sort of thing:

This tells me (in small print!) that my Oracle server has been automatically assigned (at least this time around) the IP address 192.168.0.93. It’s that same address I now want to fix, permanently. Note, too, that this output tells you what you netmask is: in my case, 255.255.255.0. You’ll need both pieces of information for what comes next.

Now you know your existing network settings, click the System > Preferences > Network Connections menu options. You’ll see this sort of thing:

On the Wired tab, highlight the entry for the eth0 network interface and click the [Edit] button. Move to the IPv4 Settings tab and fill in the relevant details like so:

The key things are to make sure you select the Manual option toward the top of the screen; use the [Add] button to let you enter the IP and Netmask details; specify Gateway and DNS Server address if you have them. The gateway address is that which belongs to the PC or router giving you access to the Internet; the DNS address belongs to the machine which does name server lookups in your network (at home, it’s quite likely -as in my case- that the gateway and the DNS server are the same machine).

The entry for search domains is not strictly necessary: it’s the domain name for which the DNS server you’ve just specified is authoritative. That is, in my case, the PC with address 192.168.0.1 knows how to look up ‘xyz.dizwell.home’ without having to refer, via the Gateway, to other DNS servers. Setting it means I don’t have to visit my ISP’s DNS servers just to resolve the name of my other half’s PC, for example, when trying to download a file from it via Windows Networking.

When you’re done, click [Apply]. You will probably be asked for root’s password to confirm you have the authority to change the network settings. Supply it when prompted, then click [Close].

I found that my new settings didn’t take proper effect until I’d right-clicked the little networking icon in the top-right of the screen and unchecked the Enable Networking option, then repeated the process and re-checked it. (If you prefer achieving the same thing at the command prompt, become root and issue the command service network restart).

Configuring Database Auto-start

The last thing you might like to do is to arrange for your database to re-start every time your server reboots (there are good reasons for not doing this, too!). The Gladstone script has done most of the hard work in this regard already: it creates a script, called dboraz which does most of the work.

But dboraz requires three bits of manual file editing before it can work properly. The first is done by root:

nano /etc/oratab

You’ll see the last line of this file currently reads something like:

lindb:/u01/app/oracle/product/11.2.0/db_1:N

It’s that last “N” which needs to be changed to a Y. This tells the server that the lindb database should be auto-stopped and -started whenever the server reboots.

The next two edits are done as the oracle user. Both require you to know the value of the $ORACLE_HOME environment variable, so start by issuing this command:

echo $ORACLE_HOME

…and make a note of the answer (in my case, /u01/app/oracle/product/11.2.0/db_1). Knowing this, edit your first file:

gedit $ORACLE_HOME/bin/dbstart

(I’ve used gedit here because I find cut-and-paste works better with a graphical text editor, but stick to nano -or your text editor of choice!- if you prefer).

You’ll see, right at the start of the file (line 80 if we’re counting), that there is a line which sets ORACLE_HOME_LISTNER=$1. It’s the $1 bit that has to be replaced with the value of the $ORACLE_HOME environment variable, spelled out precisely. You need to end up with this sort of thing, in other words:

Once that’s changed, save the file. The second edit is very similar:

gedit $ORACLE_HOME/bin/dbshut

This time, the offending line is on Line 50 -but it’s the same as before: ORACLE_HOME_LISTNER is currently set to $1 but needs to be set to the literal value of your $ORACLE_HOME environment variable.

With oratab, dbstart and dbshut each edited, you can try out the auto-start scripts manually, without having to reboot your virtual machine: become root (su – root) and then issue the command:

/etc/init.d/dboraz stop

You should see the database and Enterprise Manager shut down. Next, you can issue this command:

/etc/init.d/dboraz start

Once that completes, try connecting to your Enterprise Manager via a browser… you should find the database is up and running just fine.

I suppose the acid test, though, is to issue the command reboot …you should be able to connect to Enterprise Manager in your browser without having to issue any other commands -provided you wait enough time for the entire Oracle server to reboot, of course!

Concusion

I’ll stop at this point. It’s been a long article, but that’s only because I’ve tried to show you every screen of every wizard you’re ever likely to come across! In reality, it’s pretty simple to create an Oracle server if you:

  • Build your virtual machine with at least 2GB RAM and 30GB Hard Disk
  • Install Red Hat 5 or 6 with one of my Kickstart scripts
  • Install the VirtualBox Guest Additions to get the screen resolution to 1024×768 (or better)
  • Run the Gladstone pre-installer script
  • Run the Oracle Universal Installer, mostly just clicking [Next] all the way through
  • Fix your browser to display Flash and to use a static IP address

It can certainly seem a long-winded process, but if you let Kickstart and Gladstone do all the heavy lifting for you, it’s mostly just a lot of sitting around and waiting.

Well, you have a database to explore… so have fun.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>