Difference: APPX500ToOracleOnWindows (41 vs. 42)

Revision 422016-04-07 - JeanNeron

Line: 1 to 1
 
META TOPICPARENT name="APPX500ToOracle"
Changed:
<
<

APPX 5 connectivity to Oracle on Window

>
>

APPX 5 on Windows connectivity to Oracle

 
Changed:
<
<
How to configure APPX 5 to store data inside Oracle on Windows.
>
>
How to configure APPX 5 on Windows to store data inside Oracle.
 
Changed:
<
<

>
>

 

Overview

Line: 13 to 13
  This document assumes you already have Oracle installed on your network and configured to accept connections. For performance reasons, it is recommended that your RDBMS and APPX be on the same server. APPX should also already be installed with the AppxLoginMgr configured to accept logins.
Deleted:
<
<
Unix/Linux will ignore environment variables such as LD_LIBRARY_PATH, SHLIB_PATH and LIBPATH required for Oracle's Instant Client when called from a SUID binary (which APPX typically is). To accomodate this, you'll want to remove the SUID on appx and configure APPX Login Manager to impersonate the appx user (typically appx) and appx group (typically appxgrp). This is accomplished via the service .ini parameters:
ImpersonateGroup            = NamedGroup(appxgrp)               #[LogonUser, NamedGroup(groupname), ServiceOwner] 
ImpersonateUser             = NamedUser(appx)          #[LogonUser, NamedUser(username), ServiceOwner]

Connections via the APPX Login Manager will then be able to make use of the Oracle Instant Client connection. From the command line, you can connect to the APPX Login Manager via the -c argument to appx like so:

appx -c
 

Oracle Instant Client

Downloading

If you are running an APPX release prior to 6.0, you will need the 32 bit Oracle interface. Even if your OS is 64 bit, even if your Oracle is 64 bit, APPX requires you to connect to Oracle via the 32 bit version of the Oracle Instant Client. You can download the 32 bit version of Oracle Instant Client here. If you are running APPX 6.0 or greater, you need to know if you are running 32 or 64 bit APPX engine and download the appropriate Instant Client.

Changed:
<
<
On my test server here I have APPX installed on Red Hat Enterprise 5 64 bit OS. Oracle is installed on a secondary server - Red Hat Enterprise 4 32 bit. The connection from APPX to Oracle should work fine to Oracle 10.2.0.4 and above (including 11). I downloaded the 32 bit version of Oracle's Instant Client 10.2.0.4, selecting two file bundles, Instant Client Package - Basic and Instant Client Package - SQL*Plus. I chose the rpm, but the zip packages work just as well. The rpms deposited the Oracle Instant client files as shown below:
>
>
On my test server here I have APPX installed on Windows 2012R2. Oracle is installed on a secondary server - AIX. The connection from APPX to Oracle should work fine to Oracle 10.2.0.4 and above (including 11). I downloaded the 32 bit version of Oracle's Instant Client 10.2.0.4, selecting two file bundles, Instant Client Package - Basic and Instant Client Package - SQL*Plus.
 

Installing

Changed:
<
<
[root@appx502 10.2.0.4-32bit]# rpm -ivh oracle-instantclient-basic-10.2.0.4-1.i386.rpm oracle-instantclient-sqlplus-10.2.0.4-1.i386.rpm 
Preparing...                ########################################### [100%]
   1:oracle-instantclient-ba########################################### [ 50%]
   2:oracle-instantclient-sq########################################### [100%]
[root@appx502 10.2.0.4-32bit]#
[root@appx502 10.2.0.4-32bit]# rpm -qlp oracle-instantclient-basic-10.2.0.4-1.i386.rpm oracle-instantclient-sqlplus-10.2.0.4-1.i386.rpm 
/usr/lib/oracle/10.2.0.4/client/bin/genezi
/usr/lib/oracle/10.2.0.4/client/lib/libclntsh.so.10.1
/usr/lib/oracle/10.2.0.4/client/lib/libnnz10.so
/usr/lib/oracle/10.2.0.4/client/lib/libocci.so.10.1
/usr/lib/oracle/10.2.0.4/client/lib/libociei.so
/usr/lib/oracle/10.2.0.4/client/lib/libocijdbc10.so
/usr/lib/oracle/10.2.0.4/client/lib/ojdbc14.jar
/usr/bin/sqlplus
/usr/lib/oracle/10.2.0.4/client/bin/sqlplus
/usr/lib/oracle/10.2.0.4/client/lib/glogin.sql
/usr/lib/oracle/10.2.0.4/client/lib/libsqlplus.so
/usr/lib/oracle/10.2.0.4/client/lib/libsqlplusic.so
[root@appx502 10.2.0.4-32bit]#
>
>
To install the Instant client files, I simply unzipped them both and put all the files in one directory, C:\Oracle_instant_10.2 in this example:

oci.png

 
 

Testing

Changed:
<
<
The location isn't terribly important, only that you know where the library files libclntsh, libnnz10, libocci, libociei and the executable file sqlplus are located. Let's test the Oracle Instant Client with SQL*Plus. You can't test the Oracle Instant Client with just any SQL*Plus. You must use a version of SQL*Plus that was developed to use the Instant Client library files. To perform the SQL*Plus connection we need five pieces of information from your Oracle DBA. My example values are listen in parenthesis below:
>
>
The location isn't terribly important, only that you know where the files are located. Let's test the Oracle Instant Client with SQL*Plus. You can't test the Oracle Instant Client with just any SQL*Plus. You must use a version of SQL*Plus that was developed to use the Instant Client library files. To perform the SQL*Plus connection we need five pieces of information from your Oracle DBA. My example values are listen in parenthesis below:
 
  • Oracle SID (customer)
  • TCP port number that Oracle is configured to listen (TCP 1521)
Line: 58 to 35
 
  • Oracle user ID (larry)
  • Oracle password (yacht)
I'll use the Oracle Easy Connect syntax to log in.
Changed:
<
<

Failure without LD_LIBRARY_PATH

[root@appx502 ~]#
[root@appx502 ~]# /usr/lib/oracle/10.2.0.4/client/bin/sqlplus larry/yacht@10.50.0.6:1521/customer
/usr/lib/oracle/10.2.0.4/client/bin/sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory
[root@appx502 ~]#

Notice the failure to find libsqlplus.so in the text above. You can resolve this on Linux with LD_LIBRARY_PATH. An example is below.

Success with LD_LIBRARY_PATH

[root@appx502 ~]# export LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.4/client/lib
[root@appx502 ~]#
[root@appx502 ~]# /usr/lib/oracle/10.2.0.4/client/bin/sqlplus larry/yacht@10.50.0.6:1521/customer

SQL*Plus: Release 10.2.0.4.0 - Production on Thu Jul 8 13:06:38 2010

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
>
>
PS C:\Oracle_instant_10.2> .\sqlplus.exe larry/yacht@10.50.0.6:1521/customer
SQL*Plus: Release 10.2.0.5.0 - Production on Thu Apr 7 12:22:01 2016
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
  Connected to:
Changed:
<
<
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options

SQL> quit Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production

>
>
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
 With the Partitioning, OLAP and Data Mining options
Changed:
<
<
[root@appx502 ~]#
>
>
SQL>
 

APPX

Changed:
<
<
We can configure APPX now that we know that we can connect to Oracle using the Instant Client library files via the special Instant Client version of SQL*Plus (you did perform that test right?). In order for APPX to successfully connect to Oracle via the Oracle Instant Client, it must have visibility of certain environment variables prior to the start of APPX. Setting these environment variables in the commonly used appx.env file will not work. Setting them in the shell would work for command line APPX sessions. You should consider setting them inside the service environment variable file so that all connections to APPX via TCP (even the text based ones via appx -c) will be able to connect to Oracle via the Oracle Instant Client.
>
>
We can configure APPX now that we know that we can connect to Oracle using the Instant Client library files via the special Instant Client version of SQL*Plus (you did perform that test right?).
 

Configuration

Changed:
<
<
Since the environment variables needed to enable APPX make use of the Oracle Instant Client must be present prior to the start of APPX, I've decided to place them in the APPX Login Manager environment variable file.

Environment variables

I'm going to set two environment variables, the first is for the OS (LD_LIBRARY_PATH) and the second is for APPX (APPX_OCI_LIB). These will be placed inside my APPX Login Manager environment variable file /usr/local/appx/services/appx-8060.env).

>
>
Since the environment variable needed to enable APPX make use of the Oracle Instant Client must be present prior to the start of APPX, I've decided to place it in the 'appx.env' file ($APPXPATH\appx.env).
APPX_OCI_LIB=c:\Oracle_instant_10.2\oci.dll 
 
Changed:
<
<
[appx@appx502 services]$ pwd
/usr/local/appx/services
[appx@ocportal services]$
[appx@ocportal services]$ cat appx-8060.env
# Appx connection manager environment variables
#
#   The entries in this file will become
#   environment variables in the engines
#   spawned by this service
#
#   blank lines are ignored
#
#   anything following a '#' is treated as a comment
#
#   letter case IS important in this file
# --------------------------------------------------

APPX_KEYMAP = Windows
APPXPATH = /usr/local/appx/data
LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.4/client/lib/
# APPX_SQL_CMD=/usr/local/appx/appx_sql_cmd.txt
# APPX_DBG_CODE=0xFFFFFFF
# APPX_OCI_DIR=/usr/lib/oracle/10.2.0.4/client/lib/
APPX_OCI_LIB=libclntsh.so.10.1
[appx@appx502 services]$
>
>
 
Changed:
<
<
The two environment varialbes needed for for the Oracle connection are LD_LIBRARY_PATH and APPX_OCI_LIB.
>
>
APPX_OCI_LIB should include the full path and file name for the 'oci.dll' file.
 

FMS settings

We need to create an FMS group of type 5 (Oracle) that will point to the Oracle server. To do this we will need the same five pieces of Oracle configuration data that we used when we performed a test connection to Oracle using the Instant Client version of SQL*Plus. The values that I'm using in this example are listed below in parenthesis.

Line: 217 to 152
 

Troubleshooting APPX to Oracle connection

Changed:
<
<
If you try to make a connection to Oracle from APPX and receive a message "*Can't load Oracle Call Interface (libclntsh)" then you might be missing the environment variables required, or you might have them set to incorrect paths. Make sure you downloaded the correct Oracle Instant Client files for your platform and that it maches the bitness of your APPX engine.
>
>
If you try to make a connection to Oracle from APPX and receive a message "*Can't load Oracle Call Interface (libclntsh)" then you might be missing the environment variable required, or you might have it set to an incorrect path. Make sure you downloaded the correct Oracle Instant Client files for your platform and that it maches the bitness of your APPX engine.
 
Changed:
<
<
Verify environment variable values via the following path: System Administration > System Setup > Release Information > Environment Variables. Did you set the environment variables inside appx.env? Setting these Oracle connectivity environment variables inside appx.env will not work. These environment variables must be present prior to the appx session starting. Try setting them in the appxLoginMgr environment variable file and then make sure you restart the daemon and reconnect to try the Oracle connection again.
>
>
Verify environment variable values via the following path: System Administration > System Setup > Release Information > Environment Variables.
  -- JoeOrtagus - 2010-07-07
Line: 236 to 171
 
META FILEATTACHMENT attachment="011.png" attr="h" comment="" date="1278616883" name="011.png" path="011.png" size="46314" stream="011.png" tmpFilename="/tmp/WTcWqBsdak" user="JoeOrtagus" version="1"
META FILEATTACHMENT attachment="012.png" attr="h" comment="" date="1278616888" name="012.png" path="012.png" size="36004" stream="012.png" tmpFilename="/tmp/FFMd1JFBTs" user="JoeOrtagus" version="1"
META FILEATTACHMENT attachment="013.png" attr="h" comment="" date="1278616894" name="013.png" path="013.png" size="32207" stream="013.png" tmpFilename="/tmp/P0hGp0qGTp" user="JoeOrtagus" version="1"
Added:
>
>
META FILEATTACHMENT attachment="oci.png" attr="h" comment="" date="1460049555" name="oci.png" path="oci.png" size="82512" user="JeanNeron" version="1"
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback