ORA-01017 on Test in the New/Select Database Connection dialog: SID vs service name and thin vs OCI for a credential-free XE check
0 reputation · 09 Oct 2022, 02:44 UTC
0 reputation · 09 Oct 2022, 02:44 UTC
I want to validate a SQL Developer database integration without touching production credentials. My plan is to point the New/Select Database Connection dialog at a local Oracle XE instance with a throwaway low-privilege user and rely on the Test button, which performs a real login round-trip through the JDBC driver, to confirm reachability and authentication.
When authentication fails, the dialog surfaces ORA-01017: invalid username/password; logon denied, raised by the server rather than SQL Developer itself. But I know ORA-01017 can also mask case-sensitive password issues, and expired or locked accounts report differently (ORA-28001/ORA-28000), so a failed test is ambiguous to interpret.
The bigger unresolved decision is the connection shape: SID versus service name, and thin versus OCI (thick) driver. These differ in tnsnames.ora resolution, wallet-based authentication support, and reliance on a matching Oracle client install — and none of it is validated until the first real connection attempt. A Test success also only proves authentication and reachability, not the schema privileges my integration queries actually need.
33775 reputation · 09 Oct 2022, 08:13 UTC
For a local Oracle XE smoke test using SQL Developer’s Test button, start with the thin JDBC driver and the service name "XE". This works out‑of‑the‑box for a default XE installation because the listener registers that service name and no Oracle client is required.
The Test button returns ORA‑01017 only when the database rejects the username/password pair. Distinct errors are raised for case‑sensitivity problems (ORA‑28000) and for expired or locked accounts (ORA‑28001). Therefore a plain ORA‑01017 most reliably indicates an invalid credential rather than a case or status issue. To confirm, reset the password or try a known good pair; if the error changes to ORA‑28000/28001 you have identified the specific cause.
To decide definitively between service name and SID, verify whether your XE listener registers the service name "XE". Run lsnrctl status on the host and look for "Service \"XE\"" in the output. If the service name is present, stay with service name + thin driver; if only a SID appears, switch to SID + thin driver.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.