Easysoft Blog

Mon, 11 Feb 2019

Connecting SQL Server to Oracle

  1. Obtain the pre-release version of the Oracle WP ODBC Driver for Windows by contacting the Easysoft Support Team ().
  2. Install and license the Oracle WP ODBC Driver on the machine where your SQL Server instance is installed.

    To do this, execute the ODBC driver file distribution, and follow the on screen instructions.

    The install program starts the Easysoft License Manager, because you cannot use the Oracle ODBC Driver until a license is obtained.

    The following types of license are available:

    • Free time-limited trial license which gives you free and unrestricted use of the product for a limited period (usually 14 days).
    • Full license if you have purchased the product. On purchasing the product you are given an authorization code, which you use to obtain a license
  3. In Easysoft License Manager, enter your details.

    You MUST enter the Name, E-Mail Address and Company fields.

    The E-Mail Address MUST be the same as the address used to register and download from the Easysoft web site or you will be unable to obtain trial licenses.

  4. Choose Request License.

    You are asked for a license type.

  5. Do one of the following:
    • For a trial license click Time Limited Trial and then click Next.

      The License Manager asks what software you are licensing. Select Easysoft ODBC-Oracle Driver from the drop-down list and then click Next.

    • If you have obtained an authorization code for a purchased license, select Non-expiring License and then click Next.

      The License Manager requests your authorization code.

      Enter the authorization code and then click Next.

  6. The License Manager displays a summary of the information you entered and allows you to choose the method of applying for your license.
  7. Do one of the following:
    • Choose On-line Request if your machine is connected to the internet and can make outgoing connections to port 8884.

      The License Manager then sends a request to the Easysoft license server to activate your license key automatically. This is the quickest method and results in your details being entered immediately into our support database.

    • The remaining three options (Email Request, Print Request and View Request) are all ways to obtain a license if your machine is off-line (i.e. does not have a connection to the internet).

      Each of these methods involves providing Easysoft with information including your machine number (a number unique to your machine) and then waiting to receive your license key.

      Instead of emailing your details to Easysoft, you can enter them directly at the Easysoft web site and your license key will be emailed to you automatically.

      To use this method, click View Request, and then visit:

      In the Licensing page, enter your machine number (and authorization code for purchased license), click Submit and your license key will be emailed to you.

      When you receive the license key, you can activate it either by double-clicking the email attachment or by clicking Enter License on the License Manager main screen and pasting the license key into the dialog box.

    • Choose Finish to exit the License Manager.

      The installation is complete.

Configuring an ODBC Data Source

Before you can use the Oracle ODBC Driver to connect your SQL Server to Oracle, you need to configure an ODBC data source. An ODBC data source stores the connection details for the target database (e.g. Oracle) and the ODBC driver that is required to connect to it (e.g. the Oracle ODBC driver).

You configure ODBC data sources in ODBC Administrator, which is included with Windows. How you run ODBC Administrator depends on whether your version of Windows is 32-bit or 64-bit:

Use ODBC Administrator to create a Oracle ODBC Driver data source:

  1. Choose the System DSN tab, and then choose Add.
  2. In the Create New Data Source dialog box, choose Easysoft ODBC-Oracle WP Driver, and then choose Finish.
  3. Complete these fields Easysoft ODBC-Oracle WP Driver DSN Setup dialog box:
    Setting Value
    DSN ORACLEWP
    User Name The name of your Oracle user.
    Password The password for your Oracle user.
    Server The host name or IP address of the machine on which Oracle is running.
    SID The service name that identifies the database you want to connect to. For Oracle Database XE, the service name is XE.
  4. Use the Test button to verify that you can successfully connect to your Oracle database.

Connecting SQL Server to Oracle

These steps show you how to use a linked server to work with Oracle data, just as if you were working with data stored in a SQL Server table:

  1. In Microsoft SQL Server Management Studio, connect to the SQL Server instance you want to create the linked server against.

    You need to log on with an account that is a member of the SQL Server sysadmin fixed server role to create a linked server.

  2. Right-click Server Objects. From the pop-up menu choose New > Linked Server.
  3. In the Linked server box, type "ORACLEWP".
  4. From the Provider list, choose Microsoft OLE DB Provider for ODBC Drivers.
  5. In the Data source box, type the name of your Oracle ODBC driver data source, and then choose OK.
  6. Choose the Security page.
  7. Choose Be made using this security context.
  8. Type your Oracle user name and password in the spaces provided. Choose OK.

    SQL Server verifies the linked server by testing the connection.

    • If you made a mistake when specifying the Oracle ODBC driver data source, you get the error "Data source name not found and no default driver specified. If you get this error, choose No when prompted whether to keep the linked server and edit the value in the Data source box.
  9. You can query your Oracle data either by using a:
    • Four part table name in a distributed query.

      A four part table name has the format:

      server_name.[database_name].[schema_name].table_name.

      For Oracle you need to omit the database name. For example:

      SELECT * from ORACLEWP..SYSTEM.mytable
      
    • Pass-through query in an OPENQUERY function. For example:
      SELECT * FROM OPENQUERY(ORACLEWP, 'SELECT * FROM mytable)
      

      SQL Server sends pass-through queries as uninterpreted query strings to the Oracle ODBC driver. This means that SQL Server does not apply any kind of logic to the query or try to estimate what that query will do.


Oracle is a registered trademark of Oracle Corporation and/or its affiliates.