Background:
Multiple Linux servers require the installation of an Oracle client to perform business processing with the Oracle database connection.
After the first installation, the installed directory is compressed and copied directly to several other machines, and when the Sqlplus connection database is started, the user name and password are always prompted.
[xxxxxxx]$ sqlplus user/[email protected]sql*plus:release 11.2.0.4.0 Production on Fri Feb 5 10:56:38 2016Copyright (c) 1 982, Oracle.
Error ora-21561:oid generation failed output was found using Strace trace.
Strace sqlplus User/[email protected]
Close (5) = 0write (1, "error:\n", 7ERROR:) = 7write (1, "ora-21561:oid generation Failed" ..., 33ora-21561:oid Gen Eration failed) = 33write (1, "\ n", 1) = 1write (1, "\ n", 1) = 1write (1, "Enter user-name:", 17Enter user-name:)
= 17fstat (0, {st_mode=s_ifchr|0620, St_rdev=makedev (136, 1), ...}) = 0mmap (NULL, 4096, prot_read| Prot_write, map_private| Map_anonymous,-1, 0) = 0x7feaa51c9000read (0, ^c <unfinished ...>
The error ora-21561:oid generation failed is caused by inconsistencies in hostname and host name in the Hosts file.
Workaround:
Querying the host name of a machine using the command hostname
[Xxxxx]$ hostnamebillingserver001
Modify the/etc/hosts file to add the host name to the hosts file.
[xxxxx]$ cat/etc/hosts127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost localhost.localdomain localhost6 localhost6.localdomain6192.168.1.2 billingserver001
Re-use Sqlplus User/[email protected] to connect to the database, the connection is successful.
[xxxxx]$ sqlplus user/[email protected]sql*plus:release 11.2.0.4.0 Production on Fri Feb 5 11:05:57 2016Copyright (c) 198 2, Oracle. All rights reserved. Connected to:oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit productionwith The partitioning, OLAP, Data Mining and Real Application testing optionssql>
Done.
Sqlplus Connecting Oracle Failure Analysis and resolution