Three options to convert single-container system to a multiple-container system
The blog ‘Convert to a multi tenant hana database’ describes already how to convert an SAP HANA single database system to a multitenant one. In this blog the conversion was executed using hdbnsutil. It is not recommended to use the hdbnsutil anymore, because with SPS12 you can convert a single-container system to a multiple-container system using SAP HANA database lifecycle manager (HDBLCM). You can choose between three options to execute this operation: command-line, the graphical user interface (GUI) or Web UI application for HDBLCM.
In this blog I will explain all three options. I prefer to start the conversion by using the HDBLCM command-line. But first let me explain my single-container system, which I would like to convert.
The SAP HANA single-container system ‘M02’, located on one host, has already some metadata. It contains the schema ‘CAR_DEALER’. The schema contains three tables ‘CUSTOMER’, ‘CAR’ and ‘CUSTOMER_CAR’. And I have provided some data for these tables. I have also created users ‘SYSTEMADMIN’, ‘USERADMIN’ and assigned some system privileges to them.
So, now I would like to convert my single-container system to a multiple-container system. The conversion must not affect any customer data or applications. Let’s see how it works. But first I have to check if my system is ready for this operation.
- First be aware that the statistics server is running as an embedded service in the master index server. If this is not the case, migrate the statistics server to the embedded statistics service as described in SAP Note 1917938.
- The host must be able to as access the installation directories <sapmnt> and <sapmnt>/<SID>.
- The SAP HANA system was installed with the SAP HANA database lifecycle manager (HDBLCM).
- The SAP HANA database server is up and running.
Conversion using HDBLCM command-line interface
If all prerequisites are met we can start the migration. First change to the SAP HANA HDBLCM directory: cd <sapmnt>/<SID>/hdblcm. By default <sapmnt> is /hana/shared. From here I will start the HDBLCM in the command line: ./hdblcm –action=convert_to_multidb.
I have to provide credentials for <sid>adm and define a new password for the SYSTEM user. These are the credentials of the SYSTEM user you need to connect to the system database (system DB), which will be created during conversion. The tenant database owns the SYSTEM user credentials of the original single-container system.
Before you will continue, be aware that converting to a multiple-container system is permanent and cannot be reversed.
Unlike in the past, you don’t need to stop the system manually. All processes will be stopped automatically. After conversion all processes are up and running and you can work with the database immediately.
If the single-container system was converted successfully, you will have one system DB and one tenant DB. The name of this tenant is <SID>@<SID>, my tenant has then a name M02@M02.
You can add the system DB to your workspace in the SAP HANA studio and using Configuration tab in Administration editor have a look at how it is configured now. The global.ini->multidb->mode has been set to ‘multidb’.
So, what happens with my schema, tables and users which I created in the single-container system?
My single-container system was converted to a tenant DB. You can add it to your workspace in SAP HANA studio as well. Use the same host, SID and SYSTEM user credentials of the original single-container system.
After adding you will see that the schema ‘CAR_DEALER’ with all tables and users ‘SYSTEMADMIN’, ‘USERADMIN’ have been migrated to this tenant.
If you open the tables in Table editor and users in User editor you will see that all data and user privileges were migrated successfully.
Conversion using HDBLCM GUI
The next possibility to convert a single-container system to multiple-container system is via the HDBLCM GUI.
If all prerequisites, described above, have been met, you can start the HDBLCM GUI.
First change to the SAP HANA HDBLCM directory: cd <sapmnt>/<SID>/hdblcm. By default <sapmnt> is /hana/shared. With ./hdblcmgui I start the HDBLCM GUI. On the first page I can choose the activity Convert to Multitenant Database.
I enter the credentials for <sid>adm user and define a new password for the SYSTEM user on the next page.
Just review the summary and press the Run button.
The conversion finished successfully.
Conversion using Web UI
And the last, but not least, option to convert is using Web UI. Again, the prerequisites, described above, should be met. Then be sure that communication port 1129 is open. I will run the HDBLCM Web UI for migration in Google Chrome, but you can also use Internet Explorer (version 9 or higher), Mozilla Firefox (Last version), Safari 5.1. or higher, etc. For more information about supported browsers, see the SAP Note 1716423.
Using the URL https://<host_name>:1129/lmsl/HDBLCM/<SID>/index.html you can open Launchpad of SAP HANA Platform Lifecycle Management. From here I can drill-down into the Convert to Multitenant Database Container app.
Again, I have to provide credentials for the <sid>adm user and a new password for the SYSTEM user.
Under Settings I can configure some advanced parameters e.g. I don’t want to start my tenant after migration.
On the next page I can review my configuration and proceed with or cancel the conversion.
So, it was successful.
After conversion you can work with the tenant DB like you worked with the single-container system. You can also create additional tenants in the multiple-container system. For more information, see Creating and Configuring Tenant Databases in the SAP HANA Multitenant Database Containers.
It’s important to mention here which data won’t be migrated so you can take care of it after conversion. All the data of the original system (single-container system), users, the system configurations and connection properties will be migrated to a new tenant. The backup history and system license won’t be migrated.
Now you know how you can convert a single-container system to a multiple-container system using HDBLCM tools.
Maybe you will ask me, why do you need to convert a single-container database to MDC? Running your system in multi-container mode has several key benefits. First of all the cost saving. If your MDC contains several tenant DBs, the upgrade is much easier now. Since system upgrade can be applied to all tenants by simply upgrading the system.
The administration of MDC e.g. configuration, tracing can be done on the system database level and it will be applied to all tenants. The most important monitoring views of the tenant databases can be seen in an aggregation schema on the system database.
There is also a strongly separation between system and database administrations. The applications on tenants are isolated and each tenant can be recovered separately.
The next reason, you can copy or move your tenants from one host to another inside one multiple-container system or from one multiple-container system to another one. You see there are several advantages to having a multiple-container system.
In my next blog I will write about how to copy/move a tenant from one multiple-container system to another remote one.