I believed that whoever follow my blog on “Introduction to SAP HANA MDC” will have better idea on how the MDC architecture in the HANA environment. This section will be guiding on converting a single HANA DB system to support SAP HANA multitenant database containers.
The scenario in this blog is based on AWS “cr1.8xlarge” EC2 instance with 1.8TB of EBS volume located in EU-WEST region. We had install the HANA single DB system with 256GB of RAM in the EC2 instance on HANA revision 110 with DB SID = HBT and DB system number = 00.
First of foremost, the HANA DB cockpit must be up and running in your HANA system that need to convert to SAP HANA MDC later. You may need to install the SAP HANA DB cockpit if this is not exist in your HANA environment. The HANA DB cockpit is pre-installed with the HANA revision 110 installation, it can be view via http://<host_name>.<FQDN>:80<nn>/sap/hana/admin/cockpit as in the screen captured 1.
The SAP HANA DB cockpit can be used for creating SAP HANA tenant DB, start/stop HANA tenant DB, system administration/monitoring, tenant DB backup, trace files and etc. SAP Note “2185556 – FAQ: SAP HANA Cockpit” will give you more understanding on SAP HANA DB cockpit.
Screen captured 1: SAP HANA DB Cockpit
There is pre-requisite need to be fulfilled which the statistic server must be 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. You may check the statistic server status via command “sapcontrol -nr <instance number> -function GetProcessList”, if you can see a separate process for the statistics server then you are still working with the old statistics server hence you will required to migrate the statistics server to the embedded statistics service.
After that, you may run the python script that migrates a single database system to a multitenant database container system. The python script will running the following activities once triggered.
- Bring down the SAP HANA Instance
- Converts the system to support multitenant database containers by:
- Setting the global.ini property [multidb] mode to multidb.
- Creating the system database (SYSTEMDB@<SID>).
- Converting the existing SAP HANA database to a tenant database. The name of this database is the system ID (<SID>@<SID>).
- Update the secure store in the file system (SSFS).
- Exports the topology
- Re-initializes the nameserver persistence of the system database
- Imports the topology
- Sets the SYSTEM user password of the system database
Detail steps as following:-
1. Login as <sid>adm and cd to exe/python_support
2. Run the command “python convertMDC.py”
3. It will prompt for SYSTEM user password for the SYSTEM DB when running the python script as in screen captured 2. Please do take note that your single DB SYSTEM user password still remain the same after it converted to tenant DB.
Screen Captured 2: Running the python script
4. It will show the “Conversion done” at the end of the processes. The you will required to change the SYSTEM user password for the SYSTEMDB, re-install SAP HANA license, re-deploy the delivery units to the SYSTEM DB and start up the tenant DB as in screen captured 3. Do take note that the tenant DB is not started after the conversion, you will need to start it manually. (Reset the SYSTEM user password for SYSTEM DB is important, otherwise it will prevent you access from HANA studio)
Screen captured 3: The end of python script.
5. Reset the SYSTEM user password in SYSTEM DB with command “hdbsql –i <nn> -n <hostname>:3<nn>03 –d SYSTEMDB –u SYSTEM –p <New_PASSWORD> with user <sid>adm. You can also using the “hdnnameserver –resetUserSystem command” in the nameserver mode with user <sid>adm.
6. As you did follow my blog on “Introduction to SAP HANA MDC”, there are some port number need to open after the SAP HANA MDC conversion, for example 3<nn>13 (SYSTEM DB SQL/MDX access), 3<nn>41 (tenant count 0 SQL/MDX access), 3<nn>44 (tenant count 1 SQL/MDX access), 80<nn> and 43<nn> (HTTP access).
7. Add the SYSMTEM DB into the SAP HANA studio (make sure your hana studio is > rev 90, of course always using the latest HANA studio rev, we are using SAP HANA studio rev 110 in this blog). The SYSTEM user password for SYSTEM DB is based on item 5.
8. Reinstall your SAP HANA license, run the SYSTEM DB backup as in the screen captured 4.
Screen captured 4: SYSTEM DB backup
9. Once the SYSTEM DB backup is done, then we need to deploy all the auto-content delivery units (DU) in the SYSTEM DB. Login as user <sid>adm, cd /usr/sap/<SID>/SYS/global/hdb/install/bin/, run the command “hdbupdrep”. The SYSTEM user password is based on item 5.
Screen captured 5: Deploy DU
10. After that, you can start the tenant DB via hdbsql (screen captured 6) or HANA studio (screen captured 7) or SAP HANA cockpit (screen captured 8). “ALTER SYSTEM START DATABASE <tenantDB_Name>
Screen captured 6: Start tenant DB via hdbsql
Screen captured 7: Start tenant DB via SAP HANA Studio
Screen captured 8: Start tenant DB via SAP HANA Cockpit
11. If you are using AWS, this parameter required to modify (global.ini > public_hostname_resolution > use_default_route -> Change from “ip” to “no”). After this change the HANA Database engine will no longer replace the jdbc connection with the internal AWS IP but instead will use the hostname. This step is necessary, otherwise you will have connection refused to add in the tenant DB.
12. Adding in the tenant DB count 0 and you will see it from the HANA studio. Tenant DB entry will look like <TenantDB_Name>@<SID> and the SYSTEM DB entry will look like SYSTEMDB@<SID>. Always remember the tenant DB count 0 after the conversion will having the same SID as original.
Screen captured 9: SYSTEM DB and Tenant DB entries in HANA studio
13. To differentiate the HANA system either a Single DB system or MDC system, just need to run following steps. If you can see the indexserver- <tenantDB_name> in the “GetProcessList” which mean your SAP HANA system is MDC enable.
Screen captured 10: SELECT * FROM SYS.M_DATABASES
Screen captured 11: /usr/sap/hostctrl/exe/sapcontrol -nr <nn> -function GetProcessList
The conversion from SAP HANA single DB to SAP HANA MDC is just as simple as the steps above. A full data backup must be triggered immediately after the SAP HANA single DB system converted to SAP HANA MDC because it required a new backup history. If you like my blog on this topic, there will be more interesting blog on “Tenant DB configuration and backup/restore”, the blog will be telling you on how to create tenant DB, some tenant DB post creation steps and the backup/restore experiment for SAP HANA MDC.