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

SHUTDOWN

SHUTDOWN

Syntax

SHUTDOWN [ABORT|IMMEDIATE|NORMAL|TRANSACTIONAL [LOCAL]]

Shuts down a currently running Oracle instance, optionally closing and dismounting a database. You cannot use SHUTDOWN to stop Oracle instances on Oracle7 servers.

Terms

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

ABORT

Proceeds with the fastest possible shutdown of the database without waiting for calls to complete or users to disconnect.

Uncommitted transactions are not rolled back. Client SQL statements currently being processed are terminated. All users currently connected to the database are implicitly disconnected and the next database startup will require instance recovery.

You must use this option if a background process terminates abnormally.

IMMEDIATE

Does not wait for current calls to complete or users to disconnect from the database.

Further connects are prohibited. The database is closed and dismounted. The instance is shutdown and no instance recovery is required on the next database startup.

NORMAL

NORMAL is the default option which waits for users to disconnect from the database.

Further connects are prohibited. The database is closed and dismounted. The instance is shutdown and no instance recovery is required on the next database startup.

Command Reference 5-101

SHUTDOWN

TRANSACTIONAL [LOCAL]

Performs a planned shutdown of an instance while allowing active transactions to complete first. It prevents clients from losing work without requiring all users to log off.

No client can start a new transaction on this instance. Attempting to start a new transaction results in disconnection. After completion of all transactions, any client still connected to the instance is disconnected. Now the instance shuts down just as it would if a SHUTDOWN IMMEDIATE statement was submitted. The next startup of the database will not require any instance recovery procedures.

The LOCAL mode specifies a transactional shutdown on the local instance only, so that it only waits on local transactions to complete, not all transactions. This is useful, for example, for scheduled outage maintenance.

Usage

SHUTDOWN with no arguments is equivalent to SHUTDOWN NORMAL.

You must be connected to a database as SYSOPER, or SYSDBA. You cannot connect via a multi-threaded server. For more information about connecting to a database, see the CONNECT command earlier in this chapter.

Examples

To shutdown the database in normal mode, enter

SHUTDOWN

Database closed.

Database dismounted.

Oracle instance shut down.

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

START

START

Syntax

STA[RT] {uri|file_name[.ext] } [arg...]

Runs the SQL*Plus statements in the specified command file. The command file can be called from the local file system or from a web server. uri is only supported on Windows platforms in this release. Only the uri form is supported in iSQL*Plus.

Terms

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

uri

Specifies the Uniform Resource Identifier of a script to run on the specified web server. SQL*Plus supports HTTP, FTP and gopher protocols.

file_name[.ext]

Represents the command file you wish to execute. The file can contain any command that you can run interactively.

If you do not specify an extension, SQL*Plus assumes the default com- mand-file extension (normally SQL).

When you enter START file_name.ext, SQL*Plus searches for a file with the filename and extension you specify in the current default directory. If SQL*Plus does not find such a file, SQL*Plus will search a sys- tem-dependent path to find the file. Some operating systems may not support the path search. Consult the Oracle installation and user’s manual(s) provided for your operating system for specific information related to your operating system environment.

arg ...

Represent data items you wish to pass to parameters in the command file. If you enter one or more arguments, SQL*Plus substitutes the values into the parameters (&1, &2, and so forth) in the command file. The first argument replaces each occurrence of &1, the second replaces each occurrence of &2, and so forth.

The START command DEFINEs the parameters with the values of the arguments; if you START the command file again in this session, you can enter new arguments or omit the arguments to use the old values.

Command Reference 5-103

START

Usage

The @ (“at” sign) and @@ (double “at” sign) commands function similarly to START. Disabling the START command in the Product User Profile also disables the @ and @@ commands. See the @ (“at” sign) and @@ (double “at” sign) commands in this chapter for further information on these commands.

Examples

A file named PROMOTE with the extension SQL, used to promote employees, might contain the following command:

SELECT FIRST_NAME, LAST_NAME, JOB_ID, SALARY

FROM EMP_DETAILS_VIEW

WHERE JOB_ID=’&1’ AND SALARY>&2;

To run this command file, enter

START PROMOTE ST_MAN 7000

or if it is located on a web server, enter a command in the form:

START HTTP://HOST.DOMAIN/PROMOTE.SQL ST_MAN 7000

START FTP://HOST.DOMAIN/PROMOTE.SQL ST_MAN 7000

START GOPHER://HOST.DOMAIN/PROMOTE.SQL ST_MAN 7000

Where HOST.DOMAIN must be replaced by the host.domain name for the web server where the script is located.

In either case, SQL*Plus then executes the following command:

SELECT LAST_NAME, LAST_NAME

FROM EMP_DETAILS_VIEW

WHERE JOB_ID=’ST_MAN’ AND SALARY>7000;

and displays the results in SQL*Plus.

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

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