cancel
Showing results for 
Search instead for 
Did you mean: 

HANA XSA Import Privileges to import Data from CSV

Former Member

Hi Experts,

I am trying to import data from a CSV in HANA HDO container.

Altered the indexserver also by enabling the import_export parameter.

I use the same old sql statement as used in HANA XSC:

import from '/mnt/share/data.ctl';

It drops an error saying:

Insufficient Privileges: Not authorized

The CTL is file is correctly built, since whenever i change the schema inside the CTL file it drops an error.

It seems to be some privilege issue since i am running this from SYSTEM user in HANA studio.

Can someone guide how to solve this.

Thanks,

Abhishek.

Accepted Solutions (0)

Answers (1)

Answers (1)

pfefferf
Active Contributor
0 Kudos

By default no user has any privileges for the HDI generated schema or objects, even not the generated technical user used to access the db artifacts. For the technical user a "default_access_role.hdbrole" can be defined in the src/defaults folder.

For your case I would define a role in the XSA application db module (for which it is required) which gives the required object or schema privileges. After building the module the role can be assigned to the required user using a user with the User Mgmt system privilege (consider that the user SYSTEM cannot be used to assign privileges/roles to himself, for that another user has to be used - in a "dirty world" for instance XSA_ADMIN could be used, but a dedicated user management user is recommended).

Following is a role described which provides different schema privileges. Details about your required privileges can be found in the authorization trace (when you activate it):

{
	"role": {
		"name": "xsa_misc.db.roles::dummy_access_role",
		"schema_privileges": [{
			"privileges": [
			        "CREATE ANY",
					"SELECT",
					"INSERT",
					"UPDATE",
					"DELETE",
					"ALTER",
					"DROP",
					"EXECUTE"
				]
			}
		]
	}
}

Regards,
Florian

former_member540015
Participant
0 Kudos
IMPORT 

is a system privilege which can not be assigned to a role in HDI module .hdbrole file.

At least on SPS03 it will through

Error: com.sap.hana.di.role: Database error 258: : insufficient privilege: Not authorized [8201003]

during Build process.

pfefferf
Active Contributor
0 Kudos

Hm, you are saying that it is not possible, but on the other hand you are asking here how this is possible. Because of that I do not really understand your comment here, especially because my answer is not related to system privileges!

former_member540015
Participant
0 Kudos

Hi Florian! Original question was about IMPORT FROM CSV and INSERT schema_privileges is required but not enough.