User`s guide

Running SQL*Plus
3-2 Oracle Database User's Guide
3.1.1.1 The GLOGIN.SQL Global Startup File
The global startup file
GLOGIN.SQL
begins whenever any user starts SQL*Plus. This file
can contain SQL statements or SQL*Plus commands to be run at the beginning of the
SQL*Plus session. The
GLOGIN.SQL
file is located under the
$ORAC1120
user ID, and its
name is
$ORAC1120.SQLPLUS.ADMIN.GLOGIN.SQL
. The database administrator may
customize the
GLOGIN.SQL
file if required. The
GLOGIN.SQL
file will be run regardless of
the current user ID.
3.1.1.2 The LOGIN.SQL User Startup File
The
LOGIN.SQL
startup file is called after the
GLOGIN.SQL
command file each time a
user starts SQL*Plus. Like
GLOGIN.SQL
, this file may contain either SQL statements or
SQL*Plus commands that a user wants to run at the beginning of every SQL*Plus
session.
SQL*Plus first searches for
LOGIN.SQL
under the current BS2000 user ID. If the
LOGIN.SQL
file is not found, but the
SQLPATH
environment variable specifies a path,
then SQL*Plus searches along that path. If SQL*Plus finds a
LOGIN.SQL
file, then it runs
the first
LOGIN.SQL
file that it finds. For a customized SQL*Plus environment, each
user ID can have its own
LOGIN.SQL
file.
Refer to Appendix B, "Oracle Environment Variables" for a description of the
SQLPATH
environment variable. Refer to the SQL*Plus User's Guide and Reference for more
information about
LOGIN.SQL
.
The following is a sample startup file:
set echo off
set feedback 4
set pause on
set pause PLEASE ACKNOWLEDGE TO CONTINUE
set echo on
3.1.2 Starting SQL*Plus
To start SQL*Plus, enter:
/START-PROGRAM $ORAC1120.SQLPLUS
* userid/password
If you omit either the user ID or password, then you are prompted to enter them.
Once you are logged in to SQL*Plus, the SQL prompt is displayed:
SQL>
If you do not want to be prompted for user ID/password, then enter:
/START-PROGRAM $ORAC1120.SQLPLUS
* /NOLOG
SQL> connect userid/password
You can enter any SQL statement (SELECT... FROM, CREATE TABLE, and so on.) or
any SQL*Plus command (
SET LINESIZE
,
COLUMN x FORMAT...
, and so on) in response
to this prompt.
3.1.3 Interrupting SQL*Plus
Use the INTERRUPT key [K2] to interrupt SQL*Plus SQL statements. For example,
you can interrupt SQL*Plus if you receive a long report that you do not want to select.