Connect Oracle SQLcl Cloud Without a Wallet

SQLcl is a command-line interface used to enter SQL commands. You can use SQLcl to connect to an Autonomous Database with TLS authentication without a wallet.

Note

See Update your Autonomous Database Instance to Allow both TLS and mTLS Authentication for information on allowing TLS connections.

You can use SQLcl version 4.2 or later with Autonomous Database. Download SQLcl from oracle.com.

If you use JDBC Thin Driver, prepare for JDBC Thin connections. See Prepare for JDBC Thin Connections.

To connect using a JDBC Thin Driver with TLS authentication, do the following to connect to the database.

  1. Copy a connection string for the Autonomous Database.

    To connect with TLS authentication copy a TLS connection string. On the Database Connection page, under TLS Authentication, select TLS to view the connection strings for connecting with TLS authentication.

    See View TNS Names and Connection Strings for an Autonomous Database Instance for information on viewing and copying connection stings.

    See Database Service Names for Autonomous Database for information on the different databases services for each connection string.

  2. Start SQLcl and connect to the database:

    On UNIX/Linux start sql with the connection string, enclosed in quotes on the command line, as follows:

    sql username/password@'my_connect_string'

    For example (for clarity line breaks added):

    $ sql admin/password@'(description= (retry_count=20)(retry_delay=3)
    (address=(protocol=tcps)(port=1521)(host=adb.region.oraclecloud.com))
    (connect_data=(service_name=u9adutfb2ba8x4d_database_medium.adb.oraclecloud.com))
    (security=(ssl_server_dn_match=yes)))'
    
    SQLcl: Release 21.2 Production on Thu Sep 16 10:43:00 2021
    Copyright (c) 1982, 2021, Oracle. All rights reserved.
    
    Last Successful login time: Thu Sep 16 2021 10:43:01 -07:00
    
    Connected to:
    Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
    Version 19.12.0.1.0
    
    SQL>

    On Windows, start sql with the /nolog option and then connect with the copied connection string, as follows (as compared to UNIX/Linux, on Windows do not surround the connection string with quotes):

    > sql /nolog
    
    SQLcl: Release 21.2 Production on Fri Sep 17 10:15:01 2021
    Copyright (c) 1982, 2021, Oracle.  All rights reserved.
    SQL> conn username/password@my_connect_string
    

    For example (for clarity line breaks are added):

    > sql admin/password@(description= (retry_count=20)(retry_delay=3)
    (address=(protocol=tcps)(port=1521)(host=adb.region.oraclecloud.com))
    (connect_data=(service_name=u9adutfb2ba8x4d_database_medium.adb.oraclecloud.com))
    (security=(ssl_server_dn_match=yes)))
    
    SQLcl: Release 21.2 Production on Thu Sep 16 10:43:00 2021
    Copyright (c) 1982, 2021, Oracle. All rights reserved.
    
    Last Successful login time: Thu Sep 16 2021 10:43:01 -07:00
    
    Connected to:
    Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
    Version 19.12.0.1.0
    
    SQL>
Note

If you are connecting to Autonomous 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 information on SQLcl, see Oracle SQLcl.