Learn how to connect to your cloud database from Visual Studio Code. In this blog, how to connect from Oracle SQL Developer in VS Code.

Sidebar menu displaying various cloud service categories, highlighting 'Oracle AI Database' in green and 'Developer Services' in yellow.

In Oracle Cloud Infrastructure (OCI) you have several options for running an Apex Service. To connect to this Apex database and use local tools like Visual Studio Code, you need to use the right database. The regular Apex Developer Database will not let you connect to it from Visual Studio Code. You are stuck with SQL Worksheet inside apex or Oracle Database Actions – SQL

Under Developer Services you can create an Apex Instance, but this database will not let you use local tools like Sql Developer or Visual Studio Code to connect to it.

Under Oracle Ai Database you can create an Autonomous Ai Database. All Oracle Databases come with Apex. This database type will let you connect to it using a wallet.

Screenshot of Oracle AI Database interface showing the header, search bar, and a message indicating 'No items to display' under the display table.

Press Create Autonomous AI Database.

Follow the instructions below.

A user interface for creating an Autonomous AI Database Serverless, featuring fields for Display name, Database name, and Compartment, along with workload type options such as Lakehouse, Transaction Processing, JSON, and APEX.

Fill in display name and database name. Choose your compartment. Select Transaction Processing. This workload type will let you use credentials/wallet to connect to the database. The Apex workload will not allow you to do this. But as you know, every Oracle Database have Apex installed.

Screenshot of an online form for creating administrator credentials for an Autonomous AI Database, featuring fields for username, password, and password confirmation, along with options like enabling 'Always Free' resources and selecting the database version.

Choose Always Free if you want it to be free. Database version 26ai. Fill inn password for your ADMIN user.

Screenshot of a network access configuration menu in the OCI console, displaying options for secure access and contact details for operational notifications.

Select “Secure access from anywhere”. Fill in your contact email and press Create. A few minutes later the database will be provisioned and ready to use.

Screenshot of the Oracle APEX configuration page for an Autonomous AI Database, displaying options for tool configuration, database actions, and public access URLs.

Just for show; Apex is available under Tool configuration. Press the Database Connection button to download wallet.

Screenshot of a database connection settings page, displaying a warning about secure connections, options for downloading client credentials (wallet), and instructions for selecting wallet type.

Choose Instance wallet if you want a wallet only for the database you just created or Regional wallet if you want a wallet to access all AI-database in your region.

User interface for downloading a wallet for Oracle Net Services, featuring password input fields and a warning about client connections.

Give the wallet a password and press Download. The downloaded zip will be used in Visual Studio Connection settings.

Use wallet to connect to the database from Visual Studio Code.

Screenshot of the Visual Studio Code interface showing the Extensions view with 'Oracle SQL Developer for VSCode' installed, including details like the developer name, rating, and a description of the tool.

In VSCode, under extensions. Find Oracle SQL Developer for VSCode and install it.

Screenshot of Oracle SQL Developer interface showing a message indicating no database connections found and a button to 'Create Connection'.

Under connections, press Create Connection.

A user interface for creating a connection named 'sbdev' with fields for connection name, colour, connection type, configuration file, service, authentication type, username, password, and a 'Save Password' option.

Give the connection a name. Choose connection type “Cloud Wallet”. Press “Choose File” and select the wallet zip file. Service is the default the _HIGH TNS name. Set admin as username and the password for the database you created earlier. Check “Save Password”. Press Test, and if successful, press Save.

If you already have an apex developer schema you want to connect to in stead, use username and password for this schema.

Screenshot of SQL Developer interface highlighting the 'sbdev' connection under the 'CONNECTIONS' section.

Under connection, press the Open SQL Worksheet button.

Screenshot of SQL Developer showing a SQL query 'select * from DUAL;' executed, displaying results in the output panel.

The good old “Select * from dual” gives one row back. Success!

In my next blog I will show you how to create an Apex schema from VS Code, to start coding locally.

2 responses to “Connect to Oracle Apex, in Cloud Autonomous AI Database, from Visual Studio Code”

  1. […] For running the script, this post assumes you are logged on as an Admin or a DB-user with sufficient privileges to create a new DB-user. See this blog post for how to: Connecting Oracle Cloud Database to Visual Studio Code […]

  2. […] Connecting Oracle Cloud Database to Visual Studio Code […]

Leave a Reply


Oppdag mer fra Standal.blog

Abonner for å få de siste innleggene sendt til din e-post.

Håvard Standal avatar

Published by

Discover more from Standal.blog

Subscribe now to keep reading and get access to the full archive.

Continue reading