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.
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.
- Open the navigation menu. Select Oracle Database, then select Oracle Base Database Service.
- Select your Compartment. A list of DB systems is displayed.
- 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.
- In the list of databases, find the database containing the PDB you want to use. Click the database name to display details about it.
- In the Resources section of the page, click Pluggable Databases.
- In the list of PDBs, find the PDB, and click the PDB name to display details about it.
- Click Create connection.
- Provide the following information about the connection:
- Name: A user-friendly informative name to describe the connection.
- Compartment: Choose a compartment you have permission to work in for the connection.
- Username: The database user you want to use for the connection.
- 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.
- 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.
- 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:
- 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
. - Description: Optionally, provide a description of the secret.
- Compartment: Select a compartment which you would like to create the secret in.
- 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.
- 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.
- User password: Provide the password for the user.
- Confirm user password: Retype the password previously entered.
- Click 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 PDB is
needed for the DBA user, the name could be
- The Connection string field is pre-populated.
- 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.
- After you complete the Connection Details section, click Next.
- In the SSL details section, provide secure connection details.
-
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)
- 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.
- Open the navigation menu. Select Oracle Database, then select Oracle Base Database Service.
- Select your Compartment. A list of DB systems is displayed.
- 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.
- In the list of databases, find the database containing the PDB you want to use. Click the database name to display details about it.
- In the Resources section of the page, click Pluggable Databases.
- In the list of PDBs, find the PDB, and click the PDB name to display details about it.
- From the PDB details page, click Launch SQL Worksheet.
- Select the Connection you want to use and click Launch SQL Worksheet.