How To Find Block Sizes of All Oracle Database Files?
How To Find Block Sizes of All Oracle Database Files?
How To Find Block Sizes of All Oracle Database Files?
Database files?
TYPE
VALUE
db_block_size integer
8192
It is 8KB on my system, alright now let us check the block size of the
control files on this database server.
SQL> select BLOCK_SIZE from v$controlfile;
BLOCK_SIZE
16384
16384
There are two control files on my system each of 16KB size, Aww!!! Should
it not be the default block size of 8KB? Well, you see that right. Oracle
says that irrespective of block size supported by OS or storage
control file block size will always remain 16KB and that cannot be
altered.
Will this create any issue? I dont see that this is as problematic until
unless your minimum block size at your operating system is more than
16KB ex: 32KB. When minimum block size at the OS level is 4KB or 8KB
then Oracle can bundle 4 blocks or 2 blocks respectively to create one
logical block for the control file. Interesting isnt it!!!
Redo log block size:
Block size of redo log files are bit different from control files which we
have seen so far. Let us quickly check the current block size of all the redo
logs on my server. Note that I did not specify any block size of the redo
logs when I created this database, so the output below is the default size
created by DBCA.
SQL> select BLOCKSIZE from v$log;
BLOCKSIZE
512
512
512
Thats 512B on my system. Just like control file, block size of redo log is
not same as the default database block size(8KB).
But can we have a redo log files of different block sizes, I tried creating
two other groups with 1KB , 4KB and 8KB.
SQL> alter database add logfile group 4 size 5M blocksize 1024;
ERROR at line 1:
ORA-01377: Invalid log file block size
SQL> alter database add logfile group 4 size 5M blocksize 4096;
ERROR at line 1:
ORA-01378: The logical block size (4096) of file
/pdbdata/ORACDB3/onlinelog/o1_mf_4_%u_.log is not compatible with the
disk
sector size (media sector size is 512 and host sector size is 512)
SQL> alter database add logfile group 4 size 5M blocksize 8192;
ERROR at line 1:
ORA-01377: Invalid log file block size
Oracle says that only possible block sizes for redo logs are 512, 1024 and
4096 bytes.
For 1024, my database server errors out as invalid block size just
sector size on the disk is 512 so it cannot create a redo log with block
size as 4096.
In your environment if redo log block size is 4096 then it means that if
media sector supports 4096 bytes of block size then oracle automatically
identifies and creates redo logs with block size as 4096.
Will this create any issue? Having redo log block size of 4096 bytes
results in redo log wastage compared to 512 bytes. There will be
tremendous performance issue if your disk is not aligned with the block
size of your redo log blocks.
This was the same reason why one my database environment was
performing bad, it was because of 4KB of redo log block size and there
was lot of redo wastage happening in the database. I could recognize the
redo wastage from V$SYSSTAT.
SQL> SELECT name, value FROM v$sysstat WHERE name = redo
wastage';
NAME
VALUE
redo wastage
17941684
Key points:
With 512 bytes of media sectors we still have Control file block size
as 16KB, as it logically binds 32 sectors to one block. But this is not
possible in redo log.
Having 4KB block size of redo log files will not degrade the