Introduction:
I must thank my fellow DBA Rodrigo Mufalani for his publication in Portuguese OTN.
Throughout my career as a DBA, I had to do hundreds of Oracle installations on virtually all supported Operating Systems, sometimes for testing, even some not supported by Oracle. My vision is that installing Oracle in a Linux environments has improved a lot over the years and various features have been incorporated into every released OS. In this article I will show you how very simple and quick to install Oracle 12cR2 Enterprise edition, continuing the article where I showed the installation of Oracle Enterprise Linux 7.1 64 bits.

Host machine configuration:

MacBook Pro
8 GB Ram memory
Processor Intel Core i5 2.7 GHz
MacOs Sierra 10.12

Virtual Machine Configuration:

Virtual Box 5.1.8 for MacOS (Can be for any Operating System you are using)
Virtual machine with 2Gb Ram memory
12 Gb virtual machine disk (vdi)
Additional disk for installing Oracle 25Gb (vdi) – Only RDBMS installation occupies 12Gb

To start our installation we will do some steps that configure the OS, which are very simple installing a package through yum, previously all these settings had to be done manually. It is worth mentioning that the configuration is generic, so revising the values does well if you are installing a production environment and may have some specificities that are not well configured by the default values. Here’s what you needed to set up before:

  • Kernel parameters;
  • Memory parameters;
  • Creation of users in the OS and some groups;
  • Installing various packages and libraries (this step done here with rpm was the terror of any OS analyst, it was a huge hassle);

 

Now that you know how much time will save, let’s start the work !!!

As in the installation I did not configure the name of the virtual machine, so it was localhost and this is not cool, so let’s configure the hostname with the command below:

[Root @ localhost] # hostnamectl set-hostname

 

01

Now after the rename has succeeded, after closing and opening the terminal it already has the correct name:

02

One step it is not done by the package installed via yum, is to configure the / etc / hosts file, so below I made my configuration by putting ip, name and fully qualified name (with domain). To do this, I issued the vi / etc / hosts command and edited the file that looked like this:

03

Once the hostname configuration is done, let’s go straight to the “magic” package yum that sets up almost everything for us. We will execute the following command as root:

04

After that, just press the Enter key for the magic to occur and much of the OS setting is performed at one time, as I mentioned earlier.

05

We are following the installation, which needs the internet, and depending on the speed of your can take a few minutes or several. Below we can check more progress of the package installation via yum:

06

At the end of the package installation, an image like the one below will appear:

07

As this the first time I’m using this package for 12c, that is, this package that is specific to each version of the database, I’ll check manually to see if it did everything we need. Note that this check can be done by you or I can trust Oracle and move on.

I made a cat in the configuration files below: /etc/sysctl.conf

08

I checked if the groups I need to install Oracle have been created and the oracle user exists with the command: id oracle

09

For this version instead use the /etc/secutiry/limits.conf standard has a new file that is used for this configuration and the original is left untouched.

10

See the original file without changes, note that I made a “grep -v #”, that is, there are no lines in it that are not commented out:

11

This below is another step that the magic package does not do, set the oracle user password. For testing purposes I have configured it as “oracle”. It is not recommended to leave this password, especially if it is in a production environment. The OS itself complains that the password is weak, but I am root, so he complies with the command and we will follow.

12

This is another step that we have to do manually, stop the firewall or if so configure to allow only what is needed. As this here would yield another article and is not impediment to continue, we will disable our firewall. And in the disable disabling SElinux, previously we had to disable this option of the OS, now just put as Permisive to install Oracle, but I have decided to disallow for this article.

13

The commands below are required to create the Oracle home, when I went to install the database the path was short, then follow a step by step I had to do before:

  1. Create a 25 GB vdi disk for this machine in Virtual Box configurations with the virtual machine turned off;
  2. When you connect the machine, a new device will be listed, note that there is already a / dev / sda1 and there will be a new device / dev / sdb (no partition created):2.1 With fdisk create a new partition, logged in as root, with the command: fdisk / dev / sdbNote: It will ask a series of questions, answer with: n, p, enter, enter, w2.2 Now that there is a partition on the disk, it will create / dev / sdb1 and we will use ext4 to format this partition, again logged in as root, issue the command: mkfs.ext4 / dev / sdb12.3 Now let’s create a / u01 folder with the command: mkdir / u01

    2.4 Let’s mount the / u01 folder on the newly created disk, with the command: mount -t ext4 / u01 / dev / sdb1

Note: This setting is only in memory, to keep this permanent configure the / etc / fstab file.

Now that I’ve explained how to mount the 25Gb filesystem, it’s time to create the directory where my ORACLE HOME will reside:

[Root @ labora12cr2] # mkdir -p / u01 / app / oracle / product / 12201 / db1
[Root @ labora12cr2] # chown -R oracle.oinstall / u01
[Root @ labora12cr2] # chmod -R 775 / u01

14

This file here, a lot of people forget to configure and is something else that we must do manually. It stores the Oracle user environment variables and resides inside the / home / oracle directory with the name of .bash_profile. Here’s how I set up my variables. It is possible to create some aliases that also make your DBA life easier, such as a tail in the alert.log, going to some directories, and so on. Since this is not the focus, I left only with the necessary.

15

Below the progress of decompressing the Oracle installation binaries that were downloaded to the / home / oracle directory and as I was without space in / I had to unzip it to / u01 with the command:

[Oracle @ labora12cr2] $ unzip Oracle12cR2_x86_64_rdbms.zip -d / u01 /

16

Now the time has come for the truth, and if all we have done so far has been done successfully, we will not have trouble performing the installation. Check if the network of your virtual machine is connected and with ip to not give problem at the time of configuring the listener.To run the installer, such as oracle, issue the command:

[Oracle @ labora12cr2] # cd / u01 / database
[Oracle @ labora12cr2] # ./runInstaller

As the Oracle installer has matured over the years, since the 10g version he does a series of checks before and during the opening of the installer, which we call OUI (Oracle Universal Installer), which is a java application. Here below for example he is doing the check if you are logged in on a console that has X (can open graphical interface), note that he also checked the swap and my file system / tmp.

18

Welcome screen of the Oracle 12c installer, it already asks you to enter the credentials of Oracle My Support (Metalink), in case you have not can uncheck this option. But I emphasize that it is very important to hire Oracle support to run in a production environment and it is always a great experience working with Oracle engineers to solve the most diverse problems.

19

Since this is a test-only installation, I will uncheck this option for support and security updates.

20

Because Oracle knows this is important, the installer gives you this warning, but you can continue the installation by clicking Yes.

21

In the screen below, the OUI will ask you what task you want to perform:

22

If it is for testing, we can choose Desktop Class or Desktop Class, even so, I opted to use the server option that will give me some more configuration options ahead.

23

This is a single instance installation, ie it is a RAC, so I left default:

24

For our purposes in this article the typical installation meets, I believe I never use the same when I create a production DB, in the advanced option there are a number of important settings that the typical will leave as default:

25

One of the checks that the installer makes and does not let pass now without is the strong password for administrative users of the database, look below what happened when I left the password “oracle”:

26

The installer detected that the password was out of the standard and detected that I had little disk space, so I, before, took the steps to create the 25Gb disk

27

Now that I’ve entered a strong password and allocated more disk, Oracle will not mind finishing the installation and creating my db12cr2 database with a pdb called pdb1.

28

The next step is to define Oracle Inventory, which is a very important part. It records installed Oracle products and patchsets applied to each home. In our case, I left where the installer recommended:

29

This part of the installer since version 11gR1 does all the checks of packages, memory, disk and etc, in some cases, it is possible to correct and continue, in ours as only a test environment will ignore.30

It is not good to ignore this in a production environment, and the OUI tells you that.

31

Summary screen where you can still go back and edit something that is not as you would like. In our case, we will click on install.

32

Here below, we can see the OUI in progress with all the steps it is taking.

33

Almost at the end of the installation, which is done almost entirely as an oracle, the install will prompt you to run two scripts with the root user in another terminal window. Open a terminal as root, run the scripts as I will next and then press OK on this screen.

34

Running the first script, the orainstRoot.sh that will adjust the permissions of the Oracle Inventory:

35

This script is the most complex and makes some file adjustments and copies in an RAC environment, the whole DBA is very happy when it runs 100% smoothly and formats the OCRs and joins the nodes in the cluster (if you never did, it’s okay Just an attack on it). One thing that is cool right now is that root.sh can already configure the Trace File Analyzer (TFA) which is an important tool for opening calls with Oracle Support (MOSC).

36

You can configure this later, or simply do not configure, as I did below:

37

After we click OK, there on the screen where he asked to run the scripts as root, the progress bar continues and the installation follows …

38

In a few more minutes the Oracle installation is ready and functional with the screen below informing you that everything has been done successfully.

39

When you click next, it shows the Enterprise Manager Database Express URL:

40

Here to attest that the installation worked as it should, I’m connecting as SYS to my newly created db12cr2 database (running Oracle 12c Enterprise Edition 12.2.0.1 – 64bit)

41

Below is the listener configured for this bank.

42

Conclusion

With the second part of the article, we saw that installing Oracle 12c R2 is not at all complex and Oracle is doing a great job facilitating the lives of users around the world improving their products every day. We installed the Oracle 12c R2 (12.2.0.1) 64bit RDBMS binaries on top of a virtual machine running Oracle Enterprise Linux 7.1 64bit within the Oracle Virtual Box. I can say that it was very simple to do these configurations and hope the two articles can Have helped you set up your environment. Believe me, it was very difficult to install Oracle on Linux in the early 2000s, when I started my DBA career, you had to look for a lot of information online and they were very difficult to find.Nowadays we have several sources of research, Oracle manuals are more accessible to everyone online and besides, a source that I always use for installations is the Tim Hall blog (www.oracle-base.com), which has tutorials Awesome about a lot of cool Oracle thing.

Leave a Reply