SapHanaTutorial.Com HOME     Learning-Materials Interview-Q&A Certifications Quiz Online-Courses Forum Jobs Trendz FAQs  
     Explore The World of Hana With Us     
About Us
Contact Us
 Apps
X
HANA App
>>>
Hadoop App
>>>
Tutorial App on SAP HANA
This app is an All-In-One package to provide everything to HANA Lovers.

It contains
1. Courses on SAP HANA - Basics, Modeling and Administration
2. Multiple Quizzes on Overview, Modelling, Architeture, and Administration
3. Most popular articles on SAP HANA
4. Series of Interview questions to brushup your HANA skills
Tutorial App on Hadoop
This app is an All-In-One package to provide everything to Hadoop Lovers.

It contains
1. Courses on Hadoop - Basics and Advanced
2. Multiple Quizzes on Basics, MapReduce and HDFS
3. Most popular articles on Hadoop
4. Series of Interview questions to brushup your skills
Apps
HANA App
Hadoop App
';
Search
Stay Connected
Search Topics
Topic Index
+
-
XSA Overview
+
-
XS Overview
+
-
Hello World Example
+
-
XS OData Service
+
-
HANA XSJS Service
+
-
Core Data Service
+
-
Others

Create Schema using hdbschema file

In this article we will learn - How to define a design-time schema and maintain the schema definition in the repository.

Introduction:

SAP HANA XS enables you to create database schema as a design-time files in the repository. This is achieved with the help .hdbschema file.
For example a file MySchema.hdbschema will create a database schema MY_SCHEMA when activated.

SAP HANA hdbschema

Now let us see the steps to create a schema using hdbschema file in details.

Prerequisite:


Steps to create a schema using hdbschema file:

  1. Create a XS project as mentioned in the article Create Your First HANA XS Application using HANA Studio
  2. Right click and select  New à Other à SAP HANA à Database Development à Schema.

SAP HANA hdbschema


  1. Specify file name as “MySchema”.
  2. Copy the below code and paste it in the file.

schema_name = "MY_SCHEMA";

  1. Right click and select Team à Activate. This will activate the file.

SAP HANA hdbschema

  1. Check in Catalog that the schema “MY_SCHEMA” is created.

SAP HANA hdbschema

Done!! You have successfully created schema using hdbschema file.


The Schema “MY_SCHEMA” is not visible in Catalog. What’s went wrong?

If you open the Catalog, you may not see the schema “MY_SCHEMA” created via hdbschema file.

Reason:
After activation in the repository, the schema object is only visible in the catalog to the _SYS_REPO user. To enable other users, for example the schema owner, to view the newly created schema, you must grant the user the required SELECT privilege.

Grant SELECT privileges on the new schema to you user:
To get access to the Schema, open SQL Console and call below procedure:
call _SYS_REPO.GRANT_SCHEMA_PRIVILEGE_ON_ACTIVATED_CONTENT(
                'select, create any, insert, delete, update, execute, alter, drop',
                '<SCHEMA_NAME>',
                '<USER_NAME>');
<SCHEMA_NAME> is the name of the newly activated schema, and <USER_NAME> is the database user you want to give access to.

Continue reading:



Support us by sharing this article.



Explore More
Close X
Close X

Leave a Reply

Your email address will not be published. Required fields are marked *

Current day month ye@r *

 © 2017 : saphanatutorial.com, All rights reserved.  Privacy Policy