on 2023 Mar 13 8:21 AM
Hi,
we are following the script described in this help article: Manually Migrate a Cloud Foundry Multitarget Application's Database to SAP HANA Cloud | SAP Help Por....
The first steps are creating in the source container a user and grant priviledges to the user - to acess data in the source hdi-container.
Our source container is defined containing lower case characters and minus '-', eg 'my_hana_service-app-container'.
Copy of the original script:
In the source (HaaS) system, as user SYSTEM, create the user required by a remote source later in the migration process.
CREATE USER REMOTE_SOURCE_USER PASSWORD RemoteSourceUserPassword NO FORCE_FIRST_PASSWORD_CHANGE;
Grant schema privileges on the HaaS HDI container to REMOTE_SOURCE_USER:
CREATE LOCAL TEMPORARY COLUMN TABLE #PRIVILEGES LIKE _SYS_DI.TT_SCHEMA_PRIVILEGES;
INSERT INTO #PRIVILEGES ( PRIVILEGE_NAME, PRINCIPAL_SCHEMA_NAME, PRINCIPAL_NAME ) VALUES ( 'SELECT', '', 'REMOTE_SOURCE_USER' );
CALL _SYS_DI.GRANT_CONTAINER_SCHEMA_PRIVILEGES('<HDI_CONTAINER_NAME>', #PRIVILEGES, _SYS_DI.T_NO_PARAMETERS, ?, ?, ?);
The last statement ends with failure:
CALL _SYS_DI.GRANT_CONTAINER_SCHEMA_PRIVILEGES('hana_service-app-container', #PRIVILEGES, _SYS_DI.T_NO_PARAMETERS, ?, ?, ?);
MESSAGE
Granting schema privileges in the container "my_hana_service-app-container" and the parameters "[]"...
"my_hana_service-app-container": the DTC name contains invalid characters; valid characters are "A"-"Z", "0"-"9", and "_", and the first character cannot be "_"
Granting schema privileges in the container "my_hana_service-app-container" and the parameters "[]"... failed
Nevertheless we completed the script but finally we are not able to adress with the remote source (CREATE REMOTE SOURCE RS_MIGRATION_APP ADAPTER hanaodbc CONFIGURATION ...) from the target system the source-container application tables.
So our idea is that the priviledges of the REMOTE_SOURCE_USER in the source db/container is not properly authorized.
My question: is there anybody who can confirm that assumption? Is there any way to proceed with that script to migrate the application table data between the containers?
Thanks for feedback and kind regards,
Axel
ps: our source container sub-structured with a schema 'SOURCE_SCHEMA_NAME' and the virtual table we try to create with that code:
CREATE VIRTUAL TABLE "TARGET_SCHEMA"."REM_APP_TABLE_1" at "RS_MIGRATION"."NULL"."my_hana_service-app-container"."SOURCE_SCHEMA_NAME.APP_TABLE_1"; failing with SQL error 476 invalid remote object name. And in the admin-database-explorer view we are not able to find our app tables or our SOURCE_SCHEMA_NAME under the REMOTE_SOURCE definition tree.
Request clarification before answering.
correct statement is:
CALL _SYS_DI.GRANT_CONTAINER_SCHEMA_PRIVILEGES('SOURCE_SCHEMA_NAME', #PRIVILEGES, _SYS_DI.T_NO_PARAMETERS, ?, ?, ?);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
this is one of the prerequisite
The database user performing the migration requires HDI container-administrator access to the HDI containers that are being migrated.
similar to step3, you have to make dbamin as hdi container admin for the hdi container you are trying to migrate.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
well, thanks for feedback!
Looks like there is some confusion and insufficient documentation - (at least for me)
Obviously its necessary to take into consideration a slightly different architecture of users, hdi-containers and sub-container schemas. so in this case we are on the old HANA-service container which is supposed to be administrated as SYSTEM user. And it looks like the parametrisation of procedure is different in HANA Cloud
Our source system structure:
HDI container: my_hana_service-app-container
local schema in the container: SOURCE_SCHEMA_NAME
tables in the schema we want to migrate: SOURCE_SCHEMA_NAME.APP_TABLE_1
system generated application schema: SOURCE_SCHEMA_NAME#DI
system generated schemas: SYS and several _SYS_...
Procedure GRANT_CONTAINER_SCHEMA_PRIVILEGES
comes obviously with 3 in parameters CALL _SYS_DI.GRANT_CONTAINER_SCHEMA_PRIVILEGES('<HDI_CONTAINER_NAME>', #PRIVILEGES, _SYS_DI.T_NO_PARAMETERS, ?, ?, ?);
How to put these things together?
original proposed statement comes up with that failure:
CALL _SYS_DI.GRANT_CONTAINER_SCHEMA_PRIVILEGES('my_hana_service-app-container', #PRIVILEGES, _SYS_DI.T_NO_PARAMETERS, ?, ?, ?);
MESSAGE
Granting schema privileges in the container "my_hana_service-app-container" and the parameters "[]"...
"my_hana_service-app-container": the DTC name contains invalid characters; valid characters are "A"-"Z", "0"-"9", and "_", and the first character cannot be "_"
In which schema to call _SYS_DI ??
first parameter '<HDI_CONTAINER_NAME>' -> my_hana_service-app-container or SOURCE_SCHEMA_NAME ??
User | Count |
---|---|
78 | |
12 | |
9 | |
8 | |
7 | |
5 | |
4 | |
4 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.