User`s guide
Using the SQL*Plus Utility
5-2 Oracle Database Installation and Administration Guide
5.1.2 Calling SQL*Plus from a Procedure
Set Task Switch 1 to on (
/MODIFY-JOB-SWITCHES ON=1
). This forces SQL*Plus to read in
data from the procedure, rather than prompt you at the terminal.
5.1.3 Using SQL*Plus in the POSIX shell
Before starting SQL*Plus in the POSIX shell, you must set the environment variable
ORACLE_HOME
and extend the POSIX variable PATH by the path to the Oracle
bin
directory
$ORACLE_HOME/bin
. For example:
$ ORACLE_HOME=/u01/app/orac1120/product/dbhome_1
$ export ORACLE_HOME
$ PATH=$ORACLE_HOME/bin:$PATH
$ export PATH
Alternatively, you can process the profile
oracle_home_path/.profile.oracle
, which
is created during the installation of the Oracle software under POSIX. This profile sets
and expands the most important variables like
ORACLE_HOME
and
PATH
. Process the
profile as follows:
$ . /u01/app/orac1120/product/dbhome_1/.profile.oracle
If you want to start SQL*Plus for a specific Oracle instance, then you must also set the
variable
ORACLE_SID
. For starting an Oracle server process, the BS2000 variable
BGJPAR
is required. This variable is not set by running
.profile.oracle
.
If you want to start a background job with special job parameters, for example, a job
should be assigned to a special
JOB-CLASS
, then ensure that the variable
BGJPAR
is set
in your environment.
$ ORACLE_SID=orcl
$ export ORACLE_SID
$ BGJPAR=’START=SOON,CPU-LIMIT=NO,J-C=JCBORA,LOGGING=*NO’
$ export BGJPAR
You can start SQL*Plus in the same way as on other UNIX systems with the following
command:
$ sqlplus /nolog
$ SQL> connect / as sysdba
5.1.4 Running System Commands from SQL*Plus
The SQL*Plus HOST command enables you to enter a BS2000 command, while you are
logged on to SQL*Plus.
Keep the following points in mind when using the
HOST
command:
■ If you enter the
HOST
command without any BS2000 command, then it takes you to
the command level. To return to SQL*Plus, you must use the
RESUME
command in
BS2000 or the
exit
command in the POSIX subshell.
■ If you enter the
HOST
command with a system command in the BS2000
environment, then you can only run BS2000 commands. In the POSIX shell, you
can run shell commands and BS2000 commands by using the shell command
bs2cmd
.