Page 336
MAXDATA integer | Sets the maximum number of bytes that you can fetch from the database in a single SELECT statement. The default is 20,480 bytes (20KB). Your operating system defines the maximum number for this parameter. |
NUMWIDTH integer | Defines the length in characters in which data types of NUMBER are displayed. The default is 10, and the minimum and maximum values are operating system_dependent. |
RETRIES integer/INFINITE | Usedwith the STARTUP command, this specifies how many times the STARTUP command attempts to start the database. INFINITE means that it tries until it succeeds or is canceled . |
SERVER OUTPUT OFF/ ON SIZE integer | Specifies the size of the message buffer, in bytes, that can accumulate at one time. This message buffer is used by the PUT() and PUT_LINE() commands. |
STOPONERROR ON/OFF | Tells Server Manager, when executing a command file, to stop if it encounters an error. If it finds an error, the rest of the command file is not executed, and it returns control to the operating system. |
TERMOUT ON/OFF | Controls the display of output from SQL commands to the output window. ON enables display of the output, whereas OFF disables the output. This is helpful if you're spooling output to files. The output is sent to the spool file but not the terminal. |
TIMING ON/OFF | Displays the parse, execute, and fetch times for every SQL statement executed. The default is OFF. This option is useful for establishing response times. |
Examples
SET INSTANCE D:DEV-PROD
SET HISTORY 50;
SET NUMWIDTH 20;
Description
Using the SHOW command shows the values of all the parameters set by the SET command. Additionally, this command supports several other parameters. For a definition of any parameter listed, refer to the preceding section, "SET."
Page 337
Command Syntax
SHOW ARRAYSIZE ALL APPINFO AUTORECOVERY CHARWIDTH COMPATIBILITY DATEWIDTH ECHO ERRORS FETCHROWS INSTANCE LOGSOURCE LONGWIDTH MAXDATA NUMWIDTH PARAMETERS RETRIES SERVER OUTPUT SGA SPOOL STOPONERROR TERMOUT TIMING
Keywords
ALL | Shows the values of all settings. Does not show ERRORS, PARAMETERS, or SGA, which must be displayed separately. |
APPINFO | Shows the current status of APPINO, as well as the current registration text. |
AUTORECOVERY | Displays the current value of the AUTORECOVERY function. |
CHARWIDTH | Displays the current display width for CHAR data. |
COMPATIBILITY | Shows the current setting for the COMPATIBILITY flag. |
DATEWIDTH | Displays the current display width for DATE fields. |
ECHO | Specifies whether command (script) file entries are displayed when executed. |
ERRORS | Shows all errors encountered during the last compilation of a function, procedure, or package. Output includes the line, column, and error message generated. |
FETCHROWS | Displays how many rows are returned from a database query. |
INSTANCE | Shows the connect string for the default instance to connect to. |
LOGSOURCE | Displays the current destination for archive logs. |
LONGWIDTH | Shows the column width for displaying fields of datatype NUMBER. |
Page 338
MAXDATA | Shows the maximum data size. |
NUMWIDTH | Displays the current column display width for NUMBER fields. |
PARAMETERS | Shows the current values for all database parameters specified in the startup files for the current instance. When used alone, it displays all parameters. When used with a parameter name , it shows the specific parameter. If a partial parameter name is used, the output includes all parameters that are similar. |
RETRIES | Displays how many times the startup of an instance in Parallel mode will be tried before failing. |
SERVEROUTPUT | Shows the value (ON/OFF) of whether output is enabled or disabled from stored procedures and functions. |
SGA | Shows current information on the system global area (SGA) for the connected instance. |
SPOOL | Displays the name of the output spool file if spooling is enabled. |
STOPONERROR | Specifies whether errors generated during a command file execution cause the command file to be aborted or whether the command errors are ignored. |
TERMOUT | Shows whether output to the terminal is disabled. |
TIMING | Shows whether parse, execute, and fetch times for SQL statements are displayed after execution. |
Examples
SHOW SGA;
SHOW TERMOUT;
SHOW ALL;
SHOW PARAMETERS COUNT;
SHOW ERRORS;
Description
You use SHUTDOWN to stop a currently running database. Various options include closing or dismounting the database.
Page 339
Command Syntax
SHUTDOWN ABORT dbname IMMEDIATE dbname NORMAL dbname
Keywords
ABORT | Shuts down the database immediately, without checkpointing the database. This procedure immediately kills all active sessions without rolling back or committing transactions and then closes and dismounts the database. If you use this command, the database will require recovery. |
IMMEDIATE | Shuts down the database by preventing new connections, terminating all existing sessions, and committing or rolling back current transactions; it then checkpoints the database before dismounting and closing it. Media recovery is not required. |
NORMAL | This is the default. It waits for currently connected users to disconnect, prevents new connections, checkpoints, and then closes and dismounts the database. No media recovery is required. |
dbname | This is a Trusted Oracle parameter that you should not use for normal or parallel operations. |
Examples
SHUTDOWN;
SHUTDOWN IMMEDIATE dev;
SHUTDOWN ABORT;
Description
The SPOOL command begins or ends the spooling of command output to a specified file.
Command Syntax
SPOOL OFF
SPOOL filename
Keywords
OFF | Closes the currently opened file. |
filename | Specifies the file to spool output to. |
Page 340
Examples
SPOOL ON ` kelly .spl';
SPOOL OFF;
Description
You use STARTUP to start a database. With options, this command enables you to bring the database into various stages of use for maintenance. As with the SHUTDOWN command, you must be connected as INTERNAL, and you cannot be connected via Oracle's multithreaded server.
Command Syntax
STARTUP FORCE RESTRICT PFILE=filename MOUNT NOMOUNT OPEN RECOVER database mount options
Keywords
FORCE | Issues a shutdown abort of the current instance and then attempts to start the instance again. This sometimes is required if there were shutdown errors. |
RESTRICT | Same as the ALTER SYSTEM ENABLE RESTRICTED SESSION command; enables the database to start up in restricted mode and only gives access to users with the RESTRICTED SESSION role. |
PFILE=filename | Enables the database to start up with a specific parameter file (INIT.ORA). Very useful if the INIT.ORA file is not in the current directory or if you are starting up a new database. |
MOUNT | Mounts the database but does not open it for use. |
NOMOUNT | Does not mount the database. You cannot use this option with the MOUNT, OPEN, PARALLEL, SHARED, or EXCLUSIVE options. |
OPEN | Default option; mounts and opens the default database. |