You are on page 1of 17

A QlikView Connection to Oracle’s DB using OLE DB, both 32

and x64
Notes:

Oracle historically will not include all drivers unless you do a full download and install
the full package database (Enterprise Edition Database). Oracle allows this install for
development testing at no cost. However, historically, you must pay a license fee to
connection to a production database and/or have and use a production database. This
procedure should not have a license cost.

Oracle historically is bad on installs. If they fail they are a pain to rectify but I found this
install OK, so maybe they have gotten better. The below has been tested on 32 and x64.
There is a requirement of about 4 gig to do the install. Once things work correctly on the
local QV machine you can shutdown the database as well as remove the database and
components. The database an listner are services that you stop , for database removeal I
need more time to document.

This document gets you up and pulling from Oracle as quickly as possible from another
host regardless of host type MS, Sun or Linux. The OCI connection protocol is
backwards compatible to 8i, when it was first implemented by Oracle. My thought is to
use the most current connector from Oracle which includes the current MS OS OLE DB
from Oracle and includes Oracle’s OCI. This will create the best connection for the data
pulls.

Thanks

1. Register as a user on Oracle’s site. http://oracle.com


The URL is found on the home page in the upper right
Below is the registration page.
2. Once logged in and “confirm” then go to list all downloads found on the home
page found in the upper right corner.

From the database options select 10G. This version works with OCI and OLEDB, you
need both. In the list of options below, select the QV host reading the OS. This would be
x64 or windows 32

Download and install the entire package onto the QV server that is connecting to Oracle.
UnZip the package and go to the Install folder found below Disk1 and click on the setup
icon. This is a Java program and will walk you through the install.

The Setup screen you see is below takes awhile to display. Hit Next when displayed.
Here the setup of the environment is set. Accept default by selecting next.

Select Enterprise addition, then Next.


Select Create a starter database, General Purpose and Next.

Write down the Global Database Name and SID (you will need this later) then Select
Next.
Select Next again.

Select default location, or find a place that has 2 gig of space. Select Next.
Make sure Do not enable Automated backups are set. Select Next.
Here is where you have to be real careful, below add passwords and write them down
before selecting Next.

Hit Install, you will be prompted to accept external communication to an outside source if
you have a firewall a couple of times. The install starts…..
Still in install…

Components are being configured and the fun begins… If you reach this point you
should be able to finish.

Hit password management and unlock accounts, the important account is Scott for testing
as seen in the next screen shot after this one.
Select OK when done.

Select OK again to confirm.


Finally Exit. Now we can work on Data Pulls from Oracle into QV.
This WEB page will show up after you select exit. Enter the sys username and password
selected from before, but be sure to connect as sysdba, then Login.

Accept the license agreement on the next page then exit.

After this connect locally via QV

This added the Oracle Provider from Oracle OLE DB to your list of options when
connecting to a datasource using OLE DB. This uses Oracle’s OCI which interfaces to
OLE DB. OCI does most of the translation to the OLE DB layer making for a faster
transfer.
Now we will check the connection locally. Remember the SID orcl from above? Enter
orcl as your Data Source and scott as the username tiger as the password.

When first trying it will fail and ask you to reset the password. Enter tiger in all 3 boxes
and click on OK.

Success!
Now a data pull
Anonymous is one of the schema’s or databases in SQL server. Let’s move to SCOTT
as the owner…

Here is an example of pulling data from Scott as the owner.


There are different ways you can authenticate and I prefer the old way, it works.

In the above example you are connecting to the local machine with 2 control files.

C:\OraHome1\network\ADMIN\tnsnames.ora
C:\OraHome1\network\ADMIN\sqlnet.ora

They contain the following:

Tnsnames:
# tnsnames.ora Network Configuration File: C:\OraHome1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)

EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)

And sqlnet.ora

# sqlnet.ora Network Configuration File: C:\OraHome1\network\admin\sqlnet.ora


# Generated by Oracle configuration tools.

SQLNET.AUTHENTICATION_SERVICES= (NTS)

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

To connect to a different host modify the tnsnames file, make a copy starting at ORCL =
and ending before EXTPROC_CONNECTION_DATA =. Change the name of the host
to reflect the global host name of the new connection.
You also need a new SID or data source that will be used in the OLE DB connection and
it must be a unique name for each SID/datasource used in tnsnames.ora file and the setup
of OLEDB

New tnsnames file:


# tnsnames.ora Network Configuration File: C:\OraHome1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
QV =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = <ip of the Oracle database QV pulls
data)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)

EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)

To test this modification there is a command line tool used call tnsping
If you have a sqlnet error. Copy the sqlnet.ora file from the source host/production to the
receiving host, where QV resides and try again.