Oracle Sql Client For Mac

It is true that Oracle does not provide the recent versions of their database software for Mac OS. The most recent versions available for you to download for Mac is Oracle 10g R2, which is quite outdated now, since it was first released in July 20.

This chapter explains how to connect to a database to use Oracle Data Mining. It contains the following sections:

Connect Application Development Tools

SQL*Plus and SQL Developer and other client tools are installed with Oracle Database. SQL*Plus is a command line tool for transmitting SQL and PL/SQL to the database. SQL Developer is a graphical development environment for SQL and PL/SQL.

You can use the Data Mining PL/SQL API in either SQL*Plus or SQL Developer. Within SQL Developer you can use both the Data Miner graphical tool and the Data Mining PL/SQL API. For information about the PL/SQL API, see Oracle Data Mining User's Guide.

If you have installed Oracle Database locally on your PC, you can follow these steps to start SQL*Plus or SQL Developer:

  1. From the Windows Start menu, select Oracle – OraDb11g_homen.

    Note:

    If there are n database installations, they will appear as Oracle – OraDb11g_home1, Oracle – OraDb11g_home2, ...... Oracle – OraDb11g_homen in the Start menu.

    Each of these refers to a separate ORACLE_HOME. Be sure to select the appropriate one.

  2. Choose Application Development.

  3. Choose the name of the application.

Connect SQL*Plus

When SQL*Plus starts up it is already connected to the local database. Enter the name of a user ID that has data mining privileges, as described in Chapter 4. You will be prompted to enter the password.


Description of the illustration sqlplus.gif

Connect SQL Developer

The first time you run SQL Developer, you may be prompted to provide the path to the Java executable. If so, specify the full path of jdkbinjava.exe under the Oracle home directory for the database. For the installation described in Chapter 2, the path would be:

To define a connection to the local database:

  1. Right click Connections and choose New.

  2. The New/Select Database Connection dialog appears.


    Description of the illustration sqldev.gif
    • For Connection Name, specify a meaningful name that you will remember.

    • For Username/Password, provide a user name and password for the connection. The user must have data mining privileges as described in Chapter 4.

    • For Hostname, specify localhost to indicate that the database is hosted on the local computer.

    • For Port, specify the port where the database will listen to requests from the client. The default port is 1521.

    • For SID (Service Identifier), specify the simple database name. This is the first component of the global database name described in the installation instructions in Chapter 2.

    Click Connect to connect to the database using the specified credentials.

Connect Oracle Data Miner

Oracle Data Miner is a choice on the Tools menu of SQL Developer.


Description of the illustration sqldevodmr.gif

Oracle Data Miner requires an administrative (SYS) connection for installation. A separate connection to the database is required for each user that will use the tool. Instructions for creating these connections are provided in the Oracle Data Miner Help. For installation and configuration instructions, go to http://www.oracle.com/technetwork/database/options/odm/dataminerworkflow-168677.html.

Oracle Client and Oracle Net

To connect to an Oracle Database, a client application must identify the database and present appropriate credentials. The connection mechanism depends on the type of client and whether it is running locally or remotely. Some connections require the installation of Oracle Client software.

There are several methods for specifying login credentials. For example, a client may present login credentials at the time of the connection, as shown below. The system will prompt for a password and establish a connection.

You may also identify a connection with a predefined Net Service Name.

Oracle Spreadsheet Add–In for Predictive Analytics, whether running locally or remotely, requires the installation of Oracle Client and the creation of a Net Service Name.

Note:

SQL Developer and Oracle Data Miner do not require the installation of Oracle Client.

For details about Oracle Data Miner installation and configuration, see Oracle Data Miner 11g Release 2 'Getting Started' on the Oracle Technology Network:

Additional details are available in the online help for Oracle Data Miner.

Install Oracle Client

You must install Oracle Client if:

  • You wish to use Oracle Spreadsheet Add-In for Predictive Analytics

  • You do not have a local database and you wish to use SQL*Plus and other tools for connecting to a remote Oracle database.

Use the following steps to install Oracle Client on a Windows platform:

Note:

The following instructions are not intended as a replacement for Oracle Client and Net Management documentation. For additional information, refer to:
  1. Ensure that your computer meets the system requirements described in Oracle Database Client Installation Guide for Microsoft Windows.

  2. Stop any Oracle services that may be running on your computer.

    In Windows Control Panel, choose Administrative Tools, then Services. Find the service names that start with 'Oracle'. Choose Stop for each one.

    Note:

    To stop an Oracle database, first stop the database service (OracleServiceservice_name), then stop the database listener (OracleOraDb11g_homeTNSListener).
  3. Log on to your computer as a member of the Administrator's group. If you are unsure if your user ID is in the Administrator's group, check User Accounts in Windows Control Panel.

  4. To start the installation, go to the Client installation directory and run SETUP.EXE to start Oracle Universal Installer.

  5. On the Select Installation Type page, choose Administrator.


    Description of the illustration client2of7.gif

    Click Next.

  6. In the Download Software Updates page, provide your My Oracle Support credentials if you want to automatically download software updates. Click Next.


    Description of the illustration client3of9.gif
  7. On the Select Product Languages page, select the language for the Oracle Client user interface.


    Click Next.

  8. On the Specify Install Location page, provide the path of the Base directory in which you installed Oracle Database. (See 'Install Oracle Database' step 8.)

    The Installer provides a Software Location under Oracle Base. This will be the home directory of the Oracle client that you are installing (Oracle home). If this directory does not exist, the Installer will create it. If the directory does exist, make sure that it is empty.


    Description of the illustration client5of9.gif

    Click Next.

  9. The Installer performs prerequisite checks, then displays the Summary page.


    Description of the illustration client7of9.gif

    Click Install to complete the set up process and begin the installation.

  10. On the Install Product page, the Installer displays a progress bar.


    Description of the illustration client8of9.gif

    When the installation is successfully completed, click Close.

  11. Oracle Net Configuration Assistant starts and displays the Welcome page.


    Description of the illustration netconfig1.gif

    Choose Local Net Service Name Configuration, then click Next.

    Oracle Net Configuration Assistant determines that Oracle Client can use the Easy Connect naming method, as described in 'Oracle Client and Oracle Net'. A Net Service Name is not needed. Simply click Next.

  12. Oracle Net Configuration Assistant displays summary information about the connection configuration.

    Click the Password Management button at the bottom of the page to unlock any schemas that you plan. If you wish, you can also reset the system passwords. If you will use the Oracle Data Mining sample programs and you did not unlock the SH schema when you installed the database, you should do so now. (See 'Install Oracle Database'.)

    Click Exit to exit Oracle Net Configuration Assistant, then click Finish to complete the installation of Oracle Client.

  13. On the End of Installation page, click Exit to exit Oracle Universal Installer.

  14. If you stopped any Oracle services before running Oracle Universal Installer, you can restart them at this time.

    In Windows Control Panel, choose Administrative Tools, then Services. Find the service names that start with 'Oracle'. Choose Start for each one.

    Note:

    To restart an Oracle database, first restart the listener (OracleOraDb11g_homeTNSListener), then restart the database service (OracleServiceservice_name).

Create a Net Service Name

The instructions in this section explain how to create a Net Service Name. Follow these instructions if you wish to use Oracle Spreadsheet Add–In for Predictive Analytics.

Note:

The following instructions are not intended as a replacement for Oracle Client and Net Management documentation. For additional information, refer to:

To create a Net Service Name:

  1. From the Windows Start menu, select Oracle – OraClient11g_homen.

    Note:

    If there are n installations of Oracle Client, they will appear as Oracle – OraClient11g_home1, Oracle – OraClient11g_home2, .... Oracle – OraClient11g_homen in the Start menu. Be sure to select the appropriate one.
  2. Choose Configuration and Migration Tools.

  3. Choose Net Configuration Assistant.

  4. Oracle Net Configuration Assistant displays the Welcome page.


    Description of the illustration netconfig1.gif

    Choose Local Net Service Name configuration, then Next.

  5. On the next page, choose Add to add a new Net Service Name. Then click Next.

  6. Provide the Global Database Name in the Service Name text box. (See 'Install Oracle Database'.)


    Description of the illustration netconfig3.gif

    Choose Next.

  7. On the next page specify the communication protocol. The default is TCP.

    Choose Next.

  8. On the next page, choose Yes, perform a test to test the new connection.


    Description of the illustration netconfig6.gif

    The connection will probably fail until you provide a new user ID and password.


    Description of the illustration netconfig7.gif

    Choose Change Login.

    Provide the user ID and password of an account that has data mining privileges on the host.


    Description of the illustration netconfig8.gif
  9. If the user name and password were the only problem with the connection, Oracle Net Configuration Assistant makes a successful test connection.


    Description of the illustration netconfig9.gif

    Choose Next.

  10. Oracle Net Configuration Assistant reports that the connection configuration was successful. When you click Next, you are returned to the Welcome page, where you have the opportunity to perform additional configuration.

    Click Finish to exit Oracle Net Configuration Assistant.

Connect the Spreadsheet Add–In

Oracle Spreadsheet Add–In for Predictive Analytics implements predictive analytics ('one–click' data mining) within Microsoft Excel. You can use the Spreadsheet Add–In to analyze data stored in Excel or in Oracle and to import/export data mining models to/from Oracle Database. Whether the data is stored in Excel or in the database, the Spreadsheet Add–In requires a database connection.

Mac

The Spreadsheet Add–In requires Oracle Client. It uses a Net Service Name to connect to the database. Even if the database is local, Oracle Client and a Net Service Name are required.

To connect to Oracle, follow these steps:

  1. Install Oracle Client on your computer as described in 'Install Oracle Client'.

  2. Create a Net Service Name as described in 'Create a Net Service Name'.

  3. Add the Add–In to Excel as described in 'Optionally Install the Spreadsheet Add–In'.

  4. From the Add–In menu, choose Connect.


    Description of the illustration addin2.gif
  5. The Connect (Oracle Database) dialog appears.


    Description of the illustration addin3.gif

    From the list of predefined Net Service Names, choose the connection you want to use. Provide a user name and password and click Connect to activate the Spreadsheet Add–In.

    See Also:

    'Optionally Install the Spreadsheet Add–In'

Step 1: Where to install the Files


Opinions differ about the best location for installing the downloaded files.
In practice you can install the Oracle instant client files anywhere on your file system so long as the PATH environment variable is updated to include that directory in the search path

Best Sql Client For Mac


  • Some install instructions suggest copying the install files into the directories:
    /usr/lib or /usr/bin
    This works - but is best avoided. My concern with this approach is that these are the default locations for OS X libraries and commands. Copying in non-standard items gets messy when things go wrong - complicating the process to diagnose and fix issues because of the difficulty identifying which items should (and shouldn’t) be there. If you upgrade Instant Client in future, copying in the new version’s files over top may result in a mixture of old/new libraries which triggers unexpected behaviour. However, if you have issues defining environmental variables then this may be your only choice.
  • In Oracle’s installation example, they’ve created a directory:
    /opt/oracle/instantclient_11_2
    This gives you a separate (clearly specified) directory for your Instant Client files. It’s also good choice as /opt is the base directory favoured for non-standard (i.e. optional) software installs in Unix operating systems …but it’s just not commonly used in Mac circles.
  • My preferred option is:
    /Library/Oracle/instantclient_11_2
    This has the advantage of the choice above - but is a more Mac-like alternative. This is the directory I’ll specify for these instructions going forward (but feel free to use whichever location you think is most appropriate for you).
After downloading the three packages above:

Oracle Client For Mac

  1. Extract instantclient-basic and instantclient-plus zip files into single folder (e.g. /Library/Oracle/instantclient_11_2), then
  2. Create a subfolder named “sdk” inside that folder, and extract instantclient-sdk into it.