SQL Plus

Last updated
command line SqlPlus connected.png
command line

SQL Plus is the most basic Oracle Database utility, with a basic command-line interface, commonly used by users, administrators, and programmers.

Contents

Command types

SQL Plus understands five categories of text: [1]

  1. SQL statements
  2. PL/SQL blocks
  3. SQL Plus internal commands, for example:
    • environment control commands such as SET
    • environment monitoring commands such as SHOW
  4. Comments
  5. External commands prefixed by the ! char

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:

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'asexamplefromdual;EXAMPLE--------------------------------Hello world

History

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]

Usage

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:

Oracle 11g

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/ASSYSDBA to replace CONNECTINTERNAL. [8] SQL Plus 8i and later allows the use of CONNECT / AS SYSDBA

Compatibility

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]

Integration

Variables

SQL Plus-internal variables, accessible within an SQL Plus session, include:

Error trapping

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.

Installation and configuration

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]

Supplementary software

See also

Related Research Articles

An integrated development environment (IDE) is a software application that provides comprehensive facilities for software development. An IDE normally consists of at least a source-code editor, build automation tools, and a debugger. Some IDEs, such as IntelliJ IDEA, Eclipse and Lazarus contain the necessary compiler, interpreter or both; others, such as SharpDevelop and NetBeans, do not.

<span class="mw-page-title-main">PostgreSQL</span> Free and open-source object relational database management system

PostgreSQL, also known as Postgres, is a free and open-source relational database management system (RDBMS) emphasizing extensibility and SQL compliance. PostgreSQL features transactions with atomicity, consistency, isolation, durability (ACID) properties, automatically updatable views, materialized views, triggers, foreign keys, and stored procedures. It is supported on all major operating systems, including Linux, FreeBSD, OpenBSD, macOS, and Windows, and handles a range of workloads from single machines to data warehouses or web services with many concurrent users.

A stored procedure is a subroutine available to applications that access a relational database management system (RDBMS). Such procedures are stored in the database data dictionary.

Oracle Forms is a software product for creating screens that interact with an Oracle database. It has an IDE that includes an object navigator, property sheet, and code editor that uses PL/SQL. It was originally developed to run server-side in character-mode terminal sessions. It was ported to other platforms, including Windows, to function in a client–server environment. Later versions were ported to Java where it runs in a Java EE container and can integrate with Java, and web services that can be launched from a URL. Recent versions provide a means to run the forms from a desktop computer without requiring a browser.

Oracle APEX is an enterprise low-code application development platform from Oracle Corporation. APEX is used for developing and deploying cloud, mobile and desktop applications. The platform is a web-based integrated development environment (IDE) with a range of features including wizards, drag-and-drop layout and property editors to simplify the process of building applications and pages.

<span class="mw-page-title-main">JDeveloper</span> Integrated development environment

JDeveloper is a freeware IDE supplied by Oracle Corporation. It offers features for development in Java, XML, SQL and PL/SQL, HTML, JavaScript, BPEL and PHP. JDeveloper covers the full development lifecycle from design through coding, debugging, optimization and profiling to deploying.

Oracle Reports is a tool for developing reports against data stored in an Oracle database. Oracle Reports consists of Oracle Reports Developer and Oracle Application Server Reports Services.

<span class="mw-page-title-main">Microsoft Data Access Components</span> Framework

Microsoft Data Access Components is a framework of interrelated Microsoft technologies that allows programmers a uniform and comprehensive way of developing applications that can access almost any data store. Its components include: ActiveX Data Objects (ADO), OLE DB, and Open Database Connectivity (ODBC). There have been several deprecated components as well, such as the Jet Database Engine, MSDASQL, and Remote Data Services (RDS). Some components have also become obsolete, such as the former Data Access Objects API and Remote Data Objects.

In database computing, Oracle Real Application Clusters (RAC) — an option for the Oracle Database software produced by Oracle Corporation and introduced in 2001 with Oracle9i — provides software for clustering and high availability in Oracle database environments. Oracle Corporation includes RAC with the Enterprise Edition, provided the nodes are clustered using Oracle Clusterware.

The software which Oracle Corporation markets as Oracle Data Guard forms an extension to the Oracle relational database management system (RDBMS). It aids in establishing and maintaining secondary standby databases as alternative/supplementary repositories to production primary databases.

Oracle Spatial and Graph, formerly Oracle Spatial, is a free option component of the Oracle Database. The spatial features in Oracle Spatial and Graph aid users in managing geographic and location-data in a native type within an Oracle database, potentially supporting a wide range of applications — from automated mapping, facilities management, and geographic information systems (AM/FM/GIS), to wireless location services and location-enabled e-business. The graph features in Oracle Spatial and Graph include Oracle Network Data Model (NDM) graphs used in traditional network applications in major transportation, telcos, utilities and energy organizations and RDF semantic graphs used in social networks and social interactions and in linking disparate data sets to address requirements from the research, health sciences, finance, media and intelligence communities.

Oracle Multimedia is a feature available for Oracle databases, which provides multimedia utilities in a database environment, generating as a result a multimedia database (MMDB). Oracle Multimedia was deprecated in Oracle 18c and desupported in Oracle 19c.

Embedded SQL is a method of combining the computing power of a programming language and the database manipulation capabilities of SQL. Embedded SQL statements are SQL statements written inline with the program source code, of the host language. The embedded SQL statements are parsed by an embedded SQL preprocessor and replaced by host-language calls to a code library. The output from the preprocessor is then compiled by the host compiler. This allows programmers to embed SQL statements in programs written in any number of languages such as C/C++, COBOL and Fortran. This differs from SQL-derived programming languages that don't go through discrete preprocessors, such as PL/SQL and T-SQL.

Oracle Data Mining (ODM) is an option of Oracle Database Enterprise Edition. It contains several data mining and data analysis algorithms for classification, prediction, regression, associations, feature selection, anomaly detection, feature extraction, and specialized analytics. It provides means for the creation, management and operational deployment of data mining models inside the database environment.

In computing, the User Programmatic Interface(UPI), also known as the User Program Interface, consists of a set of C-language software APIs which provide the lowest-level API-based interface to the Oracle database.

In the field of database computing, Oracle Net Services consists of sets of software which enable client applications to establish and maintain network sessions with Oracle Database servers. Since Oracle databases operate in and across a variety of software and hardware environments, Oracle Corporation supplies high-level transparent networking facilities with the intention of providing networking functionality regardless of differences in nodes and protocols.

The Softwell Maker is an environment development. Designer uses visual forms and reports (WYSIWYG), business rules, and visually representing other actions using flowcharts.

<span class="mw-page-title-main">Oracle Warehouse Builder</span>

Oracle Warehouse Builder (OWB) is an ETL tool produced by Oracle that offers a graphical environment to build, manage and maintain data integration processes in business intelligence systems.

PL/SQL is Oracle Corporation's procedural extension for SQL and the Oracle relational database. PL/SQL is available in Oracle Database, Times Ten in-memory database, and IBM Db2. Oracle Corporation usually extends PL/SQL functionality with each successive release of the Oracle Database.

Tcl is a high-level, general-purpose, interpreted, dynamic programming language. It was designed with the goal of being very simple but powerful. Tcl casts everything into the mold of a command, even programming constructs like variable assignment and procedure definition. Tcl supports multiple programming paradigms, including object-oriented, imperative, functional, and procedural styles.

References

  1. "SQL Plus at orafaq.com". Archived from the original on 2007-11-09. Retrieved 2007-11-26.
  2. Millsap, Cary; Kolk, Anjo; McDonald, Connor; Gorman, Tim; Hailey, Kyle; Ensor, David; Lewis, Jonathan; Vaidyanatha, Gaja Krishna; Ruthven, David; Morle, James (2004). Oracle Insights (1st ed.). Apress. p. 35. ISBN   978-1590593875 . Retrieved March 18, 2014.
  3. Evans, Robert (2008-10-01). "The SQL Plus Worksheet". Cardiff University. Archived from the original on 2008-12-01. Retrieved 2008-11-21. Oracle's SQL Plus Worksheet is a straight-forward, easy-to-use, graphical user interface for SQL.
  4. "ISQLPlus". Oracle FAQ. 2008-02-29. Retrieved 2008-11-21. 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).
  5. "Oracle SQL Developer 1.5: Feature List". Oracle Corporation. Archived from the original on 2008-07-24. Retrieved 2008-11-21. The SQL Plus commands supported by Oracle SQL Developer SQL Worksheet are listed [...]
  6. "Oracle Application Express". Oracle Corporation. Archived from the original on 2006-10-21. Retrieved 2008-11-21. 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. ...
  7. Deprecated Components in Oracle Database 11g Release 1 (11.1), retrieve by 25-Jun-2009
  8. Oracle 7 doc, 1994
  9. Hotka, Dan; Scalzo, Bert (2003-04-18). TOAD SQL Editor.
  10. Alapati, Sam R. (2008). "4". Expert Oracle Database 11g Administration. Apress. pp. 118–119. ISBN   978-1-4302-1015-3 . Retrieved 2009-07-29.
  11. Roshak, Natalka (2005-11-06). "Spice up your SQL Scripts with Variables". Oracle FAQ. Retrieved 2009-07-29. & and && indicate substitution variables in SQL Plus scripts or commands.
  12. Nyffenegger, René. "Using bind variables in SQL Plus". René Nyffenegger's collection of things on the web. Retrieved 2009-07-29. In SQL Plus, a bind variable is declared with variable [...] The value of the bind variable can then be printed with print
  13. Watt, Simon. "SQL Plus User's Guide and Reference". Oracle Help Center. Oracle Database Online Documentation, 10g Release 2 (10.2) / Administration. Oracle. p. 74. Retrieved 2015-11-04. 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).
  14. Watt, Simon. "SQL Plus User's Guide and Reference". Oracle Help Center. Oracle Database Online Documentation, 10g Release 2 (10.2) / Administration. Oracle. p. 73. Retrieved 2015-11-04. WHENEVER OSERROR [...] [d]irects SQL Plus to perform the specified action as soon as an operating system error is detected.
  15. "Oracle database services and products offer customers cost-optimized and high-performance versions of Oracle Database, the world's leading converged, multi-model database management system".