Showing posts with label with. Show all posts
Showing posts with label with. Show all posts

Thursday, 30 November 2023

Managing Large tables with partitioning

 when monitoring the system,you can sometimes see tables that have grown so large in SAP HANA that it makes sense to split them "horizontally'' into smaller partitions.By default,you can partition column tables in SAP HANA ,which is ideal for managing high data volumns. The SQL statements - or any data manipulation language(DML) statements - do not need to know that the data is partitioned.Instead,SAP HANA automatically manages the partitions behind the scenes. Thus,SAP HANA simplifies access and frontend development and gives administrators a key tool to manage disks, memory, and large column stores.


In a distributed (scale-out) SAP HANA system, you can also place the partitions on different nodes and thereby increase performance even more because more processors are available for available for your users. in fact, this may become the standard deployment method for extremely large systems with tens of thousands of users.

Currently,SAP HANA suppots up to 2 billion rows in a single column table.in a partitioned schema, you can now have 2 billion rows per partition with virtually no limit on how many partitions you can add.you are limited, not by a database limitation, but by hardware and landscape architecture issues. you can create partitions in SAP HANA in three different ways from an adninistration standpoint: with a range,with a hash and by round-robin method. while more complex schemas are possible with higher- level options. Lets take a look at these fundamental partitioning choices.


Partitioning column tables using a Range

if you know your data really well, you can partition the data by any range in your table.Although the most common is date, you can also partition by material numbers, postal codes, customer numbers, and so on.

Partitioning by date makes sense if you want to increase query speed and keep current data on a single node. Partitioning by customer number makes sense if you are trying to increase the speed of delta merges because multiple nodes can be used at the same time during data loads. you'll have to spend some time thinking of what benefitsyou want to achieve before undertaking any partitioning scheme.Note that the maintenance of range partitions is somewhat higher than the other options because you have to keep adding new partitions as data outside the existing partitions emerge (e.g., next years data if you partition by year now).


partitioning is done using SQL with the syntax seen in listing.
------------------------------------------------------------------------------------------------------------------------
CREATE COLUMN TABLE SALES (sales_order INT ,  customer_number INT , quantity INT , PRIMARY KEY (sales_order))
PARTITION BY RANGE ( sales_order)
(PARTITION 1 <= values < 100000000,
PARTITION 100000000 <= values < 200000000,

PARTITION OTHERS)
--------------------------------------------------------------------------------------------------------------------------




This syntax creates a table with three partitions. The first two have 100 million rows each, and the last partition has all the other records. However, you must follow some basic rules: first, the field you are partitioning on has to be part of the primary key (i.e., sales_order). Second, the field has to be defined as a string, a date, or an integer.Finally, you can only partition column stores, not row stores by ranges.


Partitioning column tables using a Hash:

Unlike partitioning by ranges, partitioning column stores by a hash doesn't require any in-depth knowledge of the data. Instead, partitions are created by an internal algorithm applied to one or more fields in the database by the systemitself. This algorithm is known as a hash. Records are then assigned
to the required partitions based on this internal hash number. The partitions are created in SQL with the following syntax:

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

CREATE COLUMN TABLE SALES ( sales_order INT , cutomer_number INT , quantity INT , PRIMARY KEY ( sales_order, customer_number)) PARTITION BY HASH (sales_order, customer_number)
PARTITIONS 6

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

This example creates six partitions by sales orders and customer numbers. some rules apply here as well: if the table has a primary key, the primary key  must be included in the hash. if you add more than one column, and your table has a primary key, all fields used to partition must be part of the primary key also. if you leave off the number 6, the system will determine the optional number of partitions itself based on your configuration. Therefore, using PARTITIONS without a number is the recommended setting for most hash partitions.


Partitioning column Tables using the Round-Robin method:


In a round-robin partition, the system assigns records to partitions on a rotating basis. The round-robin method makes efficient assignments and requires no knowledge of the data. However, removing partitions in the future will be more difficult because both new and old data will be in the same partitions.


The Partitions are created in SQL with the following syntax:

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

CREATE COLUMN TABLE SALES (sales_order INT , customer_number INT , quantity INT)
PARTITION BY ROUNDROBIN
PARTITIONS 6


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

This example creates six partitions and assigns records on a rotating basis. if you change the last statement to PARTITIONS GET_NUM_SERVERS( ), the system will assign the optimal number of partitions based on your system landscape.The only requirement for the round-robin method is that the table cannot contain a primary key.



Wednesday, 14 September 2022

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.


Thursday, 5 March 2020

How to include linux commands in scripts, effectively with echo command - Basic OS monitor script



#/bin/bash
echo hi!!! Naveen
echo
echo welcome to basic os monitoring script
echo
echo top 10 processes running now
top | head -10
echo
echo mount point size
df -h
echo
echo free memory in the system now
free -m
echo
echo output of uptime command
uptime
echo
echo io statistics
iostat
echo
echo

OUTPUT :

Hostname:/install # ./basic_mon.sh
hi!!! Naveen

welcome to basic os monitoring script

top 10 processes running now
top - 11:10:05 up 79 days,  2:20,  1 user,  load average: 0.19, 3.69, 3.22
Tasks: 425 total,   1 running, 424 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.3 us,  0.3 sy,  0.0 ni, 99.4 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem:  13201688+total, 66643632 used, 65373244 free,   593712 buffers
KiB Swap: 20971516 total,    78036 used, 20893480 free. 29159464 cached Mem

  PID USER      PR  NI    VIRT    RES    SHR S   %CPU  %MEM     TIME+ COMMAND
 1962 root      20   0  425120   1596    508 S  6.250 0.001 331:15.05 tuned
20580 pl0adm    20   0 13.934g 9.828g 640468 S  6.250 7.806   8:37.73 hdbindexserver
27050 root      20   0   41340   3260   2208 R  6.250 0.002   0:00.02 top

mount point size
Filesystem                                   Size  Used Avail Use% Mounted on
/dev/xvda1                                    40G  4.8G   33G  13% /
devtmpfs                                      64G     0   64G   0% /dev
tmpfs                                        110G     0  110G   0% /dev/shm
tmpfs                                         64G  800K   64G   1% /run
tmpfs                                         64G     0   64G   0% /sys/fs/cgroup
/dev/xvdd                                    2.9G  771M  2.0G  28% /opt/bmc
/dev/xvdc                                    2.0G   21M  1.8G   2% /tmp
/dev/xvdb                                    2.0G  1.3G  536M  72% /var
/dev/xvde                                    7.8G  6.9G  471M  94% /usr/sap
:/vol1_XY0_PL0/q_sysfiles/sapmnt  100G   23G   78G  23% /sapmnt/PL0
:/vol2_XY0_PL0/q_dbdata           3.5G  1.9G  1.7G  52% /hana/data/PL0
:/vol1_XY0_PL0/q_sysfiles/db      100G   23G   78G  23% /usr/sap/PL0
:/vol3_XY0_PL0/PL0                1.0G  4.8M 1020M   1% /hana_backup/PL0/log
:/vol1_XY0_PL0/q_install          100G   23G   78G  23% /install
:/vol1_XY0_PL0/q_dbhome           100G   23G   78G  23% /sybase/PL0
:/vol3_XY0_PL0/HDB_PL0            1.0G  4.8M 1020M   1% /hana_backup/PL0/data
:/vol1_XY0_PL0/q_dblog            100G   23G   78G  23% /hana/log/PL0
:/vol1_XY0_PL0/q_sysfiles/hana    100G   23G   78G  23% /hana/shared/PL0
:/vol3_XY0_PL0/q_dbarch           1.0G  4.8M 1020M   1% /sybase/PL0/saparch_1
:/vol1_XY0_PL0/q_dbdump           100G   23G   78G  23% /sybase/PL0/shmdump
:/vol1_XY0_PL0/q_dblog            100G   23G   78G  23% /sybase/PL0/saplog_1

free memory in the system now
             total       used       free     shared    buffers     cached
Mem:        128922      65081      63841        607        579      28476
-/+ buffers/cache:      36025      92897
Swap:        20479         76      20403

output of uptime command
 11:10am  up 79 days  2:20,  1 user,  load average: 0.19, 3.69, 3.22

io statistics
Linux 3.12.74-60.64.107.1.17187.0.PTF.1126890-default (hec01v031100)    03/05/2020      _x86_64_        (40 CPU)

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.72    0.00    0.29    0.01    0.00   98.97

Device:            tps    kB_read/s    kB_wrtn/s    kB_read    kB_wrtn
xvda              1.39         2.06        20.03   14072349  136903676
xvdb             12.40         1.46        71.67    9971369  489811208
xvdc              0.69         0.09         8.26     623249   56442324
xvdd              0.07         0.38         0.28    2618305    1939448
xvde              0.63         1.66         4.22   11356101   28809664
xvdy              0.75         1.51         0.00   10313048          0
xvdz              0.19         1.16         2.43    7896116   16575008


Saturday, 14 September 2019

Security: improve your user Master Record Accuracy with Hidden Fields

By default,some user master record fields in Transaction SU01 are not displayed.for better accuracy enter custom data to better classify your master data.

This post especially useful for the SAP customers, who do not have SAP ERP HCM (Human Capital Management).

Note: By following the below steps,Maintaining the perner number,company code, department,personnel area etc. is also possible. You can gather all the information by tables USR02,USR21,ADCP,ADR6 ,V_USERNAME and USER_ADDR.



Here's How

Step 1: Login to respective system.

step 2: Execute T-code: SU01

step 3: click on Edit button.
           Here i'm using DDIC user, use your user name as per your requirement.

             

step 4: Default screen obtain with the above step.                                                                                                                                                                                                                               

Step5: click on the button as shown below.


step 6:Then the hidden fields are displayed. maintain the hidden fields and SAVE. for the better accuracy of user Master data.




Saturday, 11 May 2019

SAP HANA COCKPIT NOTES 8: Setup and Administration with the Cockpit Manager


  • The Cockpit Manager configuration tool is an application separate from the SAP HANA cockpit itself.
  • The functionality visible in the Cockpit Manager depends on the role(s) assigned to the user accessing the Cockpit Manager.

The purpose of HANA COCKPIT MANAGER:




Note: creation of cockpit users,register resource,create resource groups,add resources to resource groups & grant cockpit users access to resources groups,modify settings related to the configuration of the cockpit can also be done in COCKPIT also. but proper Privileges is required.