Monday, February 18, 2019

Tip For Size of Oracle DB Tempfiles

Symptom:

   You will see big difference between ls -l and du -sm  on the same Oracle DB Tempfiles
ie
# ls -l o1_mf_temp_fpq46223_.dbf
-rw-r-----. 1 54321 54321 34358697984 Oct 14 06:21 o1_mf_temp_fpq46223_.dbf
--> 32G
# du -sm o1_mf_temp_fpq46223_.dbf
6       o1_mf_temp_fpq46223_.dbf
-->6M

Reason:

 ls -l  reads the attributions of files, so when the tempfile was created, it was created as 32G. So both allocated and unallocated together will be 32G.
However du is counting the actual number of allocated blocks.The unallocated blocks read as 0, take up no space on disk.
In this way, du is closer to the truth about how much space was used by DB.
ls shows us total size of allocated and unallocated blocks

No comments: