SQL*Plus
User's Guide and Reference
Release 8.1.6 A75664-01 |
|
Starting SQL*Plus and Getting Help, 2 of 3
You use the SQLPLUS command at the operating system prompt to start SQL*Plus:
SQLPLUS [ [option] [logon] [start] ]
where:
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:
Outputs HTML marked up text to the screen and optionally enables HTML output to a spool file. The -MARKUP option allows generation of HTML pages to the standard output device, for example, your screen. -MARKUP options have the same effect as options for the SET MARKUP command.
Note: Depending on your operating system, the complete -MARKUP clause option for the SQLPLUS command may need to be in quotes. |
Specifies whether or not to use the HTML tags implemented
by MARKUP. HTML is a mandatory argument which specifies that the type of
output generated by MARKUP is HTML.
HTML ON -- enables SQL*Plus to write HTML tags to SQL*Plus
standard output (usually a spool file).
HTML OFF -- SQL*Plus writes plain text to standard output.
You can turn HTML output ON and OFF as required during a
session. The default is OFF.
You enable the writing of HTML with the SPOOL ON option, and you initiate the writing of the spool file with the SPOOL filename command. See SPOOL ON|OFF below for more details.
Note: SQL*Plus 8.1.6 implements the HTML <PRE> tag. More HTML tags may be implemented in future releases. |
Allows you to specify content for the <HEAD> tag. By default, text is '<TITLE>SQL*Plus Report</TITLE>'. If you enter more than one word in text, it must be enclosed in quotes. The text you enter must be valid HTML for the <HEAD> tag. SQL*Plus does not verify this free text entry. It is your responsibility to ensure that the text you enter is valid HTML.
Allows you to specify attributes for the <BODY> tag. By default, there are no attributes. If you enter more than one word in text, it must be enclosed in quotes. text must be valid HTML for the <BODY> tag. SQL*Plus does not verify this free text entry. It is your responsibility to ensure that the text you enter is valid HTML.
Specifies whether or not SQL*Plus displays the special characters
"<", ">" and "&" as the HTML entities <, > and &
respectively.
ENTMAP ON -- SQL*Plus displays HTML entities on screen and
writes HTML entities to the spool file.
ENTMAP OFF -- SQL*Plus does not display or write HTML entities.
You can turn ENTMAP ON and OFF as required during a session. The default is ON. For example, with ENTMAP OFF, SQL*Plus screen output would be:
SQL> select ename, empno 2 from emp 3 where sal <= 2000;
With ENTMAP ON, SQL*Plus screen output would be:
SQL> select ename, empno 2 from emp 3 where sal <= 2000;
Note: ENTMAP only has affect when either the HTML option is set ON, or the SPOOL option is set ON. |
Specifies whether or not SQL*Plus writes HTML tags to the
start and end of a file created by the SQL*Plus SPOOL filename command.
SPOOL ON -- enables SQL*Plus to write HTML tags to the beginning
of a spool file.
SPOOL OFF -- enables SQL*Plus to write a close tag (</HTML>)
to a spool file the next time a SPOOL filename, SPOOL OFF or EXIT
command is issued.
You can turn SPOOL ON and OFF as required during a session.
The default is OFF.
SQL*Plus writes several HTML tags to the spool file when you issue the SPOOL filename command. The tags written and their default content are:
<HTML> <HEAD> <TITLE>SQL*Plus Report</TITLE> <META Name="generator" content="SQL*Plus 8.1.6"> </HEAD> <BODY> <PRE>
When you issue any of the SQL*Plus commands: EXIT, SPOOL OFF or SPOOL filename, SQL*Plus appends the following end tags and closes the file:
</PRE></BODY></HTML>
You can specify <HEAD> tag contents and <BODY> attributes using the HEAD and BODY options.
Specifies whether or not SQL*Plus writes output to the spool
file inside the HTML <PRE> tag:
PREFORMAT ON -- SQL*Plus writes output inside the HTML <PRE>
tag.
PREFORMAT OFF -- SQL*Plus writes output inside the HTML
tags implemented by the HTML ON option.
You can turn PREFORMAT ON and OFF as required during a session. The default is OFF.
Allows you to disable certain commands that interact with
the operating system. This is similar to disabling the same commands in
the Product User Profile (PUP) table. However, commands disabled with the
-RESTRICT option are disabled even if there is no connection to a server,
and remain disabled until SQL*Plus terminates.
If no -RESTRICT option is active, than all commands can
be used, unless disabled in the PUP table.
If -RESTRICT 3 is used, then LOGIN.SQL is not read. GLOGIN.SQL
is read but restricted commands used will fail.
Table 7-1 shows the commands disabled in each restriction level.
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.
SILENT is a useful mode for creating reports for the web using the SQLPLUS -MARKUP command inside a CGI script or operating system command file. The SQL*Plus banner and prompts are suppressed and do not appear in reports created using the SILENT option.
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 omit only password, SQL*Plus prompts you for password. When prompting, SQL*Plus does not display password on your terminal screen.
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.
The SQLPLUS 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.
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.
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.
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.
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 connection string), 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
To display the syntax of the SQLPLUS command, enter
SQL> SQLPLUS -
SQL*Plus displays the following
Usage: SQLPLUS [ [<option>] [<logon>] [<start>] ] where <option> ::= - | -? | [ [-M <o>] [-R <n>] [-S] ] <logon> ::= <username>[/<password>][@<connect_string>] | / |/NOLOG <start> ::= @<filename>[.<ext>] [<parameter> ...] - displays the 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
|
![]() Copyright © 1999 Oracle Corporation. All Rights Reserved. |
|