Page 330
Command Syntax
DESCRIBE FUNCTION PACKAGE PACKAGE BODY PROCEDURE TABLE VIEW
Keywords
FUNCTION | A valid function within the database. |
PACKAGE | A package stored within the database. |
PACKAGEBODY | The body of a database package. |
TABLE | A database table, which can be prefixed by a user 's schema. |
VIEW | A view across one (or more) database tables. |
Example
DESCRIBE mark.author_list;
DESC chris.book$view;
Description
You use the DISCONNECT command to disconnect from the current instance without exiting Server Manager. It has no additional parameters. You can use this command with SET INSTANCE to access multiple instances at your site without exiting and reentering Server Manager.
Command Syntax
DISCONNECT
Keywords
none
Example
DISCONNECT;
Description
You use EXECUTE to execute a one-line PL/SQL statement. If you want to execute more than one line, you must use the BEGIN...END format for PL/SQL. You also must be connected to a database before executing this command.
Page 331
Command Syntax
EXECUTE PL/SQL statement
Keywords
None
Example
EXECUTE total_orders;
Description
EXIT is the command you use to exit the Server Manager session. It automatically disconnects you from the current database if a connection has been established. This command has no parameters or keywords.
Command Syntax
EXIT
Keywords
None
Example
EXIT;
Description
The HOST command executes an operating system command or program while you're still in Server Manager. This command shells you out of Server Manager for the duration of the command. If issued by itself, it shells you to the operating system until you type EXIT or QUIT to return to Server Manager.
Command Syntax
HOST operating system command HOST
Keywords
operating system command A valid operating system command or program.
Examples
HOST who;
HOST;
Page 332
Description
The PRINT command prints the value of a variable that you defined using the SQL*Plus command VARIABLE.
Command Syntax
PRINT variable
Keyword
variable | The name of the variable defined with the VARIABLE command. If no variable is specified, all defined variables are printed. |
Examples
PRINT COUNTER;
PRINT;
PRINT NAME;
Description
You use the RECOVER command to perform media recovery on data files, tablespaces, or entire databases as required. You must be connected as INTERNAL to use this command, and you must have a dedicated process. You cannot be connected through Oracle's multithreaded server.
Command Syntax
RECOVER DATABASE RECOVER DATABASE UNTIL CANCEL CHANGE integer TIME date RECOVER DATABASE USING BACKUP CONTROLFILE RECOVER TABLESPACE tablespace RECOVER DATAFILE filename
Keywords
DATABASE | Requests the recovery of an entire database. Applies redo log files to all tablespaces that need media recovery. |
UNTIL TIME date | Specifies an incomplete RECOVER to a specific time. You must specify the date in the following format: `YYYY-MM-DD:HH24:MI:SS' YYYY is a four-digit year. MM is a two-digit month. |
Page 333
HH24 is the time in 24-hour specification. MI is minutes. SS is seconds. | |
UNTIL CHANGE integer | Recovers the database and its files until a specific change number. This is very useful in restoring a tablespace when a table is dropped accidentally . integer must be a valid change number, and the redo logs must be available to Oracle. |
UNTIL CANCEL | Specifies that recovery should continue applying redo logs until the operator cancels the operation. Recovery continues redo log by redo log until it is canceled . |
USING BACKUP CONTROLFILE | Tells the database to use a backup version of the control file instead of the primary one. This control file must be available to Oracle, or the command fails. |
TABLESPACE tablespace | Recovers the specified tablespace(s). You can recover up to 16 tablespaces in a single statement. |
DATAFILE filename | Specifies a particular data file belonging to a tablespace that you want to restore. There is no limit to the number of data files you can recover in a given statement. |
Examples
RECOVER TABLESPACE tools;
RECOVER DATABASE;
RECOVER DATAFILE `users_01.dbf';
RECOVER DATABASE UNTIL `1994-10-11:15:01:00';
RECOVER TABLESPACE tools, users;
Description
Denotes a remark or comment in a SQL script file. Server Manager ignores all text on a line that begins with this command.
Command Syntax
REMARK text
Keywords
None
Page 334
Example
REMARK Filename: shutdown_oracle.sql REMARK Author: Kelly Leigh REMARK Revised: June 30, 1997
Description
The SET command sets characteristics for the current Server Manager session. These characteristics are not saved for future sessions.
Command Syntax
SET APPINFO ON/OFF/USERTEXT AUTORECOVERY ON/OFF CHARWIDTH integer COMPATIBILITY V6/V7 DATEWIDTH integer ECHO ON/OFF FETCHROWS integer INSTANCE instance-path/LOCAL LOGSOURCE pathname/DEFAULT LONGWIDTH integer MAXDATA integer NUMWIDTH integer RETRIES integer/INFINITE SERVEROUTPUT OFF/ON SIZE integer STOPONERROR ON/OFF TERMOUT ON/OFF TIMING ON/OFF
Keywords
APPINFO ON/OFF USERTEXT | Registers a Server Manager Application through the DBMS_APPLICATION_INFO package. The default for this keyword is OFF. If specifying a registration text string, place at the key USERTEXT and enclose it in quotes. The default registration string is "Oracle SQL Worksheet". |
AUTORECOVERY ON/OFF | Tells the database to automatically apply all redo logs necessary to bring the database, tablespace, or data file to a usable state. When this is ON, the database begins recovery without requesting input from the operator. Log filenames are derived from the database parameters LOG_ARCHIVE_DEST and LOG_ARCHIVE_FORMAT. If the files cannot be located, operator input is requested . |
Page 335
CHARWIDTH integer | Defines the column width displayed for columns of type CHAR. The default is 80, and if no integer is specified, the parameter is reset to 80. |
COMPATIBILITY V6/V7/NATIVE | Sets the Server Manager compatibility mode to Version 6 or Version 7. This parameter affects how you specify columns of type CHAR, integrity constraint definitions, and the storage parameters for rollback segments. NATIVE tells Server Manager to use the connected database's version. |
DATEWIDTH integer | Sets the width for DATE data to be displayed. The default is 9, and if entered with no integer, it is reset to 9. The range of values for this parameter is operating system_ specific. |
ECHO ON/OFF | Enables echoing of commands executed from command files. The default is OFF. In this mode, only the output is displayed. |
FETCHROWS integer/ INFINITE | This parameter limits the number of rows that are returned by a database query. It can be very useful in returning only the first 10 or 20 rows from a database table. The default returns all rows that match the given criteria. As with all other parameters, entering the SET command without an integer resets the value to all. If set to INFINITE, no restriction exists on the number of rows returned. |
INSTANCE instance- path/LOCAL | Sets the instance name to where all Server Manager commands are applied. The instance-path is defined by a system node name and database name separated with a hyphen. A sample connect string is my_host-my_ database. Issuing the command with no database definition resets the instance back to the local default instance. |
LOGSOURCE pathname/ DEFAULT | Tells Oracle where to find archived redo logs to be used during a recovery session. Use this to set the location to a temporary location where redo logs have been restored. |
LONGWIDTH integer | Tells Server Manager how to display LONG data. By default, the display is 80 characters only. Once again, the operating system defines the range of values for this parameter. |