Aus der Kategorie „Heute dazugelernt“: Beim Versuch, mittels EZCONNECT (s. „Easy Connect Naming Method„) unter Verwendung eines Wallets eine Verbindung aufzubauen (um kein Passwort auf der Kommandozeile/im Script zu hinterlassen), wurde das stets mit einem „ORA-12504“ quittiert.
[oracle@myorabox bin]$ sqlplus scott@localhost/orcl SQL*Plus: Release 11.2.0.3.0 Production on Mon Feb 24 16:19:14 2014 Copyright (c) 1982, 2011, Oracle. All rights reserved. ERROR: ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA
Seltsam — der Service „orcl“ ist doch angegeben?! Werfen wir mal einen Blick ins listener.log:
(CONNECT_DATA=(SERVICE_NAME=)(CID=(PROGRAM=sqlplus)(HOST=myorabox)(USER=oracle))) * establish * 12504
Tatsache — der „SERVICE_NAME“ ist leer.
Interessanterweise findet sich bei MOS nichts dazu, aber Mark Williams hat das Problem schon mal gelöst und netterweise gebloggt! Offenbar „verheddert“ sich SQL*Plus am fehlenden „/“ vor dem nicht übergebenen Passwort; Wird der Connect String jedoch in Anführungszeichen gesetzt, dann geht’s!
sqlplus scott@\"localhost/orcl\" SQL*Plus: Release 11.2.0.3.0 Production on Mon Feb 24 16:31:38 2014 Copyright (c) 1982, 2011, Oracle. All rights reserved. Enter password: Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options