1. Trang chủ
  2. » Công Nghệ Thông Tin

Tài liệu Oracle Unleashed- P5 pdf

50 345 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 50
Dung lượng 167,94 KB

Nội dung

CONNECT INTERNAL; CONNECT SYSTEM/MANAGER; CONNECT SCOTT/TIGER; DISCONNECT Description: You use the DISCONNECT command to disconnect from the current instance without exiting SQL*DBA. It has no additional parameters. You can use this command in conjunction with SET INSTANCE to access multiple instances at your site without exiting and reentering SQL*DBA. Command syntax: DISCONNECT Example: DISCONNECT; EXECUTE 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 must also be connected to a database before executing. Command syntax: EXECUTE PL/SQL statement Example: EXECUTE total_orders; EXIT Description: EXIT is the command you use to exit the SQL*DBA 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 Example: EXIT; HOST Description: The HOST command executes an operating system command or program while you're still in SQL*DBA. This command shells you out of SQL*DBA for the duration of the command. If issued by itself, it shells you to the Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. operating system until you type EXIT to return to SQL*DBA. Command syntax: HOST operating system command HOST Keywords: operating system command A valid operating system command or program. Examples: HOST who; HOST dir; HOST; MONITOR Description: The MONITOR command enables you to monitor various statistics and attributes of the database, processes, or users. This command is extremely helpful in analyzing and resolving database problems. You can specify any parameters that the menu requests in order on the command line. Command syntax: MONITOR CIRCUIT DISPATCHER FILEIO LATCH LCACHE LOCK PROCESS QUEUE ROLLBACK SESSION SESSIONSTATISTIC SHARED SQLAREA Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. SYSTEMIO SYSTEMSTATISTIC TABLE Keywords: CIRCUIT Displays current information on the virtual circuits owned by each shared server in a Multi- Threaded Server environment. DISPATCHER Displays current information about a shared server's dispatcher processes in a Multi-Threaded Server environment. FILEIO Displays read/write information for every database file associated with the current instance. LATCH Displays information on all current latches. LCACHE Displays current information on the library cache. LOCK Lists the current processes and the locks they are waiting on. Using ALL lists all locks being held by current processes. PROCESS Monitors summary information for every process connected to the current instance. QUEUE Lists information on each shared server's message queues. ROLLBACK Shows activity on every active rollback segment in the instance. SESSION Displays active process information. SESSIONSTATISTIC Shows user session statistics for current user processes. SHARED Monitors shared server activity. SQLAREA Gives various statistics on the shared SQL area. SYSTEMIO Summarizes the read/write statistics for each Oracle process. This information is not precise but instead is representative of relative distribution of I/O. SYSTEMSTATISTIC Shows system statistics for the current database. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. TABLE Displays table names of tables referenced in SQL statements that have been recently parsed and reside in the shared SQL area. Examples: MONITOR PROCESS; MONITOR LATCH; MONITOR LOCK 10 20; MONITOR SYSTEMSTATISTIC; PRINT Description: The PRINT command prints the value of a variable that you defined using the SQL*Plus command VARIABLE. Command syntax: PRINT variable Keywords: variable The name of the variable defined with the VARIABLE command. Examples: PRINT COUNTER; PRINT NAME; RECOVER 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 Multi-Threaded Server. Command syntax: RECOVER DATABASE RECOVER DATABASE UNTIL CANCEL CHANGE integer TIME date RECOVER DATABASE USING BACKUP CONTROLFILE Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. RECOVER TABLESPACE tablespace RECOVER DATAFILE filename Keywords: DATABASE Requests the recovery of an entire database. Will apply redo log files to all tablespaces needing media recovery. UNTIL TIME date Used to specify 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. HH24 is the time in 24-hour specification. MI is minutes. SS is seconds. UNTIL CHANGE integer Used to recover until a specific change number. This is very useful in restoring a tablespace where a table was accidentally dropped. integer must be a valid change number, and the redo logs must be available to Oracle. UNTIL CANCEL Specifies recovery should continue applying redo logs until the operator cancels the operation. Recovery continues redo log by redo log until 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 will fail. TABLESPACE tablespace Recovers the specified tablespace, or tablespaces. You can recover up to 16 of them 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; Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. RECOVER DATABASE; RECOVER DATAFILE 'users_01.dbf'; RECOVER DATABASE UNTIL '1994-10-11:15:01:00'; RECOVER TABLESPACE tools, users; SET Description: The SET command sets characteristics for the current SQL*DBA session. These characteristics are not saved for future sessions. Command syntax: SET ARRAYSIZE integer AUTORECOVERY ON/OFF CHARWIDTH integer COMPATIBILITY V6/V7 CYCLE integer DATEWIDTH integer ECHO ON/OFF FETCHROWS integer HISTORY integer INSTANCE instance-path/LOCAL LABWIDTH LINES integer LOGSOURCE pathname/DEFAULT LONGWIDTH integer MAXDATA integer NUMWIDTH integer RETRIES integer/INFINITE SERVER OUTPUT OFF/ON SIZE integer SPOOL filename/OFF STOPONERROR ON/OFF TERM PAGE/NOPAGE Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. TERMOUT ON/OFF TIMING ON/OFF Keywords: ARRAYSIZE integer Indicates the number of rows that are fetched from the database at one time. The default is 20, and the maximum is specific to the operating system you are running. AUTORECOVERY 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. 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 Sets the SQL*DBA compatibility mode to either 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. CYCLE integer Used for the MONITOR command, sets the time that the monitor screens cycle in gathering statistics. The default is 5 seconds. The minimum is 1 second; maximum is 3600 seconds. The smaller the number, the higher the impact on the database. 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 that are executed from command files. The default is OFF. In this mode, only the output is displayed. FETCHROWS integer This parameter limits the number of rows that are returned by a database query. It can be very useful in returning only the first 20 or 10 rows from a database table. The default returns all rows that match the given criteria, and as with all other parameters, entering the SET command without an integer resets the value to all. HISTORY integer Sets the number of SQL*DBA commands saved in the history buffer. Any commands that reside in this buffer can be recalled and reexecuted using the Previous and Next Command options in menu mode. The default is 10 commands. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. INSTANCE instance-path/LOCAL Sets the instance name to where all SQL*DBA 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. LABWIDTH Used strictly with Oracle's Trusted Server package. LINES integer Limits the number of lines the output window of SQL*DBA can store and recall. After reaching the limit, the lines at the beginning of the buffer are erased. The default value is 1000. 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 SQL*DBA 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. 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 (20K). Your operating system defines the maximum number for this parameter. NUMWIDTH integer Defines the length in characters that data types of NUMBER are displayed in. The default is 10, and the minimum and maximum values are operating-system dependent. RETRIES integer/INFINITE Used with the STARTUP command, this specifies how many times the startup command attempts to start the database. INFINITE means 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. SPOOL filename/OFF Captures commands and output from the current session to a file. Specifying OFF closes the previously opened file. STOPONERROR ON/OFF Tells SQL*DBA, when executing a command file, to stop if it encounters an error. If it finds one, the rest of the command file is not executed, and it returns control to the operating system. TERM PAGE/NOPAGE Tells SQL*DBA to display output one page at a time. The default, NOPAGE, scrolls all output to the output window. After that, you can navigate to the output window and scroll through the saved output. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. 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; SHOW Description: Using the SHOW command shows the values of all the parameters set by the SET command. Additionally, this command supports several other parameters listed in the Keywords section. For a definition of any parameter listed, refer to the previous section on SET. Command Syntax: SHOW ARRAYSIZE AUTORECOVERY CHARWIDTH COMPATIBILITY CYCLE DATEWIDTH ECHO FETCHROWS HISTORY INSTANCE LABWIDTH LINES LOGSOURCE LONGWIDTH MAXDATA Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. NUMWIDTH RETRIES SERVER OUTPUT SPOOL STOPONERROR TERM TERMOUT TIMING ALL PARAMETERS ERRORS Keywords: ALL Shows the values of all settings. Does not show ERRORS, PARAMETERS, or SGA, which must be displayed separately. ERRORS Shows all errors encountered during the last compilation of a function, procedure, or package. Output includes the line, column, and error message generated. LABEL This is a Trusted Oracle parameter. PARAMETERS Shows the current values for all database parameters specified in the startup files for the current instance. Used alone, it displays all parameters. Used in conjunction with a parameter name, it shows the specific parameter. If a partial parameter name is used, the output includes all parameters that are similar. SGA Shows current information on the System Global Area for the connected instance. Examples: SHOW SGA; SHOW TERMOUT; SHOW ALL; SHOW PARAMETERS COUNT; SHOW ERRORS; Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. [...]... into the Oracle database This task has increased in complexity with the introduction of data warehousing; the demand has gone from migrating megabytes of data to gigabytes, and in some cases, even terabytes Oracle addresses this need with the Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark SQL*Loader utility, a very versatile tool that loads external data into Oracle database... number of retries before failing Examples: STARTUP; STARTUP MOUNT; STARTUP PFILE='/home /oracle/ init.ora' PARALLEL; STARTUP MOUNT RESTRICT; STARTUP FORCE; Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark Summary SQL*DBA is a powerful tool that is useful for creating, managing, and tuning all your Oracle instances The flexibility to run in command, line, or menu mode gives the user... SQL*Loader includes the record for processing, it is passed to the Oracle kernel for insertion into the database table Figure 8.5 shows the record-filtering process Figure 8.5 Record-filtering process Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark If SQL*Loader rejects the record due to a format error, or the Oracle kernel cannot insert the record into the database table(s)... quotation marks It is generally good practice not to use Oracle reserved words for any database object names I have seen numerous cases in which Oracle got confused when reserved words were used as database object names (the error messages are very ambiguous) For the complete lists of reserved words for SQL*Loader, SQL*DBA, and Oracle, refer to the Oracle7 Server Utility User's Guide and the SQL Language... Procedures s Snapshots s Importing and Exporting with Personal Oracle7 s Import and Export Hints and Tips s Create an Index File s Adjusting Storage Parameters s Reorganizing Data s Reducing Database Fragmentation s Migrating from Version 6 to Oracle7 s Importing Tables with LONG and LONG RAW Data Types Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark s Summary 9 Import and Export... supplied by Oracle You use the two utilities together primarily to back up and restore data, move data to other Oracle databases, and migrate data from an older Oracle version to a newer version The following lists some other uses of Import and Export: q Store data in operating system files for archiving q Store database object definitions q Selectively back up parts of a database q Move data from one Oracle. .. utility for Oracle and enables the database administrator (DBA) to perform important maintenance functions for Oracle databases Export can write out operating system files that you can move to a different operating system or a different version of Oracle Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark ... char) Listing 8.2 is a sample control file for a conventional path load using a variable-format file Listing 8.2 Variable-format control file LOAD DATA Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark INFILE'data04 /ORACLE/ TEST/prod' BADFILE'prod.bad' INSERT INTO TABLE pord' FIELDS TERMINATED BY','OPTIONALLY ENCLOSED BY "" trailing nullcols ( PROD_CODE, PROD_DESCR, PROD_CLASS,... Clause Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark The LOAD DATA clause is the main statement in the control file Only comments, the OPTIONS clause, and the RECOVERABLE clause can precede LOAD DATA in the control file LOAD DATA is followed by phrases and clauses that further qualify it For the complete syntax of the control file, refer to the Oracle7 Server Utilities... name of the data file followed by a BAD extension A bad file is created only if records were rejected because of formatting errors, or the Oracle kernel returned an error while trying to insert records into the database Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark Following the BADFILE statement is the optional discard file specification, which begins with the keyword . PFILE='/home /oracle/ init.ora' PARALLEL; STARTUP MOUNT RESTRICT; STARTUP FORCE; Please purchase PDF Split-Merge on www.verypdf.com to remove. and in some cases, even terabytes. Oracle addresses this need with the Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. SQL*Loader

Ngày đăng: 26/01/2014, 15:20

TỪ KHÓA LIÊN QUAN