SQL*Plus Quick Reference Release 9.2 Part Number A90843-01 |
|
March 2002
Part No. A90843-01
This Quick Reference shows iSQL*Plus buttons and icons, and iSQL*Plus and SQL*Plus command syntax. For detailed information on each command, refer to the SQL*Plus User's Guide and Reference.
This Quick Reference has the following topics:
The following two tables describe the notation and conventions for command syntax used in this Quick Reference.
Our goal is to make Oracle products, services, and supporting documentation accessible, with good usability, to the disabled community. To that end, our documentation includes features that make information available to users of z technology. This documentation is available in HTML format, and contains markup to facilitate access by the disabled community. Standards will continue to evolve over time, and Oracle Corporation is actively engaged with other market-leading technology vendors to address technical obstacles so that our documentation can be accessible to all of our customers. For additional information, visit the Oracle Accessibility Program Web site at http://www.oracle.com/accessibility/
Use the following syntax in your web browser's URL field to display iSQL*Plus.
http://machine_name.domain:port/isqlplus[?UserOpts]
or to start iSQL*Plus with DBA privileges, use:
http://machine_name.domain/isqlplusdba[?DBAOpts]
where UserOpts has the following syntax:
where DBAOpts has the following syntax:
DBALogin|Script|DBALogin&Script
where UserLogin has the following syntax:
userid=username[/password][@connect_identifier]
where DBALogin has the following syntax:
userid={username[/password][@connect_identifier] | / } AS {SYSDBA | SYSOPER}
and where Script has the following syntax:
script=text[&type={url|text}] [&action={execute|load}] [&variable=value. . .]
To start iSQL*Plus, enter
http://machine_name.domain:port/isqlplus
To start iSQL*Plus with DBA Privileges, enter
http://machine_name.domain:port/isqlplusdba
Use the following syntax in your web browser for the iSQL*Plus Server Statistics Report URL.
http://machine_name.domain:port/isqlplusdba?statistics={active|full} [&refresh=number]
The table lists navigation icons used to navigate in iSQL*Plus.
The table lists preferences that can be set in iSQL*Plus.
The table lists buttons in the iSQL*Plus Work screen, and their purpose.
SQLPLUS [[option] [logon] [start]]
where option has the following syntax:
where mark_options has the following syntax:
HTML [ON|OFF] [HEAD text] [BODY text] [TABLE text]
[ENTMAP {ON|OFF}] [SPOOL {ON|OFF}] [PRE[FORMAT] {ON|OFF}]
where logon has the following syntax:
and where start has the following syntax:
{EXIT|QUIT} [SUCCESS|FAILURE|WARNING|n|variable
|:BindVariable] [COMMIT|ROLLBACK]
Commits or rolls back all pending changes, logs out of Oracle, terminates SQL*Plus and returns control to the operating system.
In iSQL*Plus, commits or rolls back all pending changes, stops processing the current iSQL*Plus script and returns focus to the Input area. In iSQL*Plus, click the Logout button to log out of Oracle.
Starting up and shutting down a database requires DBA privileges.
STARTUP options | migrate_options
where options has the following syntax:
[FORCE] [RESTRICT] [PFILE=filename] [QUIET] [ MOUNT [dbname] |
[ OPEN [open_options] [dbname] ] |
NOMOUNT ]
where open_options has the following syntax:
READ {ONLY | WRITE [RECOVER]} | RECOVER
and where migrate_options has the following syntax:
Starts an Oracle instance with several options, including mounting and opening a database.
SHUTDOWN [ABORT|IMMEDIATE|NORMAL|TRANSACTIONAL [LOCAL]]
Shuts down a currently running Oracle instance, optionally closing and dismounting a database.
/ (slash)
Executes the most recently executed SQL command or PL/SQL block which is stored in the SQL buffer. Use slash (/) at the command prompt or line number prompt in SQL*Plus command line, or use slash (/) in the iSQL*Plus Input area. Does not list the command.
EXEC[UTE] statement
Executes a single PL/SQL statement or runs a stored procedure.
R[UN]
Lists and executes the most recently executed SQL command or PL/SQL block which is stored in the SQL buffer.
TIMI[NG] [START text|SHOW|STOP]
Records timing data for an elapsed period of time, lists the current timer's name and timing data, or lists the number of active timers.
HELP [topic]
Accesses the command-line help system. Enter HELP INDEX for a list of topics.
In iSQL*Plus, click the Help button to display iSQL*Plus help.
HO[ST] [command]
Executes a host operating system command without leaving SQL*Plus.
With some operating systems, you can use another character instead of HOST such as "$" (VMS), "!" (UNIX) and "$" (Windows). See the Oracle installation and user's manuals provided for your operating system for details.
HOST is not available in iSQL*Plus.
A[PPEND] text
Adds specified text to the end of the current line in the SQL buffer. To separate text from the preceding characters with a space, enter two spaces between APPEND and text. To append text that ends with a semicolon, end the command with two semicolons (SQL*Plus interprets a single semicolon as a command terminator).
APPEND is not available in iSQL*Plus.
C[HANGE] sepchar old [sepchar [new [sepchar]]]
Changes the first occurrence of the specified text on the current line of the SQL buffer. You can use any non-alphanumeric character such as "/" or "!" as a sepchar. You can omit the space between CHANGE and the first sepchar.
CHANGE is not available in iSQL*Plus.
DEL [n|n m|n *|n LAST|*|* n|* LAST|LAST]
Deletes one or more lines of the SQL buffer ("*" indicates the current line). You can omit the space between DEL and n or *, but not between DEL and LAST. Enter DEL with no clauses to delete the current line of the buffer.
DEL is not available in iSQL*Plus.
I[NPUT] [text]
Adds one or more new lines of text after the current line in the SQL buffer.
INPUT is not available in iSQL*Plus.
L[IST] [n|n m|n *|n LAST|*|* n|* LAST|LAST]
Lists one or more lines of the most recently executed SQL command or PL/SQL block which is stored in the SQL buffer. Asterisk (*) indicates the current line. You can omit the space between LIST and n or *, but not between LIST and LAST. Enter LIST with no clauses to list all lines.
@ { url | file_name[.ext] } [arg ...]
Runs the SQL*Plus statements in the specified script. The script can be called from the local file system or a web server. You can pass values to script variables in the usual way.
In iSQL*Plus the script can only be called from a web server.
@@ { url | file_name[.ext] } [arg ...]
Runs the SQL*Plus statements in the specified script. This command is almost identical to the @ ("at" sign) command. It is useful for running nested scripts because it has the additional functionality of looking for the specified script in the same path or url as the calling script.
Only the url form is supported in iSQL*Plus.
STA[RT] { url|file_name[.ext] } [arg ...]
where url supports HTTP and FTP protocols in the form:
{http|ftp}://machine_name.domain/script.sql
Runs the SQL*Plus statements in the specified script. The script can be called from the local file system or a web server. You can pass values to script variables in the usual way.
In iSQL*Plus the script can only be called from a web server.
ED[IT] [file_name[.ext]]
Invokes a host operating system text editor on the contents of the specified file or on the contents of the SQL buffer. To edit the buffer contents, omit the file name.
EDIT is not available in iSQL*Plus.
GET file_name[.ext] [LIS[T]|NOL[IST]]
Loads a SQL statement or PL/SQL block from a host operating system file into the SQL buffer.
GET is not available in iSQL*Plus. In iSQL*Plus click the Load Script button to load a script into the Input area.
REM[ARK]
Begins a comment in a script. The REMARK command must appear at the beginning of a line, and the comment ends at the end of the line (a line cannot contain both a comment and a command). SQL*Plus does not interpret the comment as a command.
SAV[E] file_name[.ext] [CRE[ATE]|REP[LACE]|APP[END]]
Saves the contents of the SQL buffer in a host operating system script.
SAVE is not available in iSQL*Plus. In iSQL*Plus, click the Save Script button to save the Input area contents to a script.
STORE {SET} file_name[.ext] [CRE[ATE]|REP[LACE]|APP[END]]
Saves attributes of the current SQL*Plus environment in a host operating system script.
STORE is not available in iSQL*Plus.
WHENEVER OSERROR {EXIT [SUCCESS|FAILURE
|n|variable|:BindVariable] [COMMIT|ROLLBACK]|CONTINUE
[COMMIT|ROLLBACK|NONE]}
Performs the specified action (exits SQL*Plus by default) if an operating system error occurs (such as a file writing error).
In iSQL*Plus, performs the specified action (stops the current script by default) and returns focus to the Input area if an operating system error occurs.
WHENEVER SQLERROR {EXIT [SUCCESS|FAILURE|WARNING
|n|variable|:BindVariable] [COMMIT|ROLLBACK]|CONTINUE
[COMMIT|ROLLBACK|NONE]}
Performs the specified action (exits SQL*Plus by default) if a SQL command or PL/SQL block generates an error.
In iSQL*Plus, performs the specified action (stops the current script by default) and returns focus to the Input area if a SQL command or PL/SQL block generates an error.
ACC[EPT] variable [NUM[BER]|CHAR|DATE] [FOR[MAT] format]
[DEF[AULT] default] [PROMPT text|NOPR[OMPT]] [HIDE]
Reads a line of input and stores it in a given user variable.
ACCEPT is not available in iSQL*Plus.
DEF[INE] [variable]|[variable = text]
Specifies a user variable and assigns a CHAR value to it, or lists the value and variable type of a single variable or all variables.
PAU[SE] [text]
Displays the specified text then waits for the user to press RETURN.
PAUSE is not available in iSQL*Plus.
PRO[MPT] [text]
Sends the specified message or a blank line to the user's screen.
UNDEF[INE] variable ...
Deletes one or more user variables that you defined either explicitly (with the DEFINE command) or implicitly (with a START command argument).
PRI[NT] [variable ...]
Displays the current values of bind variables.
VAR[IABLE] [variable {NUMBER|CHAR|CHAR (n [CHAR|BYTE])|NCHAR
|NCHAR (n)|VARCHAR2 (n [CHAR|BYTE])| NVARCHAR2(n)|CLOB|NCLOB|REFCURSOR}]
Declares a bind variable that can be referenced in PL/SQL, or lists the current display characteristics for a single variable or all variables.
&n
Specifies a parameter in a script you run using the START command. START substitutes values you list after the script name as follows: the first for &1, the second for &2, and so on.
&user_variable, &&user_variable
Indicates a substitution variable in a SQL or SQL*Plus command. SQL*Plus substitutes the value of the specified user variable for each substitution variable it encounters. If the user variable is undefined, SQL*Plus prompts you for a value each time an "&" variable is found, and the first time an "&&" variable is found.
. (period)
Terminates a substitution variable followed by a character that would otherwise be part of the variable name.
ATTRIBUTE [type_name.attribute_name [option...]]
Specifies display characteristics for a given attribute of an Object Type column, or lists the current display characteristics for a single attribute or for all attributes. option represents one of the following clauses:
ALI[AS] alias |
LIKE {type_name.attribute_name|alias} |
CLE[AR] |
ON|OFF |
FOR[MAT] format |
BRE[AK] [ON report_element [action [action]]] ...
Specifies where changes occur in a report and the formatting action to perform (for example, skipping a line each time a column value changes). Enter BREAK with no clauses to list the current BREAK definition.
Where report_element has the following syntax:
and where action has the following syntax:
The SKIP option is not available in iSQL*Plus.
BTI[TLE] [printspec [text|variable] ...]|[ON|OFF]
Places and formats a title at the bottom of each report page, or lists the current BTITLE definition. Use one of the following clauses in place of printspec:
COL n |
LE[FT] |
BOLD |
S[KIP] [n] |
CE[NTER] |
FORMAT text |
TAB n |
R[IGHT] |
CL[EAR] option ...
Resets or erases the current value or setting for the specified option; option represents one of the following clauses:
BRE[AKS] |
COMP[UTES] |
TIMI[NG] |
BUFF[ER] |
SCR[EEN] |
|
COL[UMNS] |
SQL |
CLEAR SCREEN is not available in iSQL*Plus.COL[UMN] [{column|expr} [option ...]]
Specifies display attributes for a given column, such as column heading text, column heading alignment, data format and column data wrapping.
Also lists the current display attributes for a single column or all columns.
option represents one of the following clauses:
ALI[AS] alias
CLE[AR]
ENTMAP {ON|OFF}
FFOLD_A[FTER]
FOLD_B[EFORE]
FOR[MAT] format
HEA[DING] text
JUS[TIFY] {L[EFT]|C[ENTER]|C[ENTRE]|R[IGHT]}
LIKE {expr|alias}
NEWL[INE]
NEW_V[ALUE] variable
NOPRI[NT]|PRI[NT]
NUL[L] text
OLD_V[ALUE] variable
ON|OFF
WRA[PPED]|WOR[D_WRAPPED]|TRU[NCATED]
Enter COLUMN [{column |expr} FORMAT format] where the format element specifies the display format for the column.
To change the display format of a NUMBER column, use FORMAT followed by one of the elements in the following table:
COMP[UTE] [function [LAB[EL] text] ... OF {expr|column|alias} ...ON {expr|column|alias|REPORT|ROW} ...]
Calculates and prints summary lines on subsets of selected rows using various standard computations. It also lists all COMPUTE definitions. The following table lists valid functions. All functions except NUMBER apply to non-null values only. COMPUTE functions are always executed in the following sequence AVG, COUNT, MINIMUM, MAXIMUM, NUMBER, SUM, STD, VARIANCE.
REPF[OOTER] [PAGE] [printspec [text|variable] ...]|[ON|OFF]
Places and formats a footer at the bottom of a report, or lists the current REPFOOTER definition. printspec represents one or more of the following clauses:
COL n |
LE[FT] |
BOLD |
S[KIP] [n] |
CE[NTER] |
FORMAT text |
TAB n |
R[IGHT] |
REPH[EADER] [PAGE] [printspec [text|variable] ...]|[ON|OFF]
Places and formats a header at the top of a report, or lists the current REPHEADER definition. printspec represents one or more of the following clauses:
COL n |
LE[FT] |
BOLD |
S[KIP] [n] |
CE[NTER] |
FORMAT text |
TAB n |
R[IGHT] |
SPO[OL] [filename[.ext]|OFF|OUT]
Stores query results in an operating system file, or optionally sends the file to a printer. OFF stops spooling. OUT stops spooling and sends the file to your host computer's default printer. Enter SPOOL with no clauses to list the current spooling status. If no file extension is given, the default extension, .lst or .lis, is used.
SPOOL is not available in iSQL*Plus. In iSQL*Plus, use the preference setting to direct output to a file.
TTI[TLE] [printspec [text|variable] ...]|[ON|OFF]
Places and formats a specified title at the top of each report page, or lists the current TTITLE definition. The old form of TTITLE is used if only a single word or a string in quotes follows the TTITLE command. printspec represents one or more of the following clauses:
COL n |
LE[FT] |
BOLD |
S[KIP] [n] |
CE[NTER] |
FORMAT text |
TAB n |
R[IGHT] |
CONN[ECT] [{logon|/} [AS {SYSOPER|SYSDBA}]]
where logon requires the following syntax:
Connects a given username to Oracle. If you omit connect_identifier, SQL*Plus connects you to the default database. If you omit username and/or password, SQL*Plus prompts you for them. CONNECT followed by a slash (/) connects you using a default (OPS$) logon.
In iSQL*Plus you must always include your username and password in a CONNECT command as iSQL*Plus does not prompt for a missing password.
DISC[ONNECT]
Commits pending changes to the database and logs the current user out of Oracle, but does not exit SQL*Plus. In SQL*Plus command line, use EXIT or QUIT to log out of Oracle and return control to your host computer's operating system.
In iSQL*Plus, click the Logout button to log out of Oracle.
COPY {FROM database | TO database | FROM database TO database} {APPEND|CREATE|INSERT|REPLACE} destination_table[(column, column, column, ...)] USING query
where database has the following syntax:
Copies data from a query to a table in a local or remote database. APPEND, CREATE, INSERT or REPLACE specifies how COPY treats the existing copy of the destination table (if it exists). USING query identifies the source table and determines which rows and columns COPY copies from it. COPY supports CHAR, DATE, LONG, NUMBER and VARCHAR2 datatypes.
PASSW[ORD] [username]
Allows you to change a password without displaying it on an input device.
PASSWORD is not available in iSQL*Plus. In iSQL*Plus, use the Password screen to change your password.
ARCHIVE LOG {LIST|STOP}|{START|NEXT|ALL|integer}[TO destination]
Starts or stops automatic archiving online redo logs, manually (explicitly) archives specified redo logs, or displays information about redo log files.
DESC[RIBE] {[schema.]object[@connect_identifier]}
Lists the column definitions for a table, view or synonym, or the specifications for a function or procedure.
RECOVER {general | managed | END BACKUP}
where the general clause has the following syntax:
[AUTOMATIC] [FROM location]
{ {full_database_recovery | partial_database_recovery |LOGFILE filename}
[ {TEST | ALLOW integer CORRUPTION } [TEST | ALLOW integer CORRUPTION ]...]
|CONTINUE [DEFAULT]|CANCEL}
where the full_database_recovery clause has the following syntax:
[STANDBY] DATABASE
[ {UNTIL {CANCEL | TIME date | CHANGE integer} | USING BACKUP CONTROLFILE}
[UNTIL {CANCEL | TIME date | CHANGE integer} | USING BACKUP CONTROLFILE]...]
where the partial_database_recovery clause has the following syntax:
{TABLESPACE tablespace [, tablespace]... | DATAFILE datafilename [, datafilename]...
| STANDBY
{TABLESPACE tablespace [, tablespace]... | DATAFILE datafilename [, datafilename]...}
UNTIL [CONSISTENT] [WITH] CONTROLFILE }
where the managed clause has the following syntax:
MANAGED STANDBY DATABASE
[ {NODELAY | [TIMEOUT] integer | CANCEL [IMMEDIATE] [NOWAIT]}
| [DISCONNECT [FROM SESSION] ] [FINISH [NOWAIT] ] ]
Performs media recovery on one or more tablespaces, one or more datafiles, or the entire database.
In iSQL*Plus, you must set AUTORECOVERY ON to use RECOVER. You are recommended to use command-line SQL*Plus for long running DBA operations such as RECOVER because of possible network timeouts.
SET system_variable value
Sets a system variable to alter the SQL*Plus environment settings for your current session, such as setting the display width for data, turning on HTML formatting, enabling or disabling printing of column headings, or setting the number of lines per page.
In iSQL*Plus, you can also use the System Variables screen to set system variables.
Enter a system variable followed by a value as shown below:
SET APPI[NFO]{ON|OFF|text}
SET ARRAY[SIZE] {15|n}
SET AUTO[COMMIT] {ON|OFF|IMM[EDIATE]|n}
SET AUTOP[RINT] {ON|OFF}
SET AUTORECOVERY {ON|OFF]
SET AUTOT[RACE] {ON|OFF|TRACE[ONLY]} [EXP[LAIN]] [STAT[ISTICS]]
SET BLO[CKTERMINATOR] {.|c}
SET CMDS[EP] {;|c|ON|OFF}
SET COLSEP {_|text}
SET COM[PATIBILITY] {V7|V8|NATIVE}
SET CON[CAT] {.|c|ON|OFF}
SET COPYC[OMMIT] {0|n}
SET COPYTYPECHECK {ON|OFF}
SET DEF[INE] {'&'|c|ON|OFF}
SET DESCRIBE [DEPTH {1|n|ALL}][LINENUM {ON|OFF}][INDENT {ON|OFF}]
SET ECHO {ON|OFF}
*SET EDITF[ILE] file_name[.ext]
SET EMB[EDDED] {ON|OFF}
SET ESC[APE] {\|c|ON|OFF}
SET FEED[BACK] {6|n|ON|OFF}
SET FLAGGER {OFF|ENTRY|INTERMED[IATE]|FULL}
*SET FLU[SH] {ON|OFF}
SET HEA[DING] {ON|OFF}
SET HEADS[EP] {||c|ON|OFF}
SET INSTANCE [instance_path|LOCAL]
SET LIN[ESIZE] {80|n} (default is 150 in iSQL*Plus)
SET LOBOF[FSET] {n|1}
SET LOGSOURCE [pathname]
SET LONG {80|n}
SET LONGC[HUNKSIZE] {80|n}
SET MARK[UP] HTML [ON|OFF] [HEAD text] [BODY text] [TABLE text]
[ENTMAP {ON|OFF}] [SPOOL {ON|OFF}] [PRE[FORMAT] {ON|OFF}]
*SET NEWP[AGE] {1|n|NONE}
SET NULL text
SET NUMF[ORMAT] format
SET NUM[WIDTH] {10|n}
SET PAGES[IZE] {24|n}
*SET PAU[SE] {ON|OFF|text}
SET RECSEP {WR[APPED]|EA[CH]|OFF}
SET RECSEPCHAR {_|c}
SET SERVEROUT[PUT] {ON|OFF} [SIZE n] [FOR[MAT] {WRA[PPED]
|WOR[D_WRAPPED]|TRU[NCATED]}]
*SET SHIFT[INOUT] {VIS[IBLE]|INV[ISIBLE]}
*SET SHOW[MODE] {ON|OFF}
*SET SQLBL[ANKLINES] {ON|OFF}
SET SQLC[ASE] {MIX[ED]|LO[WER]|UP[PER]}
*SET SQLCO[NTINUE] {> |text}
*SET SQLN[UMBER] {ON|OFF}
SET SQLPLUSCOMPAT[IBILITY] {x.y[.z]}
*SET SQLPRE[FIX] {#|c}
*SET SQLP[ROMPT] {SQL>|text}
SET SQLT[ERMINATOR] {;|c|ON|OFF}
*SET SUF[FIX] {SQL|text}
*SET TAB {ON|OFF}
*SET TERM[OUT] {ON|OFF}
*SET TI[ME] {ON|OFF}
SET TIMI[NG] {ON|OFF}
*SET TRIM[OUT] {ON|OFF}
*SET TRIMS[POOL] {ON|OFF}
SET UND[ERLINE] {-|c|ON|OFF}
SET VER[IFY] {ON|OFF}
SET WRA[P] {ON|OFF}
An asterisk (*) indicates the SET option is not supported in iSQL*Plus.
SHO[W] [option]
Shows the value of a SQL*Plus system variable, or the SQL*Plus environment. Enter any system variable set by the SET command in place of system_variable. Use one of the following terms or clauses in place of option:
system_variable
ALL
BTI[TLE]
ERR[ORS] [ {FUNCTION | PROCEDURE | PACKAGE | PACKAGE BODY | TRIGGER
| VIEW | TYPE | TYPE BODY | DIMENSION | JAVA CLASS} [schema.]name]
LNO
PARAMETERS [parameter_name]
PNO
REL[EASE]
REPF[OOTER]
REPH[EADER]
SGA
SPOO[L] (Not available in iSQL*Plus)
SQLCODE
TTI[TLE]
USER
Oracle is a registered trademark, and Oracle9i, SQL*Plus and iSQL*Plus are trademarks or registered trademarks of Oracle Corporation. Other names may be trademarks of their respective owners.
Copyright © 1996, 2002 Oracle Corporation.
All Rights Reserved.
|
Copyright © 1996, 2002 Oracle Corporation. All Rights Reserved. |
|