License management in HANA

License keys are required to use SAP HANA databases. You can install, and delete license keys using the SAP HANA studio, HANA cockpit, the SAP HANA HDBSQL command line tool, and SQL.
License keys are required to use SAP HANA. SAP HANA supports two kinds of license key: temporary license keys and permanent license keys.
While temporary license keys are automatically installed in an SAP HANA system, permanent license keys have to be requested on the SAP Service Marketplace and applied to the individual SAP HANA system.

**Systems that support multitenant database containers require a single license key, regardless of the number of tenant databases.**

Temporary License Keys:
A temporary license key, which is valid for 90 days, is automatically installed with a new SAP HANA system. During this period, you should request and apply a permanent license key.

Permanent License Keys:
We can get Permanent License Keys from Service market place under Keys & Request. Permanent license keys are valid until the predefined expiration date. Furthermore, they specify the amount of memory licensed to the target SAP HANA installation.
If a permanent license key expires, a temporary license key valid for 28 days is automatically installed. During this time, you can request and install a new permanent license key.

There are two types of permanent license key available for SAP HANA: unenforced and enforced

unenforced: If an unenforced license key is installed, the operation of SAP HANA is not affected if its memory consumption exceeds the licensed amount of memory

enforced: if an enforced license is installed, the system is locked down when the current memory consumption of SAP HANA exceeds the licensed amount of memory plus some tolerance. If this happens, either SAP HANA needs to be restarted, or a new license key that covers the amount of memory in use needs to be installed.

We can identify which type of license is by checking the content in key file, by seeing below entry.
Unenforced –> SWPRODUCTNAME=SAP-HANA
Enforced –> SWPRODUCTNAME=SAP-HANA-ENF
SWPRODUCTNAME=SAP-HANA-DEV
SWPRODUCTNAME=SAP-HANA-DIGITAL

License Keys for Tenant Databases:
You can install permanent license keys in individual tenant databases. The license key installed in a tenant
database is valid for that database only and takes precedence over the license key installed in the system
database. If a tenant-specific license key is not installed, the system database license key is effective in the
tenant database.
System administrators can use the view SYS_DATABASES.M_LICENSE to see the same information for all tenant databases. The system view SYS.M_LICENSE provides tenant administrators with information on the license key
effective in their tenant database, as well as where the license key is installed: in the tenant database itself
or in the system database.

System/Database lockdown:
The database goes into lockdown mode in the following situations as shown in below image.

HANA LICENSE

In lockdown mode, it is not possible to query the database. Only a user with the system privilege LICENSE
ADMIN can connect to the database and execute license-related queries, such as, obtain previous license
data, install a new license key, and delete installed license keys. The database cannot be backed up in
lockdown mode.
Also, In a locked-down tenant database, deleting the locally installed license key will resolve the situation,
assuming the system database has a valid license and the locally installed license key is not an enforced
license key.

We can Manage HANA License through multiple way, we will see in details as below:

1) HANA Cockpit:
We can view licenses installed in your SAP HANA database on the License page of the SAP HANA cockpit ( for this to see we need system privilege LICENSE ADMIN to our account).
On the Overview page, choose the Manage system licenses link –> The License page opens –> All licenses installed in the database are listed on the left.
**IMP NOTE: If you are viewing license information in the system database, usage data is for the system as a whole. In a tenant database, only the usage data of the tenant is shown.

The License page provides you with detailed information about all licenses installed in the SAP HANA
database, as shown below.

HANA LICENSE DETAIL

–> Install a Permanent license:

Prerequisites:
–> You have the necessary authorization to request permanent license keys on SAP Support Portal.
–> To install a license key in the SAP HANA system, you have the system privilege LICENSE ADMIN.
Process:
1) On the Overview page, choose the Manage system licenses link.
2) On the License page, choose the Request New License button in the footer.
3) Choose Go to SAP Support Portal.
4) In SAP Support Portal, choose Request Keys.
5) Fill the required detail or verify the auto completed field for HANA system
6) Submit
7) The permanent license will be sent to you as an e-mail attachment.
8) Install the license key by choosing Upload New License and uploading the license file (*.txt file) that you
received by e-mail.

–> Delete Licenses:
we can delete all existing license keys in the SAP HANA database, for example, if permanent license keys with
an incorrect installation number or incorrect system number were installed or removing expired license.

Process:
1. On the Overview page, choose the Manage system licenses link.
2. Click Delete All Licenses in the footer toolbar.
3. All license keys are deleted.

HANA LICENSE

2) SAP HANA Studio:
We can also check, install and delete the license from HANA studio too

–> Check the Current License Key:
1) In the Systems view, right-click the system and choose –> Properties –> License.
2) On the System License page under Current License Key, the following information is available:
–> License type
–> Start date of the license key
–> Expiration date of the license key
–> Install a Permanent License:
1) In the Systems view, right-click the system and choose –> Properties –> License.

2) Request a license key on SAP Support Portal by choosing Request Keys, fillall the details aur verify the auto filled field.
3) Submit
4) Permanent licenses are sent as e-mail attachments
5) Install the license key
–> In the Systems view, right-click the system and choose Properties License .
–> In the Request License Key area of the System License page, choose Install License Key and select the
file that you received by e-mail.

–> Delete Licenses:
we can delete all existing license keys in the SAP HANA database, for example, if permanent license keys with
an incorrect installation number or incorrect system number were installed or removing expired license.
1) In the Systems view, right-click the system and choose Properties License .
2) On the System License page choose Delete License Key.

**Note: All permanent license keys are deleted. This results in the lockdown of the database. The installation of a new, valid permanent license key is required to unlock the database.

3) OS commands to access the HANA Database and manage the license:
For single container system, you can follow below steps to install the license directly.
While for MDC system, you have to decide where the license needs to be installed.
Generally, install system level license, you need to connect to system database.
And for tenant level license, you can connect to the specific tenant database to perform below steps.

1) Logon as sidadm user, connect to the Database via hdbsql.
For single container system, please try below command:
> hdbsql -n <hostname>:3<instance no.>15 -i <instance no.> -u <DB username> -p <password>

For MDC system, please try connecting to the system DB by below command:
> hdbsql -n <hostname>:3<instance no.>13 -i <instance no.> -u <DB username> -p <password>

To install license in a specific tenant, please maintain the SQL port of the tenant DB in the command accordingly.
> hdbsql -n <hostname>:3<instance no.><tenant SQL port> -i <instance no.> -u <DB username> -p <password>

2) Enable multiline mode in hdbsql
> hdbsql <DB name>=> \mu

3) You need a new license key, which you can download from Support Portal.

4) Enter statement
SET SYSTEM LICENSE ‘<license file content>’
Please note to add quotation mark outside the content of the license file you just downloaded.

5) Execute the statement by command: \g
hdbsql <DB name>=> \g

Note:
Install the new license via hdbsql cannot replace the old license. Please consider to delete the old license key before installing the new one.
You can also delete license keys by executing the SQL statement UNSET SYSTEM LICENSE ALL.

Hope this article will explain in details, also for more details you can refer below SAP Notes:
Refer SAP Note SAP Note 1644792,2690863,2311999, 2645528.

Leave a Reply

Your email address will not be published. Required fields are marked *