Name

sqlplus

Use sqlplus (SQL*Plus) to connect to an Oracle database and execute SQL statements.

Syntax

sqlplus [[username[/password][@connect]
         | / [as {sysdba|sysoper}]]
         |/nolog]
         [[-s[ilent]]
          [-h[elp]]
          [-v[ersion]]
          [-r[estrict] level]
          [-l[ogon]]
          [-m[arkup] "markup_options"]
          [@scriptfile [arg1 arg2 arg3...]]]

Parameters

[[username[/password][@connect]

Specifies the username, password, and the net service name (connect) for the Oracle instance to which to connect. If you don’t specify this information, sqlplus prompts for a username and password (but not for a net service name).

/

Connects you to a local database using operating-system authentication.

as {sysdba | sysoper}

Connects you in an administrative role so that you can perform database administration tasks (e.g., starting and stopping a database instance). You may need to enclose the login within quotes, such as sqlplus "sys/password as sysdba".

/nolog

Tells SQL*Plus to start without connecting to a database first.

-s[ilent]

Tells SQL*Plus to run in silent mode. No startup message is displayed, no command prompt is displayed, and no commands are echoed to the screen.

-h[elp]

Causes SQL*Plus to display a short summary of this syntax.

-v[ersion]

Causes SQL*Plus to display version and copyright information.

-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, ...

Get Oracle Utilities 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.