If any thing does wrong with the RPM database, you can use following way to rebuild the RPM database.
First remove the /var/lib/rpm/__db* files.
root@server [~]# cd /var/lib
root@server [~]#
rm __db*
RPM Database rebuild:
root@server [~]# rpm --rebuilddb
root@server [~]# rpmdb_verify Packages