I'm using bdb 6.0.20 for embedded Linux 2.6.xx and I use "pragma bdbsql_system_memory=xx;" when open my db.
As my embedded board has a limited memory, I need to be careful for configuring BDB.
However, I have a problem in managing db-journal log files.
Most of time, log files such as log.0000000001, log.0000000002,.. are generated and then deleted while I insert and insert data.
But sometimes, after I reboot my device, the log files are not deleted any more and new log files keep being created continously.
So my journal folder becomes full of log files.
I guess I missed something in config, but I don't know what is it.
Here is my DB_CONFIG.
set_cachesize 0 1228800 0
Please help me solving this problem.
Thanks in advance.
Logs are usually removed after a checkpoint. Checkpoints happen after the database is closed, or you can force one by calling a checkpoint through either the checkpoint PRAGMA or the checkpoint function, described at Checkpoint a database
Note that for BDB SQL, WAL is always enabled.
Thanks for your reply.
I tried as your recommendation. I add "pragma wal_checkpoint;" every 10th insert SQL. However, the result was same.
The strange thing is When I create a DB first time, it works fine.
But After I reboot my device and run db_recover, it seems the config (I don't know which config matters) gets lost.
Thanks again for your comments.
Well, running recovery does remove the environment, and any environment configurations stored in it, so that could be the reason it stopped working. Try adding the following line to your DB_CONFIG file:
That should make sure the setting to automatically remove old log files remains enabled.