How to Connect Oracle to DataGrip

Galaxy Glossary

How do I connect Oracle to DataGrip?

Create and test an Oracle JDBC/OCI data source in JetBrains DataGrip so you can browse schemas and run SQL.

Sign up for the latest in SQL knowledge from the Galaxy Team!
Welcome to the Galaxy, Guardian!
Oops! Something went wrong while submitting the form.

Description

Why use DataGrip instead of SQL*Plus?

DataGrip offers code completion, schema navigation, version control integration, and AI-powered query help—features SQL*Plus lacks. Connecting Oracle unlocks these advantages instantly.

What drivers does DataGrip need for Oracle?

Use either the official Oracle JDBC Thin driver (ojdbc[version].jar) or the Oracle OCI driver for native authentication.DataGrip downloads them automatically when you create a new Oracle data source.

How do I add an Oracle data source?

Open File ▸ Data Sources ▸ + ▸ Oracle, choose Driver: Oracle, and fill in host, port, service/SID, user, and password. Click Test Connection to verify.

SID or Service name?

Older databases often expose a SID (e.g., ORCL). Newer multitenant setups use a service name (e.g., orclpdb1).DataGrip supports both—select the correct radio button.

How to supply a custom JDBC URL?

Under the Advanced tab, toggle Use custom URL and paste a string such as jdbc:oracle:thin:@//db.acme.com:1521/orclpdb1. This is useful for load-balancer VIPs or wallets.

Can I use an Oracle Wallet?

Yes. Put the wallet in a secure local folder, set TNS_ADMIN in DataGrip’s Environment tab, and use Connection type: TNS.DataGrip will read tnsnames.ora entries automatically.

How to run an example query?

Once connected, open a new SQL console and run:
SELECT c.name, o.total_amountFROM Customers cJOIN Orders o ON o.customer_id = c.idWHERE o.order_date > SYSDATE - 30;

Best practices for Oracle in DataGrip

Enable Introspection ▸ Use dual session to avoid locking; pin production connections as Read-only; and save common queries to Snippets or Galaxy Collections for team reuse.

.

Why How to Connect Oracle to DataGrip is important

How to Connect Oracle to DataGrip Example Usage


-- Identify top-spending customers in the last 90 days
SELECT c.id, c.name, SUM(o.total_amount) AS lifetime_value
FROM Customers c
JOIN Orders o ON o.customer_id = c.id
WHERE o.order_date >= SYSDATE - 90
GROUP BY c.id, c.name
ORDER BY lifetime_value DESC
FETCH FIRST 10 ROWS ONLY;

How to Connect Oracle to DataGrip Syntax


# Basic Thin JDBC URL
jdbc:oracle:thin:@//<host>:<port>/<service>

# SID-based URL
jdbc:oracle:thin:@<host>:<port>:<SID>

# Full DataGrip field mapping
Host:    db.acme.com
Port:    1521
Service: orclpdb1
User:    shop_admin
Password: ********

# Example using ecommerce tables
SELECT p.name, p.stock
FROM Products p
WHERE p.stock < 10;

Common Mistakes

Frequently Asked Questions (FAQs)

Do I need to install an Oracle client?

No. The Thin JDBC driver bundled by DataGrip is self-contained. Only wallet-based or OCI auth needs an Oracle client.

Can I enable SSL?

Yes. In the SSH/SSL tab, check Use SSL, point to wallet files or truststore, and retest the connection.

How do I share the connection settings?

Export the data source to .idea/dataSources.xml or share a Galaxy Collection containing the DSN and queries.

Want to learn about other SQL terms?

Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie
BauHealth Logo
Truvideo Logo
Welcome to the Galaxy, Guardian!
Oops! Something went wrong while submitting the form.