HOWTO – Import SFLIGHT sample data into SAP HANA from a local computer
Out of the box, SAP HANA does not include any sample data. When getting familiar with and learning the platform, it’s often useful to have some to play around with as you get a feel for HANA before beginning some real work with it.
SAP provides a free data model focused on flight data for anyone to use. You can download the data here: https://github.com/SAP/hana-xsa-opensap-hana7/raw/snippets_2.3.2/ex2/sflight_hana.tar.gz
Below, I’ll be walking you through the steps on how to import the data into HANA from your local machine.
- Make note of where your downloaded archive is. You’ll need to know this to find it later.
- On the SAP Web IDE for SAP HANA, open the Database Explorer view. If you haven’t already, connect to the database you wish to import the data into. Press the Add button to do so.
- Add a new database connection by filling out the required fields as appropriate for your database. The only difference for a tenant on a multi-tenant database is the need to specify which tenant you wish to connect to.
- After selecting your newly connected database, right-click on the Catalog folder and select Import Catalog Objects
- From your local machine, click Browse to navigate to where you downloaded the flight data. After a few moments, the file should be uploaded, and you can select all Catalog Objects within it to import by checking the box at the top of the table. Once you have, you can click.
- It will take another few moments for the data to be imported into HANA. After, you should be able to expand the database and click Tables to view all the newly imported table schema. Right-click on one of them like SFLIGHT and select Open Data to view it all.
Congrats! You’ve now added a wealth of data to your HANA instance and are ready to explore and learn with it. Once you have some substance to work with, it’ll be much easier to experiment with all the functionality that HANA has to offer — enjoy!
Much needed thanks for sharing
I got stuck on step 2 as I don’t see the icon for adding database connections:
P.S. I'm all set as Thomas Jung has provided the next step here: https://blogs.sap.com/2018/09/13/build-database-objectsservices-in-hana-service-using-sap-webide-full-stack-part-1/
I think you had to set up a SAP HANA Instance like this https://developers.sap.com/topics/sap-hana-express.html#flowchart
If you decide to set up HANA on Google drive you can use a google Voucher about 350 €.
Elswere you can download the express edition or use Amazon Cloud.
I am getting this error "An error occurred while performing a catalog import (dberror) insufficient privilege: Not authorized"-
Can you please help which roles/ authorization objects are required for this?
I am also getting same error when trying to import to HANA SPS02 system.
I was having the same issue until I found out that my connection with the database was set with the XSA_ADMIN user. I switched to the SYSTEM user, that for me had the same password as the XSA_ADMIN and it worked.
I added as the system user and it went fine
Jim Varrati can you please explain how you added as technical user? I am still facing the issue...It would be really appreciated if you can provide steps to add as technical user.
Thanks in advance 🙂
This is what worked for me, the older courses they were using just the privileges now they are using a role so first make sure you install the SFLIGHT in the systemdb not the HXE then using Hana client open SQL console for the sflight schema ( you can use the hana cockpit sql tool as well just make sure you are connected to sflight) then create the user and role for the exercise by executing the following statements one at a time. change the password below with what you want to use and remember because you will need to enter this when you create the service it asks for user and password. if you are using hanaexpress I believe I used 39015.
CREATE USER CUPS_SFLIGHT PASSWORD "<Password>" SET PARAMETER CLIENT = '001';
ALTER USER CUPS_SFLIGHT DISABLE PASSWORD LIFETIME;
GRANT SELECT ON SCHEMA SFLIGHT TO CUPS_SFLIGHT WITH GRANT OPTION;
GRANT SELECT METADATA ON SCHEMA SFLIGHT to CUPS_SFLIGHT WITH GRANT OPTION;
CREATE ROLE SFLIGHT_CONTAINER_ACCESS;
GRANT SELECT, SELECT METADATA ON SCHEMA SFLIGHT TO SFLIGHT_CONTAINER_ACCESS WITH GRANT OPTION;
GRANT SFLIGHT_CONTAINER_ACCESS TO CUPS_SFLIGHT WITH ADMIN OPTION;
good luck let me know how you made out 😉
I tried following your steps, but i not able to see any objects.
I have executed all SQL statements one by one without any errors.
is there something I have missed? I'm logged on as XSA_ADMIN in WebIDE.
When you say you don't see any objects is that when you are browsing for tables in the synonym? you have the service check box checked? if that is the case then either the port is wrong or SFLIGHT is installed in the other DB, HXE or SYSTEM HanaExpress has both. If your still stuck tonight when I go home I will look at the exact port.
Sorry for the late reply!
When i got home again problem has been solved 🙂
Awesome! Code on!!
Hi All ,
I am new on WEBIDE
I got same screen as step 3 but unable to proper host name .
help to get host name of web IDE .
Thanks in Ad.
Thanks for Sharing..
I successfully added SFLIGHT using your blog and was able to see this addition in WebIDE. But I can’t see the new tables when I log into HANA using Eclipse. To add tables to Eclipse, I used this blog – https://blogs.sap.com/2013/05/16/howto-import-sflight-sample-data-into-hana-from-a-local-computer/
How do I sync the Database Explorer with Eclipse or vice versa?
Got it. A trivial error.
I used the wrong database. In Eclipse I added the database as Multi Tenant and was using its System database. While in Database Explorer, I added it as Single Tenant.
So, one should use the same databases (Multi Tenant (SYSTEM)) at both the places.