Interacting with SQL*Plus

This section covers essential information that you need to know in order to interact with SQL*Plus. Here you will learn how to start SQL*Plus, enter commands, delimit strings, and name variables.

Starting SQL*Plus

SQL*Plus is almost always invoked by issuing the sqlplus command from your operating system command prompt. On Microsoft Windows systems, you also have the option of selecting an icon from the Start menu. Early releases of SQL*Plus on Windows used executable names such as PLUS33 and PLUS80W depending on the specific release number and on whether the DOS version or the Windows version was to be invoked.

Syntax for the sqlplus command

The syntax used to invoke SQL*Plus looks like this:

sqlplus [[-S[ILENT]] [-R[ESTRICT] level]
   [-M[ARKUP] markup_options]
   [username[/password][@connect]|/|/NOLOG]
   [@scriptfile [arg1 arg2 arg3...]]] | - | -?

The -RESTRICT and -MARKUP parameters are new in release 8.1.6. The descriptions of the parameters follow:

-S[ILENT]

Tells SQL*Plus to run in silent mode. No startup messages will be displayed; no command prompt will be displayed; no commands will be echoed to the screen.

-R[ESTRICT] level

Restricts what the user can do from SQL*Plus. The level must be one of the following:

1

Disables the EDIT, HOST, and ! commands.

2

Disables the EDIT, HOST, !, SAVE, SPOOL, and STORE commands.

3

Disables the EDIT, GET, HOST, !, SAVE, START, @, @@, SPOOL, and STORE commands.

Level 3 also disables the reading of the login.sql file. The glogin.sql file ...

Get Oracle SQL*Plus Pocket Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.