<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Tutorial: Setting Up Oracle Access in Red Hat Environment in Administration and Deployment</title>
    <link>https://communities.sas.com/t5/Administration-and-Deployment/Tutorial-Setting-Up-Oracle-Access-in-Red-Hat-Environment/m-p/568527#M16586</link>
    <description>&lt;P&gt;This process was a bit ugly for me, so I thought I would share the steps I used to get this connection setup and working. Along with the source where relevant, when I had a bit of help. These are really my personal notes, just thought I would share with the general public.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Caveat: this may not be the best method or best practice. It was literally achieved via reading the manual and google searches against error messages, until they went away and I could see my data. I am a competent Windows SysAdmin that has been forced to wear a Linux Admin hat just for SAS, thrashing teeth and screaming, free of charge.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;&lt;FONT size="4"&gt;General OS Instructions and Info:&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Info&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;We are running SAS 9.4 M5, in a mult-tiered environment across 7 SAS servers that are running Oracle 6.8.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Instructions &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1) &lt;/STRONG&gt;&lt;A href="https://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html" target="_self"&gt;Downloaded oracle ODBC installers and tools from here:&lt;/A&gt;&amp;nbsp;(&lt;A href="https://blogs.sas.com/content/sgf/2017/04/25/how-to-configure-oracle-client-for-successful-access-to-oracle-databases-from-sas-viya/" target="_self"&gt;LINK&lt;/A&gt; to a decent writeup using SAS Viya with Oracle)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$ cd ~
$ rpm -ivh oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm  
$ rpm -ivh oracle-instantclient12.2-sqlplus-12.2.0.1.0-1.x86_64.rpm&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2) Now, add this path to the system library list. Create and edit a new file:&lt;/STRONG&gt; (&lt;A href="https://stackoverflow.com/questions/31978331/libsqlplus-so-connot-open-shared-object-file-no-such-file-or-directory-even-t/34261234#34261234" target="_self"&gt;LINK&lt;/A&gt;)&lt;/P&gt;&lt;PRE&gt;$ sudo nano /etc/ld.so.conf.d/oracle.conf&lt;BR /&gt;&lt;BR /&gt;CONTENT:&lt;BR /&gt;/usr/lib/oracle/12.2/client64/lib/&lt;/PRE&gt;&lt;P&gt;Now run the dynamic linker run-time bindings utility:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$ sudo ldconfig&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: bold;"&gt;3) Next we need to make the path info persistent: &lt;/SPAN&gt;(&lt;A href="https://stackoverflow.com/a/50585965" target="_blank" rel="noopener"&gt;LINK&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;You should already have all needed variables in /etc/profile.d/oracle.sh. Make sure you source it:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$ sudo nano /etc/profile.d/oracle.sh&lt;BR /&gt;&lt;BR /&gt;CONTENT:&lt;BR /&gt;ORACLE_HOME=/usr/lib/oracle/12.2/client64&lt;BR /&gt;PATH=$ORACLE_HOME/bin:$PATH&lt;BR /&gt;LD_LIBRARY_PATH=$ORACLE_HOME/lib&lt;BR /&gt;export ORACLE_HOME&lt;BR /&gt;export LD_LIBRARY_PATH&lt;BR /&gt;export PATH&lt;BR /&gt;&lt;BR /&gt;$ source /etc/profile.d/oracle.sh&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;4) Create the tnsnames.ora file:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;(Provided by the oracle db admin)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$ sudo nano /etc/tnsnames.ora
&lt;BR /&gt;CONTENT:
myhost =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = myhost.edu)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = myhost)
    )
  )&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;5) Verify that the oracle connection is working at the OS level:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;sqlplus my_USERNAME/my_password@myhost
(Should show Successful login)


SQL&amp;gt; SELECT DISTINCT OWNER FROM ALL_OBJECTS;
SQL&amp;gt; SELECT owner, table_name FROM all_tables;
SQL&amp;gt; SELECT view_name FROM all_views;
SQL&amp;gt; exit&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;FONT size="4" color="#3366FF"&gt;SAS Specific Instructions:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1) Edit the sas environment variables: &lt;/STRONG&gt;(&lt;A href="https://communities.sas.com/t5/Administration-and-Deployment/SAS-Oracle-Configration/m-p/344741#M8090" target="_blank" rel="noopener"&gt;LINK&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$ nano /opt/sasinside/sashome/SASFoundation/9.4/bin/sasenv_local

CONTENT:
#ORACLE
export TNS_ADMIN=/etc
export ORACLE_BASE=/usr/lib/oracle
export ORACLE_HOME=/usr/lib/oracle/12.2/client64
export ORACLE_VERSION=12.2.0
export PATH=/usr/lib/oracle/12.2/client64/bin:$PATH
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/lib/oracle/12.2/client64/lib&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2) At this point, I restarted my SAS environment. I do not know if that is really necessary or not. But I wanted to make sure that my changes went into effect.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;3) I then got the super secret password and tested my libname statement: (&lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a003113591.htm" target="_blank" rel="noopener"&gt;LINK&lt;/A&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc PWENCODE in="my_password"; run;

libname test oracle user=my_USERNAME password="{SAS002}DBCC5712369DE1C65B19864C1564FB850F398DCF" path=myhost schema=EDU_SCHEMA;&lt;/PRE&gt;&lt;P&gt;I got an error message, indicating that SAS was looking for Oracle 11, it included the phrase:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;libclntsh.so.11.1: cannot open shared object file: No such file or directory&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I knew from the manual, that when the installer originally setup the environment, there is a part of the install where he says what version of Oracle we are using. I was not able to find where to find that info after the fact. So this was my first indication of what he had put.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;4) SAS was setup to use Oracle 11, not 12, so we have to create a symbolic link: &lt;/STRONG&gt;(&lt;A href="https://support.sas.com/kb/60/895.html" target="_blank" rel="noopener"&gt;LINK&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$ cd /opt/sasinside/sashome/SASFoundation/9.4/sasexe
$ mv sasora sasora.bak   
$ ln -s orlax11 sasora
$ cd ${ORACLE_HOME}/lib   
$ ln -s libclntsh.so.12.1 libclntsh.so.11.1&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;5) Test my libname statement again:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;libname test oracle user=my_USERNAME password="{SAS002}DBCC5712369DE1C65B19864C1564FB850F398DCF" path=myhost schema=EDU_SCHEMA;&lt;/PRE&gt;&lt;P&gt;&lt;FONT size="4" color="#FF00FF"&gt;Success! I see tables and data in those tables. Off, to let the professor know they can do their thing.&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 24 Jun 2019 20:09:01 GMT</pubDate>
    <dc:creator>five</dc:creator>
    <dc:date>2019-06-24T20:09:01Z</dc:date>
    <item>
      <title>Tutorial: Setting Up Oracle Access in Red Hat Environment</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Tutorial-Setting-Up-Oracle-Access-in-Red-Hat-Environment/m-p/568527#M16586</link>
      <description>&lt;P&gt;This process was a bit ugly for me, so I thought I would share the steps I used to get this connection setup and working. Along with the source where relevant, when I had a bit of help. These are really my personal notes, just thought I would share with the general public.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Caveat: this may not be the best method or best practice. It was literally achieved via reading the manual and google searches against error messages, until they went away and I could see my data. I am a competent Windows SysAdmin that has been forced to wear a Linux Admin hat just for SAS, thrashing teeth and screaming, free of charge.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;&lt;FONT size="4"&gt;General OS Instructions and Info:&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Info&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;We are running SAS 9.4 M5, in a mult-tiered environment across 7 SAS servers that are running Oracle 6.8.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Instructions &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1) &lt;/STRONG&gt;&lt;A href="https://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html" target="_self"&gt;Downloaded oracle ODBC installers and tools from here:&lt;/A&gt;&amp;nbsp;(&lt;A href="https://blogs.sas.com/content/sgf/2017/04/25/how-to-configure-oracle-client-for-successful-access-to-oracle-databases-from-sas-viya/" target="_self"&gt;LINK&lt;/A&gt; to a decent writeup using SAS Viya with Oracle)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$ cd ~
$ rpm -ivh oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm  
$ rpm -ivh oracle-instantclient12.2-sqlplus-12.2.0.1.0-1.x86_64.rpm&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2) Now, add this path to the system library list. Create and edit a new file:&lt;/STRONG&gt; (&lt;A href="https://stackoverflow.com/questions/31978331/libsqlplus-so-connot-open-shared-object-file-no-such-file-or-directory-even-t/34261234#34261234" target="_self"&gt;LINK&lt;/A&gt;)&lt;/P&gt;&lt;PRE&gt;$ sudo nano /etc/ld.so.conf.d/oracle.conf&lt;BR /&gt;&lt;BR /&gt;CONTENT:&lt;BR /&gt;/usr/lib/oracle/12.2/client64/lib/&lt;/PRE&gt;&lt;P&gt;Now run the dynamic linker run-time bindings utility:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$ sudo ldconfig&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: bold;"&gt;3) Next we need to make the path info persistent: &lt;/SPAN&gt;(&lt;A href="https://stackoverflow.com/a/50585965" target="_blank" rel="noopener"&gt;LINK&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;You should already have all needed variables in /etc/profile.d/oracle.sh. Make sure you source it:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$ sudo nano /etc/profile.d/oracle.sh&lt;BR /&gt;&lt;BR /&gt;CONTENT:&lt;BR /&gt;ORACLE_HOME=/usr/lib/oracle/12.2/client64&lt;BR /&gt;PATH=$ORACLE_HOME/bin:$PATH&lt;BR /&gt;LD_LIBRARY_PATH=$ORACLE_HOME/lib&lt;BR /&gt;export ORACLE_HOME&lt;BR /&gt;export LD_LIBRARY_PATH&lt;BR /&gt;export PATH&lt;BR /&gt;&lt;BR /&gt;$ source /etc/profile.d/oracle.sh&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;4) Create the tnsnames.ora file:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;(Provided by the oracle db admin)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$ sudo nano /etc/tnsnames.ora
&lt;BR /&gt;CONTENT:
myhost =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = myhost.edu)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = myhost)
    )
  )&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;5) Verify that the oracle connection is working at the OS level:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;sqlplus my_USERNAME/my_password@myhost
(Should show Successful login)


SQL&amp;gt; SELECT DISTINCT OWNER FROM ALL_OBJECTS;
SQL&amp;gt; SELECT owner, table_name FROM all_tables;
SQL&amp;gt; SELECT view_name FROM all_views;
SQL&amp;gt; exit&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;FONT size="4" color="#3366FF"&gt;SAS Specific Instructions:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1) Edit the sas environment variables: &lt;/STRONG&gt;(&lt;A href="https://communities.sas.com/t5/Administration-and-Deployment/SAS-Oracle-Configration/m-p/344741#M8090" target="_blank" rel="noopener"&gt;LINK&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$ nano /opt/sasinside/sashome/SASFoundation/9.4/bin/sasenv_local

CONTENT:
#ORACLE
export TNS_ADMIN=/etc
export ORACLE_BASE=/usr/lib/oracle
export ORACLE_HOME=/usr/lib/oracle/12.2/client64
export ORACLE_VERSION=12.2.0
export PATH=/usr/lib/oracle/12.2/client64/bin:$PATH
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/lib/oracle/12.2/client64/lib&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2) At this point, I restarted my SAS environment. I do not know if that is really necessary or not. But I wanted to make sure that my changes went into effect.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;3) I then got the super secret password and tested my libname statement: (&lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a003113591.htm" target="_blank" rel="noopener"&gt;LINK&lt;/A&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc PWENCODE in="my_password"; run;

libname test oracle user=my_USERNAME password="{SAS002}DBCC5712369DE1C65B19864C1564FB850F398DCF" path=myhost schema=EDU_SCHEMA;&lt;/PRE&gt;&lt;P&gt;I got an error message, indicating that SAS was looking for Oracle 11, it included the phrase:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;libclntsh.so.11.1: cannot open shared object file: No such file or directory&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I knew from the manual, that when the installer originally setup the environment, there is a part of the install where he says what version of Oracle we are using. I was not able to find where to find that info after the fact. So this was my first indication of what he had put.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;4) SAS was setup to use Oracle 11, not 12, so we have to create a symbolic link: &lt;/STRONG&gt;(&lt;A href="https://support.sas.com/kb/60/895.html" target="_blank" rel="noopener"&gt;LINK&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$ cd /opt/sasinside/sashome/SASFoundation/9.4/sasexe
$ mv sasora sasora.bak   
$ ln -s orlax11 sasora
$ cd ${ORACLE_HOME}/lib   
$ ln -s libclntsh.so.12.1 libclntsh.so.11.1&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;5) Test my libname statement again:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;libname test oracle user=my_USERNAME password="{SAS002}DBCC5712369DE1C65B19864C1564FB850F398DCF" path=myhost schema=EDU_SCHEMA;&lt;/PRE&gt;&lt;P&gt;&lt;FONT size="4" color="#FF00FF"&gt;Success! I see tables and data in those tables. Off, to let the professor know they can do their thing.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 20:09:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Tutorial-Setting-Up-Oracle-Access-in-Red-Hat-Environment/m-p/568527#M16586</guid>
      <dc:creator>five</dc:creator>
      <dc:date>2019-06-24T20:09:01Z</dc:date>
    </item>
  </channel>
</rss>

