SQL*Plus Error OID generation failed

I received this error on a MacBook, when trying to connect with SQL*Plus to my database:

SQL*Plus: Release Production on Mon Nov 21 08:27:22 2016

Copyright (c) 1982, 2016, Oracle. All rights reserved.

ORA-21561: OID generation failed

The issue comes from not having the MacBook’s hostname associated with the home IP address. To fix this, simply find your hostname:

~$ hostname

Then edit your /etc/hosts file and add the home name to the home IP address:       localhost MY_MACBOOK

Also make sure that when you edit the hosts file, that you are not connected to a VPN. Some VPN clients may overwrite the hosts file.