Skip navigation

Oracle Linux

13 posts

Introduction

In a previous blog post, I described the steps to streamline the pre-installation steps on Oracle Linux for Oracle Database 12c using the Database preinstallation package. In this post you will learn how to do a fully automated installation of Oracle Database 12c on Oracle Linux running in an Oracle VM VirtualBox guest. The tutorial is based on a Vagrantfile published in our Vagrant repo on GitHub.

 

Because this installation method uses VirtualBox, Vagrant and an Oracle Linux Vagrant Box, the whole process can be automated, requiring minimal to no input. Assuming you have VirtualBox, Vagrant and git installed, these are the steps needed to install Oracle Database:

 

  1. Clone the relevant GitHub repository
  2. Download the Oracle Database 12c installation media from OTN
  3. Issue a Vagrant to create the VM and start the Database installation process
  4. Wait 15-25 minutes, depending on your network bandwidth and machine horsepower
  5. Done

 

The commands are straightforward:

 

$ git clone https://github.com/oracle/vagrant-boxes

$ cd vagrant-boxes/OracleDatabase/12.2.0.1

<download Oracle Database installation zip file>

$ vagrant up

 

How Does This Work?

 

Assuming you have the required tools in place, the steps summarized earlier cause Vagrant to do the following

 

  • read the Vagrantfile (more about that later)
  • create a headless VM based on the pre-packaged Oracle Linux 7 Vagrant box
  • provision the VM by runing a script that
    • updates Oracle Linux to the latest available packages from Oracle Linux yum server
    • performs Database pre-installation checks and installs required packages
    • unzips the Database installion files,
    • installs the Oracle Database 12c software
    • creates a database and pluggable database container

 

After the installation has completed, you can either log in to the guest VM itself and interact with the Database there or, you can leave the VM running —headless— and connect from the host operating system to the Database using tools such as SQL Developer.

 

Requirements

 

Before You Get Started

 

You will need the following tools installed to follow this tutorial

 

 

Steps

 

Clone the vagrant-boxes repository from GitHub

 

$ git clone https://github.com/oracle/vagrant-boxes
Cloning into 'vagrant-boxes'...
remote: Counting objects: 382, done.
remote: Compressing objects: 100% (77/77), done.
remote: Total 382 (delta 67), reused 108 (delta 52), pack-reused 249
Receiving objects: 100% (382/382), 80.99 KiB | 0 bytes/s, done.
Resolving deltas: 100% (195/195), done.
Checking connectivity... done.
$

 

 

Download Oracle Database Installation Files

 

From the Oracle Database 12c Release 2 download page, grab the Linux x86-64 file. Accept the license and click File 1 for Linux x86-64 (see Fig. 1)

otn-download-datatabase-files.png

Fig 1. Database 12c Release 2 installation file

 

Place the downloaded Database installation zip File in the appropriate directory

 

Because you are installing Database 12c, change to the appropriate directory:

 

$ cd vagrant-boxes/OracleDatabase/12.2.0.1

 

 

You should see the following before you proceed:

 

$ ls -1F
README.md
Vagrantfile
linuxx64_12201_database.zip
ora-response/
scripts/
$

 

For my installation I used Vagrant 2.0.1 and VirtualBox 5.2.8

 

$ vagrant -v
Vagrant 2.0.1
$ vboxmanage -v
5.2.8r121009
$

 

What's in a Vagrantfile?

 

Before we kick off the installation, let's take a look at the Vagrantfile, the file that controls everything from creating the Oracle Linux VM, to installing the Database.

 

At the top of the Vagrantfile, there's a section that defines a virtual machine to be based on a Vagrant base box. In this case it's using a the latest available Oracle Linux 7 box from yum.oracle.com

 

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "ol7-latest"
  config.vm.box_url = "https://yum.oracle.com/boxes/oraclelinux/latest/ol7-latest.box"

 

 

This section configures port forwarding in VirtualBox so that a SQL*Net connection to port 1521 on the host operating system (for example) will end up connecting to the Database listener in the VM guest.

 

  # Oracle port forwarding
  config.vm.network "forwarded_port", guest: 1521, host: 1521
  config.vm.network "forwarded_port", guest: 5500, host: 5500

 

 

The last section tells Vagrant to provision the VM by running an install script that performs the Database installation. It also defines and sets environment variables for the execution of the script.  You can adjust these if you wish, but it's not required.

 

 config.vm.provision "shell", path: "scripts/install.sh", env:
    {
      "ORACLE_BASE"        => "/opt/oracle",
      "ORACLE_HOME"        => "/opt/oracle/product/12.2.0.1/dbhome_1",
      "ORACLE_SID"          => "ORCLCDB",
      "ORACLE_PDB"          => "ORCLPDB1",
      "ORACLE_CHARACTERSET" => "AL32UTF8",
      "ORACLE_EDITION"      => "EE"
    }

 

You can take a look at the install script here, but suffice to say it uses a response file to perform an installation of Oracle Dabase 12c using so-called response files so that no user interaction is required.

 

Start the installation

 

$ vagrant up

 

Now, grab yourself a beverage or a snack. The installation can take anywhere from 15 to 25 minutes, depending on the power of the host running the VM and your bandwidth (to download the Oracle Linux box). On a late 2013 Macbook Pro with SSD storage and 8GB of RAM it took about 23 minutes to get from the initial vagrant command to fully installed Oracle Database.

 

You will see tons of output as the VM is configured and the Database is installed. Some snippets below:

 

==> default: Running provisioner: shell...

    default: Running: /var/folders/dq/zx1355j55lj8n9wszqjq1j640000gn/T/vagrant-shell20180418-2363-fe5fuu.sh

    default: INSTALLER: Started up

    default: Resolving Dependencies

    default: --> Running transaction check

    default: ---> Package acl.x86_64 0:2.2.51-12.el7 will be updated

    default: ---> Package acl.x86_64 0:2.2.51-14.el7 will be an update

    default: ---> Package acpid.x86_64 0:2.0.19-8.el7 will be updated

    default: ---> Package acpid.x86_64 0:2.0.19-9.el7 will be an update

    default: ---> Package audit-libs.x86_64 0:2.7.6-3.el7 will be updated

    default: ---> Package audit-libs.x86_64 0:2.8.1-3.el7 will be an update

    default: ---> Package bash.x86_64 0:4.2.46-29.el7_4 will be updated

    default: ---> Package bash.x86_64 0:4.2.46-30.el7 will be an update

    default: ---> Package bind-libs-lite.x86_64 32:9.9.4-51.el7_4.2 will be updated

    default: ---> Package bind-libs-lite.x86_64 32:9.9.4-61.el7 will be an update

    default: ---> Package bind-license.noarch 32:9.9.4-51.el7_4.2 will be updated

...

    default: --> Finished Dependency Resolution

    default:

    default: Dependencies Resolved

    default:

    default: ================================================================================

    default:  Package                     Arch   Version                 Repository     Size

    default: ================================================================================

    default: Installing:

    default:  kernel-uek                  x86_64 4.1.12-124.14.1.el7uek  ol7_UEKR4      46 M

    default:  kernel-uek-firmware         noarch 4.1.12-124.14.1.el7uek  ol7_UEKR4     2.5 M

    default: Updating:

    default:  acl                         x86_64 2.2.51-14.el7           ol7_latest     81 k

    default:  acpid                       x86_64 2.0.19-9.el7            ol7_latest     68 k

    default:  audit-libs                  x86_64 2.8.1-3.el7             ol7_latest     99 k

 

...

 

    default: Dependencies Resolved

    default:

    default: ================================================================================

    default:  Package                 Arch   Version                        Repository  Size

    default: ================================================================================

    default: Installing:

    default:  oracle-database-server-12cR2-preinstall

    default:                          x86_64 1.0-3.el7                      ol7_latest  19 k

    default: Installing for dependencies:

    default:  bind-libs               x86_64 32:9.9.4-61.el7                ol7_latest 1.0 M

    default:  bind-utils              x86_64 32:9.9.4-61.el7                ol7_latest 204 k

...

 

    default: INSTALLER: Oracle preinstall and openssl complete

    default: INSTALLER: Oracle directories created

    default: INSTALLER: Environment variables set

    default: Archive:  /vagrant/linuxx64_12201_database.zip

    default:    creating: /vagrant/database/

    default:    creating: /vagrant/database/install/

 

...

 

    default: Starting Oracle Universal Installer...

    default:

    default: Checking Temp space: must be greater than 500 MB.   Actual 30233 MB    Passed

    default: Checking swap space: must be greater than 150 MB.   Actual 4088 MB    Passed

    default: Preparing to launch Oracle Universal Installer from /tmp/OraInstall2018-04-18_08-33-54PM. Please wait ...

    default: [WARNING] [INS-32055] The Central Inventory is located in the Oracle base.

    default:    ACTION: Oracle recommends placing this Central Inventory in a location outside the Oracle base directory.

    default: You can find the log of this install session at:

    default:  /opt/oracle/oraInventory/logs/installActions2018-04-18_08-33-54PM.log

    default: Prepare in progress.

 

...

 

    default: Finish Setup successful.

    default: The installation of Oracle Database 12c was successful.

    default: Please check '/opt/oracle/oraInventory/logs/silentInstall2018-04-18_08-33-54PM.log' for more details.

 

...

 

    default: Copying database files

    default: 1% complete

    default: 13% complete

    default: 25% complete

    default: Creating and starting Oracle instance

    default: 26% complete

    default: 30% complete

 

...

 

    default: 100% complete

    default: Look at the log file "/opt/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB.log" for further details.

    default:

    default: SQL*Plus: Release 12.2.0.1.0 Production on Wed Apr 18 20:47:37 2018

    default:

    default: Copyright (c) 1982, 2016, Oracle.  All rights reserved.

    default:

    default: Connected to:

    default: Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

    default: SQL>

    default: Pluggable database altered.

    default: SQL>

    default: Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

    default: INSTALLER: Database created

    default: INSTALLER: Oratab configured

    default: Created symlink from /etc/systemd/system/multi-user.target.wants/oracle-rdbms.service to /etc/systemd/system/oracle-rdbms.service.

 

    default: INSTALLER: Created and enabled oracle-rdbms systemd's service

    default: INSTALLER: setPassword.sh file setup

    default: ORACLE PASSWORD FOR SYS, SYSTEM AND PDBADMIN: **********

    default: INSTALLER: Installation complete, database ready to use!

 

 

 

Be sure to make a note of the generated password shown at the end of the output.

 

Next Steps

 

Connecting to the Database

To connect to your Database, you can either 1) ssh to the VM and interact with the database there; or 2) connect a database tool such as SQL Developer from your host machine to the VM.

 

1. ssh to the VM and interact with the database

 

The command vagrant ssh logs you in to the VM. This is another benefit of Vagrant — ssh keys are set up on both the host and the VM so that you can log in without a password. Next, set up the Oracle environment and use sqlplus to connect to the database with a connect string that includes a hostname and a service, in this case, localhost/orclpdb1.

 

$ vagrant ssh
[vagrant@oracle-12201-vagrant ~]$ . oraenv
ORACLE_SID = [ORCLPDB1] ? ORCLPDB1
ORACLE_HOME = [/home/oracle] ? /opt/oracle/product/12.2.0.1/dbhome_1
ORACLE_BASE environment variable is not being set since this
information is not available for the current user ID vagrant.
You can set ORACLE_BASE manually if it is required.
Resetting ORACLE_BASE to its previous value or ORACLE_HOME
The Oracle base remains unchanged with value /opt/oracle/product/12.2.0.1/dbhome_1
[vagrant@oracle-12201-vagrant ~]$ sqlplus system/<USE PASSWORD GENERATED BY SCRIPT>@localhost/orclpdb1


SQL*Plus: Release 12.2.0.1.0 Production on Wed Apr 18 22:38:20 2018


Copyright (c) 1982, 2016, Oracle.  All rights reserved.


Last Successful login time: Wed Apr 18 2018 22:37:28 +00:00


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production


SQL> 

 

Note: If the generated password has a / or @ in it, you may need to use escaped quotes around the password as follows:

 

sqlplus system/\"WPEfu/mdpFU=1\"@localhost/orclpdb1

 

2. Connect the Database from the host system

 

You'll recall that the Vagrantfile set up port mapping in VirtualBox so that a connection to port 1521 on the local host is re-directed to port 1521 in the VM. This means  you can create a connection in Oracle SQL Developer as follows:

 

Create a new connection (Fig. 2)

sqldev-new-conn.png

Fig 2. Create a new connection

 

 

Unless you changed the defaults in the Vagrantfile, the connection details are (see Fig. 3)

Hostname: localhost

Port: 1521

Service name: orclpdb1

 

conn-settings.png

 

You are now ready to connect to the Database, create database objects and run queries.

allset.png

 

Learn from the Database 12c Learning Library

If you are new to Oracle Database or Database 12c, try some of the tutorials in the Database 12c Learning Library.

 

Use Vagrant to Make and Restore Snapshot of your VM

Oracle VM VirtualBox has a snapshot feature so that you can make a snapshot of your VM in a known, good state and recover this state later.  Using Vagrant's CLI:

 

$ # shut down the vm first
$ vagrant halt
==> default: Attempting graceful shutdown of VM...
$ # create a snapshot called "freshdb"
$ vagrant snapshot save freshdb
==> default: Snapshotting the machine as 'freshdb'...
==> default: Snapshot saved! You can restore the snapshot at any time by
==> default: using `vagrant snapshot restore`. You can delete it using
==> default: `vagrant snapshot delete`.
$ # ...later ... restore the VM, making sure you don't trigger the provisioning steps in the Vagrantfile
$ vagrant snapshot restore freshdb --no-provision
==> default: Restoring the snapshot 'freshdb'...
==> default: Clearing any previously set forwarded ports...
==> default: Fixed port collision for 22 => 2222. Now on port 2200.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 1521 (guest) => 1521 (host) (adapter 1)
    default: 5500 (guest) => 5500 (host) (adapter 1)
    default: 22 (guest) => 2200 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
...

Conclusion

In this tutorial I showed how using only git, Oracle VM VirtualBox, and Vagrant you can perform an automated installation of Oracle Database 12c on your development machine.

In a previous post I covered a few useful yum commands.  One of these is repoquery, a tool for querying yum repositories in a similar way to using rpm queries.  repoquery works directly against the Oracle Linux yum server.

 

Whereas the following works against yum.oracle.com:

$ sudo repoquery --list vim-minimal 
/bin/ex
/bin/rvi
/bin/rview
/bin/vi
/bin/view
/etc/virc

 

When using, ULN you must use the --plugins flag for the repoquery command to return anything


$ sudo repoquery --plugins --list vim-minimal
/etc/virc
/usr/bin/ex
/usr/bin/rvi
/usr/bin/rview
/usr/bin/vi
/usr/bin/view

Every now and then, when the Oracle Linux yum server is in the process of being updated with new packages, you may encounter an error like the following:

 

$ sudo yum install -y yum-utils

ol7_UEKR4                                                   | 1.2 kB  00:00:00    

ol7_latest                                                  | 1.4 kB  00:00:00    

(1/5): ol7_UEKR4/x86_64/updateinfo                          |  69 kB  00:00:00    

ol7_latest/x86_64/updateinfo   FAILED                                          ETA

http://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/repodata/updateinfo.xml.gz: [Errno -1] Metadata file does not match checksum

Trying other mirror.

 

Usually, clearing the local metadata caches with yum clean will fix this issue.

 

$ sudo yum clean all

Cleaning repos: ol7_UEKR4 ol7_latest

Cleaning up everything

Product Overview

 

The Oracle Linux operating system is engineered for open cloud infrastructure. It delivers leading performance, scalability and reliability for enterprise SaaS and PaaS workloads as well as traditional enterprise applications. Oracle Linux Support offers access to award-winning Oracle support resources and Linux support specialists, zero-downtime updates using Ksplice, additional management tools such as Oracle Enterprise Manager, and lifetime support, all at a low cost. Unlike many other commercial Linux distributions, Oracle Linux is easy to download, completely free to use, free to distribute, and free to update.

 

The Unbreakable Enterprise Kernel (UEK), included as part of Oracle Linux, provides the latest open source innovations, key optimizations and security for enterprise cloud workloads. This Linux kernel powers Oracle Cloud and Oracle Engineered Systems such as Oracle Exadata Database Machine. Oracle tests UEK intensively with demanding Oracle workloads, and recommends it for Oracle deployments and all other enterprise deployments.

 

Notable Changes

  • Updated support for Intel Xeon E3 v5, Intel Xeon E5 v5 and Intel Xeon E7 v5 families of processors (formerly known as Skylake).
  • Hardware enablement for the latest HPE SGI UV platforms - The kernel is updated to apply upstream patches that enable hardware support for an HPE system utilizing SGI UV technology (HPE acquired SGI).
  • Userfaultfd support added to the kernel  - The kernel is updated to support userfaultfd, a new feature that allows on-demand paging from user space and allows user space applications to take control of various memory page faults.
  • Function Boundary Tracing (FBT) - is now available in DTrace.
  • DTrace Typed SDT arguments - This update allows kernel developers to add probes without updating the module, relying instead on DTrace's ability to dynamically compute argument types to navigate structures.
  • Xen Hypervisor Changes - The xen-blkback and xen-blkfront drivers for block device support have been updated to fix issues related to resume after migration. Other fixes include upstream patches for stability and performance.

 

Read the release notes for more details.

 

Supported Upgrade Path

Customers can upgrade existing Oracle Linux 6 and 7 servers using the Unbreakable Linux Network or the Oracle Linux yum server.

 

Software Download

Oracle Linux can be downloaded, used and distributed free of charge and all updates and errata are freely available. For support, you decide which of your systems require a support subscription. This makes Oracle Linux an ideal choice for your development, testing and production systems. You decide which support coverage is the best for each of your systems individually, while keeping all of your systems up-to-date and secure. For customers with Oracle Linux Premier Support, you also receive access to zero-downtime kernel updates using Oracle Ksplice and support for Oracle OpenStack for Oracle Linux.

 

Compatibility

UEK R4 Update 4 is fully compatible with the previous UEK R4 updates. The kernel ABI for UEK R4 will remain unchanged in all subsequent updates to the initial release. In this release, there are changes to the kernel ABI relative to UEK R3 that require recompilation of third-party kernel modules on the system. Before installing UEK R4, verify its support status with your application vendor.

Sergio-Oracle

Useful Yum Commands

Posted by Sergio-Oracle Apr 25, 2017

Introduction

Oracle Linux uses the RPM package format and yum to interact with both the free Oracle Linux yum server and Unbreakable Linux Network for customers with a support subscription. This post covers a few useful yum commands.

 

Show Information About Installed and Available Packages

yum info <package name> displays information about both installed and available packages.

 

$ yum info kernel-uek 
Loaded plugins: security
Installed Packages
Name        : kernel-uek
Arch        : x86_64
Version     : 4.1.12
Release     : 61.1.33.el6uek
Size        : 208 M
Repo        : installed
Summary     : The Linux kernel

URL         : http://www.kernel.org/

License     : GPLv2

Description : The kernel package contains the Linux kernel (vmlinuz), the core of any

            : Linux operating system.  The kernel handles the basic functions

            : of the operating system: memory allocation, process allocation, device

            : input and output, etc.

 

Available Packages

Name        : kernel-uek

Arch        : x86_64

Version     : 4.1.12

Release     : 94.1.8.el6uek

Size        : 50 M

Repo        : public_ol6_UEKR4

Summary     : The Linux kernel

URL         : http://www.kernel.org/

License     : GPLv2

Description : The kernel package contains the Linux kernel (vmlinuz), the core of any

            : Linux operating system.  The kernel handles the basic functions

            : of the operating system: memory allocation, process allocation, device

 

 

yum list <package name> will show available and installed packages by that name. To show older versions than the one currently installed or available to install, use --show-duplicates

 

$ yum list openssl --show-duplicates

Installed Packages

openssl.x86_64                                               1:1.0.2k-16.0.1.el7                                               installed

Available Packages

openssl.x86_64                                               1:1.0.2k-12.0.1.el7                                               ol7_latest

openssl.x86_64                                               1:1.0.2k-12.0.3.el7                                               ol7_latest

openssl.x86_64                                               1:1.0.2k-16.0.1.el7                                               ol7_latest

 

 

Working with Yum Repositories: Enabling and Disabling

 

Listing Enabled and Disabled Repositories

 

The command yum repolist here lists two enabled repositories: public_ol6_UEKR4 and public_ol6_latest

 

$ yum repolist

Loaded plugins: security

public_ol6_UEKR4                                                                        | 1.2 kB    00:00 

public_ol6_latest                                                                       | 1.4 kB    00:00 

repo id                    repo name                                                    status

public_ol6_UEKR4           Latest Unbreakable Enterprise Kernel Release 4 ...                244+73

public_ol6_latest          Oracle Linux 6Server Latest (x86_64)                              31,595+7,370

repolist: 31,839

 

List Disabled Repositories

To list disabled repositories, based on the yum configuration file in /etc/yum.repos.d, use the yum repolist disabled command:

 

$ yum repolist disabled

Loaded plugins: security

repo id                        repo name                                                                                      

public_ol6_MySQL               MySQL 5.5 for Oracle Linux 6 (x86_64)                                                          

public_ol6_MySQL56             MySQL 5.6 for Oracle Linux 6 (x86_64)                                                          

public_ol6_MySQL57             MySQL 5.7 for Oracle Linux 6 (x86_64)                                                          

public_ol6_UEKR3_latest        Unbreakable Enterprise Kernel Release 3 for Oracle ... (x86_64)                      

public_ol6_UEKR4_OFED          OFED supporting tool packages for... (x86_6)

public_ol6_UEK_base            Unbreakable Enterprise Kernel for Oracle Linux 6Server (x86_64)                                

public_ol6_UEK_latest          Latest Unbreakable Enterprise Kernel for Oracle Linux 6Server (x86_64)                          

public_ol6_addons              Oracle Linux 6Server Add ons (x86_64)                                                          

public_ol6_ceph10              Ceph Storage for Oracle Linux Release 1.0 - Oracle ... (x86_64)                  

public_ol6_ga_base             Oracle Linux 6Server GA installation media copy (x86_64)                                        

 

...                          

 

repolist: 0

 

Enabling and Disabling a Repository

To enable and disable repositories, you can either edit the appropriate configuration file in /etc/yum.repos.d/ or you can use the yum-config-manager tool provided by the yum-utils package

 

$ sudo yum -y install yum-utils

 

To enable a repository, use the yum-config-manager --enable command <repo name> command. For example to enable the Addons repository for Oracle Linux 6:

$ sudo yum-config-manager --enable public_ol6_addons

 

You will see output that includes the following.  Notice that enabled = 1.

 

===================================== repo: public_ol6_addons ======================================

[public_ol6_addons]

bandwidth = 0

base_persistdir = /var/lib/yum/repos/x86_64/6Server

baseurl = http://yum.oracle.com/repo/OracleLinux/OL6/addons/x86_64/

cache = 0

cachedir = /var/cache/yum/x86_64/6Server/public_ol6_addons

cost = 1000

enabled = 1

enablegroups = True

exclude =

failovermethod = priority

ftp_disable_epsv = False

...

 

Similarly to disable a repository:

 

$ sudo yum-config-manager --disable public_ol6_addons

 

Temporarily Enabling and Disabling Repositories: enablerepo and disablerepo

Sometimes you want to perform yum commands while temporarily enabling or disabling repositories without changing the current yum configuration. Use the --enablerepo and --disablerepo arguments to achieve this.  For example, to temporarily disable all currently enabled repositories while enabling a new repository, public_ol6_u9_base in order to search for the python binary only in that repository (in addition to any installed python binaries):

 

$ yum --disablerepo="*" --enablerepo=public_ol6_u9_base provides "*/bin/python"

 

For more information about the provides argument, see the separate topic below.

Security Notices and Bugfix Notices: updateinfo

Errata (security fixes, bug fixes and enhancements) for the base Oracle Linux operating system are available for free via the Oracle Linux yum server. You can view and search all errata advisories via linux.oracle.com/errata and CVEs (Common Vulnerabilities and Exposures) in particular via linux.oracle.com/cve The plugin yum-plugin-security is installed by default and lets you query security information.

 

List a Summary of Available Bugfix and Security Notices

 

$ yum updateinfo

Loaded plugins: security

Updates Information Summary: updates

    2 Security notice(s)

        1 Critical Security notice(s)

        1 Important Security notice(s)

    2 Bugfix notice(s)

updateinfo summary done

 

List Available Security Advisories

 

To get a list of available security advisories use the yum updateinfo security command:

 

$ yum updateinfo security

Loaded plugins: security

ELSA-2017-3539 Important/Sec. kernel-uek-4.1.12-61.1.34.el6uek.x86_64

ELSA-2017-3539 Important/Sec. kernel-uek-firmware-4.1.12-61.1.34.el6uek.noarch

ELSA-2017-1100 Critical/Sec.  nss-3.28.4-1.0.1.el6_9.x86_64

ELSA-2017-1100 Critical/Sec.  nss-sysinit-3.28.4-1.0.1.el6_9.x86_64

ELSA-2017-1100 Critical/Sec.  nss-tools-3.28.4-1.0.1.el6_9.x86_64

ELSA-2017-1100 Critical/Sec.  nss-util-3.28.4-1.el6_9.x86_64

updateinfo list done

 

List Advisories by Severity

To list only Critical security advisories, use the --sec-severity=Critical flag

 

$ yum updateinfo list --sec-severity=Critical

Loaded plugins: security

ELSA-2017-1100 Critical/Sec. nss-3.28.4-1.0.1.el6_9.x86_64

ELSA-2017-1100 Critical/Sec. nss-sysinit-3.28.4-1.0.1.el6_9.x86_64

ELSA-2017-1100 Critical/Sec. nss-tools-3.28.4-1.0.1.el6_9.x86_64

ELSA-2017-1100 Critical/Sec. nss-util-3.28.4-1.el6_9.x86_64

updateinfo list done

 

Show Advisory Detail

To show detail for a particular advisory, use yum updateinfo <advisory ID>

 

$ yum updateinfo ELSA-2017-1100

Loaded plugins: security

 

=======================================================================

  nss and nss-util security update

=======================================================================

  Update ID : ELSA-2017-1100

    Release : Oracle Linux 6

       Type : security

     Status : final

     Issued : 2017-04-20

       CVEs : CVE-2017-5461

Description : nss

            : [3.28.4-1.0.1]

            : - Added nss-vendor.patch to change vendor

            : - Temporarily disable some tests until expired

            :  PayPalEE.cert is renewed

            :

            : [3.28.4-1]

            : - Rebase to 3.28.4

            :

            : nss-util

            : [3.28.4-1]

            : - Rebase to NSS 3.28.4 to accommodate base64

            :  encoding fix

   Severity : Critical

updateinfo info done

 

List Advisories by CVE

To list advisories that address a particular CVE, use yum updateinfo list --cve <CVE ID>

 

$ yum updateinfo list --cve CVE-2017-5461

Loaded plugins: security

ELSA-2017-1100 Critical/Sec. nss-3.28.4-1.0.1.el6_9.x86_64

ELSA-2017-1100 Critical/Sec. nss-sysinit-3.28.4-1.0.1.el6_9.x86_64

ELSA-2017-1100 Critical/Sec. nss-tools-3.28.4-1.0.1.el6_9.x86_64

ELSA-2017-1100 Critical/Sec. nss-util-3.28.4-1.el6_9.x86_64

updateinfo list done

 

List Vulnerabilities (CVEs) for Which Updates Are Available

To list CVEs that apply to your system use yum updateinfo list cves:

 

$ yum updateinfo list cves

Loaded plugins: security

CVE-2016-7910  Important/Sec. kernel-uek-4.1.12-61.1.34.el6uek.x86_64

CVE-2017-2583  Important/Sec. kernel-uek-4.1.12-61.1.34.el6uek.x86_64

CVE-2017-6214  Important/Sec. kernel-uek-4.1.12-61.1.34.el6uek.x86_64

CVE-2017-6347  Important/Sec. kernel-uek-4.1.12-61.1.34.el6uek.x86_64

CVE-2017-7184  Important/Sec. kernel-uek-4.1.12-61.1.34.el6uek.x86_64

CVE-2016-10208 Important/Sec. kernel-uek-4.1.12-61.1.34.el6uek.x86_64

CVE-2017-5986  Important/Sec. kernel-uek-4.1.12-61.1.34.el6uek.x86_64

CVE-2016-7910  Important/Sec. kernel-uek-firmware-4.1.12-61.1.34.el6uek.noarch

 

...

 

Apply an Update to Address a Particular CVE

To update your system to address a particular CVE:

 

$ sudo yum update --cve CVE-2017-5461

Loaded plugins: security

Setting up Update Process

Resolving Dependencies

Limiting packages to security relevant ones

4 package(s) needed (+0 related) for security, out of 7 available

--> Running transaction check

---> Package nss.x86_64 0:3.28.3-3.0.1.el6_9 will be updated

---> Package nss.x86_64 0:3.28.4-1.0.1.el6_9 will be an update

---> Package nss-sysinit.x86_64 0:3.28.3-3.0.1.el6_9 will be updated

---> Package nss-sysinit.x86_64 0:3.28.4-1.0.1.el6_9 will be an update

---> Package nss-tools.x86_64 0:3.28.3-3.0.1.el6_9 will be updated

---> Package nss-tools.x86_64 0:3.28.4-1.0.1.el6_9 will be an update

 

...

Search for Installed and Available Packages: repoquery

Search For an Available Package By Name

 

Search for any package called ruby or ruby followed by a 3 digit version number and include the repository name in the results. Here %-32 is used for formatting:

 

$ repoquery -a {ruby,ruby[0-9][0-9][0-9]} --qf "%-32{repoid} %{name}"

public_ol6_latest                ruby

public_ol6_software_collections  ruby193

public_ol6_software_collections  ruby200

 

Search For an Available Package in a Specific Repository

Use the --repoid option to limit your search to a particular repo:

$ repoquery -q python* --repoid public_ol6_software_collections

 

Find Which Package Contains a Particular File, Library or Executable: provides or whatprovides

To find out which package(s) contain a particular library, executable or any other file, use the provides or whatprovides option. For example, to find one or more packages that contain uuencode:

 

$ yum provides "*/uuencode" 

Loaded plugins: security

ol6_UEK_latest/filelists                                                |  20 MB     00:02    

ol6_addons/filelists                                                    | 922 kB     00:00    

ol6_latest/filelists                                                    |  68 MB     00:07    

sharutils-4.7-6.1.el6.x86_64 : The GNU shar utilities for packaging and unpackaging shell

                             : archives

Repo        : ol6_latest

Matched from:

Filename    : /usr/bin/uuencode

 

Even More Package Details: File Contents and Changelog

List the Contents of an Available Package

Use repoquery --list to list the file contents of a package, even if it's not installed.

 

$ repoquery --list jq 
/usr/bin/jq
/usr/share/doc/jq/AUTHORS
/usr/share/doc/jq/COPYING
/usr/share/doc/jq/README
/usr/share/doc/jq/README.md
/usr/share/man/man1/jq.1.gz

 

Inspecting Package Changelogs with yum-plugin-changelog

To inspect package changelogs, install the changelog yum plugin:

 

$ sudo yum install -y yum-plugin-changelog

 

Show Changelog Starting with a Certain Date

$ yum changelog 2017-APR-10 kernel-uek

Loaded plugins: changelog, security

 

Listing changelogs since 2017-04-10

 

==================== Available Packages ====================

kernel-uek-4.1.12-94.1.8.el6uek.x86_64  public_ol6_UEKR4

* Tue Apr 18 12:00:00 2017 Chuck Anderson <...@oracle.com> [4.1.12-94.1.8.el6uek]

- qla2xxx: Fix NULL pointer deref in QLA interrupt (Bruno Prémont)  [Orabug: 25894919]

- sched/wait: Fix the signal handling fix (Peter Zijlstra)  [Orabug: 25896852]

- Change return value for notify_change() to EACCES (Dhaval Giani)  [Orabug: 25897119]

 

* Wed Apr 12 12:00:00 2017 Chuck Anderson <...@oracle.com> [4.1.12-94.1.7.el6uek]

- block: fix use-after-free in seq file (Vegard Nossum)  [Orabug: 25877496]  {CVE-2016-7910}

 

* Tue Apr 11 12:00:00 2017 Chuck Anderson <...@oracle.com> [4.1.12-94.1.6.el6uek]

- net/mlx4_core: panic the system on unrecoverable errors (Santosh Shilimkar)  [Orabug: 25225861]

 

changelog stats. 2 pkgs, 2 source pkgs, 3 changelogs

 

 

References

Introduction

Oracle Baremetal Cloud Service (BMC) has a Ruby SDK. In this port I describe the steps to install this SDK on Oracle Linux 6.  For these instructions I used an Oracle Linux Vagrant Box.

 

Steps

The BMC Ruby SDK gem requires at least version 2.2 of Ruby. As Oracle Linux 6 by default provides Ruby 1.8.7, I'll use a more recent version of Ruby from the Software Collection Library. First I'll enable the appropriate repo on the Oracle Linux yum server to install scl-utils and various rh-ruby23 packages.

 

sudo yum -y install yum-utils
sudo yum-config-manager --enable public_ol6_software_collections
sudo yum install gcc-c++ scl-utils make rh-ruby23 rh-ruby23-ruby-devel rh-ruby23-rubygems
scl enable rh-ruby23 -- bash

 

The last command enables Ruby 2.3 environment, separate from any other existing Ruby environments on the OS.  I can verify this:

 

$ ruby -v

ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux-gnu]

 

Now I can install the oraclebmc gem

 

gem install oraclebmc

 

References

We recently added the jq, a lightweight and flexible command-line JSON processor to the Oracle Linux yum server. jq is a very powerful JSON processor and it can come in handy when interacting with REST APIs Here's how you install it and a quick example of how to use it.

 

Steps

  1. Installing jq
  2. Using jq

 

1. Installing jq

The jq package is in the Addons repo on Oracle Linux yum server. Install yum-utils so that you can use yum-config-manager to enable the public_ol6_addons repo on Oracle Linux 6

 

$ sudo yum install yum-utils
$ sudo yum-config-manager --enable public_ol6_addons
$ sudo yum install jq

 

2. Using jq

Let's take a look at a public REST api on oracle.com that returns JSON:

 

$ curl -s "https://apicatalog.oraclecloud.com/v1/apicollections/?filter=name:bics&filter=version:1.0"

 

This returns:

 

{

  "data" : [ {

    "apis" : [ {

      "createdAt" : "2017-01-24T20:48:08.977Z",

      "description" : "Clear the cache so everyone sees the latest data.",

      "links" : {

        "canonical" : {

          "href" : "https://apicatalog.oraclecloud.com/v1/orgs/oracle-public/apicollections/bics/1.0/apis/delete-cached-data/canonical",

          "rel" : "canonical",

          "title" : "Canonical API Description",

          "type" : "application/swagger+json;version=2.0"

        },

        "parent" : {

          "href" : "https://apicatalog.oraclecloud.com/v1/orgs/oracle-public/apicollections/bics/1.0",

          "rel" : "parent",

          "title" : "Oracle BI Cloud Service",

          "type" : "application/json"

        },

        "raw" : {

          "href" : "https://apicatalog.oraclecloud.com/v1/orgs/oracle-public/apicollections/bics/1.0/apis/delete-cached-data/raw",

          "rel" : "raw",

          "title" : "Raw API Description",

          "type" : "application/swagger+json;version=2.0"

        },

        "self" : {

          "href" : "https://apicatalog.oraclecloud.com/v1/orgs/oracle-public/apicollections/bics/1.0/apis/delete-cached-data",

          "rel" : "self",

          "title" : "Delete Cached Data",

          "type" : "application/json"

        }

      },

      "name" : "delete-cached-data",

      "title" : "Delete Cached Data",

      "updatedAt" : "2017-02-04T03:10:53.877Z"

    }, {

      "createdAt" : "2017-01-24T20:48:08.977Z",

      "description" : "Get information about Oracle BI Cloud Service.",

      "links" : {

        "canonical" : {

          "href" : "https://apicatalog.oraclecloud.com/v1/orgs/oracle-public/apicollections/bics/1.0/apis/basic/canonical",

          "rel" : "canonical",

          "title" : "Canonical API Description",

          "type" : "application/swagger+json;version=2.0"

        },

        "parent" : {

          "href" : "https://apicatalog.oraclecloud.com/v1/orgs/oracle-public/apicollections/bics/1.0",

          "rel" : "parent",

          "title" : "Oracle BI Cloud Service",

          "type" : "application/json"

        },

        "raw" : {

          "href" : "https://apicatalog.oraclecloud.com/v1/orgs/oracle-public/apicollections/bics/1.0/apis/basic/raw",

          "rel" : "raw",

          "title" : "Raw API Description",

          "type" : "application/swagger+json;version=2.0"

        },

        "self" : {

          "href" : "https://apicatalog.oraclecloud.com/v1/orgs/oracle-public/apicollections/bics/1.0/apis/basic",

          "rel" : "self",

          "title" : "Get Basic Information",

          "type" : "application/json"

        }

      },

      "name" : "basic",

      "title" : "Get Basic Information",

      "updatedAt" : "2017-02-04T03:10:53.877Z"

    }, {

      "createdAt" : "2017-01-24T20:48:08.977Z",

      "description" : "Load and manage data sets for Oracle BI Cloud Service.",

      "links" : {

        "canonical" : {

          "href" : "https://apicatalog.oraclecloud.com/v1/orgs/oracle-public/apicollections/bics/1.0/apis/dataset-load/canonical",

          "rel" : "canonical",

          "title" : "Canonical API Description",

          "type" : "application/swagger+json;version=2.0"

        },

        "parent" : {

          "href" : "https://apicatalog.oraclecloud.com/v1/orgs/oracle-public/apicollections/bics/1.0",

          "rel" : "parent",

          "title" : "Oracle BI Cloud Service",

          "type" : "application/json"

        },

        "raw" : {

          "href" : "https://apicatalog.oraclecloud.com/v1/orgs/oracle-public/apicollections/bics/1.0/apis/dataset-load/raw",

          "rel" : "raw",

          "title" : "Raw API Description",

          "type" : "application/swagger+json;version=2.0"

        },

        "self" : {

          "href" : "https://apicatalog.oraclecloud.com/v1/orgs/oracle-public/apicollections/bics/1.0/apis/dataset-load",

          "rel" : "self",

          "title" : "Manage Data Sets",

          "type" : "application/json"

        }

      },

      "name" : "dataset-load",

      "title" : "Manage Data Sets",

      "updatedAt" : "2017-02-04T03:10:53.877Z"

    }, {

      "createdAt" : "2017-01-24T20:48:08.977Z",

      "description" : "Load and manage table data for Oracle BI Cloud Service.",

      "links" : {

        "canonical" : {

          "href" : "https://apicatalog.oraclecloud.com/v1/orgs/oracle-public/apicollections/bics/1.0/apis/table-load/canonical",

          "rel" : "canonical",

          "title" : "Canonical API Description",

          "type" : "application/swagger+json;version=2.0"

        },

        "parent" : {

          "href" : "https://apicatalog.oraclecloud.com/v1/orgs/oracle-public/apicollections/bics/1.0",

          "rel" : "parent",

          "title" : "Oracle BI Cloud Service",

          "type" : "application/json"

        },

        "raw" : {

          "href" : "https://apicatalog.oraclecloud.com/v1/orgs/oracle-public/apicollections/bics/1.0/apis/table-load/raw",

          "rel" : "raw",

          "title" : "Raw API Description",

          "type" : "application/swagger+json;version=2.0"

        },

        "self" : {

          "href" : "https://apicatalog.oraclecloud.com/v1/orgs/oracle-public/apicollections/bics/1.0/apis/table-load",

          "rel" : "self",

          "title" : "Manage Table Data",

          "type" : "application/json"

        }

      },

      "name" : "table-load",

      "title" : "Manage Table Data",

      "updatedAt" : "2017-02-04T03:10:53.877Z"

    }, {

      "createdAt" : "2017-01-24T20:48:08.977Z",

      "description" : "Create and manage relational tables and indexes that store data for Oracle BI Cloud Service.",

      "links" : {

        "canonical" : {

          "href" : "https://apicatalog.oraclecloud.com/v1/orgs/oracle-public/apicollections/bics/1.0/apis/tables-indexes/canonical",

          "rel" : "canonical",

          "title" : "Canonical API Description",

          "type" : "application/swagger+json;version=2.0"

        },

        "parent" : {

          "href" : "https://apicatalog.oraclecloud.com/v1/orgs/oracle-public/apicollections/bics/1.0",

          "rel" : "parent",

          "title" : "Oracle BI Cloud Service",

          "type" : "application/json"

        },

        "raw" : {

          "href" : "https://apicatalog.oraclecloud.com/v1/orgs/oracle-public/apicollections/bics/1.0/apis/tables-indexes/raw",

          "rel" : "raw",

          "title" : "Raw API Description",

          "type" : "application/swagger+json;version=2.0"

        },

        "self" : {

          "href" : "https://apicatalog.oraclecloud.com/v1/orgs/oracle-public/apicollections/bics/1.0/apis/tables-indexes",

          "rel" : "self",

          "title" : "Manage Tables and Indexes",

          "type" : "application/json"

        }

      },

      "name" : "tables-indexes",

      "title" : "Manage Tables and Indexes",

      "updatedAt" : "2017-02-04T03:10:53.877Z"

    } ],

    "category" : "/platform/business-analytics",

    "createdAt" : "2017-01-24T20:48:08.977Z",

    "defaultVersion" : true,

    "description" : "<p>Use the Oracle BI Cloud Service REST API to programmatically load and manage data.</p>",

    "links" : {

      "self" : {

        "href" : "https://apicatalog.oraclecloud.com/v1/orgs/oracle-public/apicollections/bics/1.0",

        "rel" : "self",

        "title" : "Oracle BI Cloud Service",

        "type" : "application/json"

      }

    },

    "name" : "bics",

    "organization" : "oracle-public",

    "tags" : [ ],

    "title" : "Oracle BI Cloud Service",

    "updatedAt" : "2017-02-04T03:10:53.877Z",

    "version" : "1.0"

  } ],

  "links" : {

    "self" : {

      "href" : "https://apicatalog.oraclecloud.com/v1/apicollections/?filter=name%3Abics&filter=version%3A1.0",

      "rel" : "self",

      "title" : "Page 1",

      "type" : "application/json"

    }

  },

  "pageNumber" : 1,

  "pageSize" : 10,

  "totalCount" : 1

 

To process this JSON to display only the API descriptions, pipe the output of curl to jq with a filter that iterates over the data array and the apis array within it and selects only the values for the description key.

 

curl -s "https://apicatalog.oraclecloud.com/v1/apicollections/?filter=name:bics&filter=version:1.0" | jq '.data[] .apis[] .description'

 

This returns:

 

"Clear the cache so everyone sees the latest data."

"Get information about Oracle BI Cloud Service."

"Load and manage data sets for Oracle BI Cloud Service."

"Load and manage table data for Oracle BI Cloud Service."

"Create and manage relational tables and indexes that store data for Oracle BI Cloud Service."

For more advanced examples of processing JSON with jq, see References below.

 

References

These are the steps to install the Oracle Bare Metal Cloud Services Command Line Interface (CLI) on Oracle Linux 6 with the help of Oracle Linux yum server. The steps were performed on an Oracle Linux 6.9 Vagrant Box

 

Outline

  1. Enable additional repos and install required packages
  2. Enable Python 2.7.8 from the Software Collection Library
  3. Create a virtual environment (virtualenv) with Python 2.7.8
  4. Install oraclebmc-cli via pip

 

1. Enable Additional Repose and Install Required Packages

By installing the yum-utils package first, you can use yum-config-manager to enable an additional repo from the Oracle Linux yum server without editing configuration files.

 

$ sudo yum install yum-utils
$ sudo yum-config-manager --config /etc/yum.repos.d/public-yum-ol6.repo --enable public_ol6_software_collections
$ sudo yum install openssl-devel libffi-devel scl-utils python27 gcc

 

2. Enable Python 2.7.8 from the Software Collection Library

Oracle Linux 6.9 comes with Python 2.6.6 and the bmcs CLI requires Python 2.7.5 at a minimum. Use Python 2.7 from the Software Collection Library, installed earlier.

 

$ scl enable python27 -- bash

 

3. Create and activate a virtual environment (virtualenv) with Python 2.7.8

Use virtualenv to create an isolated Python 2.7 environment.

 

$ python -m virtualenv bmcs 
$ . bmcs/bin/activate

 

4. Install oraclebmc-cli via pip

With the virtual environment activated, use the following command to install oraclebmc-cli with pip.

 

(bmcs) $ python -m pip install oraclebmc-cli 

Introduction

cx_Oracle is a module that enables access to Oracle Database and conforms with the Python database API specification. The module works with Oracle Database 11g and 12c and both Python 2.x and 3.x. This post covers the steps to install and set up cx_Oracle 5.3 with the default Python 2.7.5 on Oracle Linux 7 using a Python virtual environment. In an earlier post I covered how to install cx_Oracle with Python 3.5 from Software Collection Library.

 

Steps

These are the steps to install cx_Oracle.  I used an Oracle Linux 7.3 Vagrant box as a starting point.

 

  1. Download and install Oracle Instant Client 12.2 and the Instant Client SDK RPMs
  2. Install Python Virtual Environment RPM, if needed
  3. Create and activate a virtual environment
  4. Install cx_Oracle using pip

 

Download and Install Oracle Instant Client

Oracle Instant Client enables development and production deployment of Oracle Database applications. It is used for popular languages and environments including Node.js, PHP, and Python. Download the Instant Client RPM for Oracle Linux x86-64. Install the RPM as root:

 

$ sudo rpm -ihv oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm

Preparing...                          ################################# [100%]

Updating / installing...

   1:oracle-instantclient12.2-basic-12################################# [100%]

 

To build cx_Oracle, you'll need the instant client SDK header files as well. From the same download page as above, get the Instant Client Package - SDK RPM and install it:

 

$ sudo rpm -ihv oracle-instantclient12.2-devel-12.2.0.1.0-1.x86_64.rpm

Preparing...                          ################################# [100%]

Updating / installing...

   1:oracle-instantclient12.2-devel-12################################# [100%]

 

Install Python Virtual Environment

For this installation I will use a Python Virtual Environment.  In the Python 2.7.x documentation, a virtual environment is described as:

A cooperatively isolated runtime environment that allows Python users and applications to install and upgrade Python distribution packages without interfering with the behaviour of other Python applications running on the same system.

Use Yum to install python-virtualenv, if it's not already.

 

$ sudo yum install python-virtualenv

 

Create and Activate Virtual Environment

Create a virtual environment called my275env. You will see Setuptools and pip are installed during this process.

 

$ python -m virtualenv my275env

 

Activate the virtual environment. The bash prompt will change to indicate you are in the my275env virtualenvironment:

 

$ . my275env/bin/activate

(my275env) $

 

 

Install cx_Oracle

With the instant client and the SDK header files installed, there is no need to set ORACLE_HOME or any PATH environment variables.

 

(my275env) $ python -m pip install cx_Oracle

 

You should see output that ends as follows. cx_Oracle is now installed and you are ready to develop!

 

Successfully installed cx-Oracle

Cleaning up...

 

References

About cx_Oracle

cx_Oracle is a module that enables access to Oracle Database that conforms with the Python database API specification. The module works with Oracle Database 11g and 12c and works for both Python 2.x and 3.x. This post covers the steps to install and set up cx_Oracle 5.3 in a Python 3.5 virtual environment on Oracle Linux 7.

Assumptions

  1. Oracle Linux 7 installed
    1. connected to the Internet
    2. configured for Oracle Linux yum server
  2. Oracle Database installed
    1. For these instructions, I used this git repo to set up install Oracle Database 12c Release 2 with Oracle VM VirtualBox and Vagrant. If you already have a database installation, adjust your paths, Oracle service name, and port accordingly.

Steps

  1. Enable required yum repositories
  2. Install Software Collections Library and Python 3.5
  3. Enable Python 3.5 utilities from the Software Collection Library in a bash shell
  4. Create a virtual environment and activate it
  5. Set up environment variables so that cx_Oracle can find Oracle Database installation and libraries
  6. Install cx_Oracle using pip
  7. Test cx_Oracle

 

Enable Required yum Repositories

Edit the yum.oracle.com configuration file and change enabled=0 to enabled=1 in the ol7_optional_latest and ol7_software_collections stanzas.

$ sudo vi /etc/yum.repos.d/public-yum-ol7.repo 
[ol7_optional_latest]
name=Oracle Linux $releasever Optional Latest ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/optional/latest/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1
[ol7_software_collections]
name=Software Collection Library release 2.1 packages for Oracle Linux 7 (x86_64)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/SoftwareCollections/x86_64/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1

Install Software Collections Library and Python 3.5

The software collection library enables you to install and use several different versions of the same software at the same time on a system. Software collections are great for development environments, which often require more recent versions of software components such as Perl, PHP, or Python to make use of the latest features, but which need to avoid the risk of disrupting other applications on the system that rely on different versions of these components. Now that the necessary yum repositories have been enabled to install the software collections library, run the following yum command:

$ sudo yum install gcc scl-utils rh-python35

Enable Python 3.5 utilities from the Software Collection Library in a bash shell

To enable the python 3.5 utilities —installed previously— in a bash shell

$ scl enable rh-python35 -- bash

Create a Python Virtual Environment

Python Virtual Environments help establish lightweight environments that are separate and isolated from the overall system's Python site directories.  From the Python documentation:

The venv module provides support for creating lightweight “virtual environments” with their own site directories, optionally isolated from system site directories. Each virtual environment has its own Python binary (allowing creation of environments with various Python versions) and can have its own independent set of installed Python packages in its site directories.

Use the Python venv module to create a virtual environment called my35env.

$ python -m venv my35env

Activate the virtual environment:

$ . my35env/bin/activate

 

Note how your bash prompt has changed to indicate you are now in a virtual environment:

(my35env) $

Set up environment variables so that cx_Oracle can find required libraries

Set the ORACLE_HOME and LD_LIBRARY_PATH environment variables. Remember to adjust the path below for your Oracle installation, if necessary.

(my35env) $ export ORACLE_HOME=/opt/oracle/product/12.2.0.1/dbhome_1
(my35env) $ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib

Install cx_Oracle using pip

Python 3.5 includes the pip module which makes installing cx_Oracle from PyPi, the Python Package Index straightforward.

(my35env) $ python -m pip install cx_Oracle

Look for the following output at the completion of the installation.

Successfully installed cx-Oracle-5.3

Test cx_Oracle

Assuming your database has service name orcl and a user scott/tiger, the following will verify whether cx_Oracle is working

(my35env) $ python
Python 2.7.5 (default, Sep 5 2016, 02:30:38)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-9)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cx_Oracle
>>> connection = cx_Oracle.Connection('scott', 'tiger', 'localhost:1521/orcl')
>>> connection.version
'12.2.0.1.0'

References

Johan Louwers

Oracle Linux and opcinit

Posted by Johan Louwers Oct 13, 2016

Ever wondered how to influence the default installation of Oracle Linux in the Oracle cloud? Wanting to understand how you can influence the standard Oracle Linux template provided by Oracle?

 

For example, ensuring a certain package is directly installed during the provisioning of a new instance of Oracle Linux on the Oracle Cloud? You have to understand that Oracle Linux is making use of opcinit (or opc-init). You can influence the default behavior of the template based provisioning in a number of manners.

 

An introduction example of how to instruct OPCInit to do the installation of additional packages by providing additional information in the JSON requesting the provisioning is provided in this post on my personal blog.

Announcing the general availability of Oracle Linux 7.2

By Michele Casey on Nov 25, 2015

 

We're happy to announce the general availability of Oracle Linux 7 Update 2, the second update release for Oracle Linux 7. You can find the individual RPM packages on the Unbreakable Linux Network (ULN) and the Oracle Linux Yum Server and ISO installation images are available for download from the Oracle Software Delivery Cloud.

 

Oracle Linux 7 Update 2 ships with the following kernel packages:

 

  • Red Hat Compatible Kernel (kernel-3.10.0-327.el7) for x86-64
  • Unbreakable Enterprise Kernel (UEK) Release 3 (kernel-uek-3.8.13-98.7.1.el7uek) for x86-64

 

By default, both the Unbreakable Enterprise Kernel and the Red Hat Compatible Kernel are installed and the system boots the Unbreakable Enterprise Kernel.  

Notable features in this release include:

 

  • The, makedumpfile can now use sadump format for kernel dumps of more than 16 TB of physical memory
  • During non-graphical installations, kdump can now be configured at the time of install
  • MySQL 5.6 Community Edition can now be installed directly with the Anaconda installer or kickstart
  • OpenSCAP has been upgraded to version 1.2.5
  • Administrators may now configure kdump during non-graphical installations

 

For more details on these and other new features and changes in Oracle Linux 7 Update 2, please consult the release notes in the Oracle Linux Product Documentation Library.

 

Oracle Linux can be downloaded, used and distributed free of charge and all updates and errata are freely available. For support, you decide which of your systems require a support subscription.  This makes Oracle Linux an ideal choice for your development, testing and production systems.  You decide which support coverage is the best for each of your systems individually, while keeping all of your systems up-to-date and secure.  For customers with Oracle Linux Premier Support, you also receive access to zero-downtime kernel updates using Oracle Ksplice and support for Oracle OpenStack for Oracle Linux.

 

For more information about Oracle Linux, please visit www.oracle.com/linux.

linux_penguin_with_logo.gifAnnouncing the general availability of Unbreakable Enterprise Kernel Release 3 Quarterly Update 7   

By Michele Casey on - Nov 13, 2015   

                                   

We are pleased to announce the availability of the Unbreakable Enterprise Kernel Release 3 Quarterly Update 7 (UEKR3U7) for Oracle Linux 6 and Oracle Linux 7. This is the seventh quarterly update release for UEK Release 3 (Version 3.8.13-118) and includes driver updates and a consolidation of fixes for bugs and security issues.

 

Some notable highlights include:

 

  • For Oracle Linux 7 installations, support has been included for network teaming, which includes active-backup, broadcast, load-balancing and round-robin modes
  • Continued enhancements for Linux containers including the introduction of the new LXC flag --privileged=rt which allows the administrator the ability to run real-time processes
  • Support for Intel® Broadwell processors
  • Xen improvements, including updates to netfront and netback drivers
  • Device driver updates (e.g. storage devices, network cards) from key partners, such as:
    • Broadcom
    • Chelsio
    • Emulex
    • Intel®
    • Mellanox
    • QLogic
    • VMware

 

For more information about this release, please refer to the release notes.

 

The source code is available on our public git repository.