Notes 5.0.x allows you to compact a database while the database is still open. However, you actually need to compact the database twice, in order to set the document table bitmap optimization. On the first compaction the Document table bitmap optimization pending flag gets set. The table is actually generated on the second compaction.