This is a rather specific problem.
I'm doing some work in a Java project that uses a database access framework, originally designed to work with Oracle DB 9i.
To work on this project I needed an Oracle DB on my Mac, running OSX Mountain Lion, and the only apparent solution was to run it in a VM. Therefore I downloaded the OTN Developer Day VM from here which comes complete with an Oracle DB 12c instance.
After jumping through various hoops, I have gotten my Eclipse/Tomcat/Servlets setup to talk to the 12c database with the jdbc7 driver, which I downloaded from the Oracle site. Everything works as expected, and as a note, Oracle SQL Developer connects to it just fine.
Here's the connection string I'm using: jdbc:oracle:thin:@localhost:1521/pdb1
I can log on as local users I have created within the default pluggable DB, or by using the connection string jdbc:oracle:thin:@localhost:1521:orcl
I can log on as any of the common users that are set up.
Now, the trick is when I want to use the Java DB access framework, designed for use with a 9i DB. I get the error: ORA-28040: No matching authentication protocol
.
Based on what I could find, such as this Oracle thread, my 12c database is not configured to allow 9i-style authentication (due to security holes in 9i). So to fix this, I need to set my DB to allow this by going to this file:
/u01/app/oracle/product/12.1.0/dbhome_1/network/admin/sqlnet.ora
And adding the line:
SQLNET.ALLOWED_LOGON_VERSION=(9)
(Note that I have also tried (8)
, as well as (12,11,10,9,8,7)
and other such oddities, and I still experience the following. I've also seen SQLNET_ALLOWED...
, the underscore instead of the period, but I think that's for older Oracle DB versions.)
When I do this, and reboot the VM, I can no longer connect to the DB. When I attempt to connect to pdb1
I get:
An error was encountered performing the requested operation:
IO Error: The Network Adapter could not establish the connection
Vendor code 17002
And when I attempt to connect to orcl
I get:
An error was encountered performing the requested operation:
Listener refused the connection with the following error:
ORA-12528, TNS:listener: all appropriate instances are blocking new connections
Vendor code 12528
When I go into the terminal in the VM and check the status of the service with lsnrctl (something I found with a bit of Googling) this happens:
Services Summary...
Service "orcl" has 1 instance(s).
Instance "orcl", status BLOCKED, has 1 handler(s) for this service...
The command completed successfully
LSNRCTL>
Unfortunately, I am quite the lightweight on Oracle DB and DB administration in general; I would prefer to simply code stuff and have the DB just work, but I do need to get this DB access framework to work, and I only have a copy of Oracle 12c, not 9i, so I'm in a bind.