user6811693
user6811693

Reputation:

Loading data to SAP HANA

I am having my CSV file in /usr/sap/DB1/HDB/work and also having my control file which has the following code

IMPORT DATA INTO TABLE target_schema."table_name" 
FROM '/usr/sap/DB1/HDB/work/table_name.csv'
RECORD DELIMITED BY '\n' 
FIELDS DELIMITED BY ',' 
OPTIONALLY ENCLOSED BY '"' 
ERROR LOG ' table_name.err' ​

Afterwards when I execute the following query in SQL

IMPORT FROM '/usr/sap/DB1/HDB/work/table_name.ctl';

I am getting error

[258]: insufficient privilege: Not authorized.

But I am logged in as SYSTEM user. Could anyone help me? Thank you.

Upvotes: 0

Views: 995

Answers (3)

Shivam Shrivastava
Shivam Shrivastava

Reputation: 24

In the navigation pane of Hana studio, under the your System name click security. expand security then go to Users and click on your username .In the Right side of the navigation pane you will find option to alter privileges.

Upvotes: 0

abhi5800
abhi5800

Reputation: 384

There are three things that need to be done :

  1. The SYSTEM user must have the "IMPORT" privileges.
  2. Alter the Index Server service to read the CTL and CSV file from the location.
  3. The Tables in which data you are inserting should have the Insert Privileges.

Upvotes: 1

djk
djk

Reputation: 973

The user hdbadm is usually not a HANA database user but a Linux user on the HANA server. Are you sure you are using this for the HANA login? Have you tried using the SYSTEM user?

Either way, check the user privileges in SAP HANA Studio: He should have the system privileges IMPORT and INSERT.

Upvotes: 0

Related Questions