SQL*Plus User's Guide and Reference
Release 8.1.5






Prev Up Next

Starting SQL*Plus and Getting Help, 2 of 3

Starting SQL*Plus Using the SQLPLUS Command

You can start SQL*Plus from the operating system prompt by entering the SQLPLUS command in the following form:

SQLPLUS [[-S[ILENT]] [logon] [start]]|-|-?



Requires the following syntax:


Allows you to enter the name of a command file and arguments. SQL*Plus passes the arguments to the command file as though you executed the file using the SQL*Plus START command. The start clause requires the following syntax:

@file_name[.ext][arg ...]

See the START command in Chapter 8 for more information. 

You have the option of entering logon. If you do not specify logon and do specify start, SQL*Plus assumes that the first line of the command file contains a valid logon. If neither start nor logon are specified, SQL*Plus prompts for logon information.

Refer to the following list for a description of each term or clause:


      Suppresses all SQL*Plus information and prompt messages, including the command prompt, the echoing of commands, and the banner normally displayed when you start SQL*Plus. Use SILENT to invoke SQL*Plus within another program so that the use of SQL*Plus is invisible to the user.


      Represent the username and password with which you wish to start SQL*Plus and connect to Oracle. If you omit username and password, SQL*Plus prompts you for them. If you enter a slash (/) or simply enter [Return] to the prompt for username, SQL*Plus logs you in using a default logon (see "/" below).

      If you omit only password, SQL*Plus prompts you for password. When prompting, SQL*Plus does not display password on your terminal screen.


      Consists of a Net8 connection string. The exact syntax depends upon the Net8 communications protocol your Oracle installation uses. For more information, refer to the Net8 manual appropriate for your protocol or contact your DBA.


      Represents a default logon using operating system authentication. You cannot enter a database_specification if you use a default logon. In a default logon, SQL*Plus typically attempts to log you in using the username OPS$name, where name is your operating system username. Note that the prefix "OPS$" can be set to any other string of text. For example, you may wish to change the settings in your INIT.ORA parameters file to LOGONname or USERIDname. See the Oracle8i Administrator's Guide for information about operating system authentication.


      Establishes no initial connection to Oracle. Before issuing any SQL commands, you must issue a CONNECT command to establish a valid logon. Use /NOLOG when you want to have a SQL*Plus command file prompt for the username, password, or database specification. The first line of this command file is not assumed to contain a logon.


      Displays the usage and syntax for the SQLPLUS command, and then returns control to the operating system.


      Displays the current version and level number for SQL*Plus, and then returns control to the operating system. Do not enter a space between the hyphen (-) and the question mark (?).

The SQL*Plus command may be known by a different name under some operating systems, for example, plus81. See your SQL*Plus installation documentation for further information on your operating system.

Setting Up the Site Profile

SQL*Plus supports a Site Profile, a SQL*Plus command file created by the database administrator. This file is generally named GLOGIN with an extension of SQL. SQL*Plus executes this command file whenever any user starts SQL*Plus and SQL*Plus establishes the Oracle connection. The Site Profile allows the DBA to set up SQL*Plus environment defaults for all users at a particular site; users cannot directly access the Site Profile. The default name and location of the Site Profile depend on your system. Site Profiles are described in more detail in the Oracle installation and user's manual(s) provided for your operating system.

Setting Up the User Profile

SQL*Plus also supports a User Profile, executed after the Site Profile. SQL*Plus searches for a file named LOGIN with the extension SQL in your current directory. If SQL*Plus does not find the file there, SQL*Plus will search a system-dependent path to find the file. Some operating systems may not support this path search.

Receiving a Return Code

If you fail to log in successfully to SQL*Plus because your username or password is invalid or some other error, SQL*Plus will return an error status equivalent to an EXIT FAILURE command. See the EXIT command in this chapter for further information.

Example 7-1 Starting SQL*Plus

To start SQL*Plus with username SCOTT and password TIGER, enter


To start SQL*Plus, as above, and to make POLICY the default database (where POLICY is a valid Net8 database connection string), enter


To start SQL*Plus with username SCOTT and password TIGER and run a command file named STARTUP with the extension SQL, enter


Note the space between TIGER and @STARTUP.

Example 7-2 Displaying the SQLPLUS syntax

To display the syntax of the SQLPLUS command, enter


SQL*Plus displays the following

Usage: SQLPLUS [<option>] [<user>[/password>] [@<host>]]
               [@<startfile> [<parm1>] [<parm2>] ...]
where <option> ::= {-s|-?}
-s for silent mode and -? to obtain version number

Prev Up Next
Copyright © 1999 Oracle Corporation.

All Rights Reserved.