SQLcl is a command-line interface used to enter SQL commands. SQLcl connects to an Oracle database.
You can use SQLcl version 4.2 or later with Autonomous Database. Download SQLcl from oracle.com.
SQLcl can connect to the Autonomous Database using either an Oracle Call Interface (OCI) or a JDBC thin connection.
If you use Oracle Call Interface (OCI), prepare for OCI, ODBC and JDBC OCI Connections. See Prepare for Oracle Call Interface (OCI), ODBC, and JDBC OCI Connections.
If you use JDBC Thin, prepare for JDBC Thin Connections. See Prepare for JDBC Thin Connections.
SQLcl with Oracle Call Interface
To connect using Oracle Call Interface, use the
–oci option, supply the database user
name, a password, and the database service name provided in the
tnsnames.ora file. For example:
sql -oci Copyright (c) 1982, 2020, Oracle. All rights reserved. Username? (''?) adb_user@db2020adb_medium Password? (**********?) * Last Successful login time: Tue Nov 24 2020 08:02:07 -08:00 Connected to: Oracle Database 19c Enterprise Edition Release 18.104.22.168.0 - Production Version 22.214.171.124.0 SQL>
When connecting using Oracle Call Interface, the Oracle Wallet is transparent to SQLcl.
SQLcl with a JDBC Thin Connection
To connect using a JDBC Thin connection, first configure the SQLcl cloud configuration and then connect to the database.
- Start SQLcl with the /nolog option.
- Configure the SQLcl session to use your Oracle Wallet:
SQL> set cloudconfig directory/client_credentials.zip
- Connect to the database:
SQL> connect username@servicename password
sql /nolog SQLcl: Release 20.3 Production on Tue Nov 24 08:03:44 2020 Copyright (c) 1982, 2020, Oracle. All rights reserved.
SQL> set cloudconfig /home/adb/wallet_db2020ADB.zip Operation is successfully completed. SQL> connect adb_user@db2020adb_medium Password? (**********?) * Connected. SQL>
If you are connecting the database using Microsoft Active Directory credentials, then connect using an Active Directory user name in the form of "AD_domain\AD_username" (double quotes must be included), and Active Directory user password. See Use Microsoft Active Directory with Autonomous Database for more information.
For more information, on the connection types
tnsnames.ora, see Manage Concurrency and Priorities on Autonomous Database.
For information on SQLcl, see Oracle SQLcl.