NCompact does not seem to be recovering space

I received a complaint recently that a user couldn't open a db because it had grown too large.

The file is not limited to 4 gb and is about 9 gb in size. I have other dbs much larger that are not popping this error. I was able to log in and open the db on both a Win 7 and Win 10 machine.

I checked and the unused db space was at 30%. The server runs ncompact -2 10 every day and the log shows no space recovered on this db over recent compact events.

I did a manual compact without space recovery at ini the admin client. Compact seems to have run but the db is still at 30% unused space.

I am currently running a compact with file reduction via the admin client. No results yet.

I did a quick check and there are a number of dbs of various size that are all below 40% unused space.

Server is Dom 8.5.

I rarely do admin work but as I recall, most of the time when dbs are compacted, they recover back to greater than 75% unused space. I don't recall cases where a compact with or without file size reduction didn't result in an improvement in unused space.

Am I missing something?

What can I try to get the % unused space to a more reasonable number?

Am I totally wrong about how to interpret the % unused space (I am not really an admin, I just play one for my company).

Thanks for any tips.

Hi Doug,

Can you try to use 'compact -c -D -i' and see if that works. Ensure that the user is not accessing the mail file, otherwise, compact will not be able to run.

Let us know how it goes.

Hi Doug,

Please run maintenance in below order and see works.

NFixup xxx.NSF -f
NCompact xxx.NSF -c -D -i
NUpdall xxx.NSF -R

Regards

Praveen

Thank you for the replies. Note: we don't use Notes for mail; these are all application dbs.

I did a compact with space recovery via the admin console and the db sized dropped from 9 gb to 2.5 gb and %unused space went from 30% to 98%, so in line with what I'd expect.

That fixes this db but leaves me wondering why I have so many dbs with low %unused (<50%).

The c D i options are not ones I want to use unless I have to; they'll take the dbs off-line, kill the indexes, and scew with backups (change db id). Since I had success with the 'in place with file size reduction', would I be best served by changing my server program doc from ncompact -s 10 to ncompact -b 10? Are there any risks with this option? Are there better options for a nightly compact?

Thanks again for the assist.

Hi Doug,

You can use both switches on your 'compact' program doc, like below:

Command line: -b -S 10 <foldername OR dbname.nsf>

Notes:

-b = lower case 'b' is the recommended switch when Transaction logging is enabled because this will not change the DBIID. Use upper case 'B' if Transaction logging is not enabled as this will change the DBIID, and will then require a backup.

-S 10 = you can only use the '-S' switch specify the desired % as part of its options.

Reference: Compact options

Hope this helps. Regards

Hi Doug

To optimize disk space, it is recommended that you run Compact using the -B option on all databases once a week or once a month.

Compact -B Uses in-place compaction, recovers unused space, reduces file size unless there's a pending structural change in which case copy-style compacting occurs. If you use transaction logging, do full database backups after compacting completes.

Compact -b

Uses in-place compaction and recovers unused space without reducing the file size unless there's a pending structural change to a database. In this case, copy-style compaction occurs. Recommended method of compacting.

compact -s Compact database only if unused space is greater than x percent .

-b is the only switch that will not change the DBIID of a database if transactional logging is enabled.

Please note the below statement when Transaction log enabled and not enabled on the server.
-- If the Notes database is logged (Transactional Logging enabled), then a simple in-place compaction will be performed (equivalent to -b).
-- If the Notes database is not logged (Transactional Logging disabled), an in-place with file size reduction compaction will be performed (equivalent to -B).

Regards

Praveen

Transaction logging is used. The server is on a routine back up schedule with daily incremental and weekly full via Veeam.

The server OS is rebooted nightly. This process does NOT include a domino server downing prior to the OS reboot (I worked with IT for a month and they never got it so it's what we have). As I understand this process, the OS goes down/up, Domino restarts, and the transaction logs are read during the restart.

So, if I do a -B compact and the OS reboots prior to any backups being performed, what happens on the Domino restart after the OS reboot? Does the file come back on line possibly missing a few transactions (unlikely since this all happens in the middle of the night) or does something really bad happen?

Hi Doug,

Domino server will come up. Database will be assigned new DBinstance id at the Domino startup. Hence you have to make sure backup is taken after compact -B is performed on the database. Otherwise backup operations will be effected.

Regards

Praveen

What does ‘effected’ mean? What specifically happens or doesn’t happen?

Sorry but I am mostly a dev doing admin work on the side. I have enough knowledge to be useful but not much more.

Hello Doug!

What do you mean with "a user couldn't open a db because it had grown too large"?

An error message is presented? If yes, could you share the entire error message presented?

What is the Notes Client version?

What is the ODS of DB?

The same DB can be opened by another user?

Thanks for additional information.

Regards!​

Rodrigo de San Vicente

Staff Software Engineer

Collaborative Workflow Platform

Hi Doug,

Please find helpful information below.

Please share exact error message ?

Compact -B may cause Domino to assign a new DBIID to a database. From that point forward, all new transactions recorded on the log use the new DBIID;
however, any old transactions still have the old DBIID and no longer match the database's new DBIID. As a result, it is not possible to restore these old transactions to the database.
You will not be able to apply old transactions to restore the databases. So when using this option and transaction logging, do full database backups after compacting completes.
To avoid losing data, you should immediately perform a full database backup whenever a database receives a new DBIID. When you perform this backup, you capture all the database transactions up until that point and ensure that Domino needs only the new transactions (with the new DBIID) to restore the database. If the DBIID changes and a backup is not taken after the fact, the database cannot be successfully restored (backup will have the old DBIID and the transactional log will not "know" the old DBIID.

Thank you.

Regards,

Praveen

Praveen, that helps. Since we do incrementals nightly I don't think we need to worry about performing the backup in real time (too late for that anyway...)

Thank you for your patience.

So, this may be a totally different problem.

The error is "Notes error: Database (.nsf) has grown too large; use compact to reduce the ile size or use file new replica to create your file with a larger capacity (specific nsf listed here).

The file has been compacted with file size reduction via the admin client, fixup, and updall<file> =V run.

The error happens when a specific agent is run that copies docs from the 'too big' db to another db for archival storage.

This agent has been unchanged since 2011.

The code is below with the specific line that spawns the error remarked. All variables are properly set and files that fall outside of this 'if' statement (several fields changed but not copied to 2nd db) are correctly processed.

The db is now 3 gb in size with 33K docs, and % unused at 99.1.

Notes and Domino are both 8.5.x. OS on the client side is Win 7 or 10 (fails in both). Client on the server side is some variant of Windows but has been stable for several years so nothing going on there that should contribute to this problem.

I am officially confused. Any ideas?

' Close records

Call requestuidoc.refresh

Forall sn In requestdoc.snlist

Set dc = currentrecords.GetAllDocumentsByKey(sn, True)

For j = 1 To dc.Count

Set currentdoc = dc.GetNthDocument(j)

Print "Closing SN " & sn & " page number " & currentdoc.StepNumber(0)

currentsn = currentdoc.UnitSN

currentdoc.recordstatus = "Closed"

currentdoc.form = "Closed Cal Record"

currentdoc.closedon = requestdoc.requestedon

Call CurrentDoc.Save( True, True )

TestFlag = CurrentDoc.ValueFlag(0)

If TestFlag <> "Directions Only" Then

Call CurrentDoc.CopyToDatabase(CloseDb) ‘<<< FAILS HERE WITH DB TOO BIG ERROR

End If

CurrentDoc.Hide = "Hidden"

Call CurrentDoc.Save( True, True )

Next

End Forall

Hi Doug,

Please see below details might be helpful for you.

This reported error can occur if a database has reached its size limit. Please try to open the database from notes client and see works or not.

Running Compact with no switches will update the database to the current On Disk Structure (ODS) where the size limits are a maximum of 64 gigabytes.

If you have issues trying to open a database , try OS copying the database to an 8.5.2 server, running fixup/compact -c. Then try to open it in a 8.5.2 client so as to clear down the number of records.

Note: This issue is not just limited to databases whose size exceeds the 64GB limit. It has reportedly occurred in databases as small as 250MB.

Regards

Praveen

The db opens in the client.

All dbs were updated to file format 51 several years ago and none are limited to 4 gb. The db in question is under 4 GB in size so well below any possible limit.

The error occurs at a specific point in a code segment (see above). The docs to be copied contain 3 byte text docs as attachments.

I did the compact -c-D-i, no joy.

I created a new replica, no joy.

As far as I know, no other db that uses 'doc.copytodatabase' is seeing the error.

The db runs on a VM with the data drive provisioned to 650 gb. 83 gb are free. The program disk is currently running at about 25 gb free.

I did log onto the Domino server and notice that Sophos was popping an error that the sophos~1.dll was either not designed to run on Windows or it contains an error.

There is a possibility that IT did something to the Sophos setup that is somehow recognizing db operations that copy docs between dbs and somehow causing the 'db too big' error. This is unlikely since there are multiple db systems that use the copytodatabase code and, as far as I know, only this one db is throwing the error.

I have recommended that IT pull in our VAR or HCL or a local Notes Admin/Dev shop for help. This one is beyond my ability. First time since '95 I haven't been able to find and fix a problem.

If anyone has other ideas, I'd love to hear. Otherwise thank you all so much for your assistance.

More and more interesting.

I worked with the users and we decided to get outside help and, in the meantime, I'd create a semi-manual process to get the docs moved. This required minor updates to the design templates for both the sending and receiving databases. When I did the design refresh on the receiving db (69 GB, 100% unused), I got the 'too big' error. It appears that I've been chasing problems in the wrong db!

I am currently running a compact -i-D-c on the receiving db.

Per my understanding of Windows Server 2008 R2, the allowed individual file size should be in the TB range so 69 GB should be OK. Given how close 69 is to 64, I have some nagging suspicion that the problem is related to size.

The good news is that the app suite is designed to allow for more than one 'receiving' db so if it is too big, I can just spin up a new one and modify db app pointers to the correct dbs.

I'll post results as they are available.

Compacting the 'receiving' db dropped the size to 65 GB, %unused stayed at 100%.

The db design update was accepted on refresh.

The code in the 'sending' db worked fine.

Even though I'm sure that the OS max file size is in the terrabyte range, I went ahead and built a second 'receiving' db and updated all the file pointers in the apps that interact with each other.

Note: since I used the 'copy' compact option I almost ran into a jam. The server has 85 GB free space and the copy operation chewed up almost 70 GB. The process clears the 'duplicate' once the compact is complete so I didn't lose any space overall.

I hate when you spend 3 days chasing the wrong problem! I guess what happened was that the code in the 'sending' db got a message back from the 'receiving' db that the db was too big and rather than popping an error saying 'the receiving db is too big' it just said 'the sending db is too big' leading me to spend time on the wrong db.

My thanks to everyone for their suggestions and assistance.