Getting started with SQLCL

I blogged briefly before here and here about SQLcl and thought I’d write a walkthrough of using it while I explored the various features.

Firstly how do you install it? Well head over to the download page here.

You should get a zipfile (I renamed the file for brevity) –

 
bash-3.2$ ls -al 
total 34120 
drwxr-xr-x 3 jes staff 102 14 Jun 19:09 . 
drwxr-xr-x+ 76 jes staff 2584 14 Jun 19:09 .. 
-rw-r--r--@ 1 jes staff 17466359 14 Jun 19:09 sqlcl.zip 

unzipping this extracts quite a few files

 
bash-3.2$ unzip sqlcl.zip
Archive: sqlcl.zip
 inflating: sqlcl/bin/sql
 inflating: sqlcl/bin/sql.bat
 inflating: sqlcl/bin/sql.exe
 inflating: sqlcl/lib/SQLinForm.jar
 inflating: sqlcl/lib/commons-codec.jar
 inflating: sqlcl/lib/commons-logging.jar
 inflating: sqlcl/lib/httpclient.jar
 inflating: sqlcl/lib/httpcore.jar
 inflating: sqlcl/lib/httpmime.jar
 inflating: sqlcl/lib/jackson-annotations.jar
 inflating: sqlcl/lib/jackson-core.jar
 inflating: sqlcl/lib/jackson-databind.jar
 inflating: sqlcl/lib/javax.json.jar
 inflating: sqlcl/lib/jline.jar
 inflating: sqlcl/lib/jsch.jar
 inflating: sqlcl/lib/ojdbc7.jar
 inflating: sqlcl/lib/oracle.dbtools-common.jar
 inflating: sqlcl/lib/oracle.dbtools.http.jar
 inflating: sqlcl/lib/oracle.dbtools.jdbcrest.jar
 inflating: sqlcl/lib/oracle.sqldeveloper.sqlcl.jar
 inflating: sqlcl/lib/oraclepki.jar
 inflating: sqlcl/lib/orai18n-mapping.jar
 inflating: sqlcl/lib/orai18n-utility.jar
 inflating: sqlcl/lib/orai18n.jar
 inflating: sqlcl/lib/orajsoda.jar
 inflating: sqlcl/lib/osdt_cert.jar
 inflating: sqlcl/lib/osdt_core.jar
 inflating: sqlcl/lib/xdb6.jar
 inflating: sqlcl/lib/xmlparserv2.jar

this should have created a sqlcl sub-folder in the directory you unzipped the file in

 
bash-3.2$ ls -al
total 34120
drwxr-xr-x 4 jes staff 136 14 Jun 19:37 .
drwxr-xr-x+ 76 jes staff 2584 14 Jun 19:09 ..
drwxr-xr-x@ 4 jes staff 136 14 Jun 19:37 sqlcl
-rw-r--r--@ 1 jes staff 17466359 14 Jun 19:09 sqlcl.zip

inside the sqlcl folder you’ll find a bin and lib folder

 
bash-3.2$ cd sqlcl
bash-3.2$ ls -al
total 0
drwxr-xr-x@ 4 jes staff 136 14 Jun 19:37 .
drwxr-xr-x 4 jes staff 136 14 Jun 19:37 ..
drwxr-xr-x@ 5 jes staff 170 14 Jun 19:37 bin
drwxr-xr-x@ 28 jes staff 952 14 Jun 19:37 lib

in the bin directory you will find the sql command

 
bash-3.2$ cd bin
bash-3.2$ ls -al
total 840
drwxr-xr-x@ 5 jes staff 170 14 Jun 19:37 .
drwxr-xr-x@ 4 jes staff 136 14 Jun 19:37 ..
-rwxr-xr-x@ 1 jes staff 13781 14 Jun 19:37 sql
-rwxr-xr-x@ 1 jes staff 2585 14 Jun 19:37 sql.bat
-rwxr-xr-x@ 1 jes staff 406507 14 Jun 19:37 sql.exe

you’ll notice there’s a sql command, a sql.bat and a sql.exe file (since this is a single download regardless of operating system).

Since I’m on a Mac I can just invoke the sql command

 
bash-3.2$ ./sql

SQLcl: Release 4.1.0 Release Candidate on Tue Jun 14 19:42:12 2016</span>

Copyright (c) 1982,2016, Oracle. All rights reserved.

Username? (''?)

and we’re good to go! in the next post I’ll connect to a database and explore some of the commands.

One thought on “Getting started with SQLCL

  1. Pingback: Connecting to a database with SQLcl | Johns Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s