Fast Oracle 12c Installation on Linux with RPMs (2/2)

IMG_0077

The first part of this article explains how to build an RPM that contains an Oracle Database 12c Release 1 Enterprise Edition and use it with Oracle Linux 6 x86_64 and “rpm --install“. You can easily adapt this method to your needs and build your own packages, with your release or edition. Poke me on my twitter to go further into the discussion and provide some feedback on the building scripts.

Nevertheless, once you’ve built an RPM, you’re only halfway there. If you want to deploy Oracle on Linux fast, you need to create your YUM repository and add the RPM to it. This is what you’ll find in this second part of the article.

An easy way to publish a YUM repository is with an HTTP server, like Apache HTTP server. In the case of Apache HTTP server, your directory should be accessible with the following options “Indexes FollowSymLinks Multiviews”. In the next sections of this article we will assume the YUM repository is provided by this kind of infrastructure and:

  • The server local directory is /var/www/html/yum/OracleSoftware/x86_64
  • It is accessible from http://yum.arkzoyd.com/OracleSoftware/x86_64; don’t try it, this URL doesn’t exist on the Web ;-)

Step 1 – Copying RPMs in your directory

As you can easily guess the 1st step of building a YUM repository consists in pushing the RPMs onto the YUM server directory. You can use the method of your choice to do this, including SCP as shown below:

Step 2 – Creating Metadata files

Once you’ve pushed the files, you need to create the index and metadata files so that YUM can find the right RPM easily. The createrepo command does the job for you:

Note:
That is indeed all you need to do to create a repository. For some odd reasons, the 167283.sh script provided as part of “How to Create a Local Yum Repository for Oracle Linux”[1] creates RPM headers. With the RPM version shipped with Oracle Linux 6, the metadata is enough and there is no more need to create those files.

Step 3 – Referencing the YUM repository in your server

Once the YUM repository created and indexed, it should be usable by any Oracle Linux 6 x86_64 servers that can access it. In order reference it, create a file name x.repo in /etc/yum.repos.d. This is an example of such a file on my server:

Note:
If you did not sign your RPMs, set gpgcheck to 0.

Step 4- Searching RPMs and their metadata

You can check RPMs are accessible from your server with yum or repoquery:

Step 5- Installing the Database Software

Once your software is referenced in the repository, you can easily install it as well as all the required packages and prerequisites with a one-line "yum install" command :

As you can see, installing a database software has never been as simple; to de-install the software, simply execute:

It Isn’t Really Over or Is it?

This method takes 1’30’ to 2’30’’ to Install a 12cR1 Database Software from the RPM on Oracle Linux 6, including the relink. Considering the file is about 2.5GB in size, you can easily guess you would better have a fast network between your servers and the YUM repository to optimize the installation time. That’s where proxies or YUM mirrors (see reposync[2] and Yum fastestmirror plugin[3]) might help you to move file as close as possible from the servers. The good news is that if you have a 1+ Gbps network, the download might take less than 1’ and your install time around 4’. Another benefit from using RPM is that it can easily be added to your standard images for virtual machines and physical servers with KickStart.

Obviously building RPM doesn’t address everything. You would also need to provision storage, create databases, back up, monitor, create users, grant privileges, manage upgrades, secure components or sites to mention a few. I’m afraid, those tasks are boring too! Though Oracle Linux and Oracle VM might help again; and this is another story…

Bibliography
[1] How to Create a Local Yum Repository for Oracle Linux
[2] reposync(1) – Linux man page
[3] yum-plugin-fastestmirror in Fedora Documentation
[4] Yellowdog Updater Modified Modified Web Site

Gregory Guillou

About Gregory Guillou

Gregory Guillou has written 768 post in this blog.

Senior Technical Architect at Easyteam

One thought on “Fast Oracle 12c Installation on Linux with RPMs (2/2)

  1. Pingback: #DB12c by Gregory Guillou : Fast Oracle 12c Install on Linux with RPMs (2/2) | Database Scene

Leave a Reply

%d bloggers like this: