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

/ (slash)

/ (slash)

Syntax

/

Executes the SQL command or PL/SQL block currently stored in the SQL buffer.

Usage

You can enter a slash (/) at the command prompt or at a line number prompt of a multi-line command.

The slash command functions similarly to RUN, but does not list the command in the buffer on your screen.

Executing a SQL command or PL/SQL block using the slash command will not cause the current line number in the SQL buffer to change unless the command in the buffer contains an error. In that case, SQL*Plus changes the current line number to the number of the line containing the error.

Examples

Type the following SQL query:

SELECT CITY, COUNTRY_NAME

FROM EMP_DETAILS_VIEW

WHERE SALARY=12000;

Enter a slash (/) at the command prompt to re-execute the command in the buffer:

/

 

CITY

COUNTRY_NAME

------------------------------

----------------------------------------

Seattle

United States of America

Oxford

United Kingdom

Seattle

United States of America

Command Reference 5-9

ARCHIVE LOG

ARCHIVE LOG

Syntax

ARCHIVE LOG {LIST|STOP}|{START|NEXT|ALL|integer } [TO destination]

Starts or stops automatic archiving of online redo log files, manually (explicitly) archives specified redo log files, or displays information about redo log files.

Terms

Refer to the following list for a description of each term or clause:

LIST

Requests a display that shows the range of redo log files to be archived, the current log file group’s sequence number, and the current archive destination (specified by either the optional command text or by the initialization parameter LOG_ARCHIVE_DEST).

If you are using both ARCHIVELOG mode and automatic archiving, the display might appear like:

ARCHIVE LOG LIST

 

Database log mode

Archive Mode

Automatic archival

Enabled

Archive destination

/vobs/oracle/dbs/arch

Oldest online log sequence

221

Next log sequence to archive

222

Current log sequence

222

Since the log sequence number of the current log group and the next log group to archive are the same, automatic archival has archived all log groups up to the current one.

If you are using ARCHIVELOG but have disabled automatic archiving, the last three lines might look like:

Oldest online log sequence

222

Next log sequence to

archive

222

Current log sequence

 

225

If you are using NOARCHIVELOG mode, the “next log sequence to archive” line is suppressed.

5-10 iSQL*Plus User’s Guide and Reference

ARCHIVE LOG

The log sequence increments every time the Log Writer begins to write to another redo log file group; it does not indicate the number of logs being used. Every time an online redo log file group is reused, the contents are assigned a new log sequence number.

STOP

Disables automatic archival. If the instance is still in ARCHIVELOG mode and all redo log file groups fill, database operation is suspended until a redo log file is archived (for example, until you enter the command ARCHIVE LOG NEXT or ARCHIVE LOG ALL).

START

Enables automatic archiving. Starts the background process ARCH, which performs automatic archiving as required. If ARCH is started and a filename is supplied, the filename becomes the new default archive destination. ARCH automatically starts on instance startup if the initialization parameter LOG_ARCHIVE_START is set to TRUE.

NEXT

Manually archives the next online redo log file group that has been filled, but not yet archived.

ALL

Manually archives all filled, but not yet archived, online redo log file groups.

integer

Causes archival of the online redo log file group with log sequence number n. You can specify any redo log file group that is still online. An error occurs if the log file cannot be found online or the sequence number is not valid. This option can be used to re-archive a log file group.

destination

Specifies the destination device or directory in an operating system. Specification of archive destination devices is installation-specific; see your platform-specific Oracle documentation for examples of specifying archive destinations. On many operating systems, multiple log files can be spooled to the same tape.

If not specified in the command line, the archive destination is derived from the initialization parameter LOG_ARCHIVE_DEST. The command ARCHIVE LOG START destination causes the specified device or

Command Reference 5-11

ARCHIVE LOG

directory to become the new default archive destination for all future automatic or manual archives. A destination specified with any other option is a temporary destination that is in effect only for the current (manual) archive. It does not change the default archive destination for subsequent automatic archives. For information about specifying archive destinations, see your platform-specific Oracle documentation.

Usage

You must be connected to an open Oracle database as SYSOPER, or SYSDBA. For information about connecting to the database, see the CONNECT command.

If an online redo log file group fills and none are available for reuse, database operation is suspended. The condition can be resolved by archiving a log file group.

For information about specifying archive destinations, see your platform-specific Oracle documentation.

Note: This command applies only to the current instance. To specify archiving for a different instance or for all instances in a cluster database, use the SQL command ALTER SYSTEM. For more information about using SQL commands, see the Oracle9i SQL Reference.

Examples

To start up the archiver process and begin automatic archiving, using the archive destination specified in LOG_ARCHIVE_DEST, enter

ARCHIVE LOG START

To stop automatic archiving, enter

ARCHIVE LOG STOP

To archive the log file group with sequence number 1001 to the destination specified, enter

ARCHIVE LOG 1001 ’/vobs/oracle/dbs/arch’

’arch’ specifies the prefix of the filename on the destination device; the remainder of the filename is dependent on the initialization parameter LOG_ARCHIVE_ FORMAT, which specifies the filename format for archived redo log files.

5-12 iSQL*Plus User’s Guide and Reference

Тут вы можете оставить комментарий к выбранному абзацу или сообщить об ошибке.

Оставленные комментарии видны всем.

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