I am creating a Docker image for Oracle database, and many different containers will be generated from the same image.
When I start the Oracle instance, for some reason a few bytes are written to all active datafiles. Docker saves a diff from the container to the base image, and the diff is the whole file that changed, so each time I start a container more than 6 GB are written to disk just for starting the database.
So, why does Oracle write to the datafiles when starting the database? The most logic behavior would be writing to the datafiles only when data is changed and commited. Can I do something to change that?
Besides Oracle Linux (which is the base for my image) I have also tried that on Windows and the behavior is the same, all datafiles are written.
I tried setting the tablespaces to read-only. That avoids the write operation, however when I set the tablespace to read-write it immediately writes to the file, causing the problem again.
Just to be clear, I need the tablespaces to be writeable, but only when the data actually changes.