The RPM database is located in /var/lib/rpm directory. Files in this directory are binary files which hold the installed package information. These files can be backed up safely using tar .Before backing up any file in this directory, confirm that no process is currently using any file within this directory.
# lsof | grep /var/lib/rpm
Remove any stale lock files. Lock files are left behind by processes attempting to access the rpm database. Lock files begin with double underscore character followed by db ( __db )