6

Oracle by Example brandingInstalling Oracle Database Instant Client, Oracle R Distribution, and Oracle R Enterprise Client Components on a Microsoft Windows Platform

section 0Before You Begin

This 15-minute tutorial shows you how to download and install Oracle Database Instant Client, Oracle R Distribution, and the Oracle R Enterprise client components for a Microsoft Windows 64-bit operating system platform, and how to verify the installations by connecting to the Oracle R Enterprise server in a remote Oracle Database instance.

Background

The Oracle R Enterprise client components enable you to connect an R engine on your Windows PC to the Oracle R Enterprise server in an Oracle Database instance.

In this tutorial, you create a folder on your Windows PC, download the Oracle Database Instant Client, Oracle R Distribution, and the Oracle R Enterprise client component installer files, extract the contents, and configure your system to use them. You also install the Oracle R Enterprise client and supporting packages. Finally, you test the installation by connecting your local R engine to the Oracle R Enterprise server in a remote Oracle Database instance.

Description of ore.components.png follows
Description of the illustration ore_components.png

Notes: This tutorial uses Oracle Database 12c, Release 2 (12.2.0.1) and Oracle R Enterprise, Release 1.5.1. The procedures also apply to earlier versions of Oracle Database and Oracle R Enterprise. For earlier versions, substitute the versions of Oracle Database Instant Client, Oracle R Distribution, and the Oracle R Enterprise client component installer files with those that are compatible with the Oracle R Enterprise server in your remote database.

What Do You Need?

  • 64-bit Microsoft Windows and the Administrator privilege.
  • Access to the internet.
  • A remote  instance of Oracle Database 12c, Release 2 (12.2.0.1) that has Oracle R Enterprise server 1.5.1 installed, configured, and validated in the database.
  • The RQSYS schema created in your remote Oracle Database instance. RQSYS is the system account for Oracle R Enterprise in Oracle Database.
  • A user schema and password in the remote database instance. Be sure that the user has the following privileges: CREATE SESSION, CREATE TABLE, CREATE VIEW, CREATE PROCEDURE, and CREATE MINING MODEL.
  • The Oracle SID and host name of the remote database instance, and the TCP port number that the database uses.

section 1Download and Install Oracle Database Instant Client

Download and install the Oracle Database Instant Client for your database.

  1. On your Windows PC, create an installation folder for the Oracle R Enterprise client components. This tutorial uses the folder c:\oreclient_install_dir.
  2. Go to the Oracle Database Instant Client page on the Oracle Technology Network at Oracle Database Instant Client and click Downloads.
  3. On the Instant Client Downloads page, click Instant Client for Microsoft Windows (x64).
  4. On the Instant Client Downloads for Microsoft Windows (x64) page, accept the license agreement, and then locate the Version 12.2.0.1.0 section.
  5. In the Base section, click instantclient-basic-windows.x64-12.2.0.1.0.zip and save the file to the oreclient_install_dir folder.
    Description of instant-client-downloads.png follows.
    Description of the illustration instant-client-downloads.png
  6. Return to the Instant Client Downloads for Microsoft Windows (x64) page and in the same Base section, select Microsoft Visual Studio 2013 Redistributable.
  7. On the Microsoft Support page, in the Visual Studio 2013 (VC++ 12.0) section, click Microsoft Visual C++ Redistributable Packages for Visual Studio 2013.
  8. In the Update for Visual C++ 2013 and Visual C++ Redistributable Package section, in the x64.exe File Path section, in the English row in the File Paths column, click http://download.microsoft.com/download/0/5/6/056dcda9-d667-4e27-8001-8a0c6971d6b1/vcredist_x64.exe, and then save the vcredist_x64.exe file in the oreclient_install_dir folder.
  9. Return to the Instant Client Downloads for Microsoft Windows (x64) page, accept the license agreement again, and in the Development and Runtime - optional packages section, click instantclient-sdk-windows.x64-12.2.0.1.0.zip and save the file to the same folder.
  10. In your compressed file utility, such as WinZip or 7-Zip, open the instantclient-basic-windows.x64-12.2.0.1.0.zip file and click Extract Here, or similar option. The Instant Client basic files are extracted to a subfolder named instantclient_12_2. The sdk files are extracted to a subfolder named sdk in the instantclient_12_2 folder, as shown in the following illustration.
    Description of oreclient-install.png follows.
    Description of the illustration oreclient-install.png
  11. Double-click the Microsoft Visual Studio Redistributable executable file and follow the instructions to install it.

    Note: This installation requires a reboot.

  12. In the Windows Control Panel, click System, and then click Advanced system settings. Add the full path of the Instant Client to the environment variables OCI_LIB64 and PATH.
  13. On the Advanced tab, click Environment Variables.
  14. Under System variables, edit PATH to include the path to the folder that contains Oracle Database Instant Client. For this tutorial, the path is C:\oreclient_install_dir\instantclient_12_2.
  15. Also under System variables, either edit or create the OCI_LIB64 environment variable and give it the path to the same folder. Again, for this tutorial, the path is C:\oreclient_install_dir\instantclient_12_2.

section 2Download and Install Oracle R Distribution

Download and install Oracle R Distribution on your Windows PC.

  1. Go to the Oracle Open Source Software Download page for Oracle R Distribution at Oracle R Distribution. In the Windows row, in the ORD 3.3.0 column, click R Distribution and save the ORD-3.3.0-win.zip file to the c:\oreclient_install_dir folder.
  2. Extract the contents of the .zip file.
  3. Double-click the R-3.3.0-win.exe file to start the installation of Oracle R Distribution.
  4. Accept the default choices in the installer instructions to complete the installation.

section 3Download and Install the Oracle R Enterprise Supporting Packages

Download the Oracle R Enterprise supporting packages and install them.

  1. From the Oracle R Enterprise Downloads page on the Oracle Technology Network, accept the license agreement, and then in the ORE 1.5.1 column of the Windows row, click Supporting to download the ore-supporting-win-x86_64-1.5.1.zip file. Save the file to the c:\oreclient_install_dir.
    Description of ore-downloads.png follows.
    Description of the illustration ore-downloads.png
  2. Extract the contents of the .zip file.
  3. From the Windows Start menu, run R x64 as administrator.
  4. From the Packages menu in the RGui console, select Install package(s) from local files.
    Description of packages-menu.png follows.
    Description of the illustration packages-menu.png
  5. Go to the folder that contains the supporting files, select all of the .zip files, and click Open.

    Each package installation produces this message in the R console:

    package 'package_name' successfully unpacked and MD5 sums checked

    Note: You may need to stop your anti-virus software for the installations to complete without errors. Be sure to restart the anti-virus software after the installations succeed. If you cannot disable your anti-virus software, then use the R debug function, as described in the following steps.

  6. If you are unable to successfully install the Oracle R Enterprise packages, and cannot disable your anti-virus software, then in the RGui console, enter debug(utils:::unpackPkgZip).
  7. From the Packages menu, select Install package(s) from local files.
  8. Select the file or files to install and then click Open.
  9. For each package, at the Browse[2]> prompt, press Ctrl+Enter repeatedly to step through each line of the debug function until you see the following output for the package:

    package 'package_name' successfully unpacked and MD5 sums checked debug: flush.console()

  10.  After all of the packages have installed successfully, press Q to exit the debug mode.

section 4Download and Install the Oracle R Enterprise Client Packages

Download the Oracle R Enterprise client packages and install them from the RGui console.

  1. From the Oracle R Enterprise Downloads page, accept the license agreement, and then in the ORE 1.5.1 column of the Windows row, click Client to download the ore-client-win-x86_64-1.5.1.zip file. Save the file to the c:\oreclient_install_dir folder.
  2. Extract the contents of the .zip file.
  3. From the Windows Start menu, run R x64 as administrator.
  4. From the Packages menu in the RGui console, select Install package(s) from local files.
  5. Go to the folder that contains the client files, select all of the .zip files, and click Open.

    Each package installation produces this message in the R console:

    package 'package_name' successfully unpacked and MD5 sums checked

section 5Connect to Oracle R Enterprise Server from the Oracle R Enterprise Client R Engine

To verify the installations, load the Oracle R Enterprise client packages in your Oracle R Distribution R engine and connect your local R session to the Oracle R Enterprise server in your remote database.

  1. From the Windows Start menu, run R x64.
  2. Load the Oracle R Enterprise client libraries.
    > library(ORE)
    Description of load-libraries.png follows.
    Description of the illustration load-libraries.png
  3. Connect to the Oracle R Enterprise server in your remote database. Replace the argument values in the following expression with the values for your database, user schema, and password.
    > ore.connect(user="RQUSER", sid="orcl", host="myhost", 
                  password="RQUSERpsw", port=1521, all=TRUE)
  4. Verify that the client is connected to the Oracle R Enterprise server in the database. If the client is connected, then the ore.is.connected() function returns TRUE.
    > ore.is.connected()
    [1] TRUE
  5. List the sample scripts.
    > demo(package="ORE")
  6. Run a sample script.
    > demo("aggregate", package="ORE")

more informationWant to Learn More?


8