# Oracle

Procedure: Enable the Database Tools and SQL plugin

This functionality relies on the  Database Tools and SQL plugin, which  is bundled and enabled in IntelliJ IDEA   by default. If the relevant features are not available, make sure that you did not disable the plugin.

> **Note:**
> Database Tools and SQL functionality support is limited in IntelliJ IDEA without the Ultimate subscription.

1. Press `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) to open settings and then select `Plugins`.

2. Open the Installed tab, find the Database Tools and SQL plugin, and select the checkbox next to the plugin name.

Procedure: Official documentation and software

* For full information about Oracle, refer to [the official documentation](https://docs.oracle.com/en/database/oracle/oracle-database/).

* To download Oracle database software, refer to [the official software downloads](https://www.oracle.com/in/database/technologies/oracle-database-software-downloads.html).

* For more versions of Oracle JDBC driver, refer to [the official JDBC driver downloads](https://www.oracle.com/database/technologies/appdev/jdbc-downloads.html).

Supported DBMS versions: 9–23.

### Before you begin

This topic presents a general procedure on how you can create a data source for the [connection](connecting-to-a-database.html) to your Oracle database in IntelliJ IDEA, and run a test connection. It is assumed that you already have the necessary connection details and the database is up and running .

For example, if you want to run a database on your machine and connect to that database, the corresponding DBMS software must be installed on the machine first.

To learn about your DBMS software, refer to its [official documentation](#official_information_links).

Procedure: Connect to an Oracle database

To connect to a database, create a data source that will store your connection details.

1. Select the data source you want to create. You can do this using one of the following ways:

* In the main menu, go to `File | New | Data Source` and select Oracle.

* In the Database tool window , click ![the New icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.add.svg) New on the toolbar. Navigate to Data Source and select Oracle.

![Create a new data source](https://resources.jetbrains.com.cn/help/img/idea/2026.2/create_new_data_source.png)

2. In the General tab of Data Sources and Drivers dialog right pane, specify the driver and connection type.

1.

From the Driver list, select the JDBC driver for your connection.

For Oracle, the supported drivers are Oracle and Oracle for 9.X, 10.X, 11.1.  For more information about driver types, refer to  [Oracle JDBC FAQ](http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-faq-090281.html).

2.

From the Connection type list, select the connection type depending on the connection details that you have:

* SID: to use a unique name of an Oracle instance (a process that runs on the workstation).

* Service name: to use an alias to an Oracle instance (or many instances).

* TNS: to use `tnsnames.ora` configuration file.

* Long: to use an extended JDBC URL format with advanced parameters.

* URL only: connect by using only the URL.

For the URL only [connection type](data-sources-and-drivers-dialog.html#connection_type), the JDBC URL that you enter is used as is, including the database credentials.

> **Note:**
> For the URL only connection type, the JDBC URL  is stored in plain text as is, and is also available in [IDE log file](troubleshooting-materials.html#locate-ide-log) and [data source information](managing-data-sources.html#share-data-sources-between-different-ide-instances).

For the other connection types, the JDBC URL is broken down into connection details. You can either specify them separately and use the automatically generated URL, or you can enter the URL directly in the corresponding field.

![General tab of the Data Sources and Drivers dialog](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_connection_general_tab.png)

3. Check if there is a Download missing driver files link at the bottom of the connection settings area. Click this link to download drivers that are required to interact with a database. For a direct download link, refer to the [JetBrains JDBC drivers](https://www.jetbrains.com.cn/en-us/datagrip/jdbc-drivers/) page.

![The Download missing driver files link](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_connection_download_missing_drivers_link.png)

Location for the downloaded JDBC drivers is the [IntelliJ IDEA configuration directory](directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html#config-directory).

You can also use your drivers for the database instead of the provided ones. For more information about connecting to a database with your driver, refer to [Add a user driver to an existing connection](jdbc-drivers.html#configure_a_jdbc_driver_for_an_existing_data_source).

If there is no Download missing driver files link, then you already have the required drivers.

4. Specify the database connection details. Alternatively, paste the JDBC URL in the URL field.

SID:

1.  In the Host field, type your server address.

2.

In the Port field, type the port of Oracle. The default port is 1521.

> **Note:**
> Real port numbers might be different on your system. Verify that you use a correct port number with your database administrator, server settings, or hosting provider.

3.

In the SID field, specify a unique name of Oracle instance (a process that runs on the workstation).

For more information, refer to the [DBMS-specific General tab reference](#reference).

4.

From the Driver list, select the Oracle JDBC driver mode to use with your connection:

* Thin: the driver connects to the server directly.

* OCI and OCI8: the driver uses native libraries to connect to the server.

5.

From the Authentication dropdown, select the authentication method that you want to use to authenticate the connection. The following options are available:

* User & Password: by using your login and password.

* Kerberos: use Kerberos for authentication. Requires a Kerberos server and authentication with `kinit`.

* SYSDBA: connect as `SYSDBA`.

* SYSOPER: connect as `SYSOPER`.

* No auth: authentication is not required.

6.

In the User and Password fields, type your user credentials.

To use no password, leave the Password field empty.

To delete a once entered password, right-click the Password field and select Set Empty.

![the Set Empty context menu action](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_connection_password_set_empty.png)

7.

In the URL field, IntelliJ IDEA generates the JDBC URL automatically using the values of other connection settings.

If you need to use a JDBC URL with certain additional settings, paste it in the URL field. The general URL to use is as follows:

* Format: `jdbc:oracle:thin:@<host_address>:<port_number>:<instance_name>`

* Example: `jdbc:oracle:thin:@127.0.0.1:1521:XE`

For more information about the URL format, refer to the [Oracle official documentation](https://docs.oracle.com/en/database/oracle/oracle-database/23/jajdb/).

![Database connection details](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_connection_details_oracle_sid.png)

Service Name:

1.  In the Host field, type your server address.

2.

In the Port field, type the port of Oracle. The default port is 1521.

> **Note:**
> Real port numbers might be different on your system. Verify that you use a correct port number with your database administrator, server settings, or hosting provider.

3.   In the Service field, enter the alias to an Oracle instance that you want to use.

4.

From the Driver list, select the Oracle JDBC driver mode to use with your connection:

* Thin: the driver connects to the server directly.

* OCI and OCI8: the driver uses native libraries to connect to the server.

5.

From the Authentication dropdown, select the authentication method that you want to use to authenticate the connection. The following options are available:

* User & Password: by using your login and password.

* Kerberos: use Kerberos for authentication. Requires a Kerberos server and authentication with `kinit`.

* SYSDBA: connect as `SYSDBA`.

* SYSOPER: connect as `SYSOPER`.

* No auth: authentication is not required.

6.

In the User and Password fields, type your user credentials.

To use no password, leave the Password field empty.

To delete a once entered password, right-click the Password field and select Set Empty.

![the Set Empty context menu action](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_connection_password_set_empty.png)

7.

In the URL field, IntelliJ IDEA generates the JDBC URL automatically using the values of other connection settings.

If you need to use a JDBC URL with certain additional settings, paste it in the URL field. The general URL to use is as follows:

* Format: `jdbc:oracle:thin:@//<host_address>:<port_number>/<instance_alias>`

* Example: `jdbc:oracle:thin:@//127.0.0.1:1521/XE`

For more information about the URL format, refer to the [Oracle official documentation](https://docs.oracle.com/en/database/oracle/oracle-database/23/jajdb/).

![Database connection details](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_connection_details_oracle_servicename.png)

TNS:

1.

In the TNSADMIN field, specify a path to the folder with `tnsnames.ora`. Alternatively, click the Open icon (![the Open button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.general.ellipsis.svg)) and navigate to it.

For more information, refer to the [Connection settings and DBMS-specific properties](#reference).

2.

In the TNS name field, specify what service name to use if you have more than one service.

For more information, refer to the [DBMS-specific General tab reference](#reference).

3.

From the Driver list, select the Oracle JDBC driver mode to use with your connection:

* Thin: the driver connects to the server directly.

* OCI and OCI8: the driver uses native libraries to connect to the server.

4.

From the Authentication dropdown, select the authentication method that you want to use to authenticate the connection. The following options are available:

* User & Password: by using your login and password.

* Kerberos: use Kerberos for authentication. Requires a Kerberos server and authentication with `kinit`.

* SYSDBA: connect as `SYSDBA`.

* SYSOPER: connect as `SYSOPER`.

* No auth: authentication is not required.

5.

In the User and Password fields, type your user credentials.

To use no password, leave the Password field empty.

To delete a once entered password, right-click the Password field and select Set Empty.

![the Set Empty context menu action](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_connection_password_set_empty.png)

6.

In the URL field, IntelliJ IDEA generates the JDBC URL automatically using the values of other connection settings.

If you need to use a JDBC URL with certain additional settings, paste it in the URL field. The general URL to use is as follows:

* Format: `jdbc:oracle:thin:@<service_name>`

* Example: `jdbc:oracle:thin:@myServiceName`

For more information about the URL format, refer to the [Oracle official documentation](https://docs.oracle.com/en/database/oracle/oracle-database/23/jajdb/).

![Database connection details](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_connection_details_oracle_tns.png)

Long:

1.  In the Host field, type your server address.

2.

In the Port field, type the port of Oracle. The default port is 1521.

> **Note:**
> Real port numbers might be different on your system. Verify that you use a correct port number with your database administrator, server settings, or hosting provider.

3.   In the Service field, enter the alias to an Oracle instance that you want to use.

4.

From the Driver list, select the Oracle JDBC driver mode to use with your connection:

* Thin: the driver connects to the server directly.

* OCI and OCI8: the driver uses native libraries to connect to the server.

5.

From the Authentication dropdown, select the authentication method that you want to use to authenticate the connection. The following options are available:

* User & Password: by using your login and password.

* Kerberos: use Kerberos for authentication. Requires a Kerberos server and authentication with `kinit`.

* SYSDBA: connect as `SYSDBA`.

* SYSOPER: connect as `SYSOPER`.

* No auth: authentication is not required.

6.

In the User and Password fields, type your user credentials.

To use no password, leave the Password field empty.

To delete a once entered password, right-click the Password field and select Set Empty.

![the Set Empty context menu action](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_connection_password_set_empty.png)

7.

In the URL field, paste the JDBC URL of an extended format with the parameters required for your connection.

For more information about the URL format, refer to  [Oracle official documentation](https://docs.oracle.com/en/database/oracle/oracle-database/23/jajdb/).

![Database connection details](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_connection_details_oracle_long.png)

URL only:

1.

From the Authentication dropdown, select the authentication method that you want to use to authenticate the connection. The following options are available:

* User & Password: by using your login and password.

* Kerberos: use Kerberos for authentication. Requires a Kerberos server and authentication with `kinit`.

* SYSDBA: connect as `SYSDBA`.

* SYSOPER: connect as `SYSOPER`.

* No auth: authentication is not required.

2.

In the User and Password fields, type your user credentials.

To use no password, leave the Password field empty.

To delete a once entered password, right-click the Password field and select Set Empty.

![the Set Empty context menu action](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_connection_password_set_empty.png)

3.

In the URL field, IntelliJ IDEA generates the JDBC URL automatically using the values of other connection settings.

If you need to use a JDBC URL with certain additional settings, paste it in the URL field.

For more information about the URL format, refer to the [Oracle official documentation](https://docs.oracle.com/en/database/oracle/oracle-database/23/jajdb/).

> **Warning:**
> For  the URL only connection type, the URL field contents are stored in plain text, and are also available in the [IDE log file](troubleshooting-materials.html#locate-ide-log) and  [data source settings file](managing-data-sources.html#locate_the_datasources_xml_file).
>
>
>
> Use the designated fields  to provide your sensitive connection details  instead of putting them into the URL field.

![Database connection details](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_connection_details_oracle_urlonly.png)

For the reference information about connection settings and properties  on the General and other tabs of   Data Sources and Drivers  dialog (  `Shift+Enter` (Windows), `⌘ I` (macOS), `⇧ ⏎` (IntelliJ IDEA Classic (macOS)), `⌘ I` (macOS System Shortcuts), `Shift+Enter` (XWin), `Shift+Enter` (GNOME), `Shift+Enter` (KDE), `Shift+Enter` (Emacs), `Shift+Enter` (Sublime Text), `⌘ I` (Sublime Text (macOS)), `Shift+Enter` (NetBeans), `Shift+Enter` (Visual Studio), `⌘ I` (Visual Studio (macOS)), `Shift+Enter` (Eclipse), `⌘ I` (Eclipse (macOS)) ) , see [Connection settings and DBMS-specific properties](#reference) .

5. Ensure that the database connection can be established using the provided details. To do this, click the Test Connection  link at the bottom of the connection details section.

![Test Connection link](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_test_connection_link.png)

If you encounter any connection issues, refer to the [Cannot connect to a database](connectivity-problems.html) page.

6. (Optional) By default, only the default    schema is   introspected and available to work with. If you also want to work with other     schemas  , in the Schemas tab, select them for the introspection.

![Schemas tab of the Data Sources and Drivers dialog](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_connection_schemas_tab.png)

7. Click OK to create the data source.

8. Find your new data source in the    Database   tool window   .

* For more information about the Database tool window , see the corresponding [reference topic](database-tool-window.html). > **Tip:** > To see more schemas under your new data source node, click the N of M button and select the ones you need. IntelliJ IDEA will introspect and show them. > > > > ![Select databases and schemas to introspect and display in the Database tool window](https://resources.jetbrains.com.cn/help/img/idea/2026.2/connection_flow_show_databases_and_schemas.png)

* For more information about working with database objects in IntelliJ IDEA, refer to [Database objects](database-objects.html).

* To write and run queries, open the default [query console](query-consoles.html) by clicking the data source and pressing `F4` (Windows), `⌘ ↓` (macOS), `F4` (IntelliJ IDEA Classic (macOS)), `F4` (macOS System Shortcuts), `F4` (XWin), `F4` (GNOME), `F4` (KDE), `F4` (Emacs), `F4` (Sublime Text), `F4` (Sublime Text (macOS)), `F4` (NetBeans), `F4` (Visual Studio), `⌘ ↓` (Visual Studio (macOS)), `F12` (Eclipse), `F3` (Eclipse (macOS)).

* To view and edit data of a database object, open [Data editor and viewer](data-editor-and-viewer.html) by double-clicking the object.

## Connection settings and DBMS-specific properties

### Connection settings

For the reference information about  connection settings (for example, Host, Port, and so on) on the General and other tabs of   Data Sources and Drivers  dialog (  `Shift+Enter` (Windows), `⌘ I` (macOS), `⇧ ⏎` (IntelliJ IDEA Classic (macOS)), `⌘ I` (macOS System Shortcuts), `Shift+Enter` (XWin), `Shift+Enter` (GNOME), `Shift+Enter` (KDE), `Shift+Enter` (Emacs), `Shift+Enter` (Sublime Text), `⌘ I` (Sublime Text (macOS)), `Shift+Enter` (NetBeans), `Shift+Enter` (Visual Studio), `⌘ I` (Visual Studio (macOS)), `Shift+Enter` (Eclipse), `⌘ I` (Eclipse (macOS)) ) , see  [Data Sources](data-sources-and-drivers-dialog.html#db).

### DBMS-specific properties

#### General tab

| Item | Description | Connection type |
| --- | --- | --- |
| Driver | List of the Oracle JDBC driver modes.   |      * SID    * Service name    * TNS    * Long    |
| SID |     A unique name of an Oracle instance (a process that runs on the workstation). For the correct value, check the environment variable `ORACLE_SID` on the server host, or contact your database administrator. Commonly-used values are `XE` or `ORCL`.     | SID |
| Service | An alias to an Oracle instance (or many instances).   | Service name |
| TNSADMIN |     Path to the folder with `tnsnames.ora` configuration file. For more information about `tnsnames.ora`, refer to [Local Naming Parameters in                                         the tnsnames.ora file](http://docs.oracle.com/database/121/NETRF/tnsnames.htm#NETRF007).     | TNS |
| TNS name | The service name to use with your connection if you have more than one service. To find the service name, see a value of `net_service_name` in `tnsnames.ora`.   |

## See also

### Reference

[Data sources and their elements](database-tool-window.html#icons-for-data-sources-and-their-elements) [Data Sources and Drivers dialog](data-sources-and-drivers-dialog.html)

### Tool Windows

[Database tool window](database-tool-window.html)

