SQL*Plus is Oracle Database’s command-line client for connecting, running SQL and PL/SQL, and performing basic administration tasks.
For scripting-heavy workflows, many teams also use SQLcl (a modern CLI with command history and scripting niceties).
Browser-based iSQL*Plus is discontinued.
Prerequisites
Oracle Database or the Oracle Client installed.
A database user with credentials (from your DBA or during install).
A connection identifier (Easy Connect, TNS alias, or net service name).
The target database is up and reachable over the network.
Common Tasks
Start SQL*Plus and connect to a database.
Check help for SQL*Plus commands (environment, formatting, spooling).
Describe tables and views.
Run queries and review results.
Write output to a file (spool).
Optional (DBA only): start up or shut down a database when connected as SYSDBA.
Quick Examples
Connect
sqlplus username@//host:port/service_name
-- or on the same host:
-- sqlplus / as sysdba
Describe a table and query data
DESCRIBE hr.employees;
SELECT first_name, last_name, department_id
FROM hr.employees
WHERE ROWNUM <= 5;
Write output to a file (spool)
SPOOL /tmp/report.txt
SELECT COUNT(*) AS rows_in_emp FROM hr.employees;
SPOOL OFF
Note on Shared Server vs. Dedicated:
SQL*Plus works with either server mode. Shared Server is a database-side architecture choice and is not a
separate SQL*Plus command set. See the dedicated module on Shared Server Architecture for details.
Related: Monitoring with Enterprise Manager Cloud Control
SQL*Plus is ideal for ad-hoc SQL and scripting. For fleet monitoring, alerting, and job automation, use
Enterprise Manager Cloud Control.
Figure 2. Enterprise Manager Cloud Control (related tooling)