2063.A QlikView Connection to Oracle (1)

19
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.

Transcript of 2063.A QlikView Connection to Oracle (1)

Page 1: 2063.A QlikView Connection to Oracle (1)

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.comThe URL is found on the home page in the upper rightBelow is the registration page.

Page 2: 2063.A QlikView Connection to Oracle (1)

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.

Page 3: 2063.A QlikView Connection to Oracle (1)

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.

Page 4: 2063.A QlikView Connection to Oracle (1)

Here the setup of the environment is set. Accept default by selecting next.

Select Enterprise addition, then Next.

Page 5: 2063.A QlikView Connection to Oracle (1)

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.

Page 6: 2063.A QlikView Connection to Oracle (1)

Select Next again.

Select default location, or find a place that has 2 gig of space. Select Next.

Page 7: 2063.A QlikView Connection to Oracle (1)

Make sure Do not enable Automated backups are set. Select Next.

Page 8: 2063.A QlikView Connection to Oracle (1)

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…..

Page 9: 2063.A QlikView Connection to Oracle (1)

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.

Page 10: 2063.A QlikView Connection to Oracle (1)

Select OK when done.

Select OK again to confirm.

Page 11: 2063.A QlikView Connection to Oracle (1)

Finally Exit. Now we can work on Data Pulls from Oracle into QV.

Page 12: 2063.A QlikView Connection to Oracle (1)

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.

Page 13: 2063.A QlikView Connection to Oracle (1)

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!

Page 14: 2063.A QlikView Connection to Oracle (1)

Now a data pullAnonymous 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.

Page 15: 2063.A QlikView Connection to Oracle (1)

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.oraC:\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.

Page 16: 2063.A QlikView Connection to Oracle (1)

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

Page 17: 2063.A QlikView Connection to Oracle (1)

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.