1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

SAP HANA断片化確認&デフラグ実行SQL

Last updated at Posted at 2025-03-06

まずは断片化確認

SAPnote(1969700) SQL"HANA_Disks_Data_SuperBlockStatistics

SELECT
S.HOST,
  LPAD(S.PORT, 5) PORT,
  LPAD(S.VOLUME_ID, 9) VOLUME_ID,
  LPAD(TO_DECIMAL(S.SUPERBLOCK_SIZE / 1024 / 1024, 10, 2), 10) SB_SIZE_MB,
  LPAD(S.USED_SUPERBLOCK_COUNT, 13) USED_SB_COUNT,
  LPAD(S.SUPERBLOCK_COUNT, 12) TOT_SB_COUNT,
  LPAD(TO_DECIMAL(ROUND(S.SUPERBLOCK_SIZE * S.USED_SUPERBLOCK_COUNT / 1024 / 1024 / 1024), 10, 0), 10) USED_GB,
  LPAD(TO_DECIMAL(ROUND(S.SUPERBLOCK_SIZE * S.SUPERBLOCK_COUNT / 1024 / 1024 / 1024), 10, 0), 10) ALLOC_GB,
  LPAD(TO_DECIMAL(MAP(S.FILL_RATIO, 0, 0, TO_DECIMAL(100 / S.FILL_RATIO - 100, 10, 2)), 10, 2), 8) FRAG_PCT
FROM
( SELECT                   /* Modification section */
    '%' HOST,
    '%' PORT
  FROM
    DUMMY
) BI,
  M_DATA_VOLUME_SUPERBLOCK_STATISTICS S
WHERE
  S.HOST LIKE BI.HOST AND
  TO_CHAR(S.PORT) LIKE BI.PORT
ORDER BY
  S.HOST,
  S.PORT

実行結果

image.png

次にデフラグ実行

2400005 - FAQ: SAP HANA Persistence
1870858 - HANA Alerts related to file system utilization

ALTER SYSTEM RECLAIM DATAVOLUME '<host>:<port>' 120 DEFRAGMENT

note1870858だと実際の実行結果画像が載っていてわかりやすいです。
また、下記の資料によると105から120までの値が設定できるようです。

The value must not be smaller than 105. The recommended values are between 105 and 120.

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?