Getting Started using Oracle Developer Tools for VS Code

Welcome! Oracle Developer Tools for VS Code enables Visual Studio Code developers to connect to Oracle Database and Oracle Autonomous Database, edit SQL and PL/SQL scripts with Intellisense, syntax coloring, and code snippets, execute SQL and PL/SQL and view and save the results in formats such as .CSV and JSON.

We plan to have frequent releases and the next update (expected in July) will have a Database Explorer and additional user interface enhancements.

This Quick Start will help you install, connect and configure Oracle Developer Tools for VS Code.

Quick Start

 

Install

  • Install .NET Core Runtime version 2.2 or later:
  • Click on the Extensions icon in the Activity Bar on the side of VS Code or use the View: Extensions command (Ctrl+Shift+X)
  • Type Oracle in the extension search bar
  • Locate Oracle Developer Tools for VS Code and click Install
  • When the installation is complete, restart Visual Studio Code

Create a .SQL file

  • Select File > New File. Visual Studio Code opens a new Plain Text file by default.
  • Click Plain Text on the lower status bar, and select Oracle-SQL and PLSQL from the languages dropdown.

Connect to Oracle Database

  • (If your database is in the Oracle Cloud go to Connect to Oracle Autonomous Database below)
  • Press F1 to open Command Pallette and select Oracle:Connect from the dropdown
  • Select New Connection
  • Enter the Oracle Database connection string in the format host:port/servicename. For example: myserver.com:1521/XEPDB1
  • Select Administrator or Non-Administrator
  • If you selected Administrator, select the database role
  • Enter user id and then press return
  • Enter password and then press return
  • Save connection info if desired
  • Provide profile name or press return for default name

Connect using a TNSNAMES.ORA Connection Alias

  • Copy the TNSNAMES.ORA file that you want to use into the directory that is set as "Config Files Location" in the Oracle Developer Tools for VS Code Extension Settings, or change this setting as desired. By default this location is %USERPROFILE%\Oracle\network\admin on Windows, and ~/oracle/network/admin on Linux and Mac.
  • If you don't have a TNSNAMES.ORA but would like to create one, see the example located in %USERPROFILE%\.vscode\extensions\oracle.oracledevtools-19.3.0\sample\network on Windows and in ~/.vscode/extensions/oracle.oracledevtools-19.3.0/sample/network on Linux and Mac.
  • Press F1 to open Command Pallette and select Oracle:Connect from the dropdown
  • Select New Connection using TNSNAMES.ORA
  • Select the alias name you wish to connect to
  • Select Administrator or Non-Administrator
  • If you selected Administrator, select the database role
  • Enter user id and then press return
  • Enter password and then press return
  • Save connection info if desired
  • Provide profile name or press return for default name

Connect using OS Authentication

  • If using both Windows Client and Windows Database Server, set SQLNET.AUTHENTICATION_SERVICES=(NTS) in a SQLNET.ORA file located in the directory that is set as "Config Files Location" in the Oracle Developer Tools for VS Code Extension Settings. By default this location is %USERPROFILE%\Oracle\network\admin
  • Follow the steps in Connect to Oracle Database or Connect using a TNSNAMES.ORA Connection Alias above, except
  • When prompted for a user id enter "/" (without the quotes).

Connect to Oracle Autonomous Database

  • Obtain your Client Credentials File: Go to the Administration Console for your Oracle Autonomous Database and click Download Client Credentials.  Alternatively, obtain the credentials file from your administrator.
  • Unzip the credentials files into the directory that is set as "Config Files Location" in the Oracle Developer Tools for VS Code Extension Settings. By default this location is %USERPROFILE%\Oracle\network\admin on Windows, and ~/oracle/network/admin on Linux and Mac.
  • Press F1 to open Command Pallette and select Oracle:Connect from the dropdown
  • Select New Connection using TNSNAMES.ORA
  • Select the alias name you wish to connect to, for example mydb_high. (Note that if there are multiple Autonomous Database instances in your cloud account, you will see aliases for all instances)
  • Select Non-Administrator
  • Enter user id and then press return. (If you are new to Oracle Autonomous Database, use userid admin)
  • Enter password and then press return
  • Save connection info if desired
  • Provide profile name or press return for default name

Execute SQL

  • Type some SQL you wish to execute into the .SQL file
  • While typing, some code snippet suggestions may appear. You can view more snippets by typing oracle on a new line.
  • Type a schema name followed by a period, for example HR. to use intellisense to view and select database objects.
  • Right click on the SQL and select Execute Query.

View and Save Result Sets

  • If your SQL execution returns rows, a new document will open with the result set. The number of rows initially fetched is controlled by the Data Batchsize extension setting. As you scroll through the rows, more will be fetched.
  • To save results, choose the format: .CSV or JSON. Then click the icon to Save Selected Rows or Save All Rows. After providing a file name and location, the file will open in Visual Studio Code.
  • To copy the selected rows to the clipboard, click the Copy Selected Row(s) to Clipboard icon

Get Help or Provide Feedback

Tutorials
  • ..Coming Soon!..
Resources
  • ..Coming Soon!