Activity : HANA Refresh
Source DB : ABC
Source Schema : ABC_PROD
Target DB : CBA
Target Schema : CBA_TEST
Step 1 : Take export of ABC_PROD using EXPORT command.
Export Command:
EXPORT ""."*" AS BINARY INTO '/hdb/ABC/backup/data/refresh'
Step 2: Convert the create.sql/index.sql using find and replace command.
Find and Replace the source name to target:
find . -name 'create.sql' -exec sed -i 's,(source_change_on_run),(target_change_on_run),g' {} \; -print > /tmp/create_output.txt
find . -name 'index.sql' -exec sed -i 's,(source_change_on_run),(target_change_on_run),g' {} \; -print > /tmp/index_output.txt
find . -type f -exec sed -i 's,(source_change_on_run),(target_change_on_run),g' {}; -print
Step 3: Import the dump to CBA_TEST using IMPORT command
Import Command:
IMPORT "*"."*" AS BINARY FROM '/hdb/BAC/backup/data/refresh/refresh' WITH RENAME SCHEMA "(source_change_on_run)" TO "(target_change_on_run)" THREADS 16
Step 4: Validate the size of schema and row counts
Get the Schema size from both side:
SELECT SCHEMA_NAME AS "Schema",round(sum(TABLE_SIZE)/1024/1024) AS "Size in MB" FROM M_TABLES where SCHEMA_NAME='' GROUP BY SCHEMA_NAME
Get the Schema based Table row count from both side:
select schema_name,table_name,record_count from m_tables where schema_name='' order by table_name
Source DB : ABC
Source Schema : ABC_PROD
Target DB : CBA
Target Schema : CBA_TEST
Step 1 : Take export of ABC_PROD using EXPORT command.
Export Command:
EXPORT "
Step 2: Convert the create.sql/index.sql using find and replace command.
Find and Replace the source name to target:
find . -name 'create.sql' -exec sed -i 's,(source_change_on_run),(target_change_on_run),g' {} \; -print > /tmp/create_output.txt
find . -name 'index.sql' -exec sed -i 's,(source_change_on_run),(target_change_on_run),g' {} \; -print > /tmp/index_output.txt
find . -type f -exec sed -i 's,(source_change_on_run),(target_change_on_run),g' {}; -print
Step 3: Import the dump to CBA_TEST using IMPORT command
Import Command:
IMPORT "*"."*" AS BINARY FROM '/hdb/BAC/backup/data/refresh/refresh' WITH RENAME SCHEMA "(source_change_on_run)" TO "(target_change_on_run)" THREADS 16
Step 4: Validate the size of schema and row counts
Get the Schema size from both side:
SELECT SCHEMA_NAME AS "Schema",round(sum(TABLE_SIZE)/1024/1024) AS "Size in MB" FROM M_TABLES where SCHEMA_NAME='
Get the Schema based Table row count from both side:
select schema_name,table_name,record_count from m_tables where schema_name='
1 comment:
Hi Shailendra,
I am trying to export a table from my Hana DB to my local system as a CSV file, Using GUI. But am unable to export it. The error it is giving as
"Not allowed to exceed max in-memory lob size. Please use server-local Export"...
Can you please look at this issue, and help me in this regard.
thanks,
Anil Re
Post a Comment