Oracle Database 10g The Complete Reference phần 10 ppsx

133 310 0
Oracle Database 10g The Complete Reference phần 10 ppsx

Đ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

1198 Part IX: Alphabetical Reference ORACLE Series TIGHT / Oracle Database 10g: TCR / Loney / 225351-7 / Chapter 1 Blind Folio 1:1198 FORMAT LEAST( value1 , value2 , ) DESCRIPTION LEAST is the value of a list of columns, expressions, or values. Values may be VARCHAR2, CHAR, DATE, or NUMBER datatypes, although LEAST will not properly evaluate literal dates (such as '20-MAY-04') without the TO_DATE function. See GREATEST for a discussion of evaluating relative values. LENGTH SEE ALSO CHARACTER FUNCTIONS, VSIZE, Chapter 7 FORMAT LENGTH( string ) DESCRIPTION LENGTH tells the length of a string, number, date, or expression. The string can be CHAR (returned length will include all trailing blanks), VARCHAR2, NCHAR, NVARCHAR2, CLOB, or NCLOB. There are several LENGTH functions, all following the same format: ■ LENGTH calculates the length using characters as defined by the input character set. ■ LENGTHB uses bytes instead of characters. ■ LENGTHC uses Unicode complete characters. ■ LENGTH2 uses UCS2 code points. ■ LENGTH4 uses UCS4 code points. LEVEL SEE ALSO CONNECT BY, PSEUDO-COLUMNS, Chapter 14 FORMAT LEVEL DESCRIPTION Level is a pseudo-column, used with CONNECT BY, that is equal to 1 for a root node, 2 for a child of a root, 3 for a child of a child of a root, and so on. Level tells basically how far down a tree you’ve traveled. LGWR LGWR (LoGWRiter process) writes redo log entries from the System Global Area to the online redo logs. See BACKGROUND PROCESS. LIBRARY PL/SQL blocks can reference external subprograms, stored in libraries. See CREATE LIBRARY. LIKE SEE ALSO LOGICAL OPERATORS, Chapter 3 FORMAT WHERE string LIKE string DESCRIPTION LIKE performs pattern matching. An underline represents exactly one space. A percent sign represents any number of spaces or characters, including zero. If LIKE uses either the _ or % in the first position of a comparison (as in the second and third examples following), any index on the column is ignored. P:\010Comp\Oracle8\351-7\CD\Ventura\Part9C.vp Friday, August 13, 2004 5:02:04 PM Color profile: Generic CMYK printer profile Composite Default screen DESCRIPTION LN is the “natural,” or base e , logarithm of a number .If number is BINARY_FLOAT, then the function returns BINARY_DOUBLE. LNNVL SEE ALSO SELECT FORMAT LNNVL ( condition ) DESCRIPTION LNNVL provides a way to evaluate a condition when one or both operands of the condition may be null. The function can be used only in the WHERE clause of a query. It takes as an argument a condition and returns TRUE if the condition is FALSE or UNKNOWN and returns FALSE if the condition is TRUE. LNNVL can be used anywhere a scalar expression can appear, even in contexts where the IS [NOT] NULL, AND, or OR conditions are not valid but would otherwise be required to account for potential nulls. LNNVL may show up in explain plans when Oracle internally requires NOT IN conditions as NOT EXISTS conditions. EXAMPLES If you want to retrieve all rows for which a column is greater than a given value, the standard format would be where column > value To also return the rows for which column is NULL, use LNNVL: where LNNVL( column > value ) LOADJAVA LOADJAVA is a utility for loading Java classes, resources, and sources into the database. You must load your Java classes into the database if you plan to use them in stored procedures. To remove the Java classes from the database, use the DROPJAVA utility. See Chapter 39. LOB A LOB is a large object. Oracle supports several large object datatypes, including BLOBs (binary large objects), CLOBs (character large objects), and BFILEs (binary files, stored outside the database). See Chapter 35 and the LOB clause of CREATE TABLE. LOBOFFSET (SQL*Plus) See SET. LOCAL DATABASE The local database is usually a database on your host computer. See REMOTE DATABASE. LOCAL INDEX When a table is partitioned, its data is stored in separate tables. When an index is created on the partitioned table, the index can be partitioned so that each of the table partitions has a matching index partition. The matching index partitions are called local indexes . See Chapter 17. LOCALTIMESTAMP SEE ALSO DATE FUNCTIONS, Chapter 10 1200 Part IX: Alphabetical Reference ORACLE Series TIGHT / Oracle Database 10g: TCR / Loney / 225351-7 / Chapter 1 Blind Folio 1:1200 P:\010Comp\Oracle8\351-7\CD\Ventura\Part9C.vp Friday, August 13, 2004 5:02:07 PM Color profile: Generic CMYK printer profile Composite Default screen FORMAT LOCALTIMESTAMP [( timestamp_precision )] DESCRIPTION LOCALTIMESTAMP returns the current date and time in the session time zone as a value of datatype TIMESTAMP. EXAMPLE SELECT LOCALTIMESTAMP FROM DUAL; LOCALLY MANAGED TABLESPACE A locally managed tablespace maintains its extent usage information in bitmaps within the tablespace’s datafiles. See CREATE TABLESPACE. LOCK To lock data is to temporarily restrict other users’ access to data. The restriction that is placed on such data is called “a lock.” Lock modes are SHARE, SHARE UPDATE, EXCLUSIVE, SHARE EXCLUSIVE, ROW SHARE, and ROW EXCLUSIVE. Not all locks can be acquired in all modes. LOCK TABLE SEE ALSO COMMIT, DELETE, INSERT, ROLLBACK, SAVEPOINT, UPDATE FORMAT LOCK TABLE [ schema .] { table | view } [ { PARTITION ( partition ) | SUBPARTITION ( subpartition ) } | @ dblink ] [, [ schema .] { table | view } [ { PARTITION ( partition ) | SUBPARTITION ( subpartition ) } | @ dblink ] ] IN lockmode MODE [NOWAIT]; DESCRIPTION LOCK TABLE locks a table in one of several specified modes, allowing it to be shared, but without loss of data integrity. Using LOCK TABLE allows you to give other users continued but restricted access to the table. Regardless of which option you choose, the table will remain in that lock mode until you COMMIT or ROLLBACK your transactions. Lock modes include ROW SHARE, ROW EXCLUSIVE, SHARE UPDATE, SHARE, SHARE ROW EXCLUSIVE, and EXCLUSIVE. EXCLUSIVE locks permit users to query the locked table but not to do anything else. No other user may lock the table. SHARED locks permit concurrent queries but no updates to the locked table. With a ROW SHARE or SHARE UPDATE lock, no user can lock the whole table for exclusive access, allowing concurrent access for all users to the table. The two types of lock are synonymous, and SHARE UPDATE exists for compatibility with previous versions of Oracle. ROW EXCLUSIVE locks are similar to ROW SHARE but they prohibit shared locking, so only one user may access the table at a time. If a LOCK TABLE command cannot be completed (usually because someone else has executed a prior and competing LOCK TABLE of some sort), then your LOCK TABLE will wait until it can complete. If you wish to avoid this, and simply have control returned to you, use the NOWAIT option. Note that you can lock specific partitions and subpartitions. LOCK TABLE 1201 ORACLE Series TIGHT / Oracle Database 10g: TCR / Loney / 225351-7 / Chapter 1 Blind Folio 1:1201 P:\010Comp\Oracle8\351-7\CD\Ventura\Part9C.vp Friday, August 13, 2004 5:02:08 PM Color profile: Generic CMYK printer profile Composite Default screen 1202 Part IX: Alphabetical Reference ORACLE Series TIGHT / Oracle Database 10g: TCR / Loney / 225351-7 / Chapter 1 Blind Folio 1:1202 LOG SEE ALSO NUMBER FUNCTIONS, Chapter 9 FORMAT LOG( base , number ) DESCRIPTION LOG gives the logarithm of a number for a specified base . EXAMPLE LOG(EXP(1),3) = 1.098612 log( e ) of 3 LOG(10,100) = 2 log(10) of 100 LOGICAL EXPRESSION A logical expression is one whose value evaluates to either TRUE or FALSE. It is a synonym for CONDITION. LOGICAL OPERATORS SEE ALSO PRECEDENCE FORMAT The following lists all current logical operators in the Oracle version of SQL. Most of these are listed elsewhere in this reference under their own names with their proper format and use. All of these operators work with columns or literals. Logical Operators that Test a Single Value = expression is equal to expression > expression is greater than expression >= expression is greater than or equal to expression < expression is less than expression <= expression is less than or equal to expression != expression is not equal to expression ^= expression is not equal to expression <> expression is not equal to expression EXISTS ( query ) NOT EXISTS ( query ) LIKE expression NOT LIKE expression expression IS NULL expression IS NOT NULL Logical Operators that Test More than a Single Value ANY ( expression [, expression ] | query ) ALL ( expression [, expression ] | query ) ANY and ALL require an equality operator as a prefix, such as >ANY, =ALL, and so on. IN ( expression [, expression ] | query ) NOT IN ( expression [, expression ] | query ) P:\010Comp\Oracle8\351-7\CD\Ventura\Part9C.vp Friday, August 13, 2004 5:02:09 PM Color profile: Generic CMYK printer profile Composite Default screen BETWEEN expression AND expression NOT BETWEEN expression AND expression Other Logical Operators + Addition - Subtraction * Multiplication / Division ** Exponentiation || Concatenation () Overrides normal precedence rules, or encloses a subquery NOT Reverses logical expression AND Combines logical expressions OR Combines logical expressions UNION Combines results of queries UNION ALL Combines results of queries without eliminating duplicates INTERSECT Combines results of queries MINUS Combines results of queries LOGIN ACCOUNT A login account is a username and password combination that allows people to use the Oracle RDBMS. This account is usually separate from your operating system account. LOBSOURCE (SQL*Plus) See SET. LONG (SQL*Plus) See SET. LONG DATATYPE See DATATYPES. LONG RAW DATATYPE A LONG RAW column contains raw binary data, but is otherwise the same as a LONG column. Values entered into LONG RAW columns must be in hex notation. LOOP You can use loops to process multiple records within a single PL/SQL block. PL/SQL supports three types of loops: Simple loops A loop that keeps repeating until an EXIT or EXIT WHEN statement is reached within the loop FOR loops A loop that repeats a specified number of times WHILE loops A loop that repeats until a condition is met LOOP 1203 ORACLE Series TIGHT / Oracle Database 10g: TCR / Loney / 225351-7 / Chapter 1 Blind Folio 1:1203 P:\010Comp\Oracle8\351-7\CD\Ventura\Part9C.vp Friday, August 13, 2004 5:02:10 PM Color profile: Generic CMYK printer profile Composite Default screen 1204 Part IX: Alphabetical Reference ORACLE Series TIGHT / Oracle Database 10g: TCR / Loney / 225351-7 / Chapter 1 Blind Folio 1:1204 You can use loops to process multiple records from a cursor. The most common cursor loop is a cursor FOR loop. See CURSOR FOR LOOP and Chapter 29 for details on using loops for both simple and cursor-based processing logic. LOWER SEE ALSO CHARACTER FUNCTIONS, INITCAP, UPPER, Chapter 7 FORMAT LOWER( string ) DESCRIPTION LOWER converts every letter in a string to lowercase. EXAMPLE LOWER('PeninSula') = peninsula LPAD SEE ALSO CHARACTER FUNCTIONS, LTRIM, RPAD, RTRIM, Chapter 7 FORMAT LPAD( string , length [,' set ']) DESCRIPTION Left PAD makes a string a certain length by adding a certain set of characters to the left of the string. If set is not specified, the default pad character is a space. EXAMPLE LPAD('>',11,'- ') produces - - - - - > LTRIM SEE ALSO CHARACTER FUNCTIONS, LPAD, RPAD, RTRIM, Chapter 7 FORMAT LTRIM( string [,' set ']) DESCRIPTION Left TRIM trims all the occurrences of any one of a set of characters off of the left side of a string . EXAMPLE LTRIM('NANCY','AN') produces this: CY MAKE_REF SEE ALSO Chapter 36 FORMAT MAKE_REF ( table | view , key [, key ] ) P:\010Comp\Oracle8\351-7\CD\Ventura\Part9C.vp Friday, August 13, 2004 5:02:12 PM Color profile: Generic CMYK printer profile Composite Default screen DESCRIPTION MAKE_REF constructs a REF (reference) from the foreign key of a table that references the base table of an object view. MAKE_REF allows you to construct references superimposed on existing foreign key relationships. See Chapter 36 for examples. MATERIALIZED VIEW You can use materialized views to pre-aggregate data and improve query performance. When you create a materialized view, Oracle creates a physical table to hold data that would usually be read via a view. When you create a materialized view, you specify the view’s base query as well as a schedule for the refreshes of its data. You can then index the materialized view to enhance the performance of queries against it. As a result, you can provide data to your users in the format they need, indexed appropriately. See CREATE MATERIALIZED VIEW and Chapter 24. MATERIALIZED VIEW LOG When you refresh a materialized view, you can perform a full or incremental refresh. An incremental refresh, called a “fast” refresh, sends only the DML changes from the master table to the materialized view. To track changes to the master table for the materialized view, you must create a materialized view log. The materialized view log must be in the same schema as the master table for the materialized view. Fast refreshes are not available for complex materialized views. See CREATE MATERIALIZED VIEW LOG and Chapter 24. MAX SEE ALSO AGGREGATE FUNCTIONS, COMPUTE, MIN, Chapter 9 FORMAT MAX([DISTINCT | ALL] value ) [OVER analytic_clause ] DESCRIPTION MAX is the maximum of all values for a group of rows. MAX ignores NULL values. The DISTINCT option is not meaningful, since the maximum of all values is identical to the maximum of the distinct values. MEDIA RECOVERY Media recovery is recovery in the event of hardware failure that would prevent reading or writing of data and thus operation of the database. See also INSTANCE RECOVERY. MEDIAN SEE ALSO AVG, COUNT FORMAT MEDIAN ( expr ) [OVER ( query_partition_clause )] DESCRIPTION MEDIAN takes a numeric or datetime value and returns the middle value or an interpolated value that would be the middle value once the values are sorted. NULLs are ignored. MERGE SEE ALSO INSERT, UPDATE, Chapter 15 MERGE 1205 ORACLE Series TIGHT / Oracle Database 10g: TCR / Loney / 225351-7 / Chapter 1 Blind Folio 1:1205 P:\010Comp\Oracle8\351-7\CD\Ventura\Part9C.vp Friday, August 13, 2004 5:02:12 PM Color profile: Generic CMYK printer profile Composite Default screen FORMAT merge::= merge_update_clause::= merge_insert_clause::= where_clause::= DESCRIPTION MERGE performs updates and inserts of a target table in a single command, based on a selected set of rows. You specify the conditions to determine whether an insert or update is performed on a row-by-row basis. See Chapter 15 for detailed examples. NOTE Since MERGE performs queries, you can use hints. As of Oracle Database 10 g , you can specify either the UPDATE or the INSERT operation, or both. Also, you can delete rows from the target table during the UPDATE operation. 1206 Part IX: Alphabetical Reference ORACLE Series TIGHT / Oracle Database 10g: TCR / Loney / 225351-7 / Chapter 1 Blind Folio 1:1206 MERGE hint INTO schema . table t_alias USING schema . table view subquery t_alias ON ( condition ) merge_update_clause merge_insert_clause WHEN MATCHED THEN UPDATE SET column = expr DEFAULT , where_clause DELETE where_clause WHEN NOT MATCHED THEN INSERT ( column , ) VALUES ( expr , DEFAULT ) where_clause WHERE condition P:\010Comp\Oracle8\351-7\CD\Ventura\Part9C.vp Friday, August 13, 2004 5:02:14 PM Color profile: Generic CMYK printer profile Composite Default screen MOD 1207 ORACLE Series TIGHT / Oracle Database 10g: TCR / Loney / 225351-7 / Chapter 1 Blind Folio 1:1207 METHOD A method is a block of code. In reference to user-defined datatypes, a method is a block of PL/SQL code used to encapsulate the data access method for an object. Methods are specified as part of the datatype specification ( see CREATE TYPE) and their body is specified as part of the CREATE TYPE BODY command. Users can execute methods on the datatypes for which the methods are defined. The constructor method created for each user-defined datatype is an example of a method. See Chapter 33 for examples of methods. In Java, a method is a member of a class. You can call a class method and pass parameters to it for it to use when executing its commands. See Chapter 33 for examples. MIN SEE ALSO AGGREGATE FUNCTIONS, COMPUTE, MAX, Chapter 9 FORMAT MIN([DISTINCT | ALL] value ) [OVER ( analytic_clause )] DESCRIPTION MIN is the minimum of all values for a group of rows. MIN ignores NULL values. The DISTINCT option is not meaningful, since the minimum of all values is identical to the minimum of the distinct values. MINUS SEE ALSO INTERSECT, QUERY OPERATORS, TEXT SEARCH OPERATORS, UNION, Chapters 13 and 25 FORMAT select MINUS select within Oracle Text queries against CONTEXT indexes: select column from TABLE where CONTAINS(Text,' text MINUS text ') >0; DESCRIPTION MINUS combines two queries. It returns only those rows from the first SELECT statement that are not produced by the second SELECT statement (the first SELECT MINUS the second SELECT). The number of columns and datatypes must be identical between SELECT statements, although the names of the columns do not need to be. The data, however, must be identical in the rows produced for the MINUS to reject them. See Chapter 13 for a discussion of the important differences and effects of INTERSECT, MINUS, and UNION. Within text searches against CONTEXT indexes, MINUS tells the text search of two terms to subtract the score of the second term’s search from the score of the first term’s search before comparing the result to the threshold score. MOD SEE ALSO NUMBER FUNCTIONS, Chapter 9 FORMAT MOD( value , divisor ) P:\010Comp\Oracle8\351-7\CD\Ventura\Part9C.vp Friday, August 13, 2004 5:02:15 PM Color profile: Generic CMYK printer profile Composite Default screen [...]... environment, since users can be directed to multiple servers to access the same data ORACLE APPLICATION SERVER 10g Oracle Application Server 10g allows developers to access Oracle databases from Web-based applications The developers call procedures from within the database The procedures, in turn, retrieve or manipulate data and return results to the developers See Chapter 45 ORA_HASH FORMAT ORA_HASH ( expr... hypothetical row R identified by the arguments of the function and a corresponding sort specification, the rank of row R minus 1 divided by the number of rows in the aggregate group This calculation is made as if the hypothetical row R were inserted into the group of rows over which Oracle is to aggregate The arguments of the function identify a single hypothetical row within each aggregate group Therefore,... observed by the function or module See PARAMETERS for an example PARAMETERS SEE ALSO &, &&, ACCEPT, DEFINE DESCRIPTION Parameters allow the execution of a start file with values passed on the SQL*Plus command line These are simply spaced apart following the name of the start file Within the file, parameters are referenced by the order in which they appeared on the command line &1 is the first, &2 the second,... execute the query OPEN cursor, in effect, executes the query in the named cursor and keeps its results in a staging area, where they can be called in, a row at a time, with FETCH, and their column values put into local variables with the INTO clause of the FETCH If the cursor SELECT statement used parameters, then their actual values are passed to the SELECT statement in the parameter list of the OPEN... Part IX: ORACLE Series TIGHT / Oracle Database 10g: TCR / Loney / 225351-7 / Chapter 1 Blind Folio 1:1208 Alphabetical Reference DESCRIPTION MOD divides a value by a divisor, and gives the remainder MOD(23,6) = 5 means divide 23 by 6 The answer is 3 with 5 left over, so 5 is the result of the modulus value and divisor can both be any real number, except that divisor cannot be 0 EXAMPLES MOD (100 ,10) MOD(22,23)... ALL stops the audits of all commands on the object See Chapter 42 for details on the auditing views in the data dictionary P:\010Comp \Oracle8 \351-7\CD\Ventura\Part9C.vp Friday, August 13, 2004 5:02:20 PM Color profile: Generic CMYK printer profile Composite Default screen ORACLE Series TIGHT / Oracle Database 10g: TCR / Loney / 225351-7 / Chapter 1 Blind Folio 1:1213 NTILE EXAMPLES table: The following... ASC | DESC ] P:\010Comp \Oracle8 \351-7\CD\Ventura\Part9C.vp Friday, August 13, 2004 5:02:28 PM 1221 Color profile: Generic CMYK printer profile Composite Default screen 1222 Part IX: ORACLE Series TIGHT / Oracle Database 10g: TCR / Loney / 225351-7 / Chapter 1 Blind Folio 1:1222 Alphabetical Reference DESCRIPTION The ORDER BY clause causes Oracle to sort the results of a query before they are displayed... requires the word IS: where Name IS NULL During ORDER BY sorts, NULL values always come first when the order is ascending, and last when it is descending When NULL values are stored in the database, they are represented with a single byte if they fall between two columns that have real values, and no bytes if they fall at the end of the row (last in the column definition in the CREATE TABLE) If some of the. .. of a fixed-point number when the integer is zero 99999MI If the number is negative, a minus sign follows the number The default is for the negative sign to be on left P:\010Comp \Oracle8 \351-7\CD\Ventura\Part9C.vp Friday, August 13, 2004 5:02:23 PM 1215 Color profile: Generic CMYK printer profile Composite Default screen 1216 Part IX: ORACLE Series TIGHT / Oracle Database 10g: TCR / Loney / 225351-7... Oracle Database 10g: TCR / Loney / 225351-7 / Chapter 1 Blind Folio 1:1230 Alphabetical Reference PREVIOUS SEE ALSO FORMAT ITERATION_NUMBER PREVIOUS ( cell _reference ) DESCRIPTION PREVIOUS is relevant only for interrow calculations It can be used only in the MODEL clause of the SELECT statement and then only in the ITERATE … [UNTIL] clause of the MODEL RULES clause It returns the value of cell_reference . with the default sort sequence for the session, but this function lets you specify the exact sort sequence to use. 1 210 Part IX: Alphabetical Reference ORACLE Series TIGHT / Oracle Database 10g: . DATE FUNCTIONS, Chapter 10 1200 Part IX: Alphabetical Reference ORACLE Series TIGHT / Oracle Database 10g: TCR / Loney / 225351-7 / Chapter 1 Blind Folio 1:1200 P:10Comp Oracle8 351-7CDVenturaPart9C.vp Friday,. classes into the database if you plan to use them in stored procedures. To remove the Java classes from the database, use the DROPJAVA utility. See Chapter 39. LOB A LOB is a large object. Oracle supports

Ngày đăng: 08/08/2014, 20:21

Tài liệu cùng người dùng

Tài liệu liên quan