8 Connect Oracle Database Tools to the Database

Oracle Database Tools such as SQL Developer, SQLcl and SQL*Plus can be used with the Autonomous Transaction Processing.

The following sections provide step-by-step instructions for connecting to Autonomous Transaction Processing using these tools.

Connect to Oracle SQL Developer Web in the Database

Oracle SQL Developer Web, a browser-based application that provides many database development, management and monitoring features, is built into dedicated Autonomous Transaction Processing databases. Therefore, you can use it without downloading or installing additional software on your system.

By default, only the ADMIN database user has access to SQL Developer Web. Before you can sign in as another database user, the ADMIN user must enable access for that user, as described in Enabling User Access to SQL Developer Web in Using Oracle SQL Developer Web.

Note:

To sign into SQL Developer Web, the system you are using must have network access to the dedicated Autonomous Transaction Processing database, as described in Configure a Development System to Access the Database.

To access the SQL Developer Web Sign In page, you direct your browser to a URL of the format:

https://database-host/ords/database-name/user-name/_sdw/

To avoid having to build the correct URL based on this format, you can copy the URL for the ADMIN user from the Database Connection dialog for the database and then just edit the user-name portion, provided that you have an Oracle Cloud user account that permits you to access the database's Details page in the Oracle Cloud console page.

  1. In your web browser, sign in to Oracle Cloud and navigate to the Details page for the dedicated Autonomous Transaction Processing database.

  2. Click DB Connection.

  3. In the Database Connection dialog, click Application Connection.

  4. In the Oracle SQL Developer Web box, click the Copy link in the Access URL field to copy the URL to your clipboard.


    screenshot showing the Oracle SQL Web box

  5. Paste the URL into a text editor and then change "admin" to the user name of the database user you are signing in as. Copy the edited URL and paste it into your web browser's address bar.

For information about the wide-ranging features of SQL Developer Web, see Using Oracle SQL Developer Web.

Connect with Oracle SQL Developer Version 18.2 or Later

Oracle SQL Developer is a free integrated development environment that simplifies the development and management of Oracle Database in both traditional and cloud deployments.

Note:

To connect Oracle SQL Developer to a dedicated Autonomous Transaction Processing database, the system running Oracle SQL Developer must have network access to the database, as described in Configure a Development System to Access the Database.

To create a new connection to a dedicated Autonomous Transaction Processing database, do the following:

  1. Download the zip file containing client credentials for your database to a secure directory on system.
    This zip file is available for download from the database's Details page in the Oracle Cloud console. If you have an Oracle Cloud user account that permits you to access this page, download the credentials as described in Download Client Credentials. Otherwise, you will need to get the zip file from the administrator of the database, together with the password that was used to protect the zip file.
  2. Start Oracle SQL Developer and in the connections panel, right-click Connections and select New Database Connection....
  3. Choose the Connection Type Cloud Wallet.
  4. Enter the following information:
    • Connection Name: Enter the name for this connection.

    • Username: Enter the database username. You can either use the default administrator database account (ADMIN) provided as part of the service or create a new schema, and use it.

    • Password: Enter the password for the database user.

    • Connection Type: Select Cloud Wallet (with the older version, SQL Developer 18.2, this is Cloud PDB)

    • Configuration File : Click Browse, and select the client credentials zip file.

    • Service: Enter the service name. The client credentials file provides the service names.

  5. Click Connect to connect to the database.

Connect with Oracle SQL Developer Versions Earlier Than 18.2

Oracle SQL Developer is a free integrated development environment that simplifies the development and management of Oracle Database in both traditional and cloud deployments.

Note:

To connect Oracle SQL Developer to a dedicated Autonomous Transaction Processing database, the system running Oracle SQL Developer must have network access to the database, as described in Configure a Development System to Access the Database.

Oracle recommends that you use Oracle SQL Developer version 18.2 or later; however, earlier versions of SQL Developer will work with Autonomous Transaction Processing.

To create a new connection to a dedicated Autonomous Transaction Processing database, do the following:

  1. Download the zip file containing client credentials for your database to a secure directory on system.
    This zip file is available for download from the database's Details page in the Oracle Cloud console. If you have an Oracle Cloud user account that permits you to access this page, download the credentials as described in Download Client Credentials. Otherwise, you will need to get the zip file from the administrator of the database, together with the password that was used to protect the zip file.
  2. Start Oracle SQL Developer and in the connections panel, right-click Connections and select New Connection.
  3. Choose the Connection Type Cloud PDB.
  4. Enter the following information:
    • Connection Name: Enter the name for this connection.

    • Username: Enter the database username. You can either use the default administrator database account (ADMIN) provided as part of the service or create a new schema, and use it.

    • Password: Enter the password for the database user.

    • Connection Type: Select Cloud PDB.

    • Configuration File : Click Browse, and select the client credentials zip file.

    • Keystore Password: Enter the password generated while downloading the client credentials from Autonomous Transaction Processing.

    • Service: Enter the service name. The client credentials file provides the service names.

Connect with Oracle SQLcl

SQLcl (Oracle SQL Developer Command Line) is a command-line interface for Oracle Database. It allows you to interactively or batch execute SQL and PL/SQL. SQLcl provides in-line editing, statement completion, and command recall for a feature-rich experience, all while also supporting your previously written SQL*Plus scripts.

Note:

To connect Oracle SQLcl to a dedicated Autonomous Transaction Processing database, the system running Oracle SQLcl must have network access to the database, as described in Configure a Development System to Access the Database.

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

SQLcl can connect to a dedicated Autonomous Transaction Processing database using either an Oracle Call Interface (OCI) or a JDBC thin connection.

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

SQLcl: Release 18.4 Production on Wed Apr 03 15:28:40 2019

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

Username? (''?) sales_trans@atpc1_low
Password? (**********?) **************
Last Successful login time: Wed Apr 03 2019 15:29:19 -07:00

Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.4.0.0.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 dedicated Autonomous Transaction Processing database.

  1. Start SQLcl with the /nolog option.
    sql /nolog
    
  2. Configure the SQLcl session to use your Oracle Wallet:
    SQL> set cloudconfig directory/client_credentials.zip
    Wallet Password:  **********
  3. Connect to the Autonomous Transaction Processing database:
    SQL> connect username@servicename
    password

    For example:

    sql /nolog
    
    SQLcl: Release 18.4 Production on Thu Jan 24 11:29:41 2019
    
    Copyright (c) 1982, 2019, Oracle.  All rights reserved.
    
    SQL> set cloudconfig /home/atpc/wallet_ATPC1.zip
    Wallet Password:  **********
    
    SQL> connect admin@atpc_medium
    

For more information, on the connection types specified in tnsnames.ora, see Database Services for Autonomous Transaction Processing Databases.

For information on SQLcl, see Oracle SQLcl.

Connect with SQL*Plus

SQL*Plus is a command-line interface used to enter SQL commands. SQL*Plus connects to an Oracle database.

Note:

To connect SQL*Plus to a dedicated Autonomous Transaction Processing database, the system running SQL*Plus must have network access to the database, as described in Configure a Development System to Access the Database.

To install and configure the client and connect to a dedicated Autonomous Transaction Processing database using SQL*Plus, do the following:

  1. Prepare to connect by following the instructions in Download, Install and Configure Oracle Instant Client.
  2. Connect using a database user, password, and database service name provided in the tnsnames.ora file.

    For example:

    sqlplus sales_trans@atpc1_low  
    
    SQL*Plus: Release 18.0.0.0.0 - Production on Wed Apr 3 15:09:53 2019
    Version 18.5.0.0.0
    
    Copyright (c) 1982, 2018, Oracle.  All rights reserved.
    
    Enter password:
    Last Successful login time: Wed Apr 03 2019 14:50:39 -07:00
    
    Connected to:
    Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
    Version 18.4.0.0.0
    
    SQL>

    Note:

    The Oracle Wallet is transparent to SQL*Plus because the wallet location is specified in the sqlnet.ora file. This is true for any Oracle Call Interface (OCI), ODBC, or JDBC OCI connection.