Sunday 11 December 2022

SAP HANA memory consumption

1. Resident memory:


Physical memorythe actual RAM of the system attached on the motherboard.



To check the total physical number in SAP HANA:
----------------------------------------------------------------------------------------------------------------

DO BEGIN


DECLARE V_INSTANCE_NAME varchar(20);


select t1.VALUE into V_INSTANCE_NAME from  "SYS"."M_SYSTEM_OVERVIEW" t1

where UPPER(t1.NAME) = 'INSTANCE ID';


select V_INSTANCE_NAME as Instance_id, 

       round((FREE_PHYSICAL_MEMORY + USED_PHYSICAL_MEMORY)/1024/1024/1024, 3) as "Total Physical memory resource GB size" 

from PUBLIC.M_HOST_RESOURCE_UTILIZATION;


END;


------------------------------------------------------------------------------------------------------

Resident memorythe real physical memory that processes utilize in the current state.



The below query give:


how much resident memory is used by the HANA database.


----------------------------------------------------------------------------------------------------------------

SELECT HOST,

ROUND(USED_PHYSICAL_MEMORY/1024/1024/1024, 2) AS "Resident GB", 

ROUND((USED_PHYSICAL_MEMORY + FREE_PHYSICAL_MEMORY)/1024/1024/1024, 2) AS "Physical Memory

GB"

FROM PUBLIC.M_HOST_RESOURCE_UTILIZATION


-------------------------------------------------------------------------------------------------------------------



*resident memory used outside HANA (OS, 3rd party processes) is typically quite small, not exceeding 2 GB.

in case, to check free physical RAM  size using current. Just to crosscheck any other process apart from SAP HANA is consuming more RAM.

the below Linux command, need to run at OS level:

--------------------------------------------------------------------------------------------------------------------

FREE_LINUX_MEMORY=`vmstat -s | grep "free memory" | awk '{print $1}'`

RESULT=`echo "scale=3; $FREE_LINUX_MEMORY / 1024 / 1024" | bc -l`

echo "Free physical memoy : $RESULT GB"


-------------------------------------------------------------------------------------------------------------------

* DBACockpit does currently not consider shared memory as part of the resident memory.


Case -2:

2.If processes outside the database are not contributing significantly to memory usage, 2 cases have to be distinguished in general: 

1. An 'out of memory' error has already occurred.  - https://launchpad.support.sap.com/#/notes/1984422


What is OOM:

The memory requirements of SAP HANA exceed the available memory resources or a configured memory limit. When SAP HANA requires additional memory and is not able to allocate new memory or reclaim memory otherwise, an out-of memory (OOM) dump is generated and the action is terminated.

* By default OOM dump is written once in 24HR.

*you may modify the parameter oom_dump_time_delta . 


Major reasons for causing OOM:

* Expensive queries materializing results,

*too many/too large loaded tables,

*too large internal structures/system caches,

*blocked garbage collection by long-running cursors.

* too many sessions, connections, transactions, statements running.

HOW to access OOM file?

1) Go to Administration -> Diagnosis Files;

 2) Search for the Key word - OOM.

3) Consider index server file first.

4)Double click on the file.

5) Show Entire File - option need to select.


How to resolve OOM?

If multiple OOM dump files are generated you should start with analyzing the index server dump file, because in most cases the index server is responsible for the highest memory consumption.

* If you use the Diagnosis Files tab in SAP HANA Studio you have to make sure that the complete file is displayed (“Show Entire File”), otherwise some information can be missing.

The dump file typically contains the following sections that contain useful information for analyzing OOM issues:

[BUILD]        Build information
[THREADS]      Running threads
[STACK_SHORT]  Short call stacks and pending exceptions of all threads
[PROCESS_INFO] Process information
[OS_MEMORY]    Operating system information about memory
[MEMORY_OOM]   Information about current out of memory situation
[STAT]         Statistical data



Key points:
* time stamp of OOM error.

* version number.

* search for the key word - failed to allocate.

* current callstack - is the cause for OOM.

global_allocation_limit - 

* Top allocators 

     inclusive_size_in use - including of all sub allocators
     exclusive size in use -  including of only main allocators     of the heap memory.


Generally 3 kinds of situations in OOM:

1. GAL is less  then required  memory - need to Analysis - * if the table is row table, can convert in to column store table.
* Check the size of table.
* Table 
partition.

* all other possibilities to increase the performance of access the table.

* At last, we can consider to increase the size of RAM.

2.if GAL  is 1000GB

    memory required - 975GB

    failed to allocate - 25GB


* there is high probability to avoid the OOM in the next occurance.
* Can ignore the OOM in this case.

3. IF some cases, even though the size of GAL is more then the size of required memory size.

in this case also, OOM will created - 

GAL - 1000GB
failed to allocate - 0GB


Analysis - check all the OOM occurred at the same time.
               - in other case, if the above case is not cause. Then due to the case of previous SQL queries are not been removed from the memory.


-----------------------------------------------------------------------------------------------------------------

1. Login into the tenant database where the alert got triggered.                                                
2. Check the pool size on the tenant.                                                                                          
3. Communicate to DBA on the approval for SQL plan cache clearing                                     
4. Execute the below on the tenant after DBA approval :                                                           

ALTER SYSTEM CLEAR SQL PLAN CACHE
ALTER SYSTEM CLEAR METADATA CACHE

---------------------------------------------------------------------------------------------------------------

                                                                     
Case 3

2.An 'out of memory' error was not yet triggered, but further investigation on the current memory usage of the database might be required.



1) Go to Administration -> Diagnosis Files;

2) Select "Diagnosis Information -> Collect...";

3) Set the option 'Create and collect one or multiple sets of runtime environment (RTE) dump file(s)';

4) Set the hosts, amount of samples (sets) and frenquency on which the runtime dumps will be recorded;

5) Finish.


More info - 1813020 - How to generate a runtime dump on SAP HANA.


case 4: 

Top down approach:

Which HANA process on which host is using most of the memory?



SELECT TOP 3 HOST, PORT, SERVICE_NAME, TOTAL_MEMORY_USED_SIZE

FROM M_SERVICE_MEMORY

ORDER BY TOTAL_MEMORY_USED_SIZE DESC


Case 5:

So far, the sum of used heap and shared memory has been determined. Now, this total has to be split.





Memory that can be accessed by different processes, e.g.:

  • Specific row store components (tables, catalog, free)
  • Nameserver topology

SELECT TOP 3 HOST, PORT, SERVICE_NAME, HEAP_MEMORY_USED_SIZE, SHARED_MEMORY_USED_SIZE,

TOTAL_MEMORY_USED_SIZE

FROM M_SERVICE_MEMORY

ORDER BY SHARED_MEMORY_USED_SIZE DESC



CASE 6:    Trace file approach                                                                                       The first part of this section lists the local (heap) memory the processes that make up the HANA database are currently using:
[0] PID=34884, SId=42309944, compactors active, alive, process name: hdbnameserver
AB=2220466176b (2.06gb), UA=0b, U=2015851859b (1.87gb), FSL=0b, PAL=487738426982b (454.24gb), TPAL=2220466176b (2.06gb), W=100

[1] PID=35049, SId=42310545, compactors active, alive, process name: hdbpreprocessor
AB=365772800b (348.82mb), UA=0b, U=362430594b (345.64mb), FSL=0b, PAL=487738426982b (454.24gb), TPAL=365772800b (348.82mb), W=100

[3] PID=35094, SId=42310846, compactors active, alive, process name: hdbstatisticsse
AB=17623138051b (16.41gb), UA=0b, U=14624613181b (13.62gb), FSL=268435456b (256mb), PAL=27096579276b (25.23gb), TPAL=17757355779b (16.53gb), W=100

[4] PID=35114, SId=42310947, compactors active, alive, process name: hdbxsengine
AB=2270855168b (2.11gb), UA=0b, U=2136436039b (1.98gb), FSL=0b, PAL=487738426982b (454.24gb), TPAL=2270855168b (2.11gb), W=100

[5] PID=33976, SId=171197412, compactors active, alive, process name: hdbindexserver
AB=240495694077b (223.97gb), UA=0b, U=260528715346b (242.63gb), FSL=0b, PAL=487738426982b (454.24gb), TPAL=270062153728b (251.51gb), W=100

For each process, the allocation limit (PAL),
the amount of memory currently allocated (AB)
used (U)

It might be the case that the request was that large that it was anyway impossible to fulfill it:

[MEMORY_OOM]  Information about current out of memory situation: 
OUT OF MEMORY occurred.
Failed to allocate 2405843009873693952 byte.

 A known issue regarding such large request is solved with revision 50. In case this occurs in newer revisions, please contact SAP Support.


CASE 7:

-----------------------------------------------------------------------------------------------------------------------------------

Change the Global Memory Allocation Limit

The SAP HANA database preallocates a pool of memory from the operating system over time, up to a predefined global allocation limit. You can change the default global allocation limit in the global.ini configuration file. SAP HANA One is pre-configured with 60.5 GB of memory in global_allocation_limit.

Prerequisites

You have the system privilege INIFILE ADMIN.

Context

The global_allocation_limit parameter is used to limit the amount of memory that can be used by the database. The value is the maximum allocation limit in MB. A missing entry or a value of 0 results in the system using the default settings. The global allocation limit is calculated by default as follows: 90% of the first 64 GB of available physical memory on the host plus 97% of each further GB. Or, in the case of small physical memory, physical memory minus 1 GB.

Procedure

  1. In the Administration editor, choose the Configuration tab.
    The configuration files that contain the configuration information for the system are displayed.
  2. Expand the global.ini configuration file and then the memorymanager section.
  3. In the context menu for the global_allocation_limit parameter, choose Change...
    The Change Configuration Value dialog box appears.
  4. Enter a value for the entire system and/or individual hosts.
-----------------------------------------------------------------------------------------------------------------------------

Case 8:

The results of shared memory creation can then be viewed on OS level using the ipcs command.

1. Get the process pid: ps -ef | grep 
2. ipcs -p | grep then displays all segments that were created by this particular process: 
ipcs -p | grep 4221 
86999065 hanadm 4221 4221 
87064602 hanadm 4221 4221 
87130139 hanadm 4221 4221 
87195676 hanadm 4221 4221 
87261213 hanadm 4221 4221 
87359519 hanadm 4221 4221 
88309819 hanadm 4221 4221 
88375356 hanadm 4221 4221 
88440894 hanadm 4221 4221 

3. The size of a particular segment can then be further examined using the command  ipcs -m -i  <id>

 ipcs -m -i 86999065 
Shared memory Segment shmid=86999065 
uid=60000 gid=100 cuid=60000 cgid=100 
mode=01600 access_perms=0600 
bytes=8929752 lpid=4221 cpid=4221 nattch=1 
att_time=Tue May 14 14:09:13 2013 
det_time=Tue May 14 14:09:13 2013 
change_time=Tue May 14 14:09:13 2013 

The sum of all those shared memory segments is then equivalent to the output of the statement:

SELECT SHARED_MEMORY_ALLOCATED_SIZE FROM M_SERVICE_MEMORY WHERE PROCESS_ID = '4221' 

Case 9: Row store reorganization



1813245 - SAP HANA Row Store Reorganization

Reason:

Row store grows by allocating a 64MB memory segments and shrinks by freeing empty segments.A segment is internally divided into fixed-size pages.
When a row store table requires more memory to store records, the table takes a free page from existing segments. If no segment has a free page, a new segment is allocated.

Deleting a large number of records may result in a number of sparse segments. In such a case, row store reorganization can be performed for memory compaction.
The pages in sparse segments are moved to other segments and the resultant empty segments are freed.




When to reorganize the row store

Row store reorganization is recommended, if the allocated row store table size is > 10GB and free page ratio is > 30%.

SELECT HOST, PORT, CASE WHEN (((SUM(FREE_SIZE) / SUM(ALLOCATED_SIZE)) > 0.30) AND SUM(ALLOCATED_SIZE) > TO_DECIMAL(10)*1024*1024*1024) THEN 'TRUE' ELSE 'FALSE' END "Row store Reorganization Recommended", TO_DECIMAL( SUM(FREE_SIZE)*100 / SUM(ALLOCATED_SIZE), 10,2) "Free Space Ratio in %",TO_DECIMAL( SUM(ALLOCATED_SIZE)/1048576, 10, 2) "Allocated Size in MB",TO_DECIMAL( SUM(FREE_SIZE)/1048576, 10, 2) "Free Size in MB" FROM M_RS_MEMORY WHERE ( CATEGORY = 'TABLE' ) and ( ALLOCATED_SIZE > 0 ) GROUP BY HOST, PORT;


in the result of above SQL command:

* Check ROW store Reorganization recommended column.
* Free space ratio  column 

need to consider.

If the result for Reorganization Recommended is TRUE, then row store memory can be reclaimed after row store reorganization.


How to estimate the amount of reclaimable memory

To estimate the maximum possible amount of memory that can be reclaimed, you can use below command:

SELECT HOST, PORT, FREE_SIZE/1024768 "Estimated Maximum Memory Saving in MB" FROM M_RS_MEMORY WHERE CATEGORY IN ('TABLE')



To below process will work for SAP HANA 2.0 >=SPS04:



  1. Online Row Store Reorganization v2
    1. Connect to the system
    2. Execute Online Row Store Reorganization using commands:
    • ALTER SYSTEM RECLAIM DATA SPACE

or

    • CALL REORGANIZE_ROWSTORE('REORGANIZE')

    1. To monitor the progress, check the check the monitoring view M_JOB_PROGRESS, check the Job Progress Tab in Performance Tab of the HANA Studio, or use the JobProgress in Show Statement Library in Cockpit.
    2. Check the indexserver trace files after row store reorganization is done. The trace of Online Row Store Reorganization is separately managed in indexserver_<hostname>.<port>.row_store_reorg.<sequence>.trc
      • [000000000000][0] 0000-00-00 00:00:00.000000 i RowStoreReor Executor.cc(00033) : ==== Reorganize started ====
      • [000000000000][0] 0000-00-00 00:00:00.000000 i RowStoreReor Executor.cc(00241) : Number of target segments: 0
      • [000000000000][0] 0000-00-00 00:00:00.000000 i RowStoreReor Executor.cc(00242) : Expected memory saving: 000 (MB)
      • [000000000000][0] 0000-00-00 00:00:00.000000 i RowStoreReor Executor.cc(00518) : PostReorg: emptied 0 segments

    1. Check the memory fragmentation status after reorganization using:
    • CALL REORGANIZE_ROWSTORE('DISPLAY_MEMORY_STATUS') 


For offline Row Store Reorganization:

please refer Snote - 
1813245

9.1

Indirectly, high memory usage of the row store can cause problems when parameter
client_distribution_mode is set to 'off' in distributed environments. When default value 'statement' is used, the statement is sent to the node where the table is located. With the setting 'off', the statement
might then also be directed to the master node. Since all row store tables are usually located on the
master node and consequently, the row store uses a lot of memory, materializing a large amount of
data on the master node (from a table that is actually located on another node) can then simply be too
much. Therefore, in case of problems with resolving internal and external hostnames, parameter
client_distribution_mode should not be turned off.

9.2: Too many large tables were created as row store tables. The largest tables currently contained in the row store can be retrieved by the following SQL Statement:


SELECT TOP 50 * FROM M_RS_TABLES ORDER BY (ALLOCATED_FIXED_PART_SIZE + ALLOCATED_VARIABLE_PART_SIZE) DESC


It is however important to keep in mind that in many scenarios, switching a table from rowstore to columnstore and vice versa must not be done. This applies to Suite on HANA / BW systems which are delivered with particular settings for different table types. At any case, it makes sense to check whether the system is currently adhering to the recommended configuration or not. SAP note 1659383 contains a list of tables that are supposed to be in the rowstore and a check that is based on this list is part of report RSDU_TABLE_CONSISTENCY. This report also contains a repair option when a deviation is recognized.

 
CASE: 10 - Heap memory analysis.

* In most cases, the process of interest is the index server, since it usually allocates the greatest share of the available memory. 



the below query is used to show inclusive size to exclusive size:

---------------------------------------------------------------------------------------------------------------------------------------------------
SELECT TOP 15 MS.HOST, MS.SERVICE_NAME,MH.CATEGORY, MH.INCLUSIVE_SIZE_IN_USE, MH.EXCLUSIVE_SIZE_IN_USE FROM M_HEAP_MEMORY MH, M_SERVICES MS WHERE MH.PORT = MS.PORT AND MH.HOST = MS.HOST AND MS.SERVICE_NAME = 'indexserver' ORDER BY 4 DESC

----------------------------------------------------------------------------------------------------------------------------------------------------


few case studies:

Pool/parallel/ihm There are cases where this allocator used 90% of the available memory. If such a problem is observed, the system should be upgraded to revision 54 when available. Pool/itab

This allocator is needed for the intermediate result of join operation and translation table used for join operation. This could indicate use of a suboptimal model.

Pool/FemsCompression/CompositeFemsCompressionPool/FemsCompression/CompositeFemsCompression 

A known issue is associated with high memory usage that is solved with revision 53. FEMS compression is used in BW systems to keep the size of the dataset that is transferred to the application server as small as possible. 

Pool/ValueArray 

This is the allocator which keeps the complete resultset in uncompressed form. A known issue has been solved with revision 55 which addresses memory used by this allocator not released after oom situations, thus steadily increasing over time. The details are documented in SAP note 1852425. 

Pool/JoinEvaluator/TranslationTable 

Translation tables are created for caching join column entries of join engine queries. The number of translation tables that are kept in memory is determined by the the following parameter in indexserver.ini: 

[joins]
 translator_cache_size = n 

The default value is 2000. In order to verify how many translation tables currently exist in the system, the following statement can be used: 
select * from sys.M_DEV_JOIN_TRANSLATION_TABLES_ order by TRANSLATION_TABLE_MEMORY_SIZE desc 

This statement sums up the memory usage of those tables: 
select host, port, transtable_memory from sys.m_dev_joinengine_ 

In case of excessive memory usage for this allocator, the parameter can be set to 500 as a starting point. Lowering the value can have an impact on query performance though. However, in live systems where this was done, no negative side effects were observed sofar.

 Pool/malloc/libhdbcsapi.so 


A memory leak was introduced with revision 54 that can lead to a huge growth of this allocator when BW queries containing lots of OR terms instead of IN lists are executed. A possible workaround from application side is the implementation of SAP note 1786777. From HANA side, the problem is solved starting with revision 60 (HANA SP6). See also SAP note 1880274. 

For further information on the meaning of HANA Memory allocators and known reasons why they could consume a high amount of memory please refer to question 13. What can I do if a certain heap allocator is unusually large? from the knowledge base article 1999997 - FAQ: SAP HANA Memory. 

Case 11 - Memory Usage of the Statistics server 

Even though the statistics server can also run into oom errors, it should not consume a large share of the available memory. The statistics server is supposed to have a much smaller allocation limit compared to the index server. This following two configuration parameters are relevant: 

statisticsserver.ini -> 
memory manager

allocationlimit 
minallocationlimit 

The allocation limit of the statisticsserver is either a percentage of the availably RAM or just the value of minallocationlimit, depending on what is the bigger value. In case of oom errors that indicate that the statisticsserver has reached its process allocation limit, it can make sense to increase the allocationlimit to 10% or 15% to have at least a workaround for the time being. However, further analysis regarding the heap memory usage has to be conducted (see above). In the oom trace file, such a situation would look like this: 

[3] PID=23840, SId=320543005, compactors active, alive, process name: hdbstatisticsse 

AB=6755876864b (6.29gb), U=7135415505b (6.64gb), FSL=0b, PAL=6772669235b (6.30gb), TPAL=6772669235b (6.30gb), W=100 

AB, PAL and TPAL are on the same values. Also in this case, further investigation regarding the involved pools is necessary, either using the information contained in the trace files or by using the following SQL statement: 

-----------------------------------------------------------------------------------------------------------------------
SELECT TOP 15 MS.HOST, MS.SERVICE_NAME,MH.CATEGORY, MH.INCLUSIVE_SIZE_IN_USE, MH.EXCLUSIVE_SIZE_IN_USE FROM M_HEAP_MEMORY MH, M_SERVICES MS WHERE MH.PORT = MS.PORT AND MH.HOST = MS.HOST AND MS.SERVICE_NAME = 'statisticsserver' ORDER BY 4 DESC 
-------------------------------------------------------------------------------------------------------------------------


For further information on memory issues with the statistics server please refer to the SAP note 1929538 - HANA Statistics Server - Out of Memory. 

Wednesday 2 November 2022

Concept of delta merge

 



* For analytics purpose only certain columns of tables will be used, so in these kind of cases the column storage is used.
when inserting new table entry row storage is perfered. So that all the entries will be storged in one region.
















* while delta merge option is performing,Temporary Delta2 memory will created









Thursday 13 October 2022

UAA setup - Access between tenant and HDI

 login to XSA - Cockpit.

Login to required space.

under services --> User - provided services

Click on New Space.

---------------------------------------------------------------------------------------

{
 

     "driver": "com.sap.db.jdbc.Driver",

     "tags":[

             "hana"

],

"user": "SYSTEM"

"password":<Password>

}

-----------------------------------------------------------------------------------------






Saturday 24 September 2022

Create MTA(Multi Target Application) project

 Let us create a MTA project dedicated to SDI.

Steps:

  • From web ide --> workspace -->Right click --> New --> project from template --> Choose Multi target application(MTA) -->Next --> provide <project name> --> Next --> provide the space info (dev, prod) -->Finish.
  • Right click on the MTA project, which is created in the above step -->Build.
  • Now, we don't have SRC folder --> because this project does not have a database module.
    To create Database module: Right click on the project --> New --> SAP HANA Database Module --> Provide name of the HANA module --> Finish.
  • Right click on the HANA module folder, which is created in the above step -->Build.

Friday 23 September 2022

Create HANADB remote connection

 Steps:

1. Open web IDE.

2.open HDI.

3. open catalog.

4.choose [Remote sources].

5.Right click on [Remote sources].

6.choose option --> Add Remote sources.

7.provide,


       Source Name: <name of the HANADB source-->general description>

Adapter location: <based on source system DB -->select the Adaptor>

Server: <provide server host name >

Port: <provide port number >

            3<instance number>15


Creditials:

Creditials mode: Technical user.

User Name: SYSTEM

password: <provide password>



Finally click on Create












Importing Data and Build your own models

 Steps:
1. Right Click on the workspace --> New --> Project from Template.
2. Select Multi-Target Application project --> Next.

3. Project name :   ************* --> Next.

4.Spcace: Select the correct space required --> Finish.

5. Adding SAP HANA Database Module.

   Right click on the Project name ( which is created in step 4 ) folder. -->New --> SAP HANA Database Module --> Provide <module name> -->Review --> Finish.

6. Right click on the above resultant folder --> Build.

7.Open HDI container.

     Right click on the folder created in step 5 --> Open HDI container --> HDI container specific to your project will open.

8.importing data.

 On Top of DB --> right click on it --> import catalog objects --> browse --> provide the OS path of the tar file --> change the no. Of treads if needed --> import.


_-----------------------------------------------------------------


To check whether the data imported or not. Open database and catalog --> tables.



Monday 19 September 2022

Smart data integration (SDI) & Smart data Access(SDA)

 * SDI/SDA: it is a data acquisition technique.

Installation SDI Components on the HANA server:


1. login to putty with <SID>ADM user.

2.cd /usr/sap/<sid>/home/bin/

    in here we need to run one script - to free up some space.

    if you won't run this script the DB may not able to installation SDI components - due to shortage of memory.


script name is : <SID>_gc.sh

3.Enter you system database user password:

4.Execute the below download command now:

     <SID>DownloadManager_linux.bin linuxx86_64 vm sdi.tgz


file will automatically download to the path: /usr/sap/<SID>/home/Downloads/sdi.tgz


5.cd /usr/sap/<SID>/home/Downloads/

ls

Check whether sdi.tgz file available or not


6.tar -xvf sdi.tgz

The above command is used for extracting the sdi.tgz file.

7. cd /usr/sap/<SID>/home/Downloads/HANA_EXPRESS_20/install_sdi.sh

The above cmd will install the SDI.

8.Enter HANA instance number:
9.Enter local host name: 

10.Enter system database user (SYSTEM)  password:

11.Enter name of tenant database to add smart data integration: 
12.Enter <Tenant_SID> database system user (system) password: 

13.Check the summary and press Y

14.installation of SDI component is completed - Import successful.

Restricted Column

 Restricted  columns: Are used to created a rule based access at user level.

ex: user from country USA can have USA country employee info.
      user from country IND can have IND country employee info.

Saturday 17 September 2022

Different types of Nodes

Different types of Nodes available in webide :

  • Join
  • Non Equal join
  • Union
  • Minus
  • Intersect
  • Graph
  • Projection
  • Aggregation
  • Rank
  • Table Function
  • Hierarchy Function
  • Anonymization

  Calculated Column: A column which can be built on top of original columns in the view. it can also be used independently for eg to display static values , set flags and so on.

Mapping  tab: you are settle the required set of columns and assigning them to the next node.




Wednesday 14 September 2022

To kill all the PID that related to sap

To kill all the PID that related to SAP:


 ps aux | grep -i sap* |grep adm | awk {'print $2'} | xargs kill -9

Calculated column with 2 projections and 1 join

 syntax: "companyName"+'-'+"Legal"

Steps:

1. Right click on the SRC folder -->New --> Folder--> Provide folder name --> Ok.

2.Right Click on newly created folder by the above step -->New --> Calculation view.

3. Provide name for the calculation view --> 

     Namespace - Description.

     Data category - Dimension.

     Type - Standard

Finally Click on Create

4. Create 2 projections

   insert tables in to the projections.

5. Add join node.
feed the join node with 2 projections( by drag and dropping the projections to the join).


6. Double click on the join now.


create the connection between 2 foreign 


 7. in the properties section.
   

    swap the table to right and left, if needed.

   provide the cardinality info
  join type: Left outer, right outer & Full outer.


8.in projection (flow chat)

   again select the columns in the Mapping tab.

9.Next to Mapping tab --> calculated columns tab --> click on + symbol --> 

   Provide : name, 

in the expression edition --> add expression 

"companyName"+'-'+"Legal"


10. double click on Semantics  (in the flow chart).

select the foreign key, between the tables.

11. Save all.

12. Right click on the folder below SRC -->Build.


Sunday 11 September 2022

Employee dimension calculation view

--------------------------------------------------------------------------------------------------------------------------------

 Steps:
1. Right click on the SRC folder -->New --> Folder--> Provide folder name --> Ok.

2.Right Click on newly created folder by the above step -->New --> Calculation view.

3. Provide name for the calculation view --> 

     Namespace - Description.

     Data category - Dimension.

     Type - Standard

Finally Click on Create


4. on projection --> Click + search for table and click on Finish.

5.Double click on the projection.
6. Drag and drop required columns from right to left side.
7.Click on Semantics  and select the key column.

8.Save all - option available on the left top corner.

9.Right click on the folder and Build.

10.Right click the employee table --> data preview --> Navigate to raw data tab.


Referential joins

  •  Referential joins have been introduced in HANA to improve performance.
  • Referential joins are fundamentally inner joins.

Referential joins pre- requisites:

1. Referential integrity is maintained by the central table.

2.The Cardinality is 1-N, Dimension(1) --> Transactions(N).\

 




Saturday 10 September 2022

Full Outer Join

 




--------------------------------------------------------------------------------------

/* The table 1 has 78 rows

   the Business partner table has 45 rows*/



Select * from "<Drop and Drop table 1 from HDI>" as A

Full outer join "<Drop and drop table 2 from HDI>" as B

On A."<Foreign_key name of table A>" = B. "<Foreign_key name of table B>"


----------------------------------------------------------------------------------------

Right Outer join

 







--------------------------------------------------------------------------------------
/* The table 1 has 78 rows
   the Business partner table has 45 rows*/


Select * from "<Drop and Drop table 1 from HDI>" as A                                   
Right outer join "<Drop and drop table 2 from HDI>" as B                                
On A."<Foreign_key name of table A>" = B. "<Foreign_key name of table B>"

----------------------------------------------------------------------------------------



Left Outer join



..................................................................................................................................................................

/* The table 1 has 78 rows

   the Business partner table has 45 rows*/



Select * from "<Drop and Drop table 1 from HDI>" as A

Left outer join "<Drop and drop table 2 from HDI>" as B

On A."<Foreign_key name of table A> = B. "<Foreign_key name of table B>"


..................................................................................................................................................................... 

Friday 9 September 2022

Inner join syntax

 

......................................................................................................................................................................



/* The table 1 has XX rows

   the table B has YY rows*/



Select * from "<Drop and Drop table 1 from HDI>" as A

Inner join "<Drop and drop table 2 from HDI>" as B

On A."<Foreign_key name of table A>" = B. "<Foreign_key name of table B>"






....................................................................................................................................................

HANA Modeling

 








  1. Inner join: http://basisbynaveen.blogspot.com/2022/09/inner-join-syntax.html                                 
  2. Left Outer: http://basisbynaveen.blogspot.com/2022/09/left-outer-join.html                                     
  3. Right Outer Join: http://basisbynaveen.blogspot.com/2022/09/right-outer-join.html                         
  4. Full Outer Join: http://basisbynaveen.blogspot.com/2022/09/full-outer-join.html                             
  5. Referential Joins: http://basisbynaveen.blogspot.com/2022/09/referential-joins.html                      
  6. Employee dimension calculation view :

  7. http://basisbynaveen.blogspot.com/2022/09/employee-dimension-calculation-view.html
  8. Calculated column with 2 projections and 1                                                                                          join: https://basisbynaveen.blogspot.com/2022/09/calculated-column-with-2-projections.html
  9. Different types of Nodes: https://basisbynaveen.blogspot.com/2022/09/different-types-of-nodes.html                                                                                                                                            
  10. Restricted column: http://basisbynaveen.blogspot.com/2022/09/restricted-column.html                  
  11. Smart Data Integration (SDI) & Smart Data Access (SDA) introduction and installation :   https://basisbynaveen.blogspot.com/2022/09/smart-data-integration-sdi-smart-data.html