You are on page 1of 12

SAP HANA FREQUENTLY ASKED INTERVIEW

QUESTIONS
1.What are the different types of replication techniques?
1.ETL based replication using BODS
2.Trigger based replication using SLT
3.Extractor based data acquisition using DXC
4. SDI
2.What is SLT?
SLT stands for SAP Landscape Transformation which is a trigger based replication.
SLT replication server is the replication technology to pass data from source
system to the target system. The source can be either SAP or non-SAP. Target
system is SAP HANA system which contains HANA database.
3.Is it possible to load and replicate data from one source system to
multiple target database schemas of HANA system?
Yes. It is possible for up to 4.
4.Is it possible to specify the type of data load and replication?
Yes either in real time, or scheduled by time or by interval.
5.What is Configuration in SLT?
The information to create the connection between the source system, SLT
system, and the SAP HANA system is specified within the SLT system as a
Configuration. You can define a new configuration in Configuration & Monitoring
Dashboard (transaction LTR).
6.Is there any pre-requisite before creating the configuration and
replication?
For the SAP source systems DMIS add-on is installed in SLT replication server.
User for RFC connection has the role IUUC_REPL_REMOTE assigned but not DDIC.
For non-SAP source systems DMIS add-on is not required and grant a database
user sufficient authorization for data replication.
7.What is Configuration and Monitoring Dashboard?
It is an application that runs on SLT replication server to specify configuration
information (such as source system, target system, and relevant connections) so
that data can be replicated. It can also use it to monitor the replication status
(transaction LTR).
Status Yellow: It may occur due to triggers which are not yet created successfully.
Status Red: It may occur if master job is aborted (manually in transaction SM37).
8.What is advanced replication settings?

A transaction that runs on SLT replication server to specify advanced replication


settings like
Modifying target table structures,
Specifying performance optimization settings
Define transformation rules
9.What is Latency?
It is the length of time to replicate data (a table entry) from the source system to
the target system.
10.What is logging table?
A table in the source system that records any changes to a table that is being
replicated. This ensures that SLT replication server can replicate these changes
to the target system.
11.What are Transformation rules?
A rule specified in the Advanced Replication settings transaction for source tables
such that data is transformed during the replication process. Example you can
specify rule to
Convert fields
Fill empty fields
Skip records
12.What happens when you set-up a new configuration?
The database connection is automatically created along with GUID and Mass
transfer id (MT_ID).
A schema GUID ensures that configurations with the same schema name can be
created.
The Mass transfer ID is used in the naming of SLT jobs and the system can
uniquely identify a schema.

13.What factors influence the change/increase the number of jobs?


Number of configurations managed by the SLT replication server
Number of tables to be loaded/replicated for each configuration
Expected speed of initial load
Expected replication latency time. As a rule of thumb, one BDG job should be
used for each 10 tables in replication to achieve acceptable latency times.
14.When to change the number of Data Transfer jobs?
If the speed of the initial load/replication latency time is not satisfactory
If SLT replication server has more resources than initially available, we can
increase the number of data transfer and/or initial load jobs
After the completion of the initial load, we may want to reduce the number of
initial load jobs

15.What are the jobs involved in replication process?


1. Master Job (IUUC_MONITOR_<MT_ID>)
2. Master Controlling Job (IUUC_REPLIC_CNTR_<MT_ID>)
3. Data Load Job (DTL_MT_DATA_LOAD_<MT_ID>_<2digits>)
4.Migration Object Definition Job (IUUC_DEF_MIG_OBJ_<2digits>)
5.Access Plan Calculation Job (ACC_PLAN_CALC_<MT_ID>_<2digits>)
16.What is the relation between the number of data transfer jobs in the
configuration settings and the available BGD work processes?
Each job occupies 1 BGD work processes in SLT replication server. For each
configuration, the parameter Data Transfer Jobs restricts the maximum number
of data load job for each mass transfer ID (MT_ID).
A mass transfer ID requires at least 4 background jobs to be available:
One master job
One master controller job
At least one data load job
One additional job either for migration/access plan calculation/to change
configuration settings in Configuration and Monitoring Dashboard.
17.If you set the parameter data transfer jobs to 04 in a configuration
SCHEMA1, a mass transfer ID 001 is assigned. Then what jobs should
be in the system?
1 Master job (IUUC_MONITOR_SCHEMA1)
1 Master Controller job (IUUC_REPL_CNTR_001_0001)
At most 4 parallel jobs for MT_ID 001 (DTL_MT_DATA_LOAD_001_
01/~02/~03/~04)
Performance: If lots of tables are selected for load / replication at the same time,
it may happen that there are not enough background jobs available to start the
load procedure for all tables immediately. In this case you can increase the
number of initial load jobs, otherwise tables will be handled sequentially.
For tables with large volume of data, you can use the transaction Advanced
Replication Settings (IUUC_REPL_CONT) to further optimize the load and
replication procedure for dedicated tables.
18.What happens after the SLT replication is over?
The SLT replication server creates 1 user, 4 roles, 2 stored procedures and 8
tables.
1 User
1 Privilege
4 Roles
<REPLICATION SCHEMA>_DATA_PROV
<REPLICATION_SCHEMA>_POWER_USER
<REPLICATION_SCHEMA>_USER_ADMIN
<REPLICATION_SCHEMA>_SELECT

2 Stored procedures
RS_GRANT_ACCESS, RS_REVOKE_ACCESS
8 Tables
DD02L, DD02T, RS_LOG_FILES, RS_MESSAGES, RS_ORDER, RS_ORDER_EXT,
RS_SCHEMA_MAP, RS_STATUS

19.What are the different replication scenarios?


Load, Replicate, Stop, Suspend and Resume.
Before you select any application table, the initial load of the tables DD02L,
DD02T & DD08L must be completed as they contain the metadata information.
Load: Starts an initial load of replication data from the source system. The
procedure is a one-time event. After it is completed, further changes to the
source system database will not be replicated.
For the initial load procedure, neither database triggers nor logging tables are
created in the source system. Default settings use reading type 3 (DB_SETGET)
with up to 3 background jobs in parallel to load tables in parallel or subsequently
into the HANA system.
Replicate: Combines an initial load procedure and the subsequent replication
procedure (real time or scheduled).
Before the initial load procedure will start, database trigger and related logging
table are created for each table in the source system as well as in SLT replication
server.
Stop Replication: Stops any current load or replication process of a table.
The stop function will remove the database trigger and related logging tables
completely. Only use this function if you do want to continue a selected table
otherwise you must initially load the table again to ensure data consistency.
Suspend: Pauses a table from a running replication. The database trigger will not
be deleted from the source system. The recording of changes will continue and
related information is stored in the related logging tables in the source system.
If you suspend tables for a long time the size of logging tables may increase and
adjust the table space if required.
Resume: Restarts the application for a suspended table. The previous suspended
replication will be resumed (no new initial load required).
20.What happens if the replication is suspended for a long period of
time or system outage of SLT or HANA system?
The size of the logging tables increases.

21.How to avoid unnecessary logging information from being stored?


Pause the replication by stopping the schema-related jobs.
22.Will the table size in SAP HANA database and in the source system
the same?
No as HANA database supports compression.
23.When to go for table partitioning?
If the table size in HANA database exceeds 2 billion records, split the table by
using portioning features by using Advanced replication settings (transaction
IUUC_REPL_CONT, tab page IUUC_REPL_TABSTG).
24.Where do you define transformation rules?
By using Advanced replication settings (transaction IUUC_REPL_CONT, tab page
IUUC ASS RULE MAP)
25.Are there any special considerations if the source system is non-SAP
system?
The concept of trigger-based replication is actually meant for SAP source
systems. The main differences are:
There will be a database connection between non-SAP source and SLT system
instead of RFC.
Source must have primary key
Tables DD02L, DD02T which contains metadata are just initially loaded but not
replicated.
The read modules reside on SLT system.
Tables with database specific formats may need transformation rules before they
are replicated.
Only SAP supported databases (with respective DBSL for SAP Net Weaver 7.02)
are supported as non-SAP source systems.
26.What are the potential issues in the creation of configuration?
Missing add-on DMIS_2010 in source system
Missing the proper role of SAP_IUUC_REPL_REMOTE for RFC user
( SAP_IUUC_USER for SLT system )
Logon credentials are not correct
27. How can you ensure that data is consistent in source system and
HANA system?
Since any changes in the source system is tracked in dedicated logging tables,
the replication status for each changed data record is transparent. A entry of
logging table is deleted after a successful commit statement from HANA
database and this procedure ensures the data consistency between source
system and HANA system.
28. Does SLT for SAP HANA support data compression like SAP HANA

database?
Yes, this is automatically covered by the RFC connection used for data replication
from the SAP source system.

Questions on limits
29. Maximum number of tables in a schema?
131072

30. What can be the maximum table name length?


127 characters
31. What can be the maximum column name length?
127 characters
32 .What can be the maximum number of columns in a table?
1000
33. What can be the maximum number of columns in a view?
1000
34. What can be the maximum number of partitions of a column table?
1000
35. What can be the maximum number of rows in each table?
Limited by storage size RS: 1TB/sizeof(row)
CS: 2^31 * number of partitions
36. In which table you can get the current system limits?
M_SYSTEM_LIMITS
37. Maximum number of jobs you can view the information in the
Current tab of Job log?
5

Questions on SQLScript
38. What is SQLScript?
It is a set of SQL extensions for SAP HANA database which allow developers to
push data intensive logic into the database.
39. When should be SQLScript used?
It should be used in cases where other modeling constructs of HANA such as
Attribute views or Analytic views are not sufficient.
40. Explain how SQLScript procedure is processed in HANA database?
When a user creates a new procedure, the HANA database query compiler first:
Parse the statements
Check the statement semantic correctness

Optimize the code for Declarative and Imperative logic


Code generation creates Calculation models for Declarative logic and L nodes for
Imperative logic
Compiled procedure creates Content in the database Catalog and in Repository.
41. What happens when you compile the procedure?
During compilation, the call to the procedure is rewritten for processing by the
calculation engine.
42. What happens when you execute the procedure?
It binds the actual parameters to the calculation models generated in the
definition phase.
43. What are the data types supported in SQLScript?
SQLScript allows the definitions of table types and also supports primitive data
types such as Integer, Decimal(p,q), Varchar, Blob, Timestamp, etc.
44. What is a table type?
Table types are used to define parameters for a procedure that represent tabular
results.
Example:
CREATE TYPE tt_publishers AS TABLE ( publisher INTEGER, name VARCHAR(50),
price DECIMAL, cnt INTEGER);
CREATE TYPE tt_years AS TABLE ( year VARCHAR(4), price DECIMAL, cnt
INTEGER);
45. What is the general syntax used in creating procedure?
CREATE PROCEDURE <proc_name> [(<parameter_clause>)]
[LANGUAGE <lang>] [SQL SECURITY <mode>]
[READS SQL DATA [WITH RESULT VIEW <view_name>]] AS
<local_scalar_variables>
BEGIN <procedure_code> END
46. How to recompile a procedure?
ALTER PROCEDURE proc_name RECOMPILE [WITH PLAN]
47. Can you specify a default value while creating procedure? Is there
any change while calling the procedure?
CREATE PROCEDURE my_proc (IN P1 INT,
IN P2 INT DEFAULT 1,
OUT out1 DUMMY) AS
BEGIN
out1 = SELECT :P1 + :P2 AS DUMMY FROM DUMMY;
END;
While calling the procedure, we need to pass 'Named Parameters' with token
(=>).
CALL my_proc (P1 => 3, out1 => ?)

If you want to specify all the input fields then call statement would be:
CALL my_proc (3, 4, ?)
48. What is the purpose of procedure 'Call... With Overview' option?
To write the results of a procedure call directly into a physical table.
CALL my_proc (3, 4, NULL) WITH OVERVIEW;
49. What is the purpose of procedure 'Call.....In Debug Mode' option?
It creates the additional debug information during the execution of the
procedure. This type of call has additional runtime overhead hence should be
used for debugging purposes only.
CALL my_proc (3, 4, NULL) IN DEBUG MODE;
50. What is Table variable?
These are variables with table type which are bound to the value of a physical
table, SQL query or a calculation engine plan operator. Table variables are bound
using equality operator.
51. What is a scalar variable?
We define scalar variable as IN, OUT, or INOUT and can be referenced anywhere
in a procedure.
lt_expensive_books = SELECT title, price, crcy FROM :it_books
WHERE price > :minPrice AND crcy = :currency;
In above assignment, the variable lt_expensive_books is bound. Variable
:it_books refers to an IN parameter of a Table type. :minPrice and :currency refer
to IN parameter of a scalar type.
52. What is CE plan operator? What are the different categories?
CE plan operator does the data transformation functionality internally and used
in definition of functions. It is an alternate to using SQL statements.
Data Source Access operators that bind a column table or a column view to a
table variable. (CE_COLUMN_TABLE, CE_JOIN_VIEW, CE_OLAP_VIEW,
CE_CALC_VIEW)
Relational operators that allow a user to bypass the SQL processor during
evaluation and directly executed in the calculation engine.
(CE_JOIN, CE_LEFT_OUTER_JOIN, CE_RIGHT_OUTER_JOIN,
CE_PROJECTION,CE_CALC, CE_AGGREGATION, CE_UNION_ALL)
Special extensions implement, e.g., crucial business functions inside the
database kernel.
(CE_VERTICAL_UNION, CE_CONVERSION)
53. What is CE_COLUMN_TABLE operator?
It provides access to an existing column table. It takes the name of the table and
returns its content bound to a variable.
Example:
ot_books1 = CE_COLUMN_TABLE (BOOKS);

ot_books2 = CE_COLUMN_TABLE (BOOKS, [TITLE, PRICE, CRCY]);


This example only works on a column table and does not invoke the SQL
processor. It is semantically equivalent to the following:
ot_books3 = SELECT * FROM books;
ot_books4 = SELECT title, price, crcy FROM books;
The function that provide data source access does not allow renaming of
attributes.
54. What is CE_JOIN_VIEW operator?
It return results for an existing join view (also known as Attribute view). It takes
the name of join view and optional list of attributes as parameters.
Example:
out = CE_JOIN_VIEW (PRODUCT_SALES, [PRODUCT_KEY, PRODUCT_TEXT,
SALES]);
55. What is CE_OLAP_VIEW operator?
It return results for an existing OLAP view (also known as Analytical view). It
takes the name of OLAP view and an optional list of key figures and dimensions
as parameters. The OLAP view is grouped by dimensions and the key figures are
aggregated using the default aggregation of the OLAP view.
Example:
out = CE_OLAP_VIEW (OLAP_view,[Dim1, kf]);
Is equivalent to
out = SELECT dim1, SUM(kf) FROM OLAP_view GROUP BY dim1;
56. What is CE_CALC_VIEW operator?
It returns results for an existing calculation view. It takes the name of the
calculation view and optionally a projection list of attribute names.
Example:
out = CE_CALC_VIEW (CALC_view, [CID, CNAME]);
Is equivalent to
out = SELECT cid, cname FROM CALC_view;
57. What is CE_JOIN operator?
It calculates a inner join of the given pair of tables on a list of join attributes.
Each pair of join attributes must have identical attribute names else one of
them must be renamed prior to the join.
Example:
ot_pubs_books1 = CE_JOIN (:lt_pubs, :it_books, [PUBLISHER]);
ot_pubs_books2 = CE_JOIN (:lt_pubs, :it_books, [PUBLISHER], [TITLE, NAME,
PUBLISHER, YEAR]);

Is equivalent to
ot_pubs_books3 = SELECT P.publisher as publisher, name, street, post_code,
city,
country, isbn, title, edition, year, price, crcy
FROM :lt_pubs AS P, :it_books as B
WHERE P.publisher = B.publisher;
ot_pubs_books4 = SELECT title, name, P.publisher as publisher, year
FROM :lt_pubs AS P, :it_books AS B
WHERE P.publisher = B.publisher;
58. What is CE_LEFT_OUTER_JOIN operator?
It calculates the left outer join. Besides the function name the syntax is same as
CE_JOIN.
59. What is CE_RIGHT_OUTER_JOIN operator?
It calculates the right outer join. Besides the function name the syntax is same
as CE_JOIN.
60. What is CE_PROJECTION operator?
It restricts the columns in the table variable and optionally renames columns,
computes expression, or applies a filter.
Example:
ot_books1 = CE_PROJECTION(:it_books, [TITLE, PRICE, CRCY AS
CURRENCY], 'PRICE > 50');
Is equivalent to
ot_books2 = SELECT title, price, crcy AS currency
FROM :it_books WHERE price > 50;
61. What is CE_CALC operator?
It evaluates an expression and then bound to a new column
Example:
with_tax = CE_PROJECTION(:product, [CID, CNAME, OID, SALES,
CE_CALC('SALES * :vat_rate',
decimal(10,2)) AS SALES_VAT],
''CNAME = ':cname''');
Is equivalent to
with_tax2 = SELECT cid, cname, oid, sales, sales * :vat_rate AS sales_vat
FROM :product
WHERE cname = ':cname';
All columns used in CE_CALC have to be included in the projection list. Another
frequent use of CE_CALC is computing row numbers.
CE_CALC('rownum()', integer) AS "RANK"

62. What is CE_AGGREGATION operator?


It groups the input and computes aggregates for each group.
Supported aggregate functions are count(column), sum(column),
max(column), min(column).
Use sum(column)/count(column) to compute the average.
Example:
ot_books1 = CE_AGGREGATION(:it_books, [COUNT (PUBLISHER) AS CNT],
[YEAR]);
Is equivalent to
ot_books2 = SELECT COUNT (publisher) as cnt, year FROM :it_books GROUP BY
year;
63. What is CE_UNION_ALL operator?
It computes the union of two tables which need to have identical schemas.
Example:
ot_all_books1 = CE_UNION_ALL (:lt_books, :it_audit_books);
Is equivalent to
ot_all_books2 = SELECT * FROM :lt_books
UNION ALL
SELECT * FROM :it_audit_books;
64. What is special operator?
CE_VERTICAL_UNION and CE_CONVERSION are the special operators which do
not have any immediate SQL equivalent.
65. What operator is used to debug SQLScript procedures?
TRACE operaor. It traces the tabular data passed as its argument into a local
temporary table and return its input unmodified. The names of the temporary
tables can be retrieved from the SYS.SQLSCRIPT_TRACE view.
Example: out = TRACE (:input);
66. How to set-up tracing?
From the Administration perspective, navigate to tab Trace Configuration . In
order to change settings, you need to have system privileges TRACE ADMIN
and INFILE ADMIN.
67. What is the difference between BREAK and CONTINUE?
Break means loop should stop processing, CONTINUE means loop should stop
processing the current iteration and immediately start processing the next
iteration.

You might also like