In a single database container environment, carry out the following steps to remove SAP HANA XS from the topology:
Stop all the applications that use the database. This is required because a new data backup has to be created after you remove SAP HANA XS. A log replay over the time of the service removal is not supported.
Determine all the hosts on which SAP HANA XS services are active:
-- > select host from m_services where service_name = 'xsengine'
Determine the volume ID of the SAP HANA XS services:
--> select VOLUME_ID from m_volumes where service_name = 'xsengine'
Stop the SAP HANA XS services. To do this, carry out the following command for every <host name> with an SAP HANA XS service:
-- ALTER SYSTEM ALTER CONFIGURATION ('daemon.ini', 'host', '<host name>') UNSET ('xsengine','instances') WITH RECONFIGURE
Remove the SAP HANA XS service entry from the topology. To do this, carry out the following command for every <host name> with an SAP HANA XS service:
-- ALTER SYSTEM ALTER CONFIGURATION ('topology.ini', 'system') UNSET ('/host/<Hostname>', 'xsengine') WITH RECONFIGURE
Remove the volumes from the topology. To do this, carry out the following command for every <volume_id> of an SAP HANA XS service:
-- ALTER SYSTEM ALTER CONFIGURATION ('topology.ini', 'system') UNSET ('/volumes', '<volume_id>') WITH RECONFIGURE
Caution: It can be a risk to make changes to the topology. Therefore, carefully check the host and the volume ID.
Create a new data backup.
Start the applications that use the database.
If you want to restart SAP HANA XS, proceed as follows:
Stop all the applications that use the database.
Activate SAP HANA XS. When you do this, specify the host on which you want SAP HANA XS to run:
-- ALTER SYSTEM ALTER CONFIGURATION ('daemon.ini', 'host', '<host name>') SET ('xsengine','instances') = '1' WITH RECONFIGURE
SAP HANA XS is started automatically, and the volumes of the service are created automatically.
Create a new data backup and start the applications that use the database.
In case XS Engine is still active and running: Determine the port of SAP HANA XS for the relevant tenant:
SELECT HOST, PORT FROM "SYS_DATABASES"."M_SERVICES" where DATABASE_NAME = '<tenant>' and SERVICE_NAME = 'xsengine'
Remove SAP HANA XS.
ALTER DATABASE <tenant> REMOVE 'xsengine' AT '<host>:<port>';
In case XS Engine is inactive / cannot be started:
get database_id:
select * from M_TOPOLOGY_TREE where path = '/databases'
By default the database_id is 3, but it can differ if multiple tenants are configured. So please verify by:
select * from M_TOPOLOGY_TREE where path = '/databases/3' and name = 'name' and value = '<tenantdb name>'
get hostname:
select host from sys_databases.m_services where service_name = 'xsengine'
verify host name in topology.ini:
select * from M_TOPOLOGY_TREE where path = '/host/<host name>' and name = 'xsengine'
get volume id
select VOLUME_ID from sys_databases.m_volumes where service_name = 'xsengine'
verify volume in topology.ini:
select * from M_TOPOLOGY_TREE where path = '/volumes' and name = '<database id from step 1>:<volume_id>'
remove xsenine from daemon.ini:
ALTER SYSTEM ALTER CONFIGURATION ('daemon.ini', 'host', '<host name>') UNSET ('xsengine','instances') WITH RECONFIGURE;
remove xsengine from topology:
ALTER SYSTEM ALTER CONFIGURATION ('topology.ini', 'system') UNSET ('/host/<host name>', 'xsengine') WITH RECONFIGURE;
ALTER SYSTEM ALTER CONFIGURATION ('topology.ini', 'system') UNSET ('/volumes', '<database id>:<volume id>') WITH RECONFIGURE;
Verify that xsengine is removed:
select * from sys_databases.m_services where service_name = 'xsengine'
Do you want to add the XSengine service again?
see also https://help.sap.com/docs/SAP_HANA_PLATFORM/4fe29514fd584807ac9f2a04f6754767/ee36e3441ae24a7883ab353631ecd4d6.html?locale=en-US
ALTER DATABASE JS2 ADD 'xsengine' AT '<host name>';
Verify that xsengine is back and active:
select * from sys_databases.m_services where service_name = 'xsengine'
Note
Need to run the command from SYSTEM Database if your database is a part of MDC
It can be a risk to make changes to the topology. Therefore, only use the above procedure carefully and carefully check the hostname, database, and volume id.
Make sure that you have a valid data backup and that you also backed up your topology.