NSRIM – nsrim.prv !!


nsrim–NetWorker index management program

DESCRIPTION The nsrim program is used to manage the NetWorker online file and media indexes.It can also be used to manage the save set lists and policy definitions stored on an Avamar node when the–S flag is supplied.
Normally, nsrim is invoked by savegrp(1m) command on completion, and by nsrd(1m) when Remove oldest cycle is selected from the NetWorker Administrator program. nsrim is not normally run manually. However, the command’s modes can be modified such that normal users may run the command while retaining root privileges; see nsr(1m) for more details. When the savegrp (1m) command launches nsrim at the end of its task, it checks the timestamp of the file /nsr/mm/nsrim.prv. If the timestamp of this file is greater than or equal to 23 hours, nsrim marks all save sets that are past their browse and retention policy as recyclable. If save sets need to be monitored for their browse and retention policy more frequently (for example, if savegrp(1m) is run more frequently than every 23 hours), nsrim –X should be set up as acron(1m) entry, or it should be run manually.

A recyclable save set on a tape volume is removed when the tape the save set is on is relabeled. A recyclable save set residing on a file type or an adv_filetype device is removed by nsrim on the same day it becomes recyclable

1. /nsr/mm/nsrim.prv An empty file is used to track the last time that the program nsrim was started to perform maintenance on the NetWorker databases.

2. Run the nsrim command to synchronize NetWorker and the EMC Backup and Recovery appliance.

3. To reduce the size of the media management database, run the nsrim -C command. Be aware that this command may take a long time to run and that the NetWorker server will be unavailable during this time. Run the command when the NetWorker server is not busy.

4. (Filesystem full – recovering adv_file space): Launches the nsrim program to remove aborted and expired save sets. Used with advanced file type devices only.

5. Checking online indexes:
Each time the NetWorker server starts, it uses nsrck -ML1 to perform a level 1 consistency check on the client file indexes. In some circumstances, this consistency check will not detect corruption in the client file indexes. If you believe an index may be corrupt, run a higher level check on the index, for example: nsrck -L5
If the index is still corrupt, recover the index by using the procedure outlined in Recovering expired save sets.

6. It is also good maintenance practice to periodically run the nsrck -F and nsrim -X commands to check the integrity of the client and media indexes. The EMC NetWorker Command Reference Guide or the UNIX man pages provide more information about these commands.

Compressing the media database

You can free up more space on the server by compressing the media database.
To compress the media database:

1. Delete the appropriate file:

o On Windows: NetWorker_install_dirmm.cmprssd

o On UNIX: /nsr/mm/.cmprssd

2. Type at the command prompt: nsrim




More than one nsrim process running. The first nsrim is active, other nsrim processes seems to be inactive.


If you start nsrim manually, or through your own scheduler, there may be situations in which a new process will start, but the previous one is still running.When nsrim starts, it touches /nsr/mm/nsrim.prv. This prevents NetWorker from automatically starting a new process within the next 23 hours.

However, if nsrim is started manually, it will bypass the /nsr/mm/nsrim.prv ctime check. The next step for nsrim is to lock the file /nsr/tmp/.nsrim. If this file is already locked, wait until it is released and can be locked again.


If one nsrim process is already running, new nsrim running at the same time will not do any work until /nsr/tmp/.nsrim is released.


Fact: NetWorker
Fact: Performance
Fact: nsrim -X
Fact: nsrck
Fact: nsrim.prv
Symptom: When does nsrim run and does it kick off nsrck?
Symptom: Slow backups
Symptom: Backups are slow
Symptom: Slow response
Symptom: Networker server is slow
Symptom: The index cross checking is being run during busy time (nsrim)
Cause: The nsrim program was built to run during the following times:

1) When nsrd is restarted.
2) When a savegroup completes.
3) When a client file index is purged.
4) Once every 24 hours.

In a large environment, nsrim may cause backup operations to slow because the nsrim is run when other savegroups have not completed.
Fix: Error! Hyperlink reference not valid.

Known issue: LGTpa44109 Request For Enhancement (RFE),Contact LEGATO Software (Division of EMC) Customer Support for further details


The original NetWorkermodel (Pre 5.0) assumed that there would be one group which runs once per night. Hence nsrim aka ‘Index management’ would then be run once per night after the group finished running. With the advent of multiple groups this was aproblem and NetWorker ended up running nsrim too frequently depending on how many groups ran during the day.

To fix this, code was modified in savegrp to use a smarter approach by nsrmmdbd and that is to create a file nsrim.prv and run nsrim if the file doesn’t exist or if it is older then 23 hours. So now savegrp check for the existence of this file in the /nsr/mm directory.
If it does not exist or it is older than 23 hrs it starts nsrim. Also nsrim will touch the file when it runs, whether started automatically or by hand and hence you will see the date modified to be current to what it is when it last ran.

This implies that a potential workaround you can try is to either “touch” this file once per day before NetWorker gets there, or run a scheduled “nsrim-X” daily at a time when it
will have less impact on your operation. The latter is the preferred operation as this will still provide some measure of data consistency.

Finally note that nsrim calls nsrindexd which spawns nsrckfor Consistency Checking.

If the above workaround does not help do the following:

1. Ensure that there is no activity on the backup server
2. Stop the NetWorker services
3. Empty the contents of …\nsr\tmp directory by deleting everything in
it except the tmp directory itself (please note that, you must be logged
on as the local administrator on the server for windows, or root for Unix) to do this.
4. Restart NetWorker services
5. Run nsrim -X (twice if the first takes longer to complete) to crosscheck the media database with the indexes.


About Ahmad Sabry ElGendi

This entry was posted in E20-597. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s