SQL Plus is the most basic Oracle Database utility, with a basic command-line interface, commonly used by users, administrators, and programmers.
SQL Plus understands five categories of text:[1]
Scripts can include all of these components.
An Oracle programmer in the appropriately configured software environment can launch SQL Plus, for example, by entering:
$ sqlplus scott/tiger
where the Oracle user scott has the password tiger. SQL Plus then presents a prompt with the default form of:
scott
tiger
SQL>
Interactive use can then start by entering a SQL statement (terminated by a semicolon), a PL/SQL block, or another command. For example:
SQL> select 'Hello world' as example from dual; EXAMPLE -------------------------------- Hello world
The first version of SQL Plus was called UFI ("User Friendly Interface"). UFI appeared in Oracle database releases up to Version 4.
After Oracle programmers had added new features to UFI, its name became Advanced UFI. The name "Advanced UFI" changed to "SQL Plus" with the release of the version 5 of Oracle.[2]
Graphical interfaces from Oracle or third parties have diminished the proportion of Oracle database end-users who depend on the SQL Plus environment. Oracle shops typically continue to use SQL Plus scripts for batch updating or simple reports.[citation needed]
Oracle Corporation's wrappers/gui-fications/replacements for SQL Plus include:
Starting from Oracle database 11g, iSqlplus (web based) and sqlplus GUI no longer ship with Oracle database software.[7] The command-line SQL Plus interface continues in use, mostly[citation needed] for non-interactive scripting or for administrative purposes. The Server Manager Command Line — a replacement of SQL*DBA — is obsolete and SQL Plus 8i and later allows the user to issue statements like STARTUP and SHUTDOWN when connected as SYSDBA. Server Manager 7.1 introduced the command CONNECT / AS SYSDBA to replace CONNECT INTERNAL.[8] SQL Plus 8i and later allows the use of CONNECT / AS SYSDBA
CONNECT / AS SYSDBA
CONNECT INTERNAL
Other vendors have made their software somewhat compatible with SQL Plus script commands or offer a SQL Plus mode of operation. Relevant products include TOAD from Quest Software.[9]
SQL Plus-internal variables, accessible within an SQL Plus session, include:
DEFINE
column
The WHENEVER command specifies an action to perform in the event of the system detecting an SQL error[13] or an operating-system error[14] while running a subsequent SQL Plus command.
WHENEVER
SQL*Plus needs to be installed and configured on the machine where you intend to use it. This usually involves setting up Oracle client software and configuring network connections to Oracle databases.[15]
Oracle's SQL Plus Worksheet is a straight-forward, easy-to-use, graphical user interface for SQL.
iSQLPlus (iSQL Plus) is a web-based utility similar to the SQL Plus command line utility for executing SQL and PL/SQL commands (available up to Oracle 10gR2).
The SQL Plus commands supported by Oracle SQL Developer SQL Worksheet are listed [...]
SQL Workshop provides tools to enable you to view and manage database objects from a Web browser. Use SQL Commands to run SQL and PL/SQL statements. ...
& and && indicate substitution variables in SQL Plus scripts or commands.
In SQL Plus, a bind variable is declared with variable [...] The value of the bind variable can then be printed with print
variable
print
WHENEVER SQLERROR [...] [d]irects SQL Plus to perform the specified action as soon as it detects a SQL command or PL/SQL block error (but after printing the error message).
WHENEVER OSERROR [...] [d]irects SQL Plus to perform the specified action as soon as an operating system error is detected.