SQL Worksheets

The SQL Worksheet provides a web-based SQL workspace where you can enter SQL statements directly in the browser using a database connection. From the SQL Worksheet, you can run SQL statements or scripts against the database, and create database objects.

You need to create a connection to use the SQL Worksheet. The SQL Worksheet utilizes the connection you create with the service to provide you the ability to run SQL commands and scripts from the Console. Scripts used in the SQL Worksheet can reside in either OCI Object Storage or on your local drive. Using the Connection selection menu, you can change the connection that the SQL Worksheet is using instantly.

Connections are resources that contain the necessary information for accessing an Oracle Database in OCI. Connections are created by simply providing information about the location of the database. The connection also contains the user used to access the database and the location of the password that is stored in the OCI Vault.

For more information about:

This article describes how to create a connection, launch, and use the SQL worksheet using the Console.

Related Topics

Create a Connection

Perform the following steps to create a connection.

  1. Open the navigation menu. Select Oracle Database, then select Oracle Base Database.
  2. Select your Compartment. A list of DB systems is displayed.
  3. In the list of DB systems, find the DB system containing the PDB you want to use. Click the DB system name to display details about it.
  4. In the list of databases, find the database containing the PDB you want to use. Click the database name to display details about it.
  5. In the Resources section of the page, click Pluggable Databases.
  6. In the list of PDBs, find the PDB, and click the PDB name to display details about it.
  7. Click Create connection.
  8. Provide the following information about the connection:
  9. Name: A user-friendly informative name to describe the connection.
  10. Compartment: Choose a compartment you have permission to work in for the connection.
  11. Username: The database user you want to use for the connection.
  12. Role: Use this menu to select a high-level, system wide administrative privileged role to be granted to the user you provided. If no role is needed, you can leave the default value.
  13. User password secret: This menu is populated with any secrets you have access to from the Oracle Cloud Infrastructure Vault. Click Change compartment to find a secret in a different compartment.
  14. Create password secret: If no secrets are listed or a new secret must created, use this and provide the following information in the Create password secret dialog:
    1. Name: Give the secret a name. Do not use the password or hints of the password in the name. For example, if a connection to the sales PDB is needed for the DBA user, the name could be salesPDB-DBA.
    2. Description: Optionally, provide a description of the secret.
    3. Compartment: Select a compartment which you would like to create the secret in.
    4. Vault: Choose an OCI vault that you have access to where the secret will be kept. Click Change compartment to find a vault in a different compartment.
    5. Encryption key: Select an encryption key to be used to encrypt the supplied password in the vault. Click Change compartment to find an encryption key in the same vault that is contained a different compartment.
    6. User password: Provide the password for the user.
    7. Confirm user password: Retype the password previously entered.
    8. Click Create when done to create the secret in the vault.
  15. The Connection string field is pre-populated.
  16. Use the Access database via a private network checkbox to designate that this connection will use a Private Endpoint. Then select the endpoint using the select private endpoint menu. Click Change compartment to find a private endpoint in a different compartment.
  17. After you complete the Connection Details section, click Next.
  18. In the SSL details section, provide secure connection details.
  19. A wallet must be provided when the use of mutual TLS (mTLS) authentication is required, or when TLS authentication is used and the database returns a certificate not signed by a trusted certificate authority. Oracle recommends using an SSO wallet.

    Choose one of the following options in the Wallet format menu:

    • None
    • Java Key Store (e.g., keystore.jks, truststore.jks)
    • PKCS#12
    • SSO wallet (e.g, cwallet.sso)
  20. Click Create to create the Database Connection.

For more information, see Managing a Connection.

Launch SQL Worksheet

Perform the following steps to launch the SQL Worksheet.

  1. Open the navigation menu. Select Oracle Database, then select Oracle Base Database.
  2. Select your Compartment. A list of DB systems is displayed.
  3. In the list of DB systems, find the DB system containing the PDB you want to use. Click the DB system name to display details about it.
  4. In the list of databases, find the database containing the PDB you want to use. Click the database name to display details about it.
  5. In the Resources section of the page, click Pluggable Databases.
  6. In the list of PDBs, find the PDB, and click the PDB name to display details about it.
  7. From the PDB details page, click Launch SQL Worksheet.
  8. Select the Connection you want to use and click Launch SQL Worksheet.

Use SQL Worksheet

For detailed steps about using SQL Worksheet, see Using the SQL Worksheet.