본문 바로가기

Database

[HANA] Table Replacement

- 출처 : https://help.sap.com/viewer/6b94445c94ae495c83a19646e7c3fd56/2.0.04/en-US/22888f9344954f258284d2dd936d0d0a.html

 

SAP Help Portal

 

help.sap.com

 

Table Placement

 

Table Classification and Placement Rules

Rule은 SYS.TABLE_PLACEMENT에 정의됨

기본적으로 다음 영역에서 얘기됨

- Classification : 관련된 테이블들은 동일한 Group에 위치

- 파티션을 관리하기 위한 Configuration 설정 (초기에 몇개의 파티션, Split하는 기준 등)

- 테이블이나 파티션의 서버 landscape 내에서의 물리적 분산 및 위치

 

 


Table Classification (Groups)

연관된 테이블들은 일반적인 Table group으로 분류 가능

SYS.TABLE_GROUPS

Column Description
SCHEMA_NAME The scema name
TABLE_NAME The table name
GROUP_NAME The group name
GROUP_TYPE The group type. Example: in SAP BW there are predefined group types that classify the tables associated with a BW object, such as: sap.bw.cube (InfoCubes), sap.bw.dso (DataStore Objects), sap.bw.psa (PSA tables) and so on.
-> S/4HANA의 경우 sap.s4hana.tableset 존재
SUBTYPE The subtype. This is required for some group types, for example in SAP BW:
-
a table belonging to an InfoCube (group type sap.bw.cube) can be a fact table (subtype FACT_IMO) or a dimension table (subtype DIM)
- a table belonging to a DataStore Object (group type sap.bw.dso) can be an active table (subtype ACTIVE), an activation queue (subtype QUEUE), or a Changelog (subtype CHANGE_LOG)
IS_GROUP_LEAD Determines the leading table within a group. If none is set, the largest, partitioned, non-replicated column store table is used as leading table.

 

CREATE and ALTER table로 GROUP 설정 가능

CREATE COLUMN TABLE "TEST".A1 (A INT) GROUP TYPE ABC GROUP SUBTYPE T
ALTER TABLE "SAPLG1"."/BIC/MUCSTR000000" SET GROUP NAME "ABC"

-> Create Group 문장은 없음
    Group 생성할 필요 없이 설명만 하면 그냥 설정 됨

ALTER TABLE <table_name>
                  [<set_group_option>] ...[<unset_group_option>]

<set_group_option>
Sets one or more table group option for the table. Table group settings are stored in the TABLE_GROUPS system view.

<set_group_options> ::= SET <option> [...]
<option> ::=
   GROUP TYPE <identifier>
   | GROUP SUBTYPE <identifier>
   | GROUP NAME <identifier>
   | GROUP LEAD

<unset_group_option>
Unsets (removes) all table group attributes for the table (type, subtype, name, and so on).

<unset_group_option> ::= UNSET GROUP

 

 


 

Table Placement Rules

SYS.TABLE_PLACEMENT

Column Description
SCHEMA_NAME The scema name
TABLE_NAME The table name
GROUP_NAME The group name
GROUP_TYPE The gruop type
SUBTYPE The subtype
MIN_ROWS_FOR_PARTITIONING Partitioning rule: the number of records that must exist in the table before the number of first-level partitions is increased above 1.
INITIAL_PARTITIONS Partitioning rule: determines the number of initial partitions to create, for example, HASH 1, HASH 3,
REPARTITIONING_THRESHOLD Partitioning rule: if the row count exceeds this value then further split iterations are considered.
DYNAMIC_RANGE_THRESHOLD Applies to tables that use the dynamic range partitioning feature. Overwrites the system default value defined in indexserver.ini   [partitioning]   dynamic_range_default_threshold (10,000,000) for that specific combination of schema / table / group characteristics.
SAME_PARTITION_COUNT Specifies that all partitions of the tables in a group will contain the same number of partitions.
Globally maintained in global.ini   [table_placement]   same_num_partitions but in case of several applications with deviating settings, it can be maintained on a more granular level.
LOCATION Location rule: master, slave, all 
- master: represents the master node
- slave (or slaves): represents all slave nodes that belong to the worker group ‘default’
- all: represents all nodes that belong to the worker group ‘default’, 
  i.e. master node and slave nodes.

- Location : M_LANDSCAPE_HOST_CONFIGURATION

 

 

Custom location definations

call SYS.UPDATE_LANDSCAPE_CONFIGURATION( 'GET WORKERGROUPS','<hostname>')

 

Create Worker group

call SYS.UPDATE_LANDSCAPE_CONFIGURATION( 'SET WORKERGROUPS','<hostname>','<name1> <name2> <name3>' )