Tuesday 28 April 2020

How to install HANA Database in non- Interactive Mode ?

In HANA System installation passwords are the mandatory parameter. There are three methods for configuring passwords while Hana system installation.


  • Interactive Mode
  • Command Line 
  • Configuration File 

The interactive installation is available for the SAP HANA database lifecycle manager in both graphical  (hdblcmgui ) and command-line interface (hdblcm). Passwords are entered manually one-by-one as they are requested by the installer. This method is preferred for quick, individual system installations.


There are two Non-interactive ways of HANA DB installation 

1: COMMAND LINE

Configuring passwords in the command line is a two-step process. 

 - First, a simple text file with passwords in XML syntax should be created and saved in the home directory of the root user. 

 - Then the file can be called using standard input and the read_password_from_stdin parameter in the command line with batch mode



Parameters specified in the command line override parameters specified in the configuration file. Since this method is the most powerful and flexible method, it is often the preferred method for installing multiple SAP HANA systems at one time.

The following is an example of the password file in XML syntax: 

Passwords.xml

<?xml version="1.0" encoding="UTF-8"?> 
<Passwords> 
<password>Welcome1234</password> 
<sapadm_password>Welcome1234</sapadm_password> <system_user_password>Welcome1234</system_user_password> <root_password>Root1234</root_password>
</Passwords> 


Now, the password file (stored in the root user's home directory) is called from the command line using standard input, the read_password_from_stdin=xml parameter, and batch mode: 

cat ~/Passwords.xml | ./hdblcm --sid=DB1 --number=42 -read_password_from_stdin=xml -b


2: CONFIGURATION FILE

It is possible to specify passwords in the configuration file.

A configuration file template is created with all the parameters set to their default values. The configuration file is edited to the preferred parameter values, then it is saved, and the values are read by the installer during installation. This method is preferred for a one-step installation that can be re-created several times. If passwords are specified in the configuration file, the configuration file should be stored in the home directory of the root user, for security reasons.
Example 

The following is an example of the configuration file, with configured password parameters: 

configfile1.cfg

# Root User Password 
root_password=Root1234 ... 

# SAP Host Agent (sapadm) Password 
sapadm_password=Welcome123 ...

# System Administrator Password 
password=Welcome123

 # Database User (SYSTEM) Password 
system_user_password=Welcome123




Now, the configuration file (stored in the root user's home directory) is called from the command line using the config file parameter:

 ./hdblcm --sid=DB1 --configfile=~/configfile1.cfg


Rupesh Chavan

Thanks