Monday, June 24, 2013

This blog will guide you how to install SAP Hana Client, Java and Tomcat in Linux server (Oracle/RedHat).

Install Hana Client

Step 1:
First check the version of Linux server where you want to install Hana Client.

Type following command
# uname –a

You should see output like following
Linux {your server} 2.6.32-131.0.15.el6.x86_64 #1 SMP Fri May 20 15:04:03 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux

The Linux kernel version should be same or greater than 2.6.32 in order to support Hana Client
Step 2:
Download Hana Client either 32 bit or 64 bit depends on your Linux server

Create a directory name ‘sap in ‘usr’, you can choose your favorite name and favorite location. E.g. you can create ‘sap’ directory in /opt directory path.
#mkdir sap                 

There is couple of options to download the client. You can directly download the client into Linux server using wget command but it would be tricky using command line since you have to bypass the SAP agreement. The easiest option is to download the client into Windows machine and connect to Linux server by putty.exe and copy the files from Windows machine to Linux machine by pscp.exe 

For example open windows command prompt and type following to copy Hana client from Windows to Linux:

pscp.exe sap_hana_client_linux64.gz root@{linux server IP}:/usr/sap

Step 3:
                Go to the path where you copied the Hana Client and extract the tar file

Example:
      
        #tar xzvf sap_hana_client_linux64.tgz
        
 After extracting the file, navigate to SAP_HANA_CLIENT_LINUX64 directory
          Run below command
         # ./hdbinst –a client
                
           You will see following message if the installation was successful                              

SAP HANA Database Installation Manager - Client Installation 1.00.48.372847
***************************************************************************
Enter Installation Path [/usr/sap/hdbclient]:
Checking installation...
Preparing package "Python Runtime"...
Preparing package "Product Manifest"...
Preparing package "SQLDBC"...
Preparing package "Python DB API"...
Preparing package "ODBC"...
Preparing package "JDBC"...
Preparing package "Client Installer"...
Installing SAP HANA Database Client to /usr/sap/hdbclient...
Installing package 'Python Runtime' ...
Installing package 'Product Manifest' ...
Installing package 'SQLDBC' ...
Installing package 'Python DB API' ...
Installing package 'ODBC' ...
Installing package 'JDBC' ...
Installing package 'Client Installer' ...
Installation done
Log file written to '/var/tmp/hdb_client_2013-06-21_15.42.47/hdbinst_client.log'          

Verify the connection
     # /usr/sap/hdbclient$ ./hdbsql

If you see below message then you are done
Welcome to the SAP HANA Database interactive terminal.
                                          
Type:  \h for help with commands         
       \q to quit  

 Install Java and Tomcat

Step 1:  Create a directory name ‘java in ‘usr’
              #mkdir java       

Step 2: Download JDK, JRE and Tomcat into the ‘java’ directory

             You should get latest version of JDK and JRE from here

Download as per server OS version. Again you can directly download the tar file into Linux.
For example:

Or if you are connected Linux through Windows then you can use pscp.exe to copy from Windows to Linux server
                Example:
                pscp.exe apache-tomcat-7.0.41.tar.gz root@{linux server IP}:/usr/java
                Do the same step for copying JDK and JRE tar file
              
Step 3:
                Extract Tomcat, JDK and JRE tar files
                Example:
                                #tar xzvf /usr/java/apache-tomcat-7.0.41.tar.gz
                                #tar xzvf /usr/java/jdk-7u25-linux-x64.gz
                                #tar xzvf /usr/java/jre-7u25-linux-x64.gz
               
Step 4: Set JAVA_HOME, PATH, CATALINA_HOME, CATALINA_BASE
                Example:
                                #export JAVA_HOME = /usr/java/jdk1.7.0_25/
                                #export PATH=$PATH:$JAVA_HOME/bin
                                #export CATALINA_HOME= /usr/java/apache-tomcat-7.0.39
                                #export CATALINA_BASE= /usr/java/apache-tomcat-7.0.39
               
Step 5:  Start Tomcat
                Example:
                                # /usr/java/apache-tomcat-7.0.39/bin/startup.sh
If Tomcat started up successfully, you can open up Tomcat home page by typing below URL in browser
                                http://localhost:8080 Or http//YourServerIP:8080 (if you want to access from remote)
                                In order to access Manager App do following:
                                Navigate to apache tomcat conf directory
                                # cd /usr/java/apache-tomcat-7.0.39/conf
                                #vi tomcat-users.xml
                                Insert below nodes
                                <role rolename="manager-gui"/>
        <user username="tomcat" password="tomcat" roles="manager-gui"/>
                                
                        Save and Exit
                                Esc => #ZZ

After saving the file open http://YourServerIP:8080 and click ‘Manager App’. Enter userId: ‘tomcat’ and password: ‘tomcat’ once it prompts. You should see all the applications listed.
    
Step 6:  Deploy WAR file

 At this stage you are done with the set up and you can deploy Service which talks to Hana DB. You have to just copy the WAR file to /usr/java/apache-tomcat-7.0.39/webapps and start the App from http://yourserverIP:8080/manager/html.