Hello All,
This blog will explain you details on how to copy HANA database using tenant copy procedure.
It can be helpful in various scenario's like
It follow similar mechanism as that of HANA Database Replication.
Prerequisite's for doing HANA tenant copy.
Unlike HSR we don't need OS access for doing tenant copy. we need SYSTEM user credentials for both target and source HANA database.
In our scenario, we did our HEC to RISE migration using HANA tenant copy. So this blog will be more focused on usage of Tenant copy in Database Migration.
Setting up parameters in source system
we need to set below parameters in source system. It might be possible that these are already set on the database so please verify the same.
In our case we did not had SSL communication and trust setup between source and target hence we are disabling SSL.
ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM') SET ('multidb', 'enforce_ssl_database_replication') = 'false' WITH RECONFIGURE;
ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM') SET ('system_replication_communication', 'enable_ssl') = 'off' WITH RECONFIGURE;
ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM') SET ('communication', 'ssl') = 'off' WITH RECONFIGURE;
ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM') SET ('communication', 'listeninterface') = '.global' WITH RECONFIGURE;
ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM') SET ('system_replication', 'logshipping_async_buffer_size') = '1073741824' WITH RECONFIGURE;
ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM') SET ('system_replication', 'logshipping_timeout') = '30' WITH RECONFIGURE;
ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM') SET ('persistence', 'log_mode') = 'normal' WITH RECONFIGURE;
ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM') SET ('inifile_checker', 'enable') = 'true' WITH RECONFIGURE;
ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM') SET ('inifile_checker', 'replicate') = 'false' WITH RECONFIGURE;
ALTER SYSTEM ALTER CONFIGURATION ('indexserver.ini', 'SYSTEM') SET ('system_replication', 'logshipping_async_buffer_size') = '10737418240' WITH RECONFIGURE;
ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM') SET ('system_replication', 'logshipping_async_wait_on_buffer_full') = 'false' WITH RECONFIGURE;
ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM') SET ('system_replication', 'logshipping_max_retention_size') = '1048576' WITH RECONFIGURE;
ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM') SET ('system_replication', 'enable_log_retention') = 'on' WITH RECONFIGURE;
Parameters to be set on target database
we need to set below parameters on target database (execute commands in systemDB > sql editor)
ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM') SET ('multidb', 'enforce_ssl_database_replication') = 'false' WITH RECONFIGURE;
ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM') SET ('system_replication_communication', 'enable_ssl') = 'off' WITH RECONFIGURE;
ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM') SET ('communication', 'ssl') = 'off' WITH RECONFIGURE;
ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM') SET ('communication', 'listeninterface') = '.global' WITH RECONFIGURE;
ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM') SET ('system_replication', 'logshipping_async_buffer_size') = '1073741824' WITH RECONFIGURE;
ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM') SET ('system_replication', 'logshipping_timeout') = '30' WITH RECONFIGURE;
ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM') SET ('persistence', 'log_mode') = 'normal' WITH RECONFIGURE;
ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM') SET ('inifile_checker', 'enable') = 'true' WITH RECONFIGURE;
ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM') SET ('inifile_checker', 'replicate') = 'false' WITH RECONFIGURE;
Note : If this parameter are not set already then after setting up parameter you need restart of HANA database. (Both source DB and target DB)
Additionally we can check if any additional HANA source is having using below command
SELECT * FROM M_PLUGIN_MANIFESTS;
we need to have same plugins on target database as well
Setting up tenant copy
Below are the steps to be followed to start tenant copy
ALTER SYSTEM STOP DATABASE <SID>;
Note : If DB SID which you are copying is having same SID name then we need to drop the existing tenant DB. If you want to copy to different SID then no need to drop the existing tenant DB in target
Drop database <SID>;
CREATE CREDENTIAL FOR COMPONENT 'DATABASE_REPLICATION' PURPOSE '<hostname of source db>:<Nameserver SQL port>' TYPE 'PASSWORD' USING 'user="SYSTEM";password="<password>"'
CREATE DATABASE <SID> AS REPLICA OF <Source DB SID> AT '<Source DB hostname>:<30001>';
This will start your tenant copy from source to target
you can monitor the progress using below command
SELECT * FROM SYS_DATABASES.M_DATABASE_REPLICA_STATISTICS;
you might get error regarding authentication or replication status as unknown.
for that you can find the logs in target database " indexserver log file "
Performing takeover / Finalizing replication
Once entire database is copied you will see status as " Active "
Now we are ready for finalizing the database copy.
Use below command on target SystemDB to complete the copy.
Note : when you are doing database migration you need to rampdown the source system application first then perform the FINALIZE REPLICA
Alter database PRD FINALIZE REPLICA;
Once you are done with this you can drop the source system credentials using below command
DROP CREDENTIAL FOR COMPONENT 'DATABASE_REPLICATION' PURPOSE 'Source DB hostname:30001' TYPE 'PASSWORD';
you can revert the parameters that were set during tenant copy procedure.
By using this method we migrated the systems hosted on HANA database from one datacenter to other datacenter.
Below are some reference articles of SAP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
5 | |
5 | |
4 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |