SQL*Plus User's Guide and Reference
Release 8.1.7
Part Number A82950-01

Library

Product

Contents

Index

Go to previous pageGo to next page

7
Starting SQL*Plus and Getting Help

This chapter explains how to access SQL*Plus from the operating system prompt, and discusses the following topics:

Starting SQL*Plus Using the SQLPLUS Command

You use the SQLPLUS command at the operating system prompt to start SQL*Plus:

SQLPLUS [ [Options] [Logon] [Start] ]where:
Options
 
has the following syntax: 
 - | -? 
| [ [-M[ARKUP]] markup_option] [-R[ESTRICT] {1|2|3}] [-S[ILENT]] ]
 
and markup_option has the following syntax: 
 HTML [ON|OFF] [HEAD text] [BODY text] [TABLE text] 

     [ENTMAP {ON|OFF}] [SPOOL {ON|OFF}]  [PRE[FORMAT] {ON|OFF}]
Logon
 
has the following syntax: 
{username[/password][@connect_identifier | / } [AS {SYSOPER|SYSDBA}] 
| /NOLOG 
Start
 
has the following syntax: 
@file_name[.ext] [arg ...]

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.

The following sections contain descriptions of SQLPLUS command terms:

Options

HELP Option

-

VERSION Option

-?

MARKUP Options

-M[ARKUP]
HTML [ON|OFF]
HEAD text
BODY text
TABLE text
ENTMAP {ON|OFF}
SPOOL {ON|OFF}
PRE[FORMAT] {ON|OFF}
MARKUP Usage Notes

Existing scripts that do not explicitly set PREFORMAT ON will generate output in HTML tables. If you want output in HTML <PRE> tags, you must set PREFORMAT ON.

Some SQL*Plus commands have different behavior when output is directed to an HTML table. Commands originally intended to format paper reports may have different meaning for reports intended for web tables:

RESTRICT Option

-R[ESTRICT] {1|2|3}

SILENT Option

-S[ILENT]

Logon

username[/password]
@connect_identifier
/
AS {SYSOPER|SYSDBA}
/NOLOG

Start

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

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

SQL> SQLPLUS SCOTT/TIGER

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

SQL> SQLPLUS SCOTT/TIGER@POLICY

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

SQL> SQLPLUS SCOTT/TIGER @STARTUP

Note the space between TIGER and @STARTUP.

To start SQL*Plus with HTML ON, so that output can be viewed on a web browser, enter

SQL> SQLPLUS -M "HTML ON" SCOTT/TIGER

To start SQL*Plus with no access to the EDIT and HOST commands during the session, enter

SQL> SQLPLUS -R 1 SCOTT/TIGER

Example 7-2 Displaying the SQLPLUS syntax

To display the syntax of the SQLPLUS command, enter

SQL> SQLPLUS -H

SQL*Plus displays the following

Usage: SQLPLUS [ [<option>] [<logon>] [<start>] ]
where <option> ::= - | -? | [ [-M <o>] [-R <n>] [-S] ]
      <logon>  ::= <username>[/<password>][@<connect_identifier>] | / |/NOLOG
      <start>  ::= @<filename>[.<ext>] [<parameter> ...]
        - displays the SQL*Plus version banner and usage syntax
        -? displays the SQL*Plus version banner
        -M <o> uses HTML markup options <o>
        -R <n> uses restricted mode <n>
        -S uses silent mode

Getting Help

To access online help for SQL*Plus commands, you can type HELP followed by the command name at the SQL command prompt. For example:

SQL> HELP ACCEPT

To display a list of SQL*Plus commands, type HELP followed by either TOPICS or INDEX. HELP TOPICS displays a single column list of SQL*Plus commands. HELP INDEX displays a four column list of SQL*Plus commands which usually fits in a single screen. For example:

SQL> HELP INDEX

If you get a response that help is unavailable, consult your database administrator. See the HELP command in Chapter 8 for more information.


Go to previous page Go to next page
Oracle
Copyright © 2000 Oracle Corporation.
All Rights Reserved.

Library

Product

Contents

Index