SQL Worksheets
This article provides the details and procedure to create a connection, launch and use 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:
- connection, see Managing a Connection.
- SQL Worksheet, see Using the SQL Worksheet.
Related Topics
Create a Connection
Perform the following steps to create a connection using the OCI Console:
- On the DB Systems list page, select the DB system that contains the pluggable database that you want to work with. If you need help finding the list page or the DB system, see List the DB Systems.
- On the Databases tab, select the database that contains the pluggable database that you want to work with.
- On the Pluggable Databases tab, select the pluggable database that you want to work with.
- On the pluggable database details page, select the Connections tab.
- Select Create connection.
- In the Create connection panel, provide the following information about the connection:
- Name: A user-friendly, informative name to describe the connection.
- Compartment: Select a compartment from the list.
- Username: The database user name you want to use for the connection.
- Role: Select a role from the list. 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.
- User password secret: This menu is populated with any secrets you have access to from the OCI Vault. Select Change compartment to find a secret in a different compartment.
- Create password secret: If no secrets are listed or a new secret
must be created, use this and provide the following information in the Create
password secret panel:
- 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
pluggable database is needed for the DBA user, the name could be
salesPDB-DBA
. - Description: Optionally, provide a description of the secret.
- Compartment: Select a compartment in which you would like to create the secret.
- Vault: Choose an OCI vault that you have access to where the secret will be kept. Select Change compartment to find a vault in a different compartment.
- Encryption key: Select an encryption key to be used to encrypt the supplied password in the vault. Select Change compartment to find an encryption key in the same vault that is contained in a different compartment.
- User password: Provide the password for the user.
- Confirm user password: Retype the password previously entered.
- Select Create when done to create the secret in the vault.
- 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
pluggable database is needed for the DBA user, the name could be
- The Connection string field is pre-populated.
- If you want to designate that this connection will use a private
endpoint, switch on the Access database via a private network toggle.
- Select the endpoint using the select private endpoint menu. Select Compartment to find a private endpoint in a different compartment.
-
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)
- Select Create to create a database connection.
For more information, see Managing a Connection.
Launch SQL Worksheet
Perform the following steps to launch the SQL Worksheet using the OCI Console:
- On the DB Systems list page, select the DB system that contains the pluggable database that you want to work with. If you need help finding the list page or the DB system, see List the DB Systems.
- On the Databases tab, select the database that contains the pluggable database that you want to work with.
- On the Pluggable Databases tab, select the pluggable database that you want to work with.
- On the pluggable database details page, select Launch SQL Worksheet.
- In the Launch SQL Worksheet panel, select the connection you want to use and select Launch SQL Worksheet.