Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
46
Добавлен:
16.04.2013
Размер:
774.99 Кб
Скачать

A

SQL*Plus Commands

This appendix presents many of the SQL*Plus commands.

This appendix includes the following section:

SQL*Plus Commands

SQL*Plus Commands

SQL*Plus is a command-line tool that provides access to the Oracle RDBMS.

SQL*Plus enables you to:

Enter SQL*Plus commands to configure the SQL*Plus environment

Startup and shutdown an Oracle database

Connect to an Oracle database

Enter and execute SQL commands and PL/SQL blocks

Format and print query results

SQL*Plus is available on several platforms. In addition, it has a web-based user interface, iSQL*Plus.

The commands shown in Table A–1 are SQL*Plus commands available in the command-line interface. Not all commands or command parameters are shown.

See Also:

SQL*Plus Quick Reference

SQL*Plus User's Guide and Reference

SQL*Plus Commands A-1

SQL*Plus Commands

Table A–1 Basic SQL*Plus Commands

How To...

SQL*Plus Command

 

 

Log in to SQL*Plus

SQLPLUS [ { username[/passward][@connect_identifier] | / }

 

[ AS { SYSDBA | SYSOPER } ]

 

| /NOLOG

 

]

List help topics available

HELP [ INDEX | topic ]

in SQL*Plus

 

Execute host commands

HOST [ command ]

Show SQL*Plus system

SHOW { ALL | ERRORS | USER | system_variable | ... }

variables or environment

 

settings

 

Alter SQL*Plus system

SET system_variable value

variables or environment

 

settings

 

Start up a database

STARTUP PFILE = filename

 

[ MOUNT [ dbname ] | NOMOUNT | ... ]

Connect to a database

CONNECT [ [ username [ /password ] [ @connect_identifier ]

 

[ / AS { SYSOPER | SYSDBA } ]

 

]

List column definitions for

DESCRIBE [ schema. ] object

a table, view, or synonym,

 

or specifications for a

 

function or procedure

 

Edit contents of the SQL

EDIT [ filename [ .ext ] ]

buffer or a file

 

Get a file and load its

GET filename [ .ext ] [ LIST | NOLLIST ]

contents into the SQL

 

buffer

 

Save contents of the SQL

SAVE filename [ .ext ] [ CREATE | REPLACE | APPEND ]

buffer to a file

 

List contents of the SQL

LIST [ n | n m | n LAST | ... ]

buffer

 

Delete contents of the SQL

DEL [ n | n m | n LAST | ... ]

buffer

 

Add new lines following

INPUT [ text ]

current line in the SQL

 

buffer

 

A-2 Oracle Database SQL Quick Reference

SQL*Plus Commands

Table A–1 Basic SQL*Plus Commands

How To...

SQL*Plus Command

 

 

Append text to end of

APPEND text

current line in the SQL

 

buffer

 

Find and replace first

CHANGE sepchar old [ sepchar [ new [ sepchar ] ] ]

occurrence of a text string

sepchar can be any non-alphanumeric character such as "/" or

in current line of the SQL

"!"

buffer

 

Capture query results in a

SPOOL [ filename [ .ext ]

file and, optionally, send

[ CREATE | REPLACE | APPEND | OFF | OUT ]

contents of file to default

 

printer

 

Run SQL*Plus statements

@ { url | filename [ .ext ] } [ arg... ]

stored in a file

START filename [ .ext ] [ arg... ]

 

.ext can be omitted if the filename extension is .sql

Execute commands stored

/

in the SQL buffer

 

List and execute

RUN

commands stored in the

 

SQL buffer

 

Execute a single PL/SQL

EXECUTE statement

statement or run a stored

 

procedure

 

Disconnect from a

DISCONNECT

database

 

Shut down a database

SHUTDOWN [ ABORT | IMMEDIATE | NORMAL | ... ]

Log out of SQL*Plus

{ EXIT | QUIT }

 

[ SUCCESS | FAILURE | WARNING | ... ]

 

[ COMMIT | ROLLBACK ]

 

 

SQL*Plus Commands A-3

SQL*Plus Commands

A-4 Oracle Database SQL Quick Reference

Соседние файлы в папке Oracle 10g