Wednesday, July 30, 2025

ASM: How much time the rebalance will continue?

When planning ASM changes/downtimes every DBA need to answer the query  "how much time the rebalance will continue ?". It turns out that to answer this question, you need to execute two commands only:

EXPLAIN WORK FOR + specify your ALTER DISKGROUP command, for example, alter diskgroup DATAC1 drop disk DISK1

And then query the V$ASM_ESTIMATE view:

EXPLAIN WORK FOR alter diskgroup DATAC1 drop disk DISK1;

SELECT est_work FROM V$ASM_ESTIMATE;
EST_WORK
--------
    421

 

 

19c Bugs Fixing Statistics

 

 

 

 

 

 

 

 

 

 

 

ERROR: alter system dump datafile/tempfile: invalid input file

Troubleshooting the "buffer busy wait" event with parameters 
p1=212
p2=2
p3=13

i decided to dump the block #2 in database file # 212.
The simple command:

alter system dump datafile 212 block 2;


generated the error message in trace file:

ERROR: alter system dump datafile/tempfile: invalid input file # 212


Should i use TEMPfile keywork? And the 2nd run
alter system dump tempfile 212 block 2;
brought the same error message to the trace file :(((.

The working syntax: use the file name (not a number)

alter system dump tempfile '+DATA/STAGESTB/TEMPFILE/TMP03.1566.1191597171'  block 2;

The syntax:

ALTER SYSTEM DUMP { DATAFILE | TEMPFILE } { file_num | 'file_name' } { BLOCK block_num | [ BLOCK MIN block_num ] BLOCK MAX block_num } ;



Wednesday, April 16, 2025

The new File system feature: Atomic Writes

 Большинство БД Oracle созданы с размером блока 8К и  16К. Размер блока файловых систем в Линукс =4К. Размер сектора на шпиндельном диске = 512 байт.

В результате, возможна ситуация когда БД отправляет на запись 8К, а на диск записывается только часть блока БД (например, при отключении электропитания).

Для такого случая в СУБД Оракл есть свои механизмы контроля: SCN, который записывается в заголовке и в хвосте блока БД, db_block_checksum.

В этот раз помощь пришла откуда не ждали: atomic commit для файловых систем EXT4, XFS, BTRFS и блочных устройств. 

Реализуется путём добавления "атомного" флага в syscall:  
a new "atomic" flag to each of pwritev2().  When set, these indicate that we want the write issued "atomically".  

Only direct IO is supported and for block devices. Atomic write HW is required, like SCSI ATOMIC WRITE (16).



Появились "атомные" опции монтирования (atomic-writes=1), пример для XFS (https://lwn.net/Articles/971754/):

XFS can be formatted for atomic writes as follows:
mkfs.xfs -i forcealign=1 -d extsize=16384 -d atomic-writes=1  /dev/sda

atomic-writes=1 just enables atomic writes in the SB, but does not auto-
enable atomic writes for each file.

Support can be enabled through xfs_io command:
$xfs_io -c "lsattr -v" filename
[extsize, force-align]
$xfs_io -c "extsize" filename
[16384] filename
$xfs_io -c "chattr +W" filename
$xfs_io -c "lsattr -v" filename
[extsize, force-align, atomic-writes] filename
$xfs_io -c statx filename
..
stat.stx_atomic_write_unit_min = 4096
stat.stx_atomic_write_unit_max = 16384
stat.stx_atomic_write_segments_max = 1



Статья с картинками на эту тему:
https://transactional.blog/blog/2025-torn-writes



ASM: How much time the rebalance will continue?

When planning  ASM  changes/downtimes every DBA need to answer the query  "how much time the rebalance will continue ?". It turns...