Skip navigation.

Barry McGillin

Syndicate content
Oracle SQL Developer and Database Migration, with lots of core Oracle tech as well!Barry McGillin
Updated: 1 hour 58 min ago

Connections Types in SQLcl

Fri, 2015-02-20 05:07

We support many ways to connect in SQLcl, including lots from SQL*Plus which we need to support to make sure all your SQL*Plus scripts work exactly the same way using SQLcl as with SQL*Plus.
I've added several ways to show how to connect to SQLcl.  If there is one you want to see added that is not here, let me know and I'll add it to the list.  So far, We have below:
  • EZConnect
  • LDAP
At any time when connected you can use the command 'SHOW JDBC'  to display what the connection is and how we are connected.  Here's some details of the types above.

The easy connect naming method eliminates the need for service name lookup in the tnsnames.ora files for TCP/IP environments.  It extends the functionality of the host naming method by enabling clients to connect to a database server with an optional port and service name in addition to the host name of the database:
 $sql barry/oracle@localhost:1521/orcl  
SQLcl: Release 4.1.0 Beta on Fri Feb 20 10:15:12 2015
Copyright (c) 1982, 2015, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release - 64bit Production

The TWO_TASK (on UNIX) or LOCAL (on Windows) environment variable can be set to a connection identifier. This removes the need to explicitly enter the connection identifier whenever a connection  is made in SQL*Plus or SQL*Plus Instant Client. 
In SQLcl, we can set this up as a jdbc style connection like this

$export TWO_TASK=localhost:1521/orcl  


Local Naming resolves a net service name stored in a tnsnames.ora file stored on a client.  We can set the location of that in the TNS_ADMIN variable.

 $export TNS_ADMIN=~/admin  

An example tons entry is shown here below.

 $cat tnsnames.ora   
(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521) )
(SERVICE_NAME=orcl) ) )

we can then use the entry to connect to the database.

 $sql barry/oracle@BLOG  
SQLcl: Release 4.1.0 Beta on Fri Feb 20 10:29:14 2015
Copyright (c) 1982, 2015, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release - 64bit Production


We've already written about LDAP connections here.  Here's a quick review.

  set LDAPCON jdbc:oracle:thin:@ldap://,cn=OracleContext,dc=ldapcdc,dc=lcom   

 $export LDAPCON=jdbc:oracle:thin:@ldap://,cn=OracleContext,dc=ldapcdc,dc=lcom   
$sql /nolog
SQLcl: Release 4.1.0 Beta on Fri Feb 20 10:37:02 2015
Copyright (c) 1982, 2015, Oracle. All rights reserved.
SQL> connect barry/oracle@orclservice_test(Emily's Desktop)

If we have more types to add, then they will appear here.  Let us know what you want to see.

Code Insight on SQLcl

Thu, 2015-02-19 17:29
Here's a little preview of the code insight we have in SQLcl.  These changes are part of EA2 which are coming out very soon.  This also shows the buffer and cursor management which was introduced in SQLcl

This allows you to move around the buffer easily and add and change text as you would in a normal text editor, not a console window like this.

We're also adding hotkeys to run the buffer from anywhere or to jump out of the buffer to do something else without losing the contents of the buffer.

Stayed tuned for this soon.

SQLCl - LDAP anyone?

Fri, 2015-01-23 09:02
since  we released our first preview of SDSQL, we've made  a lot of changes to it and enhanced a lot of things too in there so it would be more useable.  One specific one was the use of LDAP which some customers on SQLDeveloper are using in their organisations as a standard and our first release precluded them from working with this.

Well, to add this, we wanted a way that we could specify the LDAP strings and then use them in a connect statement.  We introduced a command called SET LDAPCON for setting the LDAP connection.  You can set it like this at the SQL> prompt
 set LDAPCON jdbc:oracle:thin:@ldap://,cn=OracleContext,dc=ldapcdc,dc=lcom  

or set it as an environment variable
 (~/sql) $export LDAPCON=jdbc:oracle:thin:@ldap://,cn=OracleContext,dc=ldapcdc,dc=lcom  

Then you can come along and as long as you know your service name, we're going to swap out the ENTRY delimiter in the LDAP connection with your service.  We're working on a more permanent way to allow these to be registered and used so they are more seamless.

In the meantime, you can then connect to your LDAP service like this
 BARRY@ORCL>set LDAPCON jdbc:oracle:thin:@ldap://,cn=OracleContext,dc=ldapcdc,dc=lcom  
BARRY@ORCL>connect barry/oracle@orclservice_test(Emily's Desktop)

Here's a qk little video of it in action!  You can then use  the 'SHOW JDBC' command to show what you are connected to.

This is the latest release which should be online soon, and you  can download it from here.