How to compare binary files after copying?

When you are copying oracle files (datafiles, archivelogs, controlfiles, etc) or any binary file one can compare if the files are the same as original file using cksum or sum command.

Example, if the files weren’t the same the values returned would be different, note in this example the database was shutdown
$ cp -p control02.ctl control02.ctl.bkp
$ cksum control02.ctl control02.ctl.bkp
3436546601 9388032 control02.ctl
3436546601 9388032 control02.ctl.bkp

$ sum control02.ctl control02.ctl.bkp
32903 9168 control02.ctl
32903 9168 control02.ctl.bkp

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 )

Facebook photo

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

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.