
In this How-To the standard HANA Admin guide was followed. Screenshots are taken from Testservers. For detailed information you MUST go through the Standard HANA Admin Guide (SAP HANA Tenant Databases > Copying and Moving Tenant Databases)
Hostname | IP | SID | HANA Version: | OS | |
SOURCE: | hanasrv83 | 192.168.0.83 | H83 | 2.00.073.00 | SLES 15 SP5 |
TARGET: | hanasrv84 | 192.168.0.84 | H84 | 2.00.073.00 | SLES 15 SP5 |
|
If something is going wrong or you want to delete the Tenant again run:
ALTER SYSTEM STOP DATABASE <DB_NAME>;
DROP DATABASE <DB_NAME> DROP BACKUPS;
In this Tutorial security will be not disabled and the self-signed certificates will be used. If you have company signed certificates you need to do the export and import based by the official guides.
Verify the SYSTEM layer values of the following parameters in the global.ini file:
[communication] ssl must be set to systempki
[communication] sslclientpki must be set to off
[system_replication_communication] enable_ssl must be set to on
You can change these settings by executing the following SQL statements:
ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM') SET ( 'communication', 'ssl') = 'systempki' WITH RECONFIGURE;
ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM') SET ( 'system_replication_communication', 'enable_ssl') = 'on' WITH RECONFIGURE;
ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM') SET ( 'communication', 'sslclientpki') = 'off' WITH RECONFIGURE;
ALTER SYSTEM CLIENTPKI DROP ROOT CA;
VERIFY:
select * from M_INIFILE_CONTENTS where file_name = 'global.ini' and section='communication' and key = 'ssl';
select * from M_INIFILE_CONTENTS where file_name = 'global.ini' and section='system_replication_communication' and key = 'enable_ssl';
select * from M_INIFILE_CONTENTS where file_name = 'global.ini' and section='communication' and key = 'sslclientpki';
Parameter Documentation:
During the copy process, data is replicated via a secure (TLS/SSL) network connection by default.
Procedure
VERIFY:
select * from PSES;
From Step 2. use the python script extract:
VERIFY:
select * from certificates;
select * from pse_certificates;
In the system database of the target system, create a certificate collection and set its purpose to DATABASE REPLICATION. You can choose any name for the certificate collection.
VERIFY:
select * from PSES;
If not already in the certificate store, import the public-key certificate of the system database of the source system (or the root certificate of the source system) into the certificate store of the target system.
For this Demo we use the previous extracted output of the python script and only use the certificate part and import it via SQL:
VERIFY:
select * from pse_certificates;
Open communication from the TARGET system to the SOURCE system by enabling services in the source system to listen on all network interfaces.
Connect via SQL to the SOURCE System and execute:
VERIFY:
select * from M_INIFILE_CONTENTS where file_name = 'global.ini' and section='communication' and key = 'listeninterface';
Connect via SQL to the TARGET Server and create Credentials for Authenticated Access to SOURCE System
VERIFY:
select * from credentials;
At this Step REBOOT SOURCE and TARGET HANA Servers!
Back up the Tenant Database which should be copied.
Connect to the SOURCE Tenant via SQL and check the current backup config:
VERIFY:
select * from M_BACKUP_CATALOG where ENTRY_TYPE_NAME = 'complete data backup';
Start the Replication of Database "SRC" to "TRG"
Connect to the TARGET Server via SQL and run:
The Replication can be checked via:
Possible Errors:
1.
Could not execute 'CREATE DATABASE TRG AS REPLICA OF SRC AT 'hanasrv83:30001'' in 80 ms 508 µs .
SAP DBTech JDBC: [2]: general error: nameserver failed to process the request;ltt exception: exception 7100011: Database connection to the source database error: Connection to source database at 'hanasrv83:30013' with credential FOR PURPOSE 'hanasrv83:30001' failed, exception 1: no.7100011 (MultiDB/impl/DatabaseConnectionSQLDBC.cpp:121) TID: 31931
Database connection to the source database error: SQLDBC connection failed with SQLDBC error -10709: Connection failed (RTE:[89001] Cannot resolve host name 'hanasrv83' rc=-2: Name or service not known (hanasrv83:30013))
.
Solution: See if both servers can resolve each others name. Either via the hosts file or via system_replication_hostname_resolution
-------
2.
Could not execute 'CREATE DATABASE TRG AS REPLICA OF SRC AT 'hanasrv83:30001'' in 83 ms 189 µs .
SAP DBTech JDBC: [2]: general error: nameserver failed to process the request;ltt exception: exception 7100011: Database connection to the source database error: Connection to source database at '192.168.0.83:30013' with credential FOR PURPOSE 'hanasrv83:30001' failed, exception 1: no.7100011 (MultiDB/impl/DatabaseConnectionSQLDBC.cpp:121) TID: 31931
Database connection to the source database error: SQLDBC connection failed with SQLDBC error -10709: Connection failed (RTE:[300015] SSL certificate validation failed: host name '192.168.0.83' does not match name in certificate 'hanasrv83' (192.168.0.84:12790 -> 192.168.0.83:30013))
.
Solution: If system_replication_hostname_resolution is used for name resolving make sure it is set the correct way (hostname -> ip). SAMPLE for the Testservers above.
ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM') SET ( 'system_replication_hostname_resolution', 'hanasrv83') = '192.168.0.83' WITH RECONFIGURE;
ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM') SET ( 'system_replication_hostname_resolution', 'hanasrv84') = '192.168.0.84' WITH RECONFIGURE;
Connect to the TARGET Server via SQL and run:
VERIFY:
select * from SYS_DATABASES.M_DATABASE_REPLICA_STATISTICS;
select * from SYS_DATABASES.M_DATABASE_REPLICAS;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
23 | |
22 | |
21 | |
15 | |
15 | |
9 | |
8 | |
8 | |
7 | |
7 |