The following connection format method is supported by 8i/9i/10g:
C:\>sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Dec 5 17:40:22 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn anysql/anysql@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=localhost)(Port=1521))(CONNECT_DATA=(SID=TEST)))
Connected.
SQL>
Yong Huang, one of my friends said there is another format in 10g, then I think of it should be the same as new JDBC url format, the following format works on 10g, but does not work on 8i/9i:
C:\>sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Dec 5 17:44:38 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn anysql/anysql@localhost:1521/TEST
Connected.
SQL>
If you are in trouble with the tnsnames.ora configuration, try this format. OCI and Pro*C program can use this format also, it's implemented at Oracle network layer.