Skip Headers
Oracle® Data Mining Administrator's Guide
11g Release 2 (11.2)

Part Number E12217-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

3 Connecting to an Oracle Database

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

Connect Oracle Data Miner

If you have installed Oracle Data Miner and Oracle Database on the same computer, you can create a simple local connection between them. If they are installed on different computers, see the instructions in "Oracle Client and Oracle Net".

To connect Oracle Data Miner to a local database, follow these steps.

  1. Start Oracle Data Miner, as described in "Start Oracle Data Miner".

  2. If no connections have previously been defined, the New Connection dialog appears.

    If connections have previously been defined, the Choose Connection Dialog will appear. Choose New to display the New Connection dialog.

    Description of odmr2.gif follows
    Description of the illustration odmr2.gif

    • For Connection Name, specify a meaningful name that you will remember.

    • Provide the user name and password for the connection. The user must have data mining privileges, as described in Chapter 4.

    • For Host, 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 step 6 of the database installation instructions in Chapter 2 .

    Click OK to create the connection.

  3. The Choose Connection dialog appears. Select the connection and click OK.

    Oracle Data Miner is launched using the specified connection

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 Oracle Data Mining PL/SQL API in either of these tools. For information about the PL/SQL API, see Oracle Data Mining Application Developer's Guide.

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 sqlplus.gif follows
Description of the illustration sqlplus.gif

Connect SQL Developer

The first time you run SQL Developer, you will be prompted to provide the path to the Java executable. Specify the full path of jdk\bin\java.exe under Oracle home of the database. For the installation described in Chapter 2, the path would be:

c:\app\demotest\product\11.2.0\db_1\jdk\bin\java.exe

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 sqldev.gif follows
    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 step 6 of the installation instructions in Chapter 2 .

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

Connect Using Java

In addition to SQL functions and the PL/SQL API, Oracle Data Mining has a Java API. You can use a Java development environment such as Oracle JDeveloper to develop data mining applications in Java.

For information about connecting to Oracle Data Mining in Java, see:

Oracle Data Mining Application Developer's Guide

To learn about Oracle support for Java and to download Oracle JDeveloper, visit:

http://www.oracle.com/technology/tech/java/index.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.

SQL>CONNECT username @ "hostname[:port][/databasename]"

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.

Oracle Data Miner does not require the installation of Oracle Client software.

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 obtain SQL*Plus, SQL Developer, and other tools for connecting to a remote Oracle database.

Note:

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

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

  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 cl1of6.gif follows
    Description of the illustration cl1of6.gif

    Click Next.

  6. On the Select Product Languages page, select the language for the Oracle Client user interface.

    Description of cl2of7.gif follows
    Description of the illustration cl2of7.gif

    Click Next.

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

    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 cl3of7.gif follows
    Description of the illustration cl3of7.gif

    Click Next.

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

    Description of cl5of7.gif follows
    Description of the illustration cl5of7.gif

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

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

    Description of cl6of7.gif follows
    Description of the illustration cl6of7.gif

    When the installation is complete, click Finish.

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

    Description of netconfig1.gif follows
    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.

  11. 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 step 11 of "Install Oracle Database".)

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

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

  13. 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 netconfig1.gif follows
    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 step 6 of "Install Oracle Database".)

    Description of netconfig3.gif follows
    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 netconfig6.gif follows
    Description of the illustration netconfig6.gif

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

    Description of netconfig7.gif follows
    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 netconfig8.gif follows
    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 netconfig9.gif follows
    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.

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 "Install the Spreadsheet Add–In".

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

    Description of addin2.gif follows
    Description of the illustration addin2.gif

  5. The Connect (Oracle Database) dialog appears.

    Description of addin3.gif follows
    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.