Hopefully, by now you have a fully functional running VM with Oracle Linux on it – if not, head back to Part 1 and follow the instructions there to get caught up! One would think that the Oracle Database may come preconfigured and setup with something called Oracle Linux but that is just not the case. In fact, before we can even think about installing Oracle Database there are a number of prerequisites we need to meet – enough to warrant it’s own part in a blog series anyways – so with that, let’s have a look….
Automatic or Manual
If you Google around about the Oracle Database Prerequisites you will see a number of different blog posts outlining a whack of manual steps that need to be taken in order to get things ready. Items like creating groups, setting up users, changing a bunch of permissions on directories. You will also see an rpm package which can be pulled down and installed which will set all of this up for you! I mean, the choice is yours, but I’m never going through all of the manual steps again – here we will just document the automagic way of doing things as it saves us a ton of time and limits our chance of making any errors. First up, ssh into your server as root and run the following command to install the pre-install packages…
1 |
yum install oracle-database-server-12cR2-preinstall -y |
This will go through and set a number of different settings as it pertains to the kernel and network settings, as well as set up all of the proper groups and create the ever so important oracle user! Once complete, go ahead and change the oracle users password to something preferred… (Be sure to still be root at this point)
1 |
passwd oracle |
Now it’s time to add some information to our /etc/hosts file. We need to add our hostname, including the FQDN to both the line defining 127.0.0.1 and also adding a new one reflecting our new IP. In the end, it should look something the file shown below, obviously replacing mwp-oracle with your own hostname.
1 2 3 |
127.0.0.1 mwp-oracle mwp-oracle.rubrik.us localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 10.10.12.111 mwp-oracle mwp-oracle.rubrik.us |
We also need to edit the /etc/selinux/config file ensuring that the SELINUX flag is set to permissive (By default this will be enforcing). Simply change the SELINUX=enforcing line to as follows..
1 |
SELINUX=permissive |
Depending on your paranoia level, configure your firewall properly (see here) or, since this is a lab, I’ll simply stop and disable it with the following commands:
1 2 |
systemctl stop firewalld systemctl disable firewalld |
Now we need to create some directories for our Oracle installation to be installed in. You can choose to change these if you wish, just remember to adjust the environment variables accordingly when we get to that step.
1 2 3 |
mkdir -p /u01/app/oracle/product/12.2.0.1/db_1 chown -R oracle:oinstall /u01 chmod -R 775 /u01 |
Finally, let’s go ahead and set up some of the environment variables for our Oracle instance. This can be done by adding the following lines to the oracle users bash_profile (/home/oracle/.bash_profile).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
# Oracle Settings export TMP=/tmp export TMPDIR=$TMP export ORACLE_HOSTNAME=mwp-oracle.rubrik.us export ORACLE_UNQNAME=cdb1 export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/12.2.0.1/db_1 export ORACLE_SID=cdb1 export PATH=/usr/sbin:/usr/local/bin:$PATH export PATH=$ORACLE_HOME/bin:$PATH export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib |
Give this bad boy a good reboot and with that, we are all set to begin part 3 of this series which is installing the Oracle Database 12C software – exciting!!!