11 July 2010

Connecting Without TNSNames With EZConnect

On my laptop I run two databases, Oracle 10g Release 2 and Oracle 11g Release 2. Next to my regular consulting work, I also give an Oracle Advanced SQL and PL/SQL training called "7Up". This training covers "all" new features since Oracle7.
I tried using VM for having multiple versions of the database, but my laptop would grind to a halt.
Anyway, usually I use SQL*Plus for all my demo's - SQL*Plus Windows that is. As you may know, SQL*Plus Windows vanished from the Oracle 11g database.
Until now I was using SQL*Plus commandline instead, and that was fine.
Last week I received the latest Oracle Magazine (July/August 2010) at home and in it was the AskTom column on connecting without TNSNames.

Just having a single shortcut on my desktop to connect to either the Oracle 10g database or the Oracle 11g database would make it easier to switch databases and show the differences between the two. I like the SQL*Plus Windows a little bit better over the SQL*Plus commandline version, it just feels more natural. I tried using SQL Developer for the demo's, but found zooming in and out to show snippets of SQL too distracting from the actual statement.
Because I probably forget what to use as the connect string, I had to write this down somewhere. And since this is my "Things I got to remember" blog,.. here it is:

SQL> conn alex/alex@//localhost/orcl11
SQL> select *
2 from v$version
3 /

Personal Oracle Database 11g Release - Production
PL/SQL Release - Production
CORE Production
TNS for 32-bit Windows: Version - Production
NLSRTL Version - Production

This works because I have EZCONNECT in my SQLNet.Ora:


Credit goes to Tom Kyte, of course.
Oracle Magazine: On Connecting, Pivoting, and Learning New Tricks


  1. When someone writes an article he/she keeps the thought of a user in his/her brain that how a user can be aware of it. Therefore that’s why this post is outstdanding.Thanks!


  2. I love your blog. Keep it up.Visit my site too.