PK FJoa,mimetypeapplication/epub+zipPKFJOEBPS/functions218.htm TREAT

TREAT

Syntax

Description of treat.gif follows

Purpose

TREAT changes the declared type of an expression.

You must have the EXECUTE object privilege on type to use this function.

This function does not support CLOB data directly. However, CLOBs can be passed in as arguments through implicit data conversion.


See Also:

"Data Type Comparison Rules" for more information

Examples

The following statement uses the table oe.persons, which is created in "Substitutable Table and Column Examples". The example retrieves the salary attribute of all people in the persons table, the value being null for instances of people that are not employees.

SELECT name, TREAT(VALUE(p) AS employee_t).salary salary 
   FROM persons p;

NAME                          SALARY
------------------------- ----------
Bob
Joe                           100000
Tim                             1000

You can use the TREAT function to create an index on the subtype attributes of a substitutable column. For an example, see "Indexing on Substitutable Columns: Examples".

PKT PKFJOEBPS/statements_8026.htm$ DROP PROCEDURE

DROP PROCEDURE

Purpose

Procedures are defined using PL/SQL. Refer to Oracle Database PL/SQL Language Reference for complete information on creating, altering, and dropping procedures.

Use the DROP PROCEDURE statement to remove a standalone stored procedure from the database. Do not use this statement to remove a procedure that is part of a package. Instead, either drop the entire package using the DROP PACKAGE statement, or redefine the package without the procedure using the CREATE PACKAGE statement with the OR REPLACE clause.

Prerequisites

The procedure must be in your own schema or you must have the DROP ANY PROCEDURE system privilege.

Syntax

drop_procedure::=

Description of drop_procedure.gif follows

Semantics

schema

Specify the schema containing the procedure. If you omit schema, then Oracle Database assumes the procedure is in your own schema.

procedure

Specify the name of the procedure to be dropped.

When you drop a procedure, Oracle Database invalidates any local objects that depend upon the dropped procedure. If you subsequently reference one of these objects, then the database tries to recompile the object and returns an error message if you have not re-created the dropped procedure.

Examples

Dropping a Procedure: Example The following statement drops the procedure remove_emp owned by the user hr and invalidates all objects that depend upon remove_emp:

DROP PROCEDURE hr.remove_emp; 
PK'lB)$PKFJOEBPS/functions057.htm EXISTSNODE

EXISTSNODE


Note:

The EXISTSNODE function is deprecated. It is still supported for backward compatibility. However, Oracle recommends that you use the XMLEXISTS function instead. See XMLEXISTS for more information.

Syntax

Description of existsnode.gif follows

Purpose

EXISTSNODE determines whether traversal of an XML document using a specified path results in any nodes. It takes as arguments the XMLType instance containing an XML document and a VARCHAR2 XPath string designating a path. The optional namespace_string must resolve to a VARCHAR2 value that specifies a default mapping or namespace mapping for prefixes, which Oracle Database uses when evaluating the XPath expression(s).

The namespace_string argument defaults to the namespace of the root element. If you refer to any subelement in Xpath_string, then you must specify namespace_string, and you must specify the "who" prefix in both of these arguments.


See Also:

"Using XML in SQL Statements" for examples that specify namespace_string and use the "who" prefix.

The return value is NUMBER:

Examples

The following example tests for the existence of the /Warehouse/Dock node in the XML path of the warehouse_spec column of the sample table oe.warehouses:

SELECT warehouse_id, warehouse_name
  FROM warehouses
  WHERE EXISTSNODE(warehouse_spec, '/Warehouse/Docks') = 1
  ORDER BY warehouse_id;

WAREHOUSE_ID WAREHOUSE_NAME
------------ -----------------------------------
           1 Southlake, Texas
           2 San Francisco
           4 Seattle, Washington
PKCPKFJOEBPS/functions086.htm LEAD

LEAD

Syntax

Description of lead.gif follows


See Also:

"Analytic Functions" for information on syntax, semantics, and restrictions, including valid forms of value_expr

Purpose

LEAD is an analytic function. It provides access to more than one row of a table at the same time without a self join. Given a series of rows returned from a query and a position of the cursor, LEAD provides access to a row at a given physical offset beyond that position.

If you do not specify offset, then its default is 1. The optional default value is returned if the offset goes beyond the scope of the table. If you do not specify default, then its default value is null.

{RESPECT | IGNORE} NULLS determines whether null values of value_expr are included in or eliminated from the calculation. The default is RESPECT NULLS.

You cannot nest analytic functions by using LEAD or any other analytic function for value_expr. However, you can use other built-in function expressions for value_expr.


See Also:

"About SQL Expressions" for information on valid forms of expr and LAG

Examples

The following example provides, for each employee in Department 30 in the employees table, the hire date of the employee hired just after:

SELECT hire_date, last_name,
       LEAD(hire_date, 1) OVER (ORDER BY hire_date) AS "Next Hired" 
  FROM employees
  WHERE department_id = 30
  ORDER BY hire_date;

HIRE_DATE LAST_NAME                 Next Hired
--------- ------------------------- ----------
07-DEC-02 Raphaely                  18-MAY-03
18-MAY-03 Khoo                      24-JUL-05
24-JUL-05 Tobias                    24-DEC-05
24-DEC-05 Baida                     15-NOV-06
15-NOV-06 Himuro                    10-AUG-07
10-AUG-07 Colmenares
PKEpPKFJOEBPS/index.htm Index

Index

A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X 

Symbols

% (percent) used with LIKE operator, 7.7.1
+ (plus sign) in Oracle Automatic Storage Management filenames, 8

Numbers

20th century, 3.4.2.4
21st century, 3.4.2.4
3GL functions and procedures, calling, 15

A

ABORT LOGICAL STANDBY clause
of ALTER DATABASE, 10.2, 10.2
ABS function, 5.8
ACCESSED GLOBALLY clause
of CREATE CONTEXT, 14
ACCOUNT LOCK clause
of CREATE USER, 17
of ALTER USER. See CREATE USER
ACCOUNT UNLOCK clause
of CREATE USER, 17
of ALTER USER. See CREATE USER
ACOS function, 5.8
ACTIVATE STANDBY DATABASE clause
of ALTER DATABASE, 10.2
AD and A.D. datetime format elements, 3.4.2.2
ADD clause
of ALTER DIMENSION, 10.2
of ALTER INDEXTYPE, 10.2
of ALTER TABLE, 12
of ALTER VIEW, 13
ADD DATAFILE clause
of ALTER TABLESPACE, 12
ADD LOGFILE clause
of ALTER DATABASE, 10.2
ADD LOGFILE GROUP clause
of ALTER DATABASE, 10.2
ADD LOGFILE INSTANCE clause
of ALTER DATABASE, 10.2
ADD LOGFILE MEMBER clause
of ALTER DATABASE, 10.2, 10.2
ADD LOGFILE THREAD clause
of ALTER DATABASE, 10.2
ADD OVERFLOW clause
of ALTER TABLE, 12
ADD PARTITION clause
of ALTER TABLE, 12, 12, 12
ADD PRIMARY KEY clause
of ALTER MATERIALIZED VIEW LOG, 11
ADD ROWID clause
of ALTER MATERIALIZED VIEW, 11
ADD SUPPLEMENTAL LOG DATA clause
of ALTER DATABASE, 10.2
ADD SUPPLEMENTAL LOG GROUP clause
of ALTER TABLE, 12
ADD TEMPFILE clause
of ALTER TABLESPACE, 12
ADD VALUES clause
of ALTER TABLE ... MODIFY PARTITION, 12, 12
ADD_MONTHS function, 5.8
adding a constraint to a table, 12
ADMINISTER ANY SQL TUNING SET system privilege, 18
ADMINISTER DATABASE TRIGGER system privilege, 18
ADMINISTER SQL MANAGEMENT OBJECT system privilege, 18, 18
ADMINISTER SQL TUNING SET system privilege, 18
ADVISE clause
of ALTER SESSION, 11
ADVISOR system privilege, 18
aggregate functions, 5.3
alias
for a column, 9.2
for an expressions in a view query, 17
specifying in queries and subqueries, 19
ALL clause
of SELECT, 19
of SET CONSTRAINTS, 19
of SET ROLE, 19
ALL EXCEPT clause
of SET ROLE, 19
ALL operator, 7.2
ALL PRIVILEGES clause
of GRANT, 18
of REVOKE, 18
ALL PRIVILEGES shortcut
of AUDIT, 13
ALL shortcut
of AUDIT, 13
ALL_COL_COMMENTS data dictionary view, 13
ALL_INDEXTYPE_COMMENTS data dictionary view, 13
ALL_MVIEW_COMMENTS data dictionary view, 13
ALL_OPERATOR_COMMENTS data dictionary view, 13
ALL_ROWS hint, 3.6.4.1
ALL_TAB_COMMENTS data dictionary view, 13
all-column wildcard, 19
ALLOCATE EXTENT clause
of ALTER CLUSTER, 10.2, 10.2
of ALTER INDEX, 10.2
of ALTER MATERIALIZED VIEW, 11
of ALTER TABLE, 12
ALLOW CORRUPTION clause
of ALTER DATABASE ... RECOVER, 10.2
ALTER ANY CLUSTER system privilege, 18
ALTER ANY CUBE DIMENSION system privilege, 18
ALTER ANY CUBE system privilege, 18
ALTER ANY DIMENSION system privilege, 18
ALTER ANY INDEX system privilege, 18
ALTER ANY INDEXTYPE system privilege, 18
ALTER ANY LIBRARY system privilege, 18
ALTER ANY MATERIALIZED VIEW system privilege, 18
ALTER ANY MINING MODEL system privilege, 18
ALTER ANY OPERATOR system privilege, 18
ALTER ANY OUTLINE system privilege, 18
ALTER ANY PROCEDURE system privilege, 18
ALTER ANY ROLE system privilege, 18
ALTER ANY SEQUENCE system privilege, 18
ALTER ANY SQL PROFILE system privilege, 18
ALTER ANY TABLE system privilege, 18
ALTER ANY TRIGGER system privilege, 18
ALTER ANY TYPE system privilege, 18
ALTER CLUSTER statement, 10.2
ALTER DATABASE LINK system privilege, 18
ALTER DATABASE statement, 10.2
ALTER DATABASE system privilege, 18
ALTER DIMENSION statement, 10.2
ALTER DISKGROUP statement, 10.2
ALTER FLASHBACK ARCHIVE statement, 10.2
ALTER FUNCTION statement, 10.2
ALTER INDEX statement, 10.2
ALTER INDEXTYPE statement, 10.2
ALTER JAVA CLASS statement, 10.2
ALTER JAVA SOURCE statement, 10.2
ALTER LIBRARY statement, 11
ALTER MATERIALIZED VIEW LOG statement, 11
ALTER MATERIALIZED VIEW statement, 11
ALTER object privilege
on a mining model, 18
on a sequence, 18
on a table, 18
on an OLAP cube, 18
on an OLAP cube dimension, 18
ALTER OPERATOR statement, 11
ALTER OUTLINE statement, 11
ALTER PACKAGE statement, 11
ALTER PROCEDURE statement, 11
ALTER PROFILE statement, 11
ALTER PROFILE system privilege, 18
ALTER PUBLIC DATABASE LINK system privilege, 18
ALTER RESOURCE COST statement, 11
ALTER RESOURCE COST system privilege, 18
ALTER ROLE statement, 11
ALTER ROLLBACK SEGMENT statement, 11
ALTER ROLLBACK SEGMENT system privilege, 18
ALTER SEQUENCE statement, 11
ALTER SESSION statement, 11
ALTER SESSION system privilege, 18
ALTER SNAPSHOT. See ALTER MATERIALIZED VIEW
ALTER SNAPSHOT LOG. See ALTER MATERIALIZED VIEW LOG
ALTER SYSTEM statement, 11
ALTER SYSTEM system privilege, 18
ALTER TABLE statement, 12
ALTER TABLESPACE statement, 12
ALTER TABLESPACE system privilege, 18
ALTER TRIGGER statement, 13
ALTER TYPE statement, 13
ALTER USER statement, 13
ALTER USER system privilege, 18
ALTER VIEW statement, 13
alter_external_table clause
of ALTER TABLE, 12
AM and A.M. datetime format elements, 3.4.2.2
analytic functions, 5.4
ANALYZE ANY system privilege, 18
ANALYZE CLUSTER statement, 13
ANALYZE INDEX statement, 13
ANALYZE TABLE statement, 13
ANCILLARY TO clause
of CREATE OPERATOR, 15
AND condition, 7.4, 7.4
AND DATAFILES clause
of DROP TABLESPACE, 18, 18
ANSI. See American National Standards Institute (ANSI), C
data types, 3.1.3
conversion to Oracle data types, 3.1.3
standards, 1.2, 1.2, C.1
supported data types, 3.1
antijoins, 9.6.7
ANY operator, 7.2
APPEND hint, 3.6.4.2
APPEND_VALUES hint, 3.6.4.3
APPENDCHILDXML function, 5.8
application servers
allowing connection as user, 13
applications
allowing connection as user, 13
securing, 14
validating, 14
ARCHIVE LOG clause
of ALTER SYSTEM, 11
archive mode
specifying, 14
archived redo logs
location, 10.2
ARCHIVELOG clause
of ALTER DATABASE, 10.2, 10.2
of CREATE CONTROLFILE, 14
of CREATE DATABASE, 14
arguments
of operators, 4
arithmetic
with DATE values, 3.1.1.16
arithmetic operators, 4.2
AS source_char clause
of CREATE JAVA, 14
AS subquery clause
of CREATE MATERIALIZED VIEW, 15
of CREATE TABLE, 16
of CREATE VIEW, 17
ASC clause
of CREATE INDEX, 14
ASCII character set, 3.2.3
ASCII function, 5.8
ASCIISTR function, 5.8
ASIN function, 5.8
ASM_DISKGROUPS initialization parameter
setting with ALTER SYSTEM, 10.2, 14
ASM_DISKSTRING initialization parameter
setting with ALTER SYSTEM, 14
ASSOCIATE STATISTICS statement, 13
asterisk
all-column wildcard in queries, 19
asynchronous commit, 13
ATAN function, 5.8
ATAN2 function, 5.8
ATTRIBUTE clause
of ALTER DIMENSION, 10.2
of CREATE DIMENSION, 14, 14
attributes
adding to a dimension, 10.2
dropping from a dimension, 10.2
maximum number of in object type, 16
of dimensions, defining, 14
of disk groups, 10.2, 14
AUDIT ANY system privilege, 18
AUDIT statement
locks, B.2.2
AUDIT SYSTEM system privilege, 18
auditing
options
for SQL statements, 13
policies
value-based, 13
SQL statements, 13
by a proxy, 13
by a user, 13
on a directory, 13
on a schema, 13
stopping, 18
system privileges, 13
AUTHENTICATED BY clause
of CREATE DATABASE LINK, 14
AUTHENTICATED clause
of ALTER USER, 13
AUTHENTICATION REQUIRED clause
of ALTER USER, 13
AUTHID CURRENT_USER clause
of ALTER JAVA, 10.2
of CREATE JAVA, 14, 14
AUTHID DEFINER clause
of ALTER JAVA, 10.2
of CREATE JAVA, 14, 14
AUTOALLOCATE clause
of CREATE TABLESPACE, 16
AUTOEXTEND clause
of ALTER DATABASE, 10.2
of CREATE DATABASE, 14
automatic segment-space management, 16
automatic undo mode, 11, 14
AVG function, 5.8

B

BACKUP ANY TABLE system privilege, 18
BACKUP CONTROLFILE clause
of ALTER DATABASE, 10.2, 10.2
backups, 10.2
basic table compression, 16
BC and B.C. datetime format elements, 3.4.2.2
BECOME USER system privilege, 18
BEGIN BACKUP clause
of ALTER DATABASE, 10.2
of ALTER TABLESPACE, 12
BETWEEN condition, 7.11
BFILE
data type, 3.1.1.20
locators, 3.1.1.20
BFILENAME function, 5.8
BIN_TO_NUM function, 5.8
binary large objects. See BLOB
binary operators, 4.1.1
binary XML format, 16
binary XML storage, 16
BINDING clause
of CREATE OPERATOR, 15
bindings
adding to an operator, 11
dropping from an operator, 11
bit vectors
converting to numbers, 5.8
BITAND function, 5.8
BITMAP clause
of CREATE INDEX, 14
bitmap indexes, 14
creating join indexes, 14
blank padding
specifying in format models, 3.4.3
suppressing, 3.4.3
BLOB data type, 3.1.1.21
transactional support, 3.1.1.21
BLOCKSIZE clause
of CREATE TABLESPACE, 16
bottom-N reporting, 5.8, 5.8, 5.8
buffer cache
flushing, 11
BUFFER_POOL parameter
of STORAGE clause, 8
BUILD DEFERRED clause
of CREATE MATERIALIZED VIEW, 15
BUILD IMMEDIATE clause
of CREATE MATERIALIZED VIEW, 15
BY ACCESS clause
of AUDIT, 13
BY SESSION clause
of AUDIT, 13
BYTE character semantics, 3.1.1.1, 3.1.1.3
BYTE length semantics, 12

C

CACHE clause
of ALTER MATERIALIZED VIEW, 11
of ALTER MATERIALIZED VIEW LOG, 11
of ALTER TABLE, 16
of CREATE CLUSTER, 14
of CREATE MATERIALIZED VIEW, 15
of CREATE MATERIALIZED VIEW LOG, 15
CACHE hint, 3.6.4.4
CACHE parameter
of CREATE SEQUENCE, 15
of ALTER SEQUENCE. See CREATE SEQUENCE, 11
CACHE READS clause
of ALTER TABLE, 12
of CREATE TABLE, 16
cached cursors
execution plan for, 18
call spec. See call specifications
in procedures, 15
CALL statement, 13
calls
limiting CPU time for, 15
limiting data blocks read, 15
CARDINALITY function, 5.8
Cartesian products, 9.6.4
CASCADE clause
of CREATE TABLE, 16
of DROP PROFILE, 17
of DROP USER, 18
CASCADE CONSTRAINTS clause
of DROP CLUSTER, 17
of DROP TABLE, 18
of DROP TABLESPACE, 18
of DROP VIEW, 18
of REVOKE, 18, 18
CASE expressions, 6.4
searched, 6.4
simple, 6.4
CAST function, 5.8
CATSEARCH condition, 7.1
CATSEARCH operator, 4.1
CEIL function, 5.8
chained rows
listing, 13
of clusters, 13
CHANGE CATEGORY clause
of ALTER OUTLINE, 11
CHANGE NOTIFICATION system privilege, 18
CHANGE_DUPKEY_ERROR_INDEX hint, 3.6.4.5
CHAR character semantics, 3.1.1.1, 3.1.1.3
CHAR data type, 3.1.1.1
converting to VARCHAR2, 3.4.1
CHAR length semantics, 12
character functions
returning character values, 5.2.2
returning number values, 5.2.3
character large objects. See CLOB
character length semantics, 12
character literal. See text
date and number formats, 3.4
literals
in SQL syntax, 3.3.1
properties of CHAR and VARCHAR2 data types, 3.3.1
syntax of, 3.3.1
character set
changing, 10.2
character set functions, 5.2.4
CHARACTER SET parameter
of CREATE CONTROLFILE, 14
of CREATE DATABASE, 14
character sets
common, 3.2.3
database, specifying, 14
multibyte characters, 3.8.1
specifying for database, 14
character strings
comparison rules, 3.2.3
exact matching, 3.4.3
fixed-length, 3.1.1.1
national character set, 3.1.1.2
variable-length, 3.1.1.4, 3.1.1.9
zero-length, 3.1.1.1
CHARTOROWID function, 5.8
CHECK clause
of constraints, 8
of CREATE TABLE, 16
check constraints, 8
CHECK DATAFILES clause
of ALTER SYSTEM, 11
CHECKPOINT clause
of ALTER SYSTEM, 11
checkpoints
forcing, 11
CHR function, 5.8
CHUNK clause
of ALTER TABLE, 12
of CREATE TABLE, 16
CLEAR LOGFILE clause
of ALTER DATABASE, 10.2, 10.2
CLOB data type, 3.1.1.22
transactional support, 3.1.1.22
clone databases
mounting, 10.2
CLOSE DATABASE LINK clause
of ALTER SESSION, 11
CLUSTER clause
of ANALYZE, 13
of CREATE INDEX, 14
of CREATE TABLE, 16
of TRUNCATE, 19
CLUSTER hint, 3.6.4.6
CLUSTER_ID function, 5.8
CLUSTER_PROBABILITY function, 5.8
CLUSTER_SET function, 5.8
clusters
assigning tables to, 16
caching retrieved blocks, 14
cluster indexes, 14
collecting statistics on, 13
creating, 14, 14
deallocating unused extents, 10.2
degree of parallelism
changing, 10.2, 10.2
when creating, 14
dropping tables, 17
extents, allocating, 10.2, 10.2
granting system privileges for, 18
hash, 14
single-table, 14
sorted, 14, 16
indexed, 14
key values
allocating space for, 14
modifying space for, 10.2
migrated and chained rows in, 13, 13
modifying, 10.2
physical attributes
changing, 10.2
specifying, 14
releasing unused space, 10.2
removing from the database, 17
SQL examples, 17
storage attributes
changing, 10.2
storage characteristics
changing, 10.2
tablespace in which created, 14
validating structure, 13
COALESCE clause
for partitions, 12
of ALTER INDEX, 10.2
of ALTER TABLE, 12, 12, 12
of ALTER TABLESPACE, 12
COALESCE function, 5.8
as a variety of CASE expression, 5.8
COALESCE SUBPARTITION clause
of ALTER TABLE, 12
COLLECT function, 5.8
collection functions, 5.2.9
collection types
multilevel, 16
collections
inserting rows into, 18
modifying, 12
modifying retrieval method, 12
nested tables, 3.1.4.4
testing for empty, 7.6.2
treating as a table, 18, 19, 19, 19
unnesting, 19
examples, 19
varrays, 3.1.4.3
collection-typed values
converting to data types, 5.8
column expressions, 6.5
column REF constraints, 8
of CREATE TABLE, 16
column values
unpivoting into rows, 19
COLUMN_VALUE pseudocolumn, 2.4
columns
adding, 12
aliases for, 9.2
altering storage, 12
associating statistics types with, 13
basing an index on, 14
comments on, 13
creating comments about, 13
defining, 16
disassociating statistics types from, 17
dropping from a table, 12
LOB
storage attributes, 12
maximum number of, 16
modifying existing, 12
parent-child relationships between, 14
properties, altering, 12, 12
qualifying names of, 9.2
REF
describing, 8
renaming, 12
restricting values for, 8
specifying
as primary key, 8
constraints on, 16
default values, 16
storage properties, 16
substitutable, identifying type, 5.8
virtual
adding to a table, 12
creating, 16
modifying, 12
COLUMNS clause
of ASSOCIATE STATISTICS, 13, 13
of DISASSOCIATE STATISTICS, 17
COMMENT ANY MINING MODEL system privilege, 18
COMMENT ANY TABLE system privilege, 18
COMMENT clause
of COMMIT, 13
COMMENT statement, 13
comments, 3.6
adding to objects, 13
associating with a transaction, 13
dropping from objects, 13
in SQL statements, 3.6.1
on indextypes, 13
on operators, 13
on schema objects, 3.6.2
on table columns, 13
on tables, 13
removing from the data dictionary, 13
specifying, 3.6.1
viewing, 13
commit
asynchronous, 13
automatic, 13
COMMIT IN PROCEDURE clause
of ALTER SESSION, 11
COMMIT statement, 13
COMMIT TO SWITCHOVER clause
of ALTER DATABASE, 10.2
comparison conditions, 7.2
comparison functions, 5.2.6
comparison semantics
of character strings, 3.2.3
COMPILE clause
of ALTER DIMENSION, 10.2
of ALTER JAVA SOURCE, 10.2
of ALTER MATERIALIZED VIEW, 11
of ALTER VIEW, 13
of CREATE JAVA, 14
COMPOSE function, 5.8
composite foreign keys, 8
composite partitioning
range-list, 12, 16
when creating a table, 16, 16
composite primary keys, 8
composite range partitions, 16
COMPOSITE_LIMIT parameter
of ALTER PROFILE, 11
of CREATE PROFILE, 15
compound conditions, 7.10
compound expressions, 6.3
COMPRESS clause
of ALTER INDEX ... REBUILD, 10.2
of CREATE TABLE, 16
compression
of index keys, 10.2
of tables, 16
of tablespaces, 16
CONCAT function, 5.8
concatenation operator, 4.3
conditions
BETWEEN, 7.11
comparison, 7.2
compound, 7.10
EXISTS, 7.9.1, 7.12
floating-point, 7.3
group comparison, 7.2.2
IN, 7.13
in SQL syntax, 7
interval, 7.11
IS [NOT] EMPTY, 7.6.2
IS ANY, 7.5.1
IS OF type, 7.14
IS PRESENT, 7.5.2
LIKE, 7.7.1
logical, 7.4
MEMBER, 7.6.3
membership, 7.6.3, 7.13
model, 7.5
multiset, 7.6
null, 7.8
pattern matching, 7.7
range, 7.11
REGEXP_LIKE, 7.7.2
SET, 7.6.1
simple comparison, 7.2.1
SUBMULTISET, 7.6.4
UNDER_PATH, 7.9.2
XML, 7.9
CONNECT BY clause
of queries and subqueries, 19
of SELECT, 9.3, 19
CONNECT clause
of SELECT and subqueries, 19
CONNECT TO clause
of CREATE DATABASE LINK, 14
CONNECT_BY_ISCYCLE pseudocolumn, 2.1.1
CONNECT_BY_ISLEAF pseudocolumn, 2.1.2
CONNECT_BY_ROOT operator, 4.4.2
CONNECT_TIME parameter
of ALTER PROFILE, 11
of ALTER RESOURCE COST, 11
connection qualifier, 3.9.3.1.1
CONSIDER FRESH clause
of ALTER MATERIALIZED VIEW, 11
constraints
adding to a table, 12
altering, 12
check, 8
checking
at end of transaction, 8
at start of transaction, 8
at the end of each DML statement, 8
column REF, 8
deferrable, 8, 19
enforcing, 11
defining, 8, 16
for a table, 16
on a column, 16
disabling, 16
after table creation, 12
cascading, 16
during table creation, 16
dropping, 12, 12, 18
enabling, 16, 16
after table creation, 12
during table creation, 16
foreign key, 8
modifying existing, 12
on views
dropping, 13, 18
partitioning referential, 12, 16
primary key, 8
attributes of index, 8
enabling, 16
referential integrity, 8
renaming, 12
restrictions, 8
setting state for a transaction, 19
storing rows in violation, 12
table REF, 8
unique
attributes of index, 8
enabling, 16
CONSTRAINT(S) session parameter, 11
CONTAINS condition, 7.1
CONTAINS operator, 4.1
context namespaces
accessible to instance, 14
associating with package, 14
initializing using OCI, 14
initializing using the LDAP directory, 14
removing from the database, 17
contexts
creating namespaces for, 14
granting system privileges for, 18
control file clauses
of ALTER DATABASE, 10.2
control files
allowing reuse, 14, 14
backing up, 10.2
force logging mode, 14
re-creating, 14
standby, creating, 10.2
CONTROLFILE REUSE clause
of CREATE DATABASE, 14
conversion
functions, 5.2.7
rules, string to date, 3.4.4
CONVERT function, 5.8
CORR function, 5.8
CORR_K function, 5.8
CORR_S function, 5.8
correlated subqueries, 9.7
correlation functions
Kendall’s tau-b, 5.8
Pearson’s, 5.8
Spearman’s rho, 5.8
correlation names
for base tables of indexes, 14
in DELETE, 17
in SELECT, 19
COS function, 5.8
COSH function, 5.8
COUNT function, 5.8
COVAR_POP function, 5.8
COVAR_SAMP function, 5.8
CPU_PER_CALL parameter
of ALTER PROFILE, 11
of CREATE PROFILE, 15
CPU_PER_SESSION parameter
of ALTER PROFILE, 11
of ALTER RESOURCE COST, 11
of CREATE PROFILE, 15
CREATE ANY CLUSTER system privilege, 18
CREATE ANY CONTEXT system privilege, 18
CREATE ANY CUBE BUILD PROCESS system privilege, 18
CREATE ANY CUBE DIMENSION system privilege, 18
CREATE ANY CUBE system privilege, 18
CREATE ANY DIMENSION system privilege, 18
CREATE ANY DIRECTORY system privilege, 18
CREATE ANY INDEX system privilege, 18
CREATE ANY INDEXTYPE system privilege, 18
CREATE ANY JOB system privilege, 18
CREATE ANY LIBRARY system privilege, 18
CREATE ANY MATERIALIZED VIEW system privilege, 18
CREATE ANY MEASURE FOLDER system privilege, 18
CREATE ANY MINING MODEL system privilege, 18
CREATE ANY OPERATOR system privilege, 18
CREATE ANY OUTLINE system privilege, 18
CREATE ANY PROCEDURE system privilege, 18
CREATE ANY SEQUENCE system privilege, 18
CREATE ANY SQL PROFILE system privilege, 18
CREATE ANY SYNONYM system privilege, 18
CREATE ANY TABLE system privilege, 18
CREATE ANY TRIGGER system privilege, 18
CREATE ANY TYPE system privilege, 18
CREATE ANY VIEW system privilege, 18
CREATE CLUSTER statement, 14
CREATE CLUSTER system privilege, 18
CREATE CONTEXT statement, 14
CREATE CONTROLFILE statement, 14
CREATE CUBE BUILD PROCESS system privilege, 18
CREATE CUBE DIMENSION system privilege, 18
CREATE CUBE system privilege, 18
CREATE DATABASE LINK statement, 14
CREATE DATABASE LINK system privilege, 18
CREATE DATABASE statement, 14
CREATE DATAFILE clause
of ALTER DATABASE, 10.2, 10.2
CREATE DIMENSION statement, 14
CREATE DIMENSION system privilege, 18
CREATE DIRECTORY statement, 14
CREATE DISKGROUP statement, 14
CREATE EXTERNAL JOB system privilege, 18
CREATE FLASHBACK ARCHIVE statement, 14
CREATE FUNCTION statement, 14
CREATE INDEX statement, 14
CREATE INDEXTYPE statement, 14
CREATE INDEXTYPE system privilege, 18
CREATE JAVA statement, 14
CREATE JOB system privilege, 18
CREATE LIBRARY statement, 15
CREATE LIBRARY system privilege, 18
CREATE MATERIALIZED VIEW LOG statement, 15
CREATE MATERIALIZED VIEW statement, 15
CREATE MATERIALIZED VIEW system privilege, 18
CREATE MEASURE FOLDER system privilege, 18
CREATE MINING MODEL system privilege, 18
CREATE OPERATOR statement, 15
CREATE OPERATOR system privilege, 18
CREATE OUTLINE statement, 15
CREATE PACKAGE BODY statement, 15
CREATE PACKAGE statement, 15
locks, B.2.2
CREATE PFILE statement, 15, 15
CREATE PROCEDURE statement, 15
locks, B.2.2
CREATE PROCEDURE system privilege, 18
CREATE PROFILE statement, 15
CREATE PROFILE system privilege, 18
CREATE PUBLIC DATABASE LINK system privilege, 18
CREATE PUBLIC SYNONYM system privilege, 18
CREATE RESTORE POINT statement, 15
CREATE ROLE statement, 15
CREATE ROLE system privilege, 18
CREATE ROLLBACK SEGMENT statement, 15
CREATE ROLLBACK SEGMENT system privilege, 18
CREATE SCHEMA statement, 15
CREATE SEQUENCE statement, 15
CREATE SEQUENCE system privilege, 18
CREATE SESSION system privilege, 18
CREATE SPFILE statement, 15
CREATE STANDBY CONTROLFILE clause
of ALTER DATABASE, 10.2, 10.2
CREATE SYNONYM statement, 16
CREATE SYNONYM system privilege, 18
CREATE TABLE statement, 16
CREATE TABLE system privilege, 18
CREATE TABLESPACE statement, 16
CREATE TABLESPACE system privilege, 18
CREATE TRIGGER statement, 16
CREATE TRIGGER system privilege, 18
CREATE TYPE BODY statement, 17
CREATE TYPE statement, 17
CREATE TYPE system privilege, 18
CREATE USER statement, 17
CREATE USER system privilege, 18
CREATE VIEW statement, 17
CREATE VIEW system privilege, 18
cross joins, 19
CUBE clause
of SELECT statements, 19
CUBE_TABLE function, 5.8
cubes
extracting data, 5.8
CUME_DIST function, 5.8
cumulative distributions, 5.8
currency
group separators, 3.4.1.1
currency symbol
ISO, 3.4.1.1
local, 3.4.1.1
union, 3.4.1.1
CURRENT_DATE function, 5.8
CURRENT_SCHEMA session parameter, 11
CURRENT_TIMESTAMP function, 5.8
CURRENT_USER clause
of CREATE DATABASE LINK, 14
CURRVAL pseudocolumn, 2.2, 15
CURSOR expressions, 6.6
CURSOR_SHARING_EXACT hint, 3.6.4.7
cursors
cached, 18
CV function, 5.8
CYCLE parameter
of CREATE SEQUENCE, 15
of ALTER SEQUENCE. See CREATE SEQUENCE, 11

D

data
aggregation
composite columns of GROUP BY, 19
concatenated grouping sets of GROUP BY, 19
grouping sets, 19
analyzing a subset, 5.8
caching frequently used, 16
independence, 16
integrity checking on input, 3.1.1.6
locks on, B.1
pivoting, 19
retrieving, 9.1
specifying as temporary, 16
undo
preserving, 12, 16
unpivoting, 19
data cartridge functions, 5.8
data conversion, 3.2.7
between character data types, 3.2.7.2
implicit
disadvantages, 3.2.7.1
implicit versus explicit, 3.2.7.1
when performed implicitly, 3.2.7.2, 3.2.7.3
when specified explicitly, 3.2.7.4
data definition language
locks, B.2
data dictionary
adding comments to, 13
locks, B.2
data files
bringing online, 10.2
changing size of, 10.2
creating new, 10.2
defining for a tablespace, 16, 16, 16
defining for the database, 14
designing media recovery, 10.2
dropping, 12
enabling autoextend, 8
end online backup of, 10.2, 12
extending automatically, 8
putting online, 10.2
recover damaged, 10.2
recovering, 10.2
re-creating lost or damaged, 10.2
renaming, 10.2, 10.2
resizing, 10.2, 10.2
reusing, 8
size of, 8
specifying, 8, 8
for a tablespace, 16
for database, 14
system generated, 10.2
taking offline, 10.2, 10.2
temporary
shrinking, 12
data manipulation language (DML)
allowing during indexing, 10.2
operations
during index creation, 14
during index rebuild, 12
restricting, 11
parallelizing, 16
retrieving rows affected by, 17, 18, 19
statements, 10.1.2
PL/SQL support, 10.1.2
data mining functions, 5.2.11
data redaction
granting system privileges for, 18
data types, 3.1
"Any" types, 3.1.6
ANSI-supported, 3.1
BFILE, 3.1.1.20
BLOB, 3.1.1.21
CHAR, 3.1.1.1
character, 3.1.1
CLOB, 3.1.1.22
comparison rules, 3.2
converting to collection-typed values, 5.8
converting to other data types, 5.8
DATE, 3.1.1.10
datetime, 3.1.1.9
interval, 3.1.1.9
INTERVAL DAY TO SECOND, 3.1.1.15
INTERVAL YEAR TO MONTH, 3.1.1.14
length semantics, 3.1.1.1, 3.1.1.3
LONG, 3.1.1.9
LONG RAW, 3.1.1.19
media types, 3.1.9
NCHAR, 3.1.1.2
NCLOB, 3.1.1.23
NUMBER, 3.1.1.6
NVARCHAR2, 3.1.1.3
Oracle-supplied types, 3.1.5
RAW, 3.1.1.19
ROWID, 3.1.2
SDO_TOPO_GEOMETRY, 3.1.8.2
spatial types, 3.1.8
TIMESTAMP, 3.1.1.11
TIMESTAMP WITH LOCAL TIME ZONE, 3.1.1.13
TIMESTAMP WITH TIME ZONE, 3.1.1.12
UROWID, 3.1.2.2
user-defined, 3.1.4
VARCHAR, 3.1.1.5
VARCHAR2, 3.1.1.4
XML types, 3.1.7
database links, 9.10
altering, 10.2
closing, 11
creating, 3.9.3.1, 14
creating synonyms with, 16
current user, 14
granting system privileges for, 18
naming, 3.9.3.1.1
public, 14
dropping, 17
referring to, 3.9.3.2
removing from the database, 17
shared, 14
syntax, 3.9.3.1.1
updating passwords, 10.2
username and password, 3.9.3.1.2
database objects
dropping, 18
nonschema, 3.7.2, 3.7.2
schema, 3.7.1
Database Smart Flash Cache, 8
databases
accounts
creating, 17
allowing changes to, 11
allowing generation of redo logs, 10.2
allowing reuse of control files, 14
allowing unlimited resources to users, 15
archive mode, specifying, 14
beginning backup of, 10.2
blocks
specifying size, 16
cancel-based recovery, 10.2
terminating, 10.2
change-based recovery, 10.2
changing characteristics, 14
changing global name, 10.2
changing name, 14, 14
character set, specifying, 14
committing to standby status, 10.2
connect strings, 3.9.3.1.3
consistency-based recovery, 10.2
controlling use, 10.2
create script for, 10.2
creating, 14
data files
modifying, 10.2
specifying, 14
default edition, setting, 10.2
designing media recovery, 10.2
dropping, 17
ending backup of, 10.2
erasing all data from, 14
flashing back, 18
granting system privileges for, 18
in FLASHBACK mode, 10.2
in FORCE LOGGING mode, 10.2, 14, 14
instances of, 14
limiting resources for users, 15
log files
modifying, 10.2
specifying, 14
managed recovery, 10.2
modifying, 10.2
mounting, 10.2, 10.2, 14
moving a subset to a different database, 12
namespaces, 3.8.1
naming, 10.2
national character set, specifying, 14
no-data-loss mode, 10.2
online
adding log files, 10.2
opening, 10.2, 14
prepare to re-create, 10.2
preventing changes to, 10.2
protection mode of, 10.2
quiesced state, 11
read-only, 10.2
read/write, 10.2
reconstructing damaged, 10.2
recovering, 10.2, 10.2
recovery
allowing corrupt blocks, 10.2
testing, 10.2
with backup control file, 10.2
re-creating control file for, 14
remote
accessing, 9.10
authenticating users to, 14
connecting to, 14
inserting into, 18
service name of, 14
table locks on, 18
resetting
to an earlier version, 10.2
restoring earlier version of, 10.2, 12, 16
restricting users to read-only transactions, 10.2
resuming activity, 11
returning to a past time, 18
standby
adding log files, 10.2
suspending activity, 11
system user passwords, 14
temp files
modifying, 10.2
time zone
determining, 5.8
setting, valid values for, 10.2, 14
time-based recovery, 10.2
upgrading, 10.2
DATAFILE clause
of CREATE DATABASE, 14
DATAFILE clauses
of ALTER DATABASE, 10.2, 10.2
DATAFILE OFFLINE clause
of ALTER DATABASE, 10.2
DATAFILE ONLINE clause
of ALTER DATABASE, 10.2
DATAFILE RESIZE clause
of ALTER DATABASE, 10.2
datafiles
dropping, 18, 18
online backup of, 12
online, updating information on, 11
DATAOBJ_TO_PARTITION function, 5.8
DATE columns
converting to datetime columns, 12
DATE data type, 3.1.1.10
julian, 3.1.1.10.1
date format models, 3.4.2, 3.4.2.1.2
long, 3.4.2.1.2
punctuation in, 3.4.2.1.2
short, 3.4.2.1.2
text in, 3.4.2.1.2
date functions, 5.2.5
dates
arithmetic, 3.1.1.16
comparison rules, 3.2.2
datetime arithmetic, 3.1.1.16
boundary cases, 11
calculating daylight saving time, 3.1.1.17
datetime columns
creating from DATE columns, 12
datetime data types, 3.1.1.9
daylight saving time, 3.1.1.17
datetime expressions, 6.7
datetime field
extracting from a datetime or interval value, 5.8
datetime format elements, 3.4.2.1
and Globalization Support, 3.4.2.2
capitalization, 3.4.2.1.1
ISO standard, 3.4.2.3
RR, 3.4.2.4
suffixes, 3.4.2.5
datetime functions, 5.2.5
datetime literals, 3.3.3
DAY datetime format element, 3.4.2.2
daylight saving time, 3.1.1.17
boundary cases, 3.1.1.17
going into or coming out of effect, 3.1.1.17
DB2 data types, 3.1.3
restrictions on, 3.1.3
DBA_2PC_PENDING data dictionary view, 11
DBA_COL_COMMENTS data dictionary view, 13
DBA_INDEXTYPE_COMMENTS data dictionary view, 13
DBA_MVIEW_COMMENTS data dictionary view, 13
DBA_OPERATOR_COMMENTS data dictionary view, 13
DBA_ROLLBACK_SEGS data dictionary view, 17
DBA_TAB_COMMENTS data dictionary view, 13
DBMS_ROWID package
and extended rowids, 3.1.2.1
DBTIMEZONE function, 5.8
DDL. See data definition language (DDL)
statements, 10.1.1
and implicit commit, 10.1.1
causing recompilation, 10.1.1
PL/SQL support, 10.1.1
statements requiring exclusive access, 10.1.1
DEALLOCATE UNUSED clause
of ALTER CLUSTER, 10.2, 10.2
of ALTER INDEX, 10.2
of ALTER TABLE, 12
DEBUG ANY PROCEDURE system privilege, 18
DEBUG object privilege
on a function, procedure, or package, 18
on a table, 18
on a view, 18
on an object type, 18
debugging
granting system privileges for, 18
decimal characters, 3.3.2.2
specifying, 3.4.1.1
DECODE function, 5.8
decoding functions, 5.2.13
DECOMPOSE function, 5.8
DEFAULT clause
of ALTER TABLE, 12
of ALTER TABLESPACE, 12
of CREATE TABLE, 16, 16
of CREATE TABLESPACE, 16
DEFAULT COST clause
of ASSOCIATE STATISTICS, 13, 13
default index, suppressing, 15
DEFAULT profile
assigning to users, 17
DEFAULT ROLE clause
of ALTER USER, 13
DEFAULT SELECTIVITY clause
of ASSOCIATE STATISTICS, 13, 13
default tablespace, 14
DEFAULT TABLESPACE clause
of ALTER DATABASE, 10.2
of ALTER USER, 13
of CREATE USER, 17
of ALTER USER. See CREATE USER
default tablespaces
specifying for a user, 13
DEFAULT TEMPORARY TABLESPACE clause
of ALTER DATABASE, 10.2
of CREATE DATABASE, 14
DEFERRABLE clause
of constraints, 8
deferrable constraints, 19
DEFERRED clause
of SET CONSTRAINTS, 19
DELETE ANY CUBE DIMENSION system privilege, 18
DELETE ANY MEASURE FOLDER system privilege, 18
DELETE ANY TABLE system privilege, 18
DELETE object privilege
on a table, 18
on a view, 18
on an OLAP cube dimension, 18
on an OLAP measures folder, 18
DELETE statement, 17
error logging, 17
DELETE STATISTICS clause
of ANALYZE, 13
DELETEXML function, 5.8
DENSE_RANK function, 5.8
DEPTH function, 5.8
DEREF function, 5.8
DESC clause
of CREATE INDEX, 14
dictionaries
granting system privileges for, 18
dimensional objects
extracting data, 5.8
dimensions
attributes
adding, 10.2
changing, 10.2
defining, 14
dropping, 10.2
compiling invalidated, 10.2
creating, 14
defining levels, 14
examples, 14
extracting data, 5.8
granting system privileges for, 18
hierarchies
adding, 10.2
changing, 10.2
defining, 14
dropping, 10.2
levels
adding, 10.2
defining, 14
dropping, 10.2
parent-child hierarchy, 14
removing from the database, 17
directory objects
as aliases for operating system directories, 14
auditing, 13, 13
creating, 14
granting system privileges for, 18
redefining, 14
removing from the database, 17
direct-path INSERT, 3.6.4.2, 3.6.4.3, 18
DISABLE ALL TRIGGERS clause
of ALTER TABLE, 12
DISABLE clause
of ALTER INDEX, 10.2
of CREATE TABLE, 16
DISABLE DISTRIBUTED RECOVERY clause
of ALTER SYSTEM, 11
DISABLE NOVALIDATE constraint state, 8
DISABLE PARALLEL DML clause
of ALTER SESSION, 11
DISABLE QUERY REWRITE clause
of ALTER MATERIALIZED VIEW, 11
of CREATE MATERIALIZED VIEW, 15
DISABLE RESTRICTED SESSION clause
of ALTER SYSTEM, 11
DISABLE RESUMABLE clause
of ALTER SESSION, 11
DISABLE ROW MOVEMENT clause
of ALTER TABLE, 12
of CREATE TABLE, 16, 16
DISABLE STORAGE IN ROW clause
of ALTER TABLE, 12
of CREATE TABLE, 16
DISABLE TABLE LOCK clause
of ALTER TABLE, 12
DISABLE VALIDATE constraint state, 8
DISASSOCIATE STATISTICS statement, 17
DISCONNECT SESSION clause
of ALTER SYSTEM, 11
disk group files
changing permission settings, 10.2
Intelligent Data Placement, 10.2
setting owner or user group, 10.2
disk groups
altering, 10.2
creating, 14
a tablespace in, 16
failure groups, 10.2, 14
files in, 8
dropping, 17
managing Oracle ADVM volumes, 10.2
rebalancing, 10.2
setting attributes, 10.2, 14
specifying files in, 8
specifying files in control files, 14
diskgroup
Oracle ASM, 15
disks
bringing online, 10.2
QUORUM, 14
regions, 10.2
REGULAR, 14
taking offline, 10.2
dispatcher processes
creating additional, 11
terminating, 11
DISTINCT clause
of SELECT, 19
distinct queries, 19
distributed queries, 9.10
restrictions on, 9.10
distribution
hints for, 3.6.4.62
domain indexes, 14, 14, 14
and LONG columns, 12
associating statistics types with, 13
creating, prerequisites, 14
determining user-defined CPU and I/O costs, 18
disassociating statistics types from, 17, 17
example, F.1
invoking drop routines for, 18
local partitioned, 14
modifying, 10.2
parallelizing creation of, 14
rebuilding, 10.2
removing from the database, 17
system managed, 14
domain_index_clause
of CREATE INDEX, 14
DOWNGRADE clause
of ALTER DATABASE, 10.2
DRIVING_SITE hint, 3.6.4.8
DROP ANY CLUSTER system privilege, 18
DROP ANY CONTEXT system privilege, 18
DROP ANY CUBE BUILD PROCESS system privilege, 18
DROP ANY CUBE DIMENSION system privilege, 18
DROP ANY CUBE system privilege, 18
DROP ANY DIMENSION system privilege, 18
DROP ANY DIRECTORY system privilege, 18
DROP ANY INDEX system privilege, 18
DROP ANY INDEXTYPE system privilege, 18
DROP ANY LIBRARY system privilege, 18
DROP ANY MATERIALIZED VIEW system privilege, 18
DROP ANY MEASURE FOLDER system privilege, 18
DROP ANY MINING MODEL system privilege, 18
DROP ANY OPERATOR system privilege, 18
DROP ANY OUTLINE system privilege, 18
DROP ANY PROCEDURE system privilege, 18
DROP ANY ROLE system privilege, 18
DROP ANY SEQUENCE system privilege, 18
DROP ANY SQL PROFILE system privilege, 18
DROP ANY SYNONYM system privilege, 18
DROP ANY TABLE system privilege, 18
DROP ANY TRIGGER system privilege, 18
DROP ANY TYPE system privilege, 18
DROP ANY VIEW system privilege, 18
DROP clause
of ALTER DIMENSION, 10.2
of ALTER INDEXTYPE, 10.2
DROP CLUSTER statement, 17
DROP COLUMN clause
of ALTER TABLE, 12
DROP constraint clause
of ALTER VIEW, 13
DROP CONSTRAINT clause
of ALTER TABLE, 12
DROP CONTEXT statement, 17
DROP DATABASE LINK statement, 17
DROP DATABASE statement, 17
DROP DIMENSION statement, 17
DROP DIRECTORY statement, 17
DROP DISKGROUP statement, 17
DROP FLASHBACK ARCHIVE statement, 17
DROP FUNCTION statement, 17
DROP INDEX statement, 17
DROP INDEXTYPE statement, 17
DROP JAVA statement, 17
DROP LIBRARY statement, 17
DROP LOGFILE clause
of ALTER DATABASE, 10.2, 10.2
DROP LOGFILE MEMBER clause
of ALTER DATABASE, 10.2, 10.2
DROP MATERIALIZED VIEW LOG statement, 17
DROP MATERIALIZED VIEW statement, 17
DROP OPERATOR statement, 17
DROP OUTLINE statement, 17
DROP PACKAGE BODY statement, 17
DROP PACKAGE statement, 17
DROP PARTITION clause
of ALTER INDEX, 10.2
of ALTER TABLE, 12
DROP PRIMARY constraint clause
of ALTER TABLE, 12
DROP PROCEDURE statement, 17
DROP PROFILE statement, 17
DROP PROFILE system privilege, 18
DROP PUBLIC DATABASE LINK system privilege, 18
DROP PUBLIC SYNONYM system privilege, 18
DROP RESTORE POINT statement, 17
DROP ROLE statement, 17
DROP ROLLBACK SEGMENT statement, 17
DROP ROLLBACK SEGMENT system privilege, 18
DROP SEQUENCE statement, 18
DROP SUPPLEMENTAL LOG DATA clause
of ALTER DATABASE, 10.2
DROP SUPPLEMENTAL LOG GROUP clause
of ALTER TABLE, 12
DROP SYNONYM statement, 18
DROP TABLE statement, 18
DROP TABLESPACE statement, 18
DROP TABLESPACE system privilege, 18
DROP TRIGGER statement, 18
DROP TYPE BODY statement, 18
DROP TYPE statement, 18
DROP UNIQUE constraint clause
of ALTER TABLE, 12
DROP USER statement, 18
DROP USER system privilege, 18
DROP VALUES clause
of ALTER TABLE ... MODIFY PARTITION, 12, 12
DROP VIEW statement, 18
DUAL dummy table, 3.8.1, 9.9
DUMP function, 5.8
DY datetime format element, 3.4.2.2
DYNAMIC_SAMPLING hint, 3.6.4.9

E

EBCDIC character set, 3.2.3
editioning views, 17
editions
comments on, 13
creating, 14
dropping, 17
granting system privileges for, 18
setting default for database, 10.2
setting for a session, 11
embedded SQL, 10.1.6
precompiler support, 10.1.6
EMPTY_BLOB function, 5.8
EMPTY_CLOB function, 5.8
ENABLE ALL TRIGGERS clause
of ALTER TABLE, 12
ENABLE clause
of ALTER INDEX, 10.2
of ALTER TRIGGER, 13
of CREATE TABLE, 16
ENABLE DISTRIBUTED RECOVERY clause
of ALTER SYSTEM, 11
ENABLE NOVALIDATE constraint state, 8
ENABLE PARALLEL DML clause
of ALTER SESSION, 11
ENABLE QUERY REWRITE clause
of ALTER MATERIALIZED VIEW, 11
of CREATE MATERIALIZED VIEW, 15
ENABLE RESTRICTED SESSION clause
of ALTER SYSTEM, 11
ENABLE RESUMABLE clause
of ALTER SESSION, 11
ENABLE ROW MOVEMENT clause
of ALTER TABLE, 12
of CREATE TABLE, 16, 16
ENABLE STORAGE IN ROW clause
of ALTER TABLE, 12
of CREATE TABLE, 16
ENABLE TABLE LOCK clause
of ALTER TABLE, 12
ENABLE VALIDATE constraint state, 8
encoding functions, 5.2.13
encryption, 16
of tablespaces, 8, 16
encryption keys
generating, 11
END BACKUP clause
of ALTER DATABASE, 10.2
of ALTER DATABASE ... DATAFILE, 10.2
of ALTER TABLESPACE, 12
enterprise users
allowing connection as database users, 13, 13
environment functions, 5.2.15
equality test, 7.2
equijoins, 9.6.2
defining for a dimension, 14
equivalency tests, 7.13
error logging
of DELETE operations, 17
of INSERT operations, 18
of MERGE operations, 18
ERROR_ON_OVERLAP_TIME session parameter, 11
EVALUATE operator, 4.1
EXCEPTIONS INTO clause
of ALTER TABLE, 12
EXCHANGE PARTITION clause
of ALTER TABLE, 12, 12
EXCHANGE SUBPARTITION clause
of ALTER TABLE, 12, 12
exchanging partitions
restrictions on, 12
EXCLUDING NEW VALUES clause
of ALTER MATERIALIZED VIEW LOG, 11
of CREATE MATERIALIZED VIEW LOG, 15
EXCLUSIVE lock mode, 18
exclusive locks
row locks (TX), B.1
table locks (TM), B.1
EXECUTE ANY CLASS system privilege, 18
EXECUTE ANY INDEXTYPE system privilege, 18
EXECUTE ANY LIBRARY system privilege, 18
EXECUTE ANY OPERATOR system privilege, 18
EXECUTE ANY PROCEDURE system privilege, 18
EXECUTE ANY PROGRAM system privilege, 18
EXECUTE ANY TYPE system privilege, 18
EXECUTE object privilege
on a directory, 18
on a library, 18
on an object type, 18
on an operator, 18
execution plans
determining, 18
dropping outlines for, 17
saving, 15
EXEMPT ACCESS POLICY system privilege, 18
EXEMPT REDACTION POLICY system privilege, 18
EXISTS condition, 7.9.1, 7.12
EXISTSNODE function, 5.8
EXP function, 5.8
EXPLAIN PLAN statement, 18
explicit data conversion, 3.2.7.1, 3.2.7.4
expressions
CASE, 6.4
changing declared type of, 5.8
column, 6.5
comparing, 5.8
compound, 6.3
computing with the DUAL table, 9.9
CURSOR, 6.6
datetime, 6.7
in SQL syntax, 6.1
interval, 6.9
lists of, 6.15
model, 6.10
object access, 6.11
placeholder, 6.12
scalar subqueries as, 6.13
simple, 6.2
type constructor, 6.14
extended rowids
base 64, 3.1.2.1
not directly available, 3.1.2.1
extensible indexing
example, F.1
EXTENT MANAGEMENT clause
of CREATE DATABASE, 14
of CREATE TABLESPACE, 16, 16
EXTENT MANAGEMENT DICTIONARY clause
of CREATE TABLESPACE, 16
EXTENT MANAGEMENT LOCAL clause
of CREATE DATABASE, 14
extents
allocating for partitions, 12
allocating for subpartitions, 12
allocating for tables, 12
restricting access by instances, 10.2
specifying maximum number for an object, 8
specifying number allocated upon object creation, 8
specifying the first for an object, 8
specifying the percentage of size increase, 8
specifying the second for an object, 8
external functions, 14, 15, 15
external LOBs, 3.1.1.19
external procedures, 15
external tables, 16
access drivers, 16
altering, 12
creating, 16
ORACLE_DATAPUMP access driver, 16
ORACLE_LOADER access driver, 16
restrictions on, 16
external users, 15, 17
EXTRACT (datetime) function, 5.8
EXTRACT (XML) function, 5.8
EXTRACTVALUE function, 5.8

F

FACT hint, 3.6.4.10
FAILED_LOGIN_ATTEMPTS parameter
of ALTER PROFILE, 11
of CREATE PROFILE, 15
failure groups
creating for a disk group, 10.2, 14
FEATURE_ID function, 5.8
FEATURE_SET function, 5.8
FEATURE_VALUE function, 5.8
files
specifying as a redo log file group, 8
specifying as data files, 8
specifying as temp files, 8
FIPS
compliance, C.11
flagging, 11
FIRST function, 5.8
FIRST_ROWS(n) hint, 3.6.4.11
FIRST_VALUE function, 5.8
FLAGGER session parameter, 11
flash cache, 8
FLASH_CACHE parameter
of STORAGE clause, 8
FLASHBACK ANY TABLE system privilege, 18, 18, 18
FLASHBACK ARCHIVE ADMINISTER system privilege, 18
FLASHBACK ARCHIVE object privilege, 18
flashback data archives
creating, 14
dropping, 17
modifying, 10.2
privileges for, 18
specifying for a table, 12, 16
FLASHBACK DATABASE statement, 18
flashback queries, 19
pseudocolumns for, 2.3
using with inserts, 18, 19
FLASHBACK TABLE statement, 18
floating-point conditions, 7.3
floating-point numbers, 3.1.1.8
converting to, 5.8, 5.8
handling NaN, 5.8
FLOOR function, 5.8
FLUSH BUFFER_CACHE clause
of ALTER SYSTEM, 11
FLUSH GLOBAL CONTEXT clause
of ALTER SYSTEM, 11
FLUSH REDO clause
of ALTER SYSTEM, 11
FLUSH SHARED_POOL clause
of ALTER SYSTEM, 11
FM format model modifier, 3.4.3
FOR clause
of CREATE INDEXTYPE, 14
of EXPLAIN PLAN, 18, 18
FOR UPDATE clause
of CREATE MATERIALIZED VIEW, 15
of SELECT, 19, 19
FORCE ANY TRANSACTION system privilege, 18
FORCE clause
of COMMIT, 13
of CREATE VIEW, 17
of DISASSOCIATE STATISTICS, 17
of DROP INDEX, 17
of DROP INDEXTYPE, 17
of DROP OPERATOR, 17
of DROP TYPE, 18
of REVOKE, 18
of ROLLBACK, 18, 18
FORCE LOGGING clause
of ALTER DATABASE, 10.2
of ALTER TABLESPACE, 12
of CREATE CONTROLFILE, 14
of CREATE DATABASE, 14
of CREATE TABLESPACE, 16
FORCE PARALLEL DML clause
of ALTER SESSION, 11
FORCE TRANSACTION system privilege, 18
foreign key constraints, 8
foreign tables
rowids of, 3.1.2.2
format models, 3.4
changing the return format, 3.4.3.1
date, 3.4.2
changing, 3.4.2
default format, 3.4.2
format elements, 3.4.2.1
maximum length, 3.4.2
modifiers, 3.4.3
number, 3.4.1
number, elements of, 3.4.1.1
specifying, 3.4.3.1
XML, 3.4.5
formats
of return values from the database, 3.4
of values stored in the database, 3.4
for dates and numbers. See format models
free lists
specifying for a table, partition, cluster, or index, 8
specifying for LOBs, 16
FREELIST GROUPS parameter
of STORAGE clause, 8
FREELISTS parameter
of STORAGE clause, 8
FREEPOOLS parameter
of LOB storage, 16
FROM clause
of queries, 9.6.3
FROM COLUMNS clause
of DISASSOCIATE STATISTICS, 17
FROM FUNCTIONS clause
of DISASSOCIATE STATISTICS, 17
FROM INDEXES clause
of DISASSOCIATE STATISTICS, 17
FROM INDEXTYPES clause
of DISASSOCIATE STATISTICS, 17
FROM PACKAGES clause
of DISASSOCIATE STATISTICS, 17
FROM TYPES clause
of DISASSOCIATE STATISTICS, 17
FROM_TZ function, 5.8
FULL hint, 3.6.4.12
full outer joins, 19
function expressions
built-in, 6.8
user-defined, 6.8
function-based indexes, 14
creating, 14
disabling, 10.2, 10.2
enabling, 10.2, 10.2
refreshing, 10.2, 10.2
functions
3GL,calling, 15
associating statistics types with, 13
avoiding run-time compilation, 10.2
built_in
as expressions, 6.8
calling, 13
changing the declaration of, 14
changing the definition of, 14
defining an index on, 14
disassociating statistics types from, 17
executing, 13
external, 14, 15, 15
inverse distribution, 5.8, 5.8
issuing COMMIT or ROLLBACK statements, 11
linear regression, 5.8
naming rules, 3.8.1
OLAP, 5.7
recompiling invalid, 10.2
re-creating, 14, 14
removing from the database, 17
statistics, assigning default cost, 13
statistics, defining default selectivity, 13
stored, 14
storing return value of, 13
synonyms for, 16
user-defined, 5.8
as expressions, 6.8
XML, 5.2.12
See also SQL functions
FUNCTIONS clause
of ASSOCIATE STATISTICS, 13, 13
of DISASSOCIATE STATISTICS, 17
FX format model modifier, 3.4.3

G

general comparison functions, 5.2.6
general recovery clause
of ALTER DATABASE, 10.2, 10.2
geoimaging, 3.1.8
global application context information
flushing, 11
global indexes. See indexes, globally partitioned
GLOBAL PARTITION BY HASH clause
of CREATE INDEX, 14
GLOBAL PARTITION BY RANGE clause
of CREATE INDEX, 14, 14
GLOBAL QUERY REWRITE system privilege, 18
GLOBAL TEMPORARY clause
of CREATE TABLE, 16
global users, 15, 17
GLOBAL_TOPIC_ENABLED system parameter, 11
globally partitioned indexes, 14, 14
GRANT ANY OBJECT PRIVILEGE system privilege, 18
GRANT ANY PRIVILEGE system privilege, 18
GRANT ANY ROLE system privilege, 18
GRANT CONNECT THROUGH clause
of ALTER USER, 13, 13, 13
GRANT statement
locks, B.2.2
GRAPHIC data type
DB2, 3.1.3
SQL/DS, 3.1.3
greater than or equal to tests, 7.2
greater than tests, 7.2
GREATEST function, 5.8
GROUP BY clause
CUBE extension, 19
identifying duplicate groupings, 5.8
of SELECT and subqueries, 19, 19
ROLLUP extension of, 19
group comparison conditions, 7.2.2
group separator
specifying, 3.4.1.1
GROUP_ID function, 5.8
GROUPING function, 5.8
grouping sets, 19
GROUPING SETS clause
of SELECT and subqueries, 19
GROUPING_ID function, 5.8
groupings
filtering out duplicate, 5.8
GUARD ALL clause
of ALTER DATABASE, 10.2
GUARD clause
of ALTER DATABASE, 10.2
overriding, 11
GUARD NONE clause
of ALTER DATABASE, 10.2
GUARD STANDBY clause
of ALTER DATABASE, 10.2

H

hash clusters
creating, 14
single-table, creating, 14
specifying hash function for, 14
HASH hint, 3.6.4.13
HASH IS clause
of CREATE CLUSTER, 14
hash partitioning clause
of CREATE TABLE, 16, 16
hash partitions
adding, 12
coalescing, 12
HASHKEYS clause
of CREATE CLUSTER, 14
HAVING condition
of GROUP BY clause, 19
heap-organized tables
creating, 16
hexadecimal value
returning, 3.4.1.1
HEXTORAW function, 5.8
hierarchical functions, 5.2.10
hierarchical queries, 9.3, 19
child rows, 2.1.3, 9.3
illustrated, 2.1.3
leaf rows, 2.1.3
operators in, 4.4
CONNECT_BY_ROOT, 4.4.2
PRIOR, 4.4.1
ordering, 19
parent rows, 2.1.3, 9.3
pseudocolumns in, 2.1
CONNECT_BY_ISCYCLE, 2.1.1
CONNECT_BY_ISLEAF, 2.1.2
LEVEL, 2.1.3
retrieving root and node values, 5.8
hierarchical query clause
of SELECT and subqueries, 19
hierarchies
adding to a dimension, 10.2
dropping from a dimension, 10.2
of dimensions, defining, 14
HIERARCHY clause
of CREATE DIMENSION, 14, 14
high water mark
of clusters, 10.2
of indexes, 10.2
of tables, 12, 13
hints, 9.2
ALL_ROWS, 3.6.4.1
APPEND, 3.6.4.2
APPEND_VALUES, 3.6.4.3
CACHE, 3.6.4.4
CLUSTER, 3.6.4.6
CURSOR_SHARING_EXACT, 3.6.4.7
DRIVING_SITE, 3.6.4.8
DYNAMIC_SAMPLING, 3.6.4.9
FACT, 3.6.4.10
FIRST_ROWS(n), 3.6.4.11
FULL, 3.6.4.12
HASH, 3.6.4.13
in SQL statements, 3.6.3
INDEX, 3.6.4.15
INDEX_ASC, 3.6.4.16
INDEX_COMBINE, 3.6.4.17
INDEX_DESC, 3.6.4.18
INDEX_FFS, 3.6.4.19
INDEX_JOIN, 3.6.4.20
INDEX_SS, 3.6.4.21
INDEX_SS_ASC, 3.6.4.22
INDEX_SS_DESC, 3.6.4.23
LEADING, 3.6.4.24
location syntax, 3.6.3
MERGE, 3.6.4.25
MODEL_MIN_ANALYSIS, 3.6.4.26
MONITOR, 3.6.4.27
NO_EXPAND, 3.6.4.31
NO_FACT, 3.6.4.32
NO_INDEX, 3.6.4.33
NO_INDEX_FFS, 3.6.4.34
NO_INDEX_SS, 3.6.4.35
NO_MERGE, 3.6.4.36
NO_MONITOR, 3.6.4.37
NO_PARALLEL, 3.6.4.39
NO_PARALLEL_INDEX, 3.6.4.41
NO_PUSH_PRED, 3.6.4.43
NO_PUSH_SUBQ, 3.6.4.44
NO_PX_JOIN_FILTER, 3.6.4.45
NO_QUERY_TRANSFORMATION, 3.6.4.46
NO_RESULT_CACHE, 3.6.4.47
NO_REWRITE, 3.6.4.48
NO_STAR_TRANSFORMATION, 3.6.4.50
NO_STATEMENT_QUEUING, 3.6.4.51
NO_UNNEST, 3.6.4.52
NO_USE_HASH, 3.6.4.53
NO_USE_MERGE, 3.6.4.54
NO_USE_NL, 3.6.4.55
NO_XML_QUERY_REWRITE, 3.6.4.56
NO_XMLINDEX_REWRITE, 3.6.4.57
NOAPPEND, 3.6.4.29
NOCACHE, 3.6.4.30
NOPARALLEL, 3.6.4.39
NOPARALLEL_INDEX, 3.6.4.41
NOREWRITE, 3.6.4.48
OPT_PARAM, 3.6.4.58
ORDERED, 3.6.4.59
PARALLEL, 3.6.4.60
PARALLEL_INDEX, 3.6.4.61
passing to the optimizer, 19
PQ_DISTRIBUTE, 3.6.4.62
PUSH_PRED, 3.6.4.63
PUSH_SUBQ, 3.6.4.64
PX_JOIN_FILTER, 3.6.4.65
QB_NAME, 3.6.4.66
REWRITE, 3.6.4.69
specifying a query block, 3.6.3
STAR_TRANSFORMATION, 3.6.4.70
STATEMENT_QUEUING, 3.6.4.71
syntax, 3.6.3
UNNEST, 3.6.4.72
USE_CONCAT, 3.6.4.73
USE_HASH, 3.6.4.74
USE_MERGE, 3.6.4.75
USE_NL, 3.6.4.76
USE_NL_WITH_INDEX, 3.6.4.77
histograms
creating equiwidth, 5.8
Hybrid Columnar Compression, 16

I

IDENTIFIED BY clause
of CREATE DATABASE LINK, 14
of SET ROLE, 19
of ALTER ROLE. See CREATE ROLE
IDENTIFIED EXTERNALLY clause
of CREATE ROLE, 15
of CREATE USER, 17
of ALTER ROLE. See CREATE ROLE
of ALTER USER. See CREATE USER
IDENTIFIED GLOBALLY clause
of CREATE ROLE, 15
of CREATE USER, 17
of ALTER ROLE. See CREATE ROLE
identifier functions, 5.2.15
IDLE_TIME parameter
of ALTER PROFILE, 11
IEEE754
floating-point arithmetic, 3.1.1.8.2
Oracle conformance with, 3.1.1.8.2
IGNORE_ROW_ON_DUPKEY_INDEX hint, 3.6.4.14
IMMEDIATE clause
of SET CONSTRAINTS, 19
implicit data conversion, 3.2.7.1, 3.2.7.2, 3.2.7.3
IN conditions, 7.13
INCLUDING CONTENTS clause
of DROP TABLESPACE, 18
INCLUDING DATAFILES clause
of ALTER DATABASE TEMPFILE DROP clause, 10.2
INCLUDING NEW VALUES clause
of ALTER MATERIALIZED VIEW LOG, 11
of CREATE MATERIALIZED VIEW LOG, 15
INCLUDING TABLES clause
of DROP CLUSTER, 17
incomplete object types, 17
creating, 17
INCREMENT BY clause
of ALTER SEQUENCE. See CREATE SEQUENCE
INCREMENT BY parameter
of CREATE SEQUENCE, 15
incremental
and block change tracking, 10.2
INDEX clause
of ANALYZE, 13
of CREATE CLUSTER, 14
INDEX hint, 3.6.4.15
index keys
compression, 10.2
INDEX object privilege
on a table, 18
index partitions
creating subpartitions, 14
index subpartitions, 14
INDEX_ASC hint, 3.6.4.16
INDEX_COMBINE hint, 3.6.4.17
INDEX_DESC hint, 3.6.4.18
INDEX_FFS hint, 3.6.4.19
INDEX_JOIN hint, 3.6.4.20
INDEX_SS hint, 3.6.4.21
INDEX_SS_ASC hint, 3.6.4.22
INDEX_SS_DESC hint, 3.6.4.23
indexed clusters
creating, 14
indexes, 10.2
allocating new extents for, 10.2
application-specific, 14
ascending, 14
based on indextypes, 14
bitmap, 14
bitmap join, 14
B-tree, 14
changing attributes, 10.2
changing parallelism of, 10.2
collecting statistics on, 13
creating, 14
creating as unusable, 14
creating on a cluster, 14
creating on a table, 14
deallocating unused space from, 10.2
descending, 14
and query rewrite, 14
as function-based indexes, 14
direct-path inserts, logging, 10.2
domain, 14, 14, 14
domain, example, F.1
dropping index partitions, 17
examples, 14
full fast scans, 3.6.4.19
function-based, 14
creating, 14
global partitioned, creating, 14
globally partitioned, 14, 14
updating, 12
granting system privileges for, 18
invisible to the optimizer, 10.2, 14
join, bitmap, 14
key compression of, 10.2
key compression, enabling, 10.2
keys, eliminating repetition, 10.2
local domain, 14
locally partitioned, 14
logging rebuild operations, 10.2
marking as UNUSABLE, 10.2
merging block contents, 10.2
merging contents of index blocks, 10.2
merging contents of index partition blocks, 10.2
modifying attributes, 10.2
moving, 10.2
on clusters, 14
on composite-partitioned tables, creating, 14
on hash-partitioned tables
creating, 14
on index-organized tables, 14
on list-partitioned tables
creating, 14
on nested table storage tables, 14
on partitioned tables, 14
on range-partitioned tables, 14, 14, 14
on range-partitioned tables, creating, 14
on scalar typed object attributes, 14
on table columns, 14
on XMLType tables, 14
online, 14
parallelizing creation of, 14
partitioned, 3.9.4, 14
user-defined, 14
partitioning, 14
partitions, 14
adding hash, 10.2
adding new, 10.2
changing default attributes, 10.2
changing physical attributes, 10.2
changing storage characteristics, 10.2
coalescing hash partitions, 10.2
deallocating unused space from, 10.2
dropping, 10.2
marking UNUSABLE, 10.2, 12
modifying the real characteristics, 10.2
preventing use of, 10.2
rebuilding, 10.2
rebuilding unusable, 12
re-creating, 10.2
removing, 10.2
renaming, 10.2
specifying tablespace for, 10.2, 10.2
splitting, 10.2, 10.2
preventing use of, 10.2
purging from the recycle bin, 18
rebuilding, 10.2
rebuilding while online, 10.2
re-creating, 10.2
removing from the database, 17
renaming, 10.2, 10.2
reverse, 10.2, 10.2, 10.2, 14
specifying tablespace for, 10.2, 10.2
statistics on usage, 10.2
subpartitions
allocating extents for, 10.2
changing default attributes, 10.2
changing physical attributes, 10.2
changing storage characteristics, 10.2
deallocating unused space from, 10.2, 10.2
marking UNUSABLE, 10.2
modifying, 10.2
moving, 10.2
preventing use of, 10.2
rebuilding, 10.2
re-creating, 10.2
renaming, 10.2
specifying tablespace for, 10.2, 10.2
tablespace containing, 14
unique, 14
unsorted, 14
used to enforce constraints, 12, 16
validating structure, 13
INDEXES clause
of ASSOCIATE STATISTICS, 13, 13
of DISASSOCIATE STATISTICS, 17
index-organized tables
bitmap indexes on, creating, 16
creating, 16
mapping tables, 12
creating, 16
moving, 12
merging contents of index blocks, 12
modifying, 12, 12
moving, 12
overflow segments
specifying storage, 12, 16
partitioned, updating secondary indexes, 10.2
PCT_ACCESS_DIRECT statistics, 13
primary key indexes
coalescing, 12
rebuilding, 12
rowids of, 3.1.2.2
secondary indexes, updating, 10.2
INDEXTYPE clause
of CREATE INDEX, 14, 14
indextypes
adding operators, 10.2
altering, 10.2
associating statistics types with, 13
changing implementation type, 10.2
comments on, 13
creating, 14
disassociating statistics types from, 17, 17
drop routines, invoking, 17
granting system privileges for, 18
indexes based on, 14
instances, 14
removing from the database, 17
INDEXTYPES clause
of ASSOCIATE STATISTICS, 13, 13
of DISASSOCIATE STATISTICS, 17
in-doubt transactions
forcing, 13
forcing commit of, 13
forcing rollback, 18, 18
rolling back, 18
inequality test, 7.2
INITCAP function, 5.8
INITIAL parameter
of STORAGE clause, 8
initialization parameters
changing session settings, 11
setting using ALTER SESSION, 11
INITIALIZED EXTERNALLY clause
of CREATE CONTEXT, 14
INITIALIZED GLOBALLY clause
of CREATE CONTEXT, 14
INITIALLY DEFERRED clause
of constraints, 8
INITIALLY IMMEDIATE clause
of constraints, 8
INITRANS parameter
of ALTER CLUSTER, 10.2
of ALTER INDEX, 10.2
of ALTER MATERIALIZED VIEW LOG, 11
of ALTER TABLE, 12
of CREATE TABLE, 8
of CREATE INDEX. See CREATE TABLE
inline constraints
of ALTER TABLE, 12
of CREATE TABLE, 16
inline views, 9.7
inner joins, 9.6.5, 19
inner-N reporting, 5.8
INSERT
direct-path versus conventional, 18
INSERT ANY CUBE DIMENSION system privilege, 18
INSERT ANY MEASURE FOLDER system privilege, 18
INSERT ANY TABLE system privilege, 18
INSERT clause
of MERGE, 18
INSERT object privilege
on a table, 18
on a view, 18
on an OLAP cube dimension, 18
on an OLAP measures folder, 18
INSERT statement, 18
append, 3.6.4.2, 3.6.4.3
error logging, 18
INSERTCHILDXML function, 5.8
INSERTCHILDXMLAFTER function, 5.8
INSERTCHILDXMLBEFORE function, 5.8
inserts
and simultaneous update, 18
conditional, 18
conventional, 18
direct-path, 18
multitable, 18, 18
examples, 18
single-table, 18
using MERGE, 18
INSERTXMLAFTER function, 5.8
INSERTXMLBEFORE function, 5.8
instance recovery
continue after interruption, 10.2
INSTANCE session parameter, 11
instances
making index extents available to, 10.2
setting parameters for, 11
INSTR function, 5.8
INSTR2 function, 5.8
INSTR4 function, 5.8
INSTRB function, 5.8
INSTRC function, 5.8
integers
generating unique, 15
in SQL syntax, 3.3.2.1
precision of, 3.3.2.1
syntax of, 3.3.2.1
internal LOBs, 3.1.1.19
INTERSECT set operator, 4.5, 19
interval
arithmetic, 3.1.1.16
data types, 3.1.1.9
literals, 3.3.4
interval conditions, 7.11
INTERVAL DAY TO SECOND data type, 3.1.1.15
INTERVAL expressions, 6.9
interval partitioning, 12, 16
changing the interval, 12
INTERVAL YEAR TO MONTH data type, 3.1.1.14
INTO clause
of EXPLAIN PLAN, 18
of INSERT, 18
INVALIDATE GLOBAL INDEXES clause
of ALTER TABLE, 12
inverse distribution functions, 5.8, 5.8
invoker rights
altering for a Java class, 10.2
defining for a Java class, 14, 14
IS [NOT] EMPTY conditions, 7.6.2
IS ANY condition, 7.5.1
IS NOT NULL operator, 7.8
IS NULL operator, 7.8
IS OF type condition, 7.14
IS PRESENT condition, 7.5.2
ISO. See International Organization for Standardization (ISO), C
standards, 1.2, 1.2, C.1
ISOLATION_LEVEL session parameter, 11
ITERATION_NUMBER function, 5.8

J

Java
class
creating, 14, 14
dropping, 17
resolving, 10.2, 14
Java source schema object
creating, 14
resource
creating, 14, 14
dropping, 17
schema object
name resolution of, 14
source
compiling, 10.2, 14
creating, 14
dropping, 17
job scheduler object privileges, 18
JOIN clause
of CREATE DIMENSION, 14
JOIN KEY clause
of ALTER DIMENSION, 10.2
of CREATE DIMENSION, 14
join views
example, 17
making updatable, 17
modifying, 17, 18, 19
joins, 9.6
antijoins, 9.6.7
conditions
defining, 9.6.1
cross, 19
equijoins, 9.6.2
full outer, 19
inner, 9.6.5, 19
left outer, 19
natural, 19
outer, 9.6.6
and data densification, 9.6.6
on grouped tables, 9.6.6
restrictions, 9.6.6
parallel, 3.6.4.62
right outer, 19
self, 9.6.3
semijoins, 9.6.8
without join conditions, 9.6.4
Julian dates, 3.1.1.10.1

K

KEEP keyword
of FIRST function, 5.8
of LAST function, 5.8
with aggregate functions, 5.3
key compression, 16
definition, 10.2
disabling, 10.2, 14
enabling, 10.2
of index rebuild, 12
of indexes
disabling, 10.2
of index-organized tables, 16
key-preserved tables, 17
keywords, 3.8.1
in object names, 3.8.1
optional, A.1.2
required, A.1.1
KILL SESSION clause
of ALTER SYSTEM, 11

L

LAG function, 5.8
large object functions, 5.2.8
large objects. See LOB data types, 3.1.1.19
LAST function, 5.8
LAST_DAY function, 5.8
LAST_VALUE function, 5.8
LEAD function, 5.8
LEADING hint, 3.6.4.24
LEAST function, 5.8
left outer joins, 19
LENGTH function, 5.8
LENGTH2 function, 5.8
LENGTH4 function, 5.8
LENGTHB function, 5.8
LENGTHC function, 5.8
less than tests, 7.2
LEVEL clause
of ALTER DIMENSION, 10.2
of CREATE DIMENSION, 14, 14
level columns
specifying default values, 16
LEVEL pseudocolumn, 2.1.3, 19
levels
adding to a dimension, 10.2
dropping from a dimension, 10.2
of dimensions, defining, 14
libraries
creating, 15
granting system privileges for, 18
re-creating, 15
removing from the database, 17
library units. See Java schema objects
LIKE conditions, 7.7.1
linear regression functions, 5.8
LIST CHAINED ROWS clause
of ANALYZE, 13
list partitioning
adding default partition, 12
adding partitions, 12
adding values, 12, 12
creating a default partition, 16
creating partitions, 16
dropping values, 12, 12
merging default with nondefault partitions, 12
splitting default partition, 12
list subpartitions
adding, 12
LISTAGG function, 5.8
listeners
registering, 11
literals, 3.3
datetime, 3.3.3
interval, 3.3.4
LN function, 5.8
LNNVL function, 5.8
LOB columns
adding, 12
compressing, 16
creating from LONG columns, 3.1.1.9, 12
deduplication, 16
defining properties
for materialized views, 15
encrypting, 16
modifying, 12
modifying storage, 12
restricted in joins, 9.6.1
restrictions on, 3.1.1.19
storage characteristics of materialized views, 11
LOB storage clause
for partitions, 12
of ALTER MATERIALIZED VIEW, 11, 11
of ALTER TABLE, 12, 12
of CREATE MATERIALIZED VIEW, 15, 15, 15, 15
of CREATE TABLE, 16, 16
LOBs
attributes, initializing, 3.1.1.19
columns
difference from LONG and LONG RAW, 3.1.1.19
populating, 3.1.1.19
external, 3.1.1.19
internal, 3.1.1.19
locators, 3.1.1.19
logging attribute, 16
modifying physical attributes, 12
number of bytes manipulated in, 16
saving old versions, 16, 16
saving values in a cache, 12, 16
specifying directories for, 14
storage
attributes, 16
characteristics, 8
in-line, 16
tablespace for
defining, 16
LOCAL clause
of CREATE INDEX, 14, 14
local users, 15, 17
locale independent, 3.4.2.1.2
locally managed tablespaces
altering, 12
storage attributes, 8
locally partitioned indexes, 14
LOCALTIMESTAMP function, 5.8
location transparency, 16
LOCK ANY TABLE system privilege, 18
LOCK TABLE statement, 18
locking, overriding automatic, 18
locks
data, B.1
dictionary, B.2
row (TX), B.1
table (TM), B.1
log data
collection during update operations, 10.2
log file clauses
of ALTER DATABASE, 10.2
log files
adding, 10.2
dropping, 10.2
modifying, 10.2
registering, 10.2
renaming, 10.2
specifying for the database, 14
LOG function, 5.8
log groups
adding, 12
dropping, 12
LOGFILE clause
OF CREATE DATABASE, 14
LOGFILE GROUP clause
of CREATE CONTROLFILE, 14
logging
and redo log size, 8
specifying minimal, 8
supplemental
dropping, 10.2
supplemental, adding log groups, 12
supplemental, dropping log groups, 12
LOGGING clause
of ALTER INDEX, 10.2
of ALTER MATERIALIZED VIEW, 11
of ALTER MATERIALIZED VIEW LOG, 11
of ALTER TABLE, 12
of ALTER TABLESPACE, 12
of CREATE MATERIALIZED VIEW, 15
of CREATE MATERIALIZED VIEW LOG, 15
of CREATE TABLE, 16
of CREATE TABLESPACE, 16
logical conditions, 7.4
logical standby database
aborting, 10.2, 10.2
activating, 10.2
stopping, 10.2, 10.2
LOGICAL_READS_PER_CALL parameter
of ALTER PROFILE, 11
LOGICAL_READS_PER_SESSION parameter
of ALTER PROFILE, 11
of ALTER RESOURCE COST, 11
LogMiner
supplemental logging, 12, 16
LONG columns
and domain indexes, 12
converting to LOB, 3.1.1.9, 12
restrictions on, 3.1.1.9
to store text strings, 3.1.1.9
to store view definitions, 3.1.1.9
where referenced from, 3.1.1.9
LONG data type, 3.1.1.9
in triggers, 3.1.1.9
LONG RAW data type, 3.1.1.19
converting from CHAR data, 3.1.1.19
LONG VARGRAPHIC data type
DB2, 3.1.3, 3.1.3
SQL/DS, 3.1.3
LOWER function, 5.8
LPAD function, 5.8
LTRIM function, 5.8

M

MAKE_REF function, 5.8
MANAGE SCHEDULER system privilege, 18
MANAGE TABLESPACE system privilege, 18
managed recovery
of database, 10.2
managed standby recovery
as background process, 10.2
create a logical standby from the physical standby, 10.2
overriding delays, 10.2
returning control during, 10.2, 10.2
terminating existing, 10.2, 10.2
MANAGED STANDBY RECOVERY clause
of ALTER DATABASE, 10.2, 10.2
MAPPING TABLE clause
of ALTER TABLE, 12, 12
mapping tables
of index-organized tables, 12, 16
modifying, 12
master databases, 15
master tables, 15
MATCHES condition, 7.1
MATCHES operator, 4.1
materialized join views, 15
materialized view logs, 15
creating, 15
excluding new values from, 11
logging changes to, 11
object ID based, 11
parallelizing creation, 15
partition attributes, changing, 11
partitioned, 15
physical attributes
changing, 11
specifying, 15
purging, 11, 15
removing from the database, 17
required for fast refresh, 15
rowid based, 11
saving new values in, 11
saving old values in, 15
storage attributes
specifying, 15
materialized views, 15
allowing update of, 15
changing from rowid-based to primary-key-based, 11
changing to primary-key-based, 11
complete refresh, 11, 15
compression of, 11, 15
constraints on, 8
creating, 15
creating comments about, 13
degree of parallelism, 11, 11
during creation, 15
enabling and disabling query rewrite, 15
examples, 15, 15
fast refresh, 11, 15, 15
for replication, 15, 15
forced refresh, 11
granting system privileges for, 18
index characteristics
changing, 11
indexes that maintain, 15
join, 15
LOB storage attributes, 11
logging changes to, 11
master table, dropping, 17
object type, creating, 15
partitions, 11
compression of, 11, 15
physical attributes, 15
changing, 11
primary key, 15
recording values in master table, 11
query rewrite
eligibility for, 8
enabling and disabling, 11
re-creating during refresh, 11
refresh, 10.2
after DML on master table, 11, 15
mode, changing, 11
on next COMMIT, 11, 15
using trusted constraints, 15
refresh, time, changing, 11
refreshing, 10.2
removing from the database, 17
restricting scope of, 15
retrieving data from, 19
revalidating, 11
rowid, 15
rowid values
recording in master table, 11
saving blocks in a cache, 11
storage attributes, 15
changing, 11
subquery, 15
suppressing creation of default index, 15
synonyms for, 16
when to populate, 15
MAX function, 5.8
MAXDATAFILES parameter
of CREATE CONTROLFILE, 14
of CREATE DATABASE, 14
MAXEXTENTS parameter
of STORAGE clause, 8
MAXINSTANCES parameter
of CREATE CONTROLFILE, 14
OF CREATE DATABASE, 14
MAXLOGFILES parameter
of CREATE CONTROLFILE, 14
of CREATE DATABASE, 14
MAXLOGHISTORY parameter
of CREATE CONTROLFILE, 14
of CREATE DATABASE, 14
MAXLOGMEMBERS parameter
of CREATE CONTROLFILE, 14
of CREATE DATABASE, 14
MAXSIZE clause
of ALTER DATABASE, 10.2
MAXTRANS parameter
of physical_attributes_clause, 8
MAXVALUE parameter
of CREATE SEQUENCE, 15
of ALTER SEQUENCE. See CREATE SEQUENCE
media recovery
avoid on startup, 10.2
designing, 10.2
disabling, 10.2
from specified redo logs, 10.2
of database, 10.2
of datafiles, 10.2
of standby database, 10.2
of tablespaces, 10.2
performing ongoing, 10.2
preparing for, 10.2, 10.2
restrictions, 10.2
sustained standby recovery, 10.2
MEDIAN function, 5.8
median values, 5.8
MEMBER conditions, 7.6.3
membership conditions, 7.6.3, 7.13
MERGE ANY VIEW system privilege, 18
MERGE hint, 3.6.4.25
MERGE PARTITIONS clause
of ALTER TABLE, 12
MERGE statement, 18
deletes during, 18
error logging, 18
inserts during, 18
updates during, 18
MERGE VIEW object privilege on a view, 18
merge_insert_clause
of MERGE, 18
migrated rows
listing, 13
of clusters, 13
MIN function, 5.8
MINEXTENTS parameter
of STORAGE clause, 8
MINIMIZE RECORDS PER BLOCK clause
of ALTER TABLE, 12
MINIMUM EXTENT clause
of ALTER TABLESPACE, 12
of CREATE TABLESPACE, 16
mining models
auditing, 13
comments on, 13
MINUS set operator, 4.5, 19
MINVALUE parameter
of CREATE SEQUENCE, 15
of ALTER SEQUENCE. See CREATE SEQUENCE
MOD function, 5.8
MODE clause
of LOCK TABLE, 18
MODEL clause
of SELECT, 19, 19
model conditions, 7.5
IS ANY, 7.5.1
IS PRESENT, 7.5.2
model expression, 6.10
model functions, 5.6
MODEL_MIN_ANALYSIS hint, 3.6.4.26
MODIFY clause
of ALTER TABLE, 12
MODIFY CONSTRAINT clause
of ALTER TABLE, 12, 12
of ALTER VIEW, 13
MODIFY DEFAULT ATTRIBUTES clause
of ALTER INDEX, 10.2, 10.2
of ALTER TABLE, 12
MODIFY LOB storage clause
of ALTER MATERIALIZED VIEW, 11, 11
of ALTER TABLE, 12
MODIFY NESTED TABLE clause
of ALTER TABLE, 12, 12
MODIFY PARTITION clause
of ALTER INDEX, 10.2
of ALTER MATERIALIZED VIEW, 11
of ALTER TABLE, 12
MODIFY scoped_table_ref_constraint clause
of ALTER MATERIALIZED VIEW, 11
MODIFY SUBPARTITION clause
of ALTER INDEX, 10.2, 10.2
MODIFY VARRAY clause
of ALTER TABLE, 12, 12
MON datetime format element, 3.4.2.2
MONITOR hint, 3.6.4.27
MONITORING USAGE clause
of ALTER INDEX, 10.2
MONTH datetime format element, 3.4.2.2
MONTHS_BETWEEN function, 5.8
MOUNT clause
of ALTER DATABASE, 10.2
MOVE clause
of ALTER TABLE, 12, 12
MOVE ONLINE clause
of ALTER TABLE, 12
MOVE SUBPARTITION clause
of ALTER TABLE, 12
multilevel collections, 16
multiset conditions, 7.6
MULTISET EXCEPT operator, 4.6.1
MULTISET INTERSECT operator, 4.6.2
MULTISET keyword
of CAST function, 5.8
multiset operators, 4.6
MULTISET EXCEPT, 4.6.1
MULTISET INTERSECT, 4.6.2
MULTISET UNION, 4.6.3
MULTISET UNION operator, 4.6.3
multitable inserts, 18
conditional, 18
examples, 18
unconditional, 18
multi-threaded server. See shared server
processes
creating additional, 11
terminating, 11
system parameters, 11

N

NAME clause
of SET TRANSACTION, 19
NAMED clause
of CREATE JAVA, 14
namespaces
and object naming rules, 3.8.1
database, 3.8.1
for nonschema objects, 3.8.1
for schema objects, 3.8.1
NANVL function, 5.8
national character set
changing, 10.2
fixed versus variable width, 3.1.1.3
multibyte character data, 3.1.1.23
multibyte character sets, 3.1.1.2, 3.1.1.3
variable-length strings, 3.1.1.3
NATIONAL CHARACTER SET parameter
of CREATE DATABASE, 14
natural joins, 19
NCHAR data type, 3.1.1.2
NCHR function, 5.8
NCLOB data type, 3.1.1.23
transactional support of, 3.1.1.23
nested subqueries, 9.7
NESTED TABLE clause
of ALTER TABLE, 12, 12
of CREATE TABLE, 16, 16
nested tables, 3.1.4.4, 5.8, 5.8, 7.6.1
changing returned value, 12
combining, 4.6
compared with varrays, 3.2.5
comparison rules, 3.2.5
creating, 17
creating from existing columns, 5.8
defining as index-organized tables, 12
determining hierarchy, 7.6.4
dropping the body of, 18
dropping the specification of, 18
in materialized views, 15, 15
indexing columns of, 14
modifying, 12
modifying column properties, 12
multilevel, 16
partitioned nested table columns, 12
storage characteristics of, 12, 16
NEW_TIME function, 5.8
NEXT clause
of ALTER MATERIALIZED VIEW ... REFRESH, 11
NEXT parameter
of STORAGE clause, 8
NEXT_DAY function, 5.8
NEXTVAL pseudocolumn, 2.2, 15
NLS_CHARSET_DECL_LEN function, 5.8
NLS_CHARSET_ID function, 5.8
NLS_CHARSET_NAME function, 5.8
NLS_DATE_LANGUAGE initialization parameter, 3.4.2.2
NLS_INITCAP function, 5.8
NLS_LANGUAGE initialization parameter, 3.4.2.2, 9.5
NLS_LENGTH_SEMANTICS initialization parameter
overriding, 3.1.1.1
NLS_LOWER function, 5.8
NLS_SORT initialization parameter, 9.5
NLS_TERRITORY initialization parameter, 3.4.2.2
NLS_UPPER function, 5.8
NLSSORT function, 5.8
NO FORCE LOGGING clause
of ALTER DATABASE, 10.2
of ALTER TABLESPACE, 12
NO_EXPAND hint, 3.6.4.31
NO_FACT hint, 3.6.4.32
NO_INDEX hint, 3.6.4.33
NO_INDEX_FFS hint, 3.6.4.34
NO_INDEX_SS hint, 3.6.4.35
NO_MERGE hint, 3.6.4.36
NO_MONITOR hint, 3.6.4.37
NO_PARALLEL hint, 3.6.4.39
NO_PARALLEL_INDEX, 3.6.4.41
NO_PUSH_PRED hint, 3.6.4.43
NO_PUSH_SUBQ hint, 3.6.4.44
NO_PX_JOIN_FILTER hint, 3.6.4.45
NO_QUERY_TRANSFORMATION hint, 3.6.4.46
NO_RESULT_CACHE hint, 3.6.4.47
NO_REWRITE hint, 3.6.4.48
NO_STAR_TRANSFORMATION hint, 3.6.4.50
NO_STATEMENT_QUEUING hint, 3.6.4.51
NO_UNNEST hint, 3.6.4.52
NO_USE_HASH hint, 3.6.4.53
NO_USE_MERGE hint, 3.6.4.54
NO_USE_NL hint, 3.6.4.55
NO_XML_QUERY_REWRITE hint, 3.6.4.56
NO_XMLINDEX_REWRITE hint, 3.6.4.57
NOAPPEND hint, 3.6.4.29
NOARCHIVELOG clause
of ALTER DATABASE, 10.2, 10.2
of CREATE CONTROLFILE, 14
OF CREATE DATABASE, 10.2, 14
NOAUDIT statement, 18
locks, B.2.2
NOCACHE clause
of ALTER CLUSTER, 10.2
of ALTER MATERIALIZED VIEW, 11
of ALTER MATERIALIZED VIEW LOG, 11, 11
of ALTER TABLE, 16
of CREATE CLUSTER, 14
of CREATE MATERIALIZED VIEW, 15
of CREATE MATERIALIZED VIEW LOG, 15
of CREATE SEQUENCE, 15
of ALTER SEQUENCE. See CREATE SEQUENCE
NOCACHE hint, 3.6.4.30
NOCOMPRESS clause
of ALTER INDEX ... REBUILD, 10.2
of CREATE INDEX, 14
of CREATE TABLE, 16
NOCYCLE parameter
of CREATE SEQUENCE, 15
of ALTER SEQUENCE. See CREATE SEQUENCE, 11
NOFORCE clause
of CREATE JAVA, 14
of CREATE VIEW, 17
NOLOGGING mode
and force logging mode, 8
for nonpartitioned objects, 8
for partitioned objects, 8
NOMAXVALUE parameter
of CREATE SEQUENCE, 15
of ALTER SEQUENCE. See CREATE SEQUENCE
NOMINIMIZE RECORDS PER BLOCK clause
of ALTER TABLE, 12
NOMINVALUE parameter
of CREATE SEQUENCE, 15
of ALTER SEQUENCE. See CREATE SEQUENCE, 11
NOMONITORING USAGE clause
of ALTER INDEX, 10.2
NONE clause
of SET ROLE, 19
nonempty subsets of, 5.8
nonequivalency tests, 7.13
nonschema objects
list of, 3.7.2
namespaces, 3.8.1
NOORDER parameter
of CREATE SEQUENCE, 15
of ALTER SEQUENCE. See CREATE SEQUENCE, 11
NOPARALLEL clause
of CREATE INDEX, 8, 16
NOPARALLEL hint, 3.6.4.39
NOPARALLEL_INDEX hint, 3.6.4.41
NORELY clause
of constraints, 8
NORESETLOGS clause
of CREATE CONTROLFILE, 14
NOREVERSE parameter
of ALTER INDEX ... REBUILD, 10.2, 10.2
NOREWRITE hint, 3.6.4.48
NOROWDEPENDENCIES clause
of CREATE CLUSTER, 14
of CREATE TABLE, 16
NOSORT clause
of ALTER INDEX, 14
NOT condition, 7.4, 7.4
NOT DEFERRABLE clause
of constraints, 8
NOT IDENTIFIED clause
of CREATE ROLE, 15
of ALTER ROLE. See CREATE ROLE
NOT IN subqueries
converting to NOT EXISTS subqueries, 5.8
NOT NULL clause
of CREATE TABLE, 16
NOWAIT clause
of LOCK TABLE, 18
NTH_VALUE function, 5.8
NTILE function, 5.8
null, 3.5
difference from zero, 3.5
in conditions, 3.5.3
table of, 3.5.3
in functions, 5.1
with comparison conditions, 3.5.2
null conditions, 7.8
NULLIF function, 5.8
as a form of CASE expression, 5.8
NULL-related functions, 5.2.14
NUMBER data type, 3.1.1.6
converting to VARCHAR2, 3.4.1
precision, 3.1.1.6
scale, 3.1.1.6
number format models, 3.4.1
number functions, 5.2.1
numbers
comparison rules, 3.2.1
floating-point, 3.1.1.6, 3.1.1.8
in SQL syntax, 3.3.2
precision of, 3.3.2.2
spelling out, 3.4.2.5
syntax of, 3.3.2.2
numeric functions, 5.2.1
numeric precedence, 3.1.1.9
NUMTODSINTERVAL function, 5.8
NUMTOYMINTERVAL function, 5.8
NVARCHAR2 data type, 3.1.1.3
NVL function, 5.8
NVL2 function, 5.8

O

object access expressions, 6.11
OBJECT IDENTIFIER clause
of CREATE TABLE, 16
object instances
types of, 7.14
object privileges
FLASHBACK ARCHIVE, 18
granting, 15
multiple, 15
on specific columns, 18
on a database object
revoking, 18
revoking, 18
from a role, 18, 18
from a user, 18, 18
from PUBLIC, 18
object reference functions, 5.5
object tables
adding rows to, 18
as part of hierarchy, 16
creating, 16, 16
querying, 16
system-generated column name, 16, 16, 17, 17
updating to latest version, 12
upgrading, 12
object type columns
defining properties
for materialized views, 15, 15
in a type hierarchy, 16
membership in hierarchy, 12
modifying properties
for tables, 12, 12
substitutability, 12
object type materialized views
creating, 15
object types, 3.1.4.1
associating statistics types with, 13
attributes, 3.9.5
in a type hierarchy, 16
membership in hierarchy, 12
substitutability, 12
bodies
creating, 17
re-creating, 17
comparison rules, 3.2.4
MAP function, 3.2.4
ORDER function, 3.2.4
components of, 3.1.4.1
creating, 17
defining member methods of, 17
disassociating statistics types from, 17, 18
dropping the body of, 18
dropping the specification of, 18
granting system privileges for, 18
identifiers, 2.5
incomplete, 17
methods, 3.9.5
privileges on subtypes, 18
statistics types, 13
values of, 2.6
references to. See REFs
object views, 17
base tables
adding rows, 18
creating, 17
creating subviews, 17
defining, 17
querying, 17
OBJECT_ID pseudocolumn, 2.5, 16, 16, 17, 17
OBJECT_VALUE pseudocolumn, 2.6
objects. See object types or database objects
ODCIIndexInsert method
indextype support of, 10.2, 14
OF clause
of CREATE VIEW, 17
OFFLINE clause
of ALTER TABLESPACE, 12
of CREATE TABLESPACE, 16
OIDINDEX clause
of CREATE TABLE, 16
OIDs. See object identifiers
contained in REFs, 3.1.4.2
of object views, 17
primary key, 16
specifying, 16
specifying an index on, 16
system-generated, 16
OLAP functions, 5.7
OLTP table compression, 16
ON clause
of CREATE OUTLINE, 15
ON COMMIT clause
of CREATE TABLE, 16
ON COMMIT REFRESH object privilege
on a materialized view, 18
ON COMMIT REFRESH system privilege, 18
ON DEFAULT clause
of AUDIT, 13
of NOAUDIT, 18
ON DELETE CASCADE clause
of constraints, 8
ON DELETE SET NULL clause
of constraints, 8
ON DIRECTORY clause
of AUDIT, 13, 13
of NOAUDIT, 18
ON MINING MODEL clause
of AUDIT, 13
ON object clause
of NOAUDIT, 18
of REVOKE, 18
ON PREBUILT TABLE clause
of CREATE MATERIALIZED VIEW, 15
online backup
of tablespaces, ending, 12
ONLINE clause
of ALTER TABLESPACE, 12
of CREATE INDEX, 14
of CREATE TABLESPACE, 16
online indexes, 14
rebuilding, 12
ONLINE parameter
of ALTER INDEX ... REBUILD, 10.2
online redo logs
reinitializing, 10.2
OPEN clause
of ALTER DATABASE, 10.2
OPEN READ ONLY clause
of ALTER DATABASE, 10.2
OPEN READ WRITE clause
of ALTER DATABASE, 10.2
operands, 4
operating system files
dropping, 18, 18
removing, 10.2
operators, 4
adding to indextypes, 10.2
altering, 11
arithmetic, 4.2
binary, 4.1.1
comments on, 13
concatenation, 4.3
CONNECT_BY_ROOT, 4.4.2
dropping from indextypes, 10.2
granting system privileges for, 18
MULTISET EXCEPT, 4.6.1
MULTISET INTERSECT, 4.6.2
MULTISET UNION, 4.6.3
precedence, 4.1.2
PRIOR, 4.4.1
set, 4.5, 19
specifying implementation of, 15
unary, 4.1.1
user-defined, 4.7
binding to a function, 11, 15
compiling, 11
creating, 15
dropping, 17
how bindings are implemented, 15
implementation type, 15
return type of binding, 15
OPT_PARAM hint, 3.6.4.58
OPTIMAL parameter
of STORAGE clause, 8
OR condition, 7.4, 7.4
OR REPLACE clause
of CREATE CONTEXT, 14
of CREATE DIRECTORY, 14
of CREATE FUNCTION, 14, 14
of CREATE LIBRARY, 15
of CREATE OUTLINE, 15
of CREATE PACKAGE, 15
of CREATE PACKAGE BODY, 15
of CREATE PROCEDURE, 15
of CREATE TRIGGER, 16
of CREATE TYPE, 17
of CREATE TYPE BODY, 17
of CREATE VIEW, 17
ORA_DST_AFFECTED function, 5.8
ORA_DST_CONVERT function, 5.8
ORA_DST_ERROR function, 5.8
ORA_HASH function, 5.8
ORA_ROWSCN pseudocolumn, 2.7
Oracle ADVM volumes, 10.2
Oracle Automatic Storage Management
migrating nodes in a cluster, 11
Oracle Call Interface, 1.5
Oracle Expression Filter
conditions, 7.1
operators, 4.1
Oracle reserved words, E.1
Oracle Text
built-in conditions, 7.1
CATSEARCH, 7.1
CONTAINS, 7.1
creating domain indexes, 14
MATCHES, 7.1
operators, 4.1
CATSEARCH, 4.1
CONTAINS, 4.1
MATCHES, 4.1
SCORE, 4.1
Oracle Tools
support of SQL, 1.5
ORDAudio data type, 3.1.9
ORDDicom data type, 3.1.9
ORDDoc data type, 3.1.9
ORDER BY clause
of queries, 9.5
of SELECT, 9.5, 19, 19
with ROWNUM, 2.9
ORDER clause
of ALTER SEQUENCE. See CREATE SEQUENCE
ORDER parameter
of CREATE SEQUENCE, 15
ORDER SIBLINGS BY clause
of SELECT, 19
ORDERED hint, 3.6.4.59
ORDImage data type, 3.1.9
ORDImageSignature data type, 3.1.9
ordinal numbers
specifying, 3.4.2.5
spelling out, 3.4.2.5
ORDVideo data type, 3.1.9
ORGANIZATION EXTERNAL clause
of CREATE TABLE, 16, 16
ORGANIZATION HEAP clause
of CREATE TABLE, 16
ORGANIZATION INDEX clause
of CREATE TABLE, 16
outer joins, 9.6.6
restrictions, 9.6.6
outlines
assign to a different category, 11
assigning to a different category, 11, 11
copying, 15
creating, 15
creating on statements, 15
dropping from the database, 17
enabling and disabling dynamically, 15
for use by current session, 15
for use by PUBLIC, 15
granting system privileges for, 18
private, use by the optimizer, 11
rebuilding, 11, 11
recompiling, 11
renaming, 11, 11, 11
replacing, 15
storing groups of, 15
use by the optimizer, 11
use to generate execution plans, 11
used to generate execution plans, 15
out-of-line constraints
of CREATE TABLE, 16
OVER clause
of analytic functions, 5.4
OVERFLOW clause
of ALTER INDEX, 10.2
of ALTER TABLE, 12
of CREATE TABLE, 16

P

package bodies
creating, 15
re-creating, 15
removing from the database, 17
packaged procedures
dropping, 17
packages
associating statistics types with, 13
creating, 15
disassociating statistics types from, 17, 17
redefining, 15
removing from the database, 17
synonyms for, 16
PACKAGES clause
of ASSOCIATE STATISTICS, 13, 13
of DISASSOCIATE STATISTICS, 17
PARALLEL clause
of ALTER CLUSTER, 10.2, 10.2
of ALTER INDEX, 10.2
of ALTER MATERIALIZED VIEW, 11, 11
of ALTER MATERIALIZED VIEW LOG, 11, 11
of ALTER TABLE, 12
of CREATE CLUSTER, 14
of CREATE INDEX, 14
of CREATE MATERIALIZED VIEW, 15, 15
of CREATE MATERIALIZED VIEW LOG, 15, 15
of CREATE TABLE, 16, 16
parallel execution, 8
hints, 3.6.4.60
of DDL statements, 11
of DML statements, 11
PARALLEL hint, 3.6.4.60
PARALLEL_INDEX hint, 3.6.4.61
parameter files
creating, 15, 15
from memory, 15
parameters
in syntax
optional, A.1.2
required, A.1.1
PARAMETERS clause
of CREATE INDEX, 14, 14
PARTITION ... LOB storage clause
of ALTER TABLE, 12
PARTITION BY HASH clause
of CREATE TABLE, 16, 16
PARTITION BY LIST clause
of CREATE TABLE, 16, 16
PARTITION BY RANGE clause
of CREATE TABLE, 16, 16
PARTITION BY REFERENCE clause
of CREATE TABLE, 16, 16
PARTITION clause
of ANALYZE, 13
of CREATE INDEX, 14
of CREATE TABLE, 16
of DELETE, 17
of INSERT, 18
of LOCK TABLE, 18
of UPDATE, 19
partitioned indexes, 3.9.4, 14, 14, 14
local, creating, 14
user-defined, 14
partitioned index-organized tables
secondary indexes, updating, 10.2
partitioned tables, 3.9.4
partition-extended table names
in DML statements, 3.9.4
restrictions on, 3.9.4
syntax, 3.9.4
partitioning
by hash, 16, 16
by list, 16, 16
by range, 16, 16
by reference, 16, 16
clauses
of ALTER INDEX, 10.2
of ALTER TABLE, 12
interval, 16
of materialized view logs, 11, 15
of materialized views, 11, 15, 15
range with interval partitions, 16
referential constraint, 12, 16
system, 16
partitions
adding, 12
adding rows to, 18
allocating extents for, 12
based on literal values, 16
composite
specifying, 16
converting into nonpartitioned tables, 12
deallocating unused space from, 12
dropping, 12
exchanging with tables, 12
extents
allocating for an index, 10.2
hash
adding, 12
coalescing, 12
specifying, 16
index, 14
inserting rows into, 18
list, adding, 12
LOB storage characteristics of, 12
locking, 18
logging attribute, 16
logging insert operations, 12
merging, 12
modifying, 12, 12
physical attributes
changing, 12
range
adding, 12
specifying, 16
removing rows from, 12, 17
renaming, 12
revising values in, 19
splitting, 12
storage characteristics, 8
tablespace for
defining, 16
PASSWORD EXPIRE clause
of CREATE USER, 17
of ALTER USER. See CREATE USER
PASSWORD_GRACE_TIME parameter
of ALTER PROFILE, 11
of CREATE PROFILE, 15
PASSWORD_LIFE_TIME parameter
of ALTER PROFILE, 11
of CREATE PROFILE, 15
PASSWORD_LOCK_TIME parameter
of ALTER PROFILE, 11
of CREATE PROFILE, 15
PASSWORD_REUSE_MAX parameter
of ALTER PROFILE, 11
of CREATE PROFILE, 15
PASSWORD_REUSE_TIME parameter
of ALTER PROFILE, 11
of CREATE PROFILE, 15
PASSWORD_VERIFY_FUNCTION parameter
of ALTER PROFILE, 11
of CREATE PROFILE, 15
passwords
expiration of, 17
grace period, 15
guaranteeing complexity, 15
limiting use and reuse, 15
locking, 15
making unavailable, 15
parameters
of CREATE PROFILE, 15
special characters in, 17
PATH function, 5.8
PATH_VIEW, 7.9.1, 7.9.2
pattern-matching conditions, 7.7
PCT_ACCESS_DIRECT statistics
for index-organized tables, 13
PCTFREE parameter
of ALTER CLUSTER, 10.2
of ALTER INDEX, 10.2
of ALTER MATERIALIZED VIEW LOG, 11
of ALTER TABLE, 12
of CREATE TABLE, 8
of CREATE MATERIALIZED VIEW. See CREATE TABLE.
PCTINCREASE parameter
of STORAGE clause, 8
PCTTHRESHOLD parameter
of CREATE TABLE, 16
PCTUSED parameter
of ALTER CLUSTER, 10.2
of ALTER INDEX, 10.2
of ALTER MATERIALIZED VIEW LOG, 11
of ALTER TABLE, 12
of CREATE TABLE, 8
of CREATE INDEX. See CREATE TABLE
PCTVERSION parameter
of LOB storage, 16
of LOB storage clause, 12
PERCENT_RANK function, 5.8
PERCENTILE_CONT function, 5.8
PERCENTILE_DISC function, 5.8
PERMANENT clause
of ALTER TABLESPACE, 12
physical attributes clause
of ALTER CLUSTER, 10.2
of ALTER INDEX, 10.2
of ALTER MATERIALIZED VIEW LOG, 11
of ALTER TABLE, 12
of CREATE CLUSTER, 14
of CREATE MATERIALIZED VIEW, 15
of CREATE TABLE, 16, 16
physical standby database
activating, 10.2
converting to snapshot standby database, 10.2
pivot operations, 19
examples, 19
syntax, 19
placeholder expressions, 6.12
plan management
granting system privileges for, 18
plan stability, 15
PLAN_TABLE sample table, 18
P.M. datetime format element, 3.4.2.2, 3.4.2.2
POSIX regular expression standard, D
POWER function, 5.8
POWERMULTISET function, 5.8
POWERMULTISET_BY_CARDINALITY function, 5.8
PQ_DISTRIBUTE hint, 3.6.4.62
precedence
of conditions, 7.1.1
of numbers, 3.1.1.9
of operators, 4.1.2
precision
number of digits of, 3.3.2.2
of NUMBER data type, 3.1.1.6
precompilers, 1.5
predefined roles, 18
PREDICTION function, 5.8
PREDICTION_BOUNDS function, 5.8
PREDICTION_COST function, 5.8
PREDICTION_DETAILS function, 5.8
PREDICTION_PROBABILITY function, 5.8
PREDICTION_SET function, 5.8
PREPARE TO SWITCHOVER clause
of ALTER DATABASE, 10.2
PRESENTNNV function, 5.8
PRESENTV function, 5.8
pretty-printing of XML output, 5.8
PREVIOUS function, 5.8
primary database
converting to physical standby database, 10.2
PRIMARY KEY clause
of constraints, 8
of CREATE TABLE, 16
primary key constraints, 8
enabling, 16
index on, 16
primary keys
generating values for, 15
PRIOR clause
of hierarchical queries, 9.3
PRIOR operator, 4.4.1
PRIVATE clause
of CREATE OUTLINE, 15
private outlines
use by the optimizer, 11
PRIVATE_SGA parameter
of ALTER PROFILE, 11
of ALTER RESOURCE COST, 11
privileges
on subtypes of object types, 18
revoking from a grantee, 18
See also system privileges or object privileges
procedures
3GL,calling, 15
calling, 13
creating, 15
executing, 13
external, 15
granting system privileges for, 18
invalidating local objects dependent on, 17
issuing COMMIT or ROLLBACK statements, 11
naming rules, 3.8.1
recompiling, 11
re-creating, 15
removing from the database, 17
synonyms for, 16
PROFILE clause
of CREATE USER, 17
of ALTER USER. See CREATE USER
profiles
adding resource limits, 11
assigning to a user, 17
changing resource limits, 11
creating, 15
examples, 15
deassigning from users, 17
dropping resource limits, 11
granting system privileges for, 18
modifying, examples, 11
removing from the database, 17
proxy clause
of ALTER USER, 13, 13
proxy users
allowing connection as database users, 13
pseudocolumns, 2
COLUMN_VALUE, 2.4
CONNECT_BY_ISCYCLE, 2.1.1
CONNECT_BY_ISLEAF, 2.1.2
CURRVAL, 2.2
flashback queries, 2.3
in hierarchical queries, 2.1
LEVEL, 2.1.3
NEXTVAL, 2.2
OBJECT_ID, 2.5, 16, 16, 17, 17
OBJECT_VALUE, 2.6
ORA_ROWSCN, 2.7
ROWID, 2.8
ROWNUM, 2.9
version queries, 2.3
XMLDATA, 2.10
PUBLIC clause
of CREATE OUTLINE, 15
of CREATE SYNONYM, 16
of DROP DATABASE LINK, 17
public database links
dropping, 17
public synonyms, 16
dropping, 18
PURGE statement, 18
PUSH_PRED hint, 3.6.4.63
PUSH_SUBQ hint, 3.6.4.64
PX_JOIN_FILTER hint, 3.6.4.65

Q

QB_NAME hint, 3.6.4.66
queries, 9.1, 19
comments in, 9.2
compound, 9.5
correlated
left correlation, 19
default locking of, B.1
defined, 9.1
distributed, 9.10
grouping returned rows on a value, 19
hierarchical, ordering, 19
hints in, 9.2
join, 9.6, 19
locking rows during, 19
multiple versions of rows, 19
of past data, 19
ordering returned rows, 19
outer joins in, 19
referencing multiple tables, 9.6
select lists of, 9.2
selecting all columns, 19
selecting from a random sample of rows, 19
sorting results, 9.5
syntax, 9.1
top-level, 9.1
top-N, 2.9
hierarchical. See hierarchical queries
query rewrite
and dimensions, 14
defined, 19
QUERY REWRITE object privilege
on a materialized view, 18
QUERY REWRITE system privilege, 18
QUIESCE RESTRICTED clause
of ALTER SYSTEM, 11
QUOTA clause
of CREATE USER, 17
of ALTER USER. See CREATE USER

R

range conditions, 7.11
range partitioning
converting to interval partitioning, 12
range partitions
adding, 12
creating, 16
values of, 16
RANK function, 5.8
RATIO_TO_REPORT function, 5.8
RAW data type, 3.1.1.19
converting from CHAR data, 3.1.1.19
RAWTOHEX function, 5.8
RAWTONHEX function, 5.8
READ object privilege
on a materialized directory, 18
READ ONLY clause
of ALTER TABLESPACE, 12
of ALTER VIEW, 13
READ WRITE clause
of ALTER TABLESPACE, 12
of ALTER VIEW, 13
REBUILD clause
of ALTER INDEX, 10.2
of ALTER OUTLINE, 11
REBUILD PARTITION clause
of ALTER INDEX, 10.2
REBUILD SUBPARTITION clause
of ALTER INDEX, 10.2
REBUILD UNUSABLE LOCAL INDEXES clause
of ALTER TABLE, 12
RECOVER AUTOMATIC clause
of ALTER DATABASE, 10.2
RECOVER CANCEL clause
of ALTER DATABASE, 10.2, 10.2
RECOVER clause
of ALTER DATABASE, 10.2
RECOVER CONTINUE clause
of ALTER DATABASE, 10.2, 10.2
RECOVER DATABASE clause
of ALTER DATABASE, 10.2, 10.2
RECOVER DATAFILE clause
of ALTER DATABASE, 10.2, 10.2
RECOVER LOGFILE clause
of ALTER DATABASE, 10.2, 10.2
RECOVER MANAGED STANDBY DATABASE clause
of ALTER DATABASE, 10.2
RECOVER TABLESPACE clause
of ALTER DATABASE, 10.2, 10.2
RECOVERABLE, 10.2, 16
See also LOGGING clause
recovery
discarding data, 10.2
distributed, enabling, 11
instance, continue after interruption, 10.2
media, designing, 10.2
media, performing ongoing, 10.2
of database, 10.2
recovery clauses
of ALTER DATABASE, 10.2
recursive subquery factoring, 19
recycle bin
purging objects from, 18
redo log files
specifying, 8
specifying for a control file, 14
redo logs, 10.2
adding, 10.2, 10.2
applying to logical standby database, 10.2
archive location, 11
automatic archiving, 11
automatic name generation, 10.2, 10.2
clearing, 10.2
dropping, 10.2, 10.2
enabling and disabling thread, 10.2
manual archiving, 11
all, 11
by group number, 11
by SCN, 11
current, 11
next, 11
with sequence numbers, 11
members
adding to existing groups, 10.2
dropping, 10.2
renaming, 10.2
remove changes from, 10.2
reusing, 8
size of, 8
specifying, 8, 14
for media recovery, 10.2
specifying archive mode, 14
switching groups, 11
REF columns
rescoping, 11
specifying, 16
specifying from table or column, 16
REF constraints
defining scope, for materialized views, 11
of ALTER TABLE, 12
REF function, 5.8
reference partitioning, 16
reference-partitioned tables, 12
maintenance operations, 12
REFERENCES clause
of CREATE TABLE, 16
REFERENCES object privilege
on a table, 18
on a view, 18
referential integrity constraints, 8
REFRESH clause
of ALTER MATERIALIZED VIEW, 11, 11
of CREATE MATERIALIZED VIEW, 15
REFRESH COMPLETE clause
of ALTER MATERIALIZED VIEW, 11
of CREATE MATERIALIZED VIEW, 15
REFRESH FAST clause
of ALTER MATERIALIZED VIEW, 11
of CREATE MATERIALIZED VIEW, 15
REFRESH FORCE clause
of ALTER MATERIALIZED VIEW, 11
of CREATE MATERIALIZED VIEW, 15
REFRESH ON COMMIT clause
of ALTER MATERIALIZED VIEW, 11
of CREATE MATERIALIZED VIEW, 15
REFRESH ON DEMAND clause
of ALTER MATERIALIZED VIEW, 11
of CREATE MATERIALIZED VIEW, 15
REFs, 3.1.4.2, 8
as containers for object identifiers, 3.1.4.2
dangling, 13
updating, 13
validating, 13
REFTOHEX function, 5.8
REGEXP_COUNT function, 5.8
REGEXP_INSTR function, 5.8
REGEXP_LIKE condition, 7.7.2
REGEXP_REPLACE function, 5.8
REGEXP_SUBSTR function, 5.8
REGISTER clause
of ALTER SYSTEM, 11
REGISTER LOGFILE clause
of ALTER DATABASE, 10.2
REGR_AVGX function, 5.8
REGR_AVGY function, 5.8
REGR_COUNT function, 5.8
REGR_INTERCEPT function, 5.8
REGR_R2 function, 5.8
REGR_SLOPE function, 5.8
REGR_SXX function, 5.8
REGR_SXY function, 5.8
REGR_SYY function, 5.8
regular expressions
multilingual syntax, D.1
operators, multilingual enhancements, D.2
Oracle support of, D
Perl-influenced operators, D.3
subexpressions, 5.8, 5.8
relational tables
creating, 16, 16
RELY clause
of constraints, 8
REMAINDER function, 5.8
RENAME clause
of ALTER INDEX, 10.2
of ALTER OUTLINE, 11
of ALTER TABLE, 12
of ALTER TABLESPACE, 12
of ALTER TRIGGER, 13
RENAME CONSTRAINT clause
of ALTER TABLE, 12
RENAME DATAFILE clause
of ALTER TABLESPACE, 12
RENAME FILE clause
of ALTER DATABASE, 10.2, 10.2
RENAME GLOBAL_NAME clause
of ALTER DATABASE, 10.2
RENAME PARTITION clause
of ALTER INDEX, 10.2
of ALTER TABLE, 12
RENAME statement, 18
RENAME SUBPARTITION clause
of ALTER INDEX, 10.2
of ALTER TABLE, 12
REPLACE function, 5.8
replication
row-level dependency tracking, 14, 16
reserved words, 3.8.1, E.1
RESET COMPATIBILITY clause
of ALTER DATABASE, 10.2
reset sequence of, 10.2
RESETLOGS parameter
of CREATE CONTROLFILE, 14
RESOLVE clause
of ALTER JAVA CLASS, 10.2
of CREATE JAVA, 14
RESOLVER clause
of ALTER JAVA CLASS, 10.2
of ALTER JAVA SOURCE, 10.2
of CREATE JAVA, 14
Resource Manager, 11
resource parameters
of CREATE PROFILE, 15
RESOURCE_VIEW, 7.9.1, 7.9.2
response time
optimizing, 3.6.4.11
restore points
guaranteed, 15
preserved, 15
using
to flash back a table, 18
to flashback the database, 18
RESTRICTED SESSION system privilege, 18, 18
result cache, 16
RESULT_CACHE hint, 3.6.4.67
resumable space allocation, 11
RESUMABLE system privilege, 18
RESUME clause
of ALTER SYSTEM, 11
RETENTION parameter
of LOB storage, 16
RETRY_ON_ROW_CHANGE hint, 3.6.4.68
RETURN clause
of CREATE OPERATOR, 15
RETURNING clause
of DELETE, 17
of INSERT, 18
of UPDATE, 19, 19, 19
REUSE clause
of CREATE CONTROLFILE, 14
of file specifications, 8
REVERSE clause
of CREATE INDEX, 14
reverse indexes, 14
REVERSE parameter
of ALTER INDEX ... REBUILD, 10.2, 10.2
REVOKE CONNECT THROUGH clause
of ALTER USER, 13, 13, 13
REVOKE statement, 18
locks, B.2.2
REWRITE hint, 3.6.4.69
right outer joins, 19
roles, 18
authorization
by a password, 15
by an external service, 15
by the database, 15
by the enterprise directory service, 15
changing, 11
creating, 15
disabling
for the current session, 19, 19
enabling
for the current session, 19, 19
granting, 18, 18
system privileges for, 18
to a user, 18
to another role, 18
to PUBLIC, 18
identifying by password, 15
identifying externally, 15
identifying through enterprise directory service, 15
identifying using a package, 15
removing from the database, 17
revoking, 18
from another role, 17, 18
from PUBLIC, 18
from users, 17, 18
rollback segments
removing from the database, 17
specifying optimal size of, 8
rollback segments granting
system privileges for, 18
ROLLBACK statement, 18
rollback undo, 11, 14
ROLLUP clause
of SELECT statements, 19
ROUND (date) function, 5.8
format models, 5.8
ROUND (number) function, 5.8
routines
calling, 13
executing, 13
row constructor, 6.15
ROW EXCLUSIVE lock mode, 18
row locking, B.1
ROW SHARE lock mode, 18
row value constructor, 6.15
row values
pivoting into columns, 19
ROW_NUMBER function, 5.8
ROWDEPENDENCIES clause
of CREATE CLUSTER, 14
of CREATE TABLE, 16
ROWID data type, 3.1.2, 3.1.2.1
ROWID pseudocolumn, 2.8, 3.1.2, 3.1.2.2
rowids, 3.1.2
description of, 3.1.2
extended
base 64, 3.1.2.1
not directly available, 3.1.2.1
nonphysical, 3.1.2.2
of foreign tables, 3.1.2.2
of index-organized tables, 3.1.2.2
uses for, 2.8
ROWIDTOCHAR function, 5.8
ROWIDTONCHAR function, 5.8
row-level dependency tracking, 14, 16
row-level locking, B.1
ROWNUM pseudocolumn, 2.9
rows
adding to a table, 18
allowing movement of between partitions, 16
inserting
into partitions, 18
into remote databases, 18
into subpartitions, 18
locking, B.1
locks on, B.1
movement between partitions, 16
removing
from a cluster, 19, 19
from a table, 19, 19
from partitions and subpartitions, 17
from tables and views, 17
selecting in hierarchical order, 9.3
specifying constraints on, 8
storing if in violation of constraints, 12
RPAD function, 5.8
RR datetime format element, 3.4.2.4
RTRIM function, 5.8
run-time compilation
avoiding, 11, 13

S

SAMPLE clause
of SELECT, 19
of SELECT and subqueries, 19
SAVEPOINT statement, 19
savepoints
erasing, 13
rolling back to, 18, 18
specifying, 19
scalar subqueries, 6.13
scale
greater than precision, 3.1.1.6
of NUMBER data type, 3.1.1.6
SCHEMA clause
of CREATE JAVA, 14
schema objects, 3.7.1
defining default buffer pool for, 8
dropping, 18
in other schemas, 3.9.2
list of, 3.7.1
name resolution, 3.9.1
namespaces, 3.8.1
naming
examples, 3.8.2
guidelines, 3.8.3
rules, 3.8.1
object types, 3.1.4.1
on remote databases, 3.9.3
partitioned indexes, 3.9.4
partitioned tables, 3.9.4
parts of, 3.8
protecting location, 16
protecting owner, 16
providing alternate names for, 16
reauthorizing, 10.1.1
recompiling, 10.1.1
referring to, 3.9, 11
remote, accessing, 14
validating structure, 13
schemas
changing for a session, 11
creating, 15
definition of, 3.7.1
scientific notation, 3.4.1.1
SCN_TO_TIMESTAMP function, 5.8
SCOPE FOR clause
of ALTER MATERIALIZED VIEW, 11
of CREATE MATERIALIZED VIEW, 15
SCORE operator, 4.1
SDO_GEOMETRY data type, 3.1.8
SDO_GEORASTER data type, 3.1.8
SDO_TOPO_GEOMETRY data type, 3.1.8.2
security
enforcing, 16
security clauses
of ALTER SYSTEM, 11
segment attributes clause
of CREATE TABLE, 16
SEGMENT MANAGEMENT clause
of CREATE TABLESPACE, 16
segments
space management
automatic, 16
manual, 16
using bitmaps, 16
using free lists, 16
table
compacting, 10.2, 11, 11, 12
SELECT ANY CUBE DIMENSION system privilege, 18
SELECT ANY CUBE system privilege, 18
SELECT ANY DICTIONARY system privilege, 18
SELECT ANY MINING MODEL system privilege, 18
SELECT ANY SEQUENCE system privilege, 18
SELECT ANY TABLE system privilege, 18
select lists, 9.2
ordering, 9.5
SELECT object privilege
granting on a view, 18
on a materialized view, 18
on a mining model, 18
on a sequence, 18
on a table, 18
on a view, 18
on an OLAP cube, 18
on an OLAP cube dimension, 18
SELECT statement, 9.1, 19
self joins, 9.6.3
semijoins, 9.6.8
sequences, 2.2, 15
accessing values of, 15
changing
the increment value, 11
creating, 15
creating without limit, 15
granting system privileges for, 18
guarantee consecutive values, 15
how to use, 2.2.2
increment value, setting, 15
incrementing, 15
initial value, setting, 15
maximum value
eliminating, 11
setting, 15
setting or changing, 11
minimum value
eliminating, 11
setting, 15
setting or changing, 11
number of cached values, changing, 11
ordering values, 11
preallocating values, 15
recycling values, 11
removing from the database, 18
renaming, 18
restarting, 18
at a different number, 11
at a predefined limit, 15
values, 15
reusing, 15
stopping at a predefined limit, 15
synonyms for, 16
where to use, 2.2.1
server parameter files
creating, 15
from memory, 15
server wallet
keys, 11
service name
of remote database, 14
session control statements, 10.1.4
PL/SQL support of, 10.1.4
session locks
releasing, 11
session parameters
changing settings, 11
INSTANCE, 11
SESSION_ROLES view, 19
sessions
calculating resource cost limits, 11
changing resource cost limits, 11
disconnecting, 11
granting system privileges for, 18
limiting CPU time, 11
limiting data block reads, 11
limiting inactive periods, 11
limiting private SGA space, 11
limiting resource costs, 11
limiting total elapsed time, 11
limiting total resources, 11
modifying characteristics of, 11
restricting, 11
restricting to privileged users, 11
switching to a different instance, 11
terminating, 11
terminating across instances, 11
time zone setting, 11
SESSIONS_PER_USER parameter
of ALTER PROFILE, 11
SESSIONTIMEZONE function, 5.8
SET clause
of ALTER SESSION, 11
of ALTER SYSTEM, 11
SET conditions, 7.6.1
SET CONSTRAINT(S) statement, 19
SET DANGLING TO NULL clause
of ANALYZE, 13
SET DATABASE clause
of CREATE CONTROLFILE, 14
SET ENCRYPTION KEY clause
of ALTER SYSTEM, 11
SET ENCRYPTION WALLET clause
of ALTER SYSTEM, 11
SET function, 5.8
set operators, 4.5, 19
INTERSECT, 4.5
MINUS, 4.5
UNION, 4.5
UNION ALL, 4.5
SET ROLE statement, 19
SET STANDBY DATABASE clause
of ALTER DATABASE, 10.2
SET STATEMENT_ID clause
of EXPLAIN PLAN, 18
SET TIME_ZONE clause
of ALTER DATABASE, 10.2, 10.2
of ALTER SESSION, 11
of CREATE DATABASE, 14
SET TRANSACTION statement, 19
SET UNUSED clause
of ALTER TABLE, 12
SGA. See system global area (SGA)
SHARE ROW EXCLUSIVE lock mode, 18
SHARE UPDATE lock mode, 18
SHARED clause
of CREATE DATABASE LINK, 14
shared pool
flushing, 11
short-circuit evaluation
DECODE function, 5.8
SHRINK SPACE clause
of ALTER INDEX, 10.2
of ALTER MATERIALIZED VIEW, 11
of ALTER MATERIALIZED VIEW LOG, 11
of ALTER TABLE, 12
SHUTDOWN clause
of ALTER SYSTEM, 11
SI_AverageColor data type, 3.1.9
SI_Color data type, 3.1.9
SI_ColorHistogram data type, 3.1.9
SI_FeatureList data type, 3.1.9
SI_PositionalColorHistogram data type, 3.1.9
SI_StillImage data type, 3.1.9
SI_Texture data type, 3.1.9
siblings
ordering in a hierarchical query, 19
SIGN function, 5.8
simple comparison conditions, 7.2.1
simple expressions, 6.2
SIN function, 5.8
SINGLE TABLE clause
of CREATE CLUSTER, 14
single-row functions, 5.2
single-table insert, 18
SINH function, 5.8
SIZE clause
of ALTER CLUSTER, 10.2
of CREATE CLUSTER, 14
of file specifications, 8
SOME operator, 7.2
SOUNDEX function, 5.8
SP datetime format element suffix, 3.4.2.5
special characters
in passwords, 15
spelled numbers
specifying, 3.4.2.5
spfile
Oracle ASM, 15
SPLIT PARTITION clause
of ALTER INDEX, 10.2
of ALTER TABLE, 12
SPTH datetime format element suffix, 3.4.2.5
SQL Developer, 1.5
SQL functions, 5.1
ABS, 5.8
ACOS, 5.8
ADD_MONTHS, 5.8
aggregate functions, 5.3
analytic functions, 5.4
APPENDCHILDXML, 5.8
applied to LOB columns, 5.1
ASCII, 5.8
ASCIISTR, 5.8
ASIN, 5.8
ATAN, 5.8
ATAN2, 5.8
AVG, 5.8
BFILENAME, 5.8
BIN_TO_NUM, 5.8
BITAND, 5.8
CARDINALITY, 5.8
CAST, 5.8
CEIL, 5.8
character functions
returning character values, 5.2.2
returning number values, 5.2.3
character set functions, 5.2.4
CHARTOROWID, 5.8
CHR, 5.8
CLUSTER_ID, 5.8
CLUSTER_PROBABILITY, 5.8
CLUSTER_SET, 5.8
COALESCE, 5.8
COLLECT, 5.8
collection functions, 5.2.9
COMPOSE, 5.8
CONCAT, 5.8
conversion functions, 5.2.7
CONVERT, 5.8
CORR, 5.8
CORR_K, 5.8
CORR_S, 5.8
COS, 5.8
COSH, 5.8
COUNT, 5.8
COVAR_POP, 5.8
COVAR_SAMP, 5.8
CUBE_TABLE, 5.8
CUME_DIST, 5.8
CURRRENT_DATE, 5.8
CURRRENT_TIMESTAMP, 5.8
CV, 5.8
data cartridge functions, 5.8
data mining functions, 5.2.11
DATAOBJ_TO_PARTITION, 5.8
datetime functions, 5.2.5
DBTIMEZONE, 5.8
DECODE, 5.8
DECOMPOSE, 5.8
DELETEXML, 5.8
DENSE_RANK, 5.8
DEPTH, 5.8
DEREF, 5.8
DUMP, 5.8
EMPTY_BLOB, 5.8
EMPTY_CLOB, 5.8
encoding and decoding functions, 5.2.13
environment and identifier functions, 5.2.15
EXISTSNODE, 5.8
EXP, 5.8
EXTRACT (datetime), 5.8
EXTRACT (XML), 5.8
EXTRACTVALUE, 5.8
FEATURE_ID, 5.8
FEATURE_SET, 5.8
FEATURE_VALUE, 5.8
FIRST, 5.8
FIRST_VALUE, 5.8
FLOOR, 5.8
FROM_TZ, 5.8
general comparison functions, 5.2.6
GREATEST, 5.8
GROUP_ID, 5.8
GROUPING, 5.8
GROUPING_ID, 5.8
HEXTORAW, 5.8
hierarchical functions, 5.2.10
INITCAP, 5.8
INSERTCHILDXML, 5.8
INSERTCHILDXMLAFTER, 5.8
INSERTCHILDXMLBEFORE, 5.8
INSERTXMLAFTER, 5.8
INSERTXMLBEFORE, 5.8
INSTR, 5.8
INSTR2, 5.8
INSTR4, 5.8
INSTRB, 5.8
INSTRC, 5.8
ITERATION_NUMBER, 5.8
LAG, 5.8
large object functions, 5.2.8
LAST, 5.8
LAST_DAY, 5.8
LAST_VALUE, 5.8
LEAD, 5.8
LEAST, 5.8
LENGTH, 5.8
LENGTH2, 5.8
LENGTH4, 5.8
LENGTHB, 5.8
LENGTHC, 5.8
linear regression, 5.8
LISTAGG, 5.8
LN, 5.8
LNNVL, 5.8
LOCALTIMESTAMP, 5.8
LOG, 5.8
LOWER, 5.8
LPAD, 5.8
LTRIM, 5.8
MAKE_REF, 5.8
MAX, 5.8
MEDIAN, 5.8
MIN, 5.8
MOD, 5.8
model functions, 5.6
MONTHS_BETWEEN, 5.8
NANVL, 5.8
NCHR, 5.8
NEW_TIME, 5.8
NEXT_DAY, 5.8
NLS_CHARSET_DECL_LEN, 5.8
NLS_CHARSET_ID, 5.8
NLS_CHARSET_NAME, 5.8
NLS_INITCAP, 5.8
NLS_LOWER, 5.8
NLS_UPPER, 5.8
NLSSORT, 5.8
NTH_VALUE, 5.8
NTILE, 5.8
NULLIF, 5.8
NULL-related functions, 5.2.14
numeric functions, 5.2.1
NUMTODSINTERVAL, 5.8
NUMTOYMINTERVAL, 5.8
NVL, 5.8
NVL2, 5.8
object reference functiions, 5.5
OLAP functions, 5.7
ORA_DST_AFFECTED, 5.8
ORA_DST_CONVERT, 5.8
ORA_DST_ERROR, 5.8
ORA_HASH, 5.8
PATH, 5.8
PERCENT_RANK, 5.8
PERCENTILE_CONT, 5.8
PERCENTILE_DISC, 5.8
POWER, 5.8
POWERMULTISET, 5.8
POWERMULTISET_BY_CARDINALITY, 5.8
PREDICTION, 5.8
PREDICTION_BOUNDS, 5.8
PREDICTION_COST, 5.8
PREDICTION_DETAILS, 5.8
PREDICTION_PROBABILITY, 5.8
PREDICTION_SET, 5.8
PRESENTNNV, 5.8
PRESENTV, 5.8
PREVIOUS, 5.8
RANK, 5.8
RATIO_TO_REPORT, 5.8
RAWTOHEX, 5.8
RAWTONHEX, 5.8
REF, 5.8
REFTOHEX, 5.8
REGEXP_COUNT, 5.8
REGEXP_INSTR, 5.8
REGEXP_REPLACE, 5.8
REGEXP_SUBSTR, 5.8
REGR_AVGX, 5.8
REGR_AVGY, 5.8
REGR_COUNT, 5.8
REGR_INTERCEPT, 5.8
REGR_R2, 5.8
REGR_SLOPE, 5.8
REGR_SXX, 5.8
REGR_SXY, 5.8
REGR_SYY, 5.8
REMAINDER, 5.8
REPLACE, 5.8
ROUND (date), 5.8
ROUND (number), 5.8
ROW_NUMBER, 5.8
ROWIDTOCHAR, 5.8
ROWIDTONCHAR, 5.8
RPAD, 5.8
RTRIM, 5.8
SCN_TO_TIMESTAMP, 5.8
SESSIONTIMEZONE, 5.8
SET, 5.8
SIGN, 5.8
SIN, 5.8
single-row functions, 5.2
SINH, 5.8
SOUNDEX, 5.8
SQRT, 5.8
STATS_BINOMIAL_TEST, 5.8
STATS_CROSSTAB, 5.8
STATS_F_TEST, 5.8
STATS_KS_TEST, 5.8
STATS_MODE, 5.8
STATS_MW_TEST, 5.8
STATS_ONE_WAY_ANOVA, 5.8
STATS_T_TEST_INDEP, 5.8, 5.8
STATS_T_TEST_INDEPU, 5.8, 5.8
STATS_T_TEST_ONE, 5.8, 5.8
STATS_T_TEST_PAIRED, 5.8, 5.8
STATS_WSR_TEST, 5.8
STDDEV, 5.8
STDDEV_POP, 5.8
STDDEV_SAMP, 5.8
SUBSTR, 5.8
SUBSTR2, 5.8
SUBSTR4, 5.8
SUBSTRB, 5.8
SUBSTRC, 5.8
SUM, 5.8
SYS_CONNECT_BY_PATH, 5.8
SYS_CONTEXT, 5.8
SYS_DBURIGEN, 5.8
SYS_EXTRACT_UTC, 5.8
SYS_GUID, 5.8
SYS_TYPEID, 5.8
SYS_XMLAGG, 5.8
SYS_XMLGEN, 5.8
SYSDATE, 5.8
SYSTIMESTAMP, 5.8
TAN, 5.8
TANH, 5.8
TIMESTAMP_TO_SCN, 5.8
TO_BINARY_DOUBLE, 5.8
TO_BINARY_FLOAT, 5.8
TO_BLOB, 5.8
TO_CHAR (character), 5.8
TO_CHAR (datetime), 5.8
TO_CHAR (number), 5.8
TO_CLOB, 5.8
TO_DATE, 5.8
TO_DSINTERVAL, 5.8
TO_LOB, 5.8
TO_MULTI_BYTE, 5.8
TO_NCHAR (character), 5.8
TO_NCHAR (datetime), 5.8
TO_NCHAR (number), 5.8
TO_NCLOB, 5.8
TO_NUMBER, 5.8
TO_SINGLE_BYTE, 5.8
TO_TIMESTAMP, 5.8
TO_TIMESTAMP_TZ, 5.8
TO_YMINTERVAL, 5.8
TRANSLATE, 5.8
TRANSLATE ... USING, 5.8
TREAT, 5.8
TRIM, 5.8
TRUNC (date), 5.8
TRUNC (number), 5.8
t-test, 5.8
TZ_OFFSET, 5.8
UID, 5.8
UNISTR, 5.8
UPDATEXML, 5.8
UPPER, 5.8
USER, 5.8
USERENV, 5.8
VALUE, 5.8
VAR_POP, 5.8
VAR_SAMP, 5.8
VARIANCE, 5.8
VSIZE, 5.8
WIDTH_BUCKET, 5.8
XML functions, 5.2.12
XMLAGG, 5.8
XMLCAST, 5.8
XMLCDATA, 5.8
XMLCOLATTVAL, 5.8
XMLCOMMENT, 5.8
XMLCONCAT, 5.8
XMLDIFF, 5.8
XMLELEMENT, 5.8
XMLEXISTS, 5.8
XMLFOREST, 5.8
XMLISVALID, 5.8
XMLPARSE, 5.8
XMLPATCH, 5.8
XMLPI, 5.8
XMLQUERY, 5.8
XMLROOT, 5.8
XMLSEQUENCE, 5.8
XMLSERIALIZE, 5.8
XMLTABLE, 5.8
XMLTRANSFORM, 5.8
SQL statements
ALTER FLASHBACK ARCHIVE, 10.2
auditing
by access, 13
by session, 13
stopping, 18
successful, 13
CREATE FLASHBACK ARCHIVE, 14
DDL, 10.1.1
determining the execution plan for, 18
DML, 10.1.2
DROP FLASHBACK ARCHIVE, 17
organization of, 10.2
rolling back, 18
session control, 10.1.4
space allocation, resumable, 11
storage in the result cache, 16
suspending and completing, 11
system control, 10.1.5
tracking the occurrence in a session, 13
transaction control, 10.1.3
type of, 10.1
undoing, 18
SQL:99 standards, 1.2
SQL*Loader inserts, logging, 10.2
SQL/DS data types, 3.1.3
restrictions on, 3.1.3
SQRT function, 5.8
standalone procedures
dropping, 17
standard SQL, C
Oracle extensions to, C.12
standby database
synchronizing with primary database, 11
standby databases
activating, 10.2
and Data Guard, 10.2
committing to primary status, 10.2
controlling use, 10.2
converting to physical standby, 10.2
designing media recovery, 10.2
mounting, 10.2
recovering, 10.2
STAR_TRANSFORMATION hint, 3.6.4.70
STAR_TRANSFORMATION_ENABLED initialization parameter, 3.6.4.70
START LOGICAL STANDBY APPLY clause
of ALTER DATABASE, 10.2
START WITH clause
of ALTER MATERIALIZED VIEW ... REFRESH, 11
of queries and subqueries, 19
of SELECT and subqueries, 19
START WITH parameter
of CREATE SEQUENCE, 15
startup_clauses
of ALTER DATABASE, 10.2
STATEMENT_QUEUING hint, 3.6.4.71
statistics
collection during index rebuild, 10.2
deleting from the data dictionary, 13
forcing disassociation, 17
on index usage, 10.2
on scalar object attributes
collecting, 13
on schema objects
collecting, 13
deleting, 13
user-defined
dropping, 17, 17, 17, 18, 18
statistics types
associating
with columns, 13
with domain indexes, 13
with functions, 13
with indextypes, 13
with object types, 13
with packages, 13
disassociating
from columns, 17
from domain indexes, 17
from functions, 17
from indextypes, 17
from object types, 17
from packages, 17
STATS_BINOMIAL_TEST function, 5.8
STATS_CROSSTAB function, 5.8
STATS_F_TEST function, 5.8
STATS_KS_TEST function, 5.8
STATS_MODE function, 5.8
STATS_MW_TEST function, 5.8
STATS_ONE_WAY_ANOVA function, 5.8
STATS_T_TEST_INDEP function, 5.8, 5.8
STATS_T_TEST_INDEPU function, 5.8, 5.8
STATS_T_TEST_ONE function, 5.8, 5.8
STATS_T_TEST_PAIRED function, 5.8, 5.8
STATS_WSR_TEST function, 5.8
STDDEV function, 5.8
STDDEV_POP function, 5.8
STDDEV_SAMP function, 5.8
STOP LOGICAL STANDBY clause
of ALTER DATABASE, 10.2, 10.2
STORAGE clause
of ALTER CLUSTER, 10.2
of ALTER INDEX, 10.2
of ALTER MATERIALIZED VIEW LOG, 11
of CREATE MATERIALIZED VIEW LOG, 15
of CREATE TABLE, 8
of CREATE MATERIALIZED VIEW LOG. See CREATE TABLE
storage parameters
default, changing, 12
resetting, 19, 19
STORE IN clause
of ALTER TABLE, 12, 16
stored functions, 14
string literals. See text literals.
conversion to database character set, 3.3.1
strings
converting to ASCII values, 5.8
converting to unicode, 5.8
Structured Query Language (SQL)
description, 1
functions, 5.1
keywords, A.1.1
Oracle Tools support of, 1.5
parameters, A.1.1
standards, 1.2, C
statements
determining the cost of, 18
syntax, 10.2, A.1
structures
locking, B.2
subexpressions
of regular expressions, 5.8, 5.8
SUBMULTISET condition, 7.6.4
SUBPARTITION BY HASH clause
of CREATE TABLE, 16, 16
SUBPARTITION BY LIST clause
of CREATE TABLE, 16
SUBPARTITION clause
of ANALYZE, 13
of DELETE, 17
of INSERT, 18
of LOCK TABLE, 18
of UPDATE, 19
subpartition template
creating, 12
replacing, 12
subpartition-extended table names
in DML statements, 3.9.4
restrictions on, 3.9.4
syntax, 3.9.4
subpartitions
adding, 12, 12
adding rows to, 18
allocating extents for, 12
coalescing, 12, 12
converting into nonpartitioned tables, 12
creating, 16
creating a template for, 12, 16
deallocating unused space from, 12
exchanging with tables, 12
hash, 16
inserting rows into, 18
list, 16
list, adding, 12
locking, 18
logging insert operations, 12
moving to a different segment, 12
physical attributes
changing, 12
removing rows from, 12, 17
renaming, 12
revising values in, 19
specifying, 16
template, creating, 16
template, dropping, 12
template, replacing, 12
subqueries, 9.1, 9.7, 19, 19, 19
containing subqueries, 9.7
correlated, 9.7
defined, 9.1
extended subquery unnesting, 9.8
inline views, 9.7
nested, 9.7
of past data, 19
scalar, 6.13
to insert table data, 16
unnesting, 9.8
using in place of expressions, 6.13
SUBSTR function, 5.8
SUBSTR2 function, 5.8
SUBSTR4 function, 5.8
SUBSTRB function, 5.8
SUBSTRC function, 5.8
subtotal values
deriving, 19
subtypes
dropping safely, 18
SUM function, 5.8
supplemental logging
identification key (full), 10.2
minimal, 10.2
SUSPEND clause
of ALTER SYSTEM, 11
sustained standby recovery mode, 10.2
SWITCH LOGFILE clause
of ALTER SYSTEM, 11
SYNC WITH PRIMARY
clause of ALTER SESSION, 11
synonyms
changing the definition of, 18
creating, 16
granting system privileges for, 18
local, 16
private, dropping, 18
public, 16
dropping, 18
remote, 16
removing from the database, 18
renaming, 18, 18
synonyms for, 16
syntax diagrams, A.1
loops, A.1.3
multipart diagrams, A.1.4
SYS user
assigning password for, 14
SYS_CONNECT_BY_PATH function, 5.8
SYS_CONTEXT function, 5.8
SYS_DBURIGEN function, 5.8
SYS_EXTRACT_UTC function, 5.8
SYS_GUID function, 5.8
SYS_NC_ROWINFO$ column, 16, 17
SYS_SESSION_ROLES namespace, 5.8
SYS_TYPEID function, 5.8
SYS_XMLAGG function, 5.8
SYS_XMLGEN function, 5.8
SYSAUX clause
of CREATE DATABASE, 14
SYSAUX tablespace
creating, 14, 16
SYSDATE function, 5.8
SYSDBA system privilege, 18
SYSOPER system privilege, 18
system change numbers
obtaining, 2.7
system control statements, 10.1.5
PL/SQL support of, 10.1.5
system global area
flushing, 11, 11
updating, 11
system parameters
GLOBAL_TOPIC_ENABLED, 11
system partitioning, 16
system privileges
ADMINISTER ANY SQL TUNING SET, 18
ADMINISTER DATABASE TRIGGER, 18
ADMINISTER SQL MANAGEMENT OBJECT, 18, 18
ADMINISTER SQL TUNING SET, 18
ADVISOR, 18
ALTER ANY CLUSTER, 18
ALTER ANY CUBE, 18
ALTER ANY CUBE DIMENSION, 18
ALTER ANY DIMENSION, 18
ALTER ANY INDEX, 18
ALTER ANY INDEXTYPE, 18
ALTER ANY LIBRARY, 18
ALTER ANY MATERIALIZED VIEW, 18
ALTER ANY MINING MODEL, 18
ALTER ANY OPERATOR, 18
ALTER ANY OUTLINE, 18
ALTER ANY PROCEDURE, 18
ALTER ANY ROLE, 18
ALTER ANY SEQUENCE, 18
ALTER ANY SQL PROFILE, 18
ALTER ANY TABLE, 18
ALTER ANY TRIGGER, 18
ALTER ANY TYPE, 18
ALTER DATABASE, 18
ALTER DATABASE LINK, 18
ALTER PROFILE, 18
ALTER PUBLIC DATABASE LINK, 18
ALTER RESOURCE COST, 18
ALTER ROLLBACK SEGMENT, 18
ALTER SESSION, 18
ALTER SYSTEM, 18
ALTER TABLESPACE, 18
ALTER USER, 18
ANALYZE ANY, 18
AUDIT ANY, 18
AUDIT SYSTEM, 18
BACKUP ANY TABLE, 18
BECOME USER, 18
CHANGE NOTIFICATION, 18
COMMENT ANY MINING MODEL, 18
COMMENT ANY TABLE, 18
CREATE ANY CLUSTER, 18
CREATE ANY CONTEXT, 18
CREATE ANY CUBE, 18
CREATE ANY CUBE BUILD PROCESS, 18
CREATE ANY CUBE DIMENSION, 18
CREATE ANY DIMENSION, 18
CREATE ANY DIRECTORY, 18
CREATE ANY INDEX, 18
CREATE ANY INDEXTYPE, 18
CREATE ANY JOB, 18
CREATE ANY LIBRARY, 18
CREATE ANY MATERIALIZED VIEW, 18
CREATE ANY MEASURE FOLDER, 18
CREATE ANY MINING MODEL, 18
CREATE ANY OPERATOR, 18
CREATE ANY OUTLINE, 18
CREATE ANY PROCEDURE, 18
CREATE ANY SEQUENCE, 18
CREATE ANY SQL PROFILE, 18
CREATE ANY SYNONYM, 18
CREATE ANY TABLE, 18
CREATE ANY TRIGGER, 18
CREATE ANY TYPE, 18
CREATE ANY VIEW, 18
CREATE CLUSTER, 18
CREATE CUBE, 18
CREATE CUBE BUILD PROCESS, 18
CREATE CUBE DIMENSION, 18
CREATE DATABASE LINK, 18
CREATE DIMENSION, 18
CREATE EXTERNAL JOB, 18
CREATE INDEXTYPE, 18
CREATE JOB, 18
CREATE LIBRARY, 18
CREATE MATERIALIZED VIEW, 18
CREATE MEASURE FOLDER, 18
CREATE MINING MODEL, 18
CREATE OPERATOR, 18
CREATE PROCEDURE, 18
CREATE PROFILE, 18
CREATE PUBLIC DATABASE LINK, 18
CREATE PUBLIC SYNONYM, 18
CREATE ROLE, 18
CREATE ROLLBACK SEGMENT, 18
CREATE SEQUENCE, 18
CREATE SESSION, 18
CREATE SYNONYM, 18
CREATE TABLE, 18
CREATE TABLESPACE, 18
CREATE TRIGGER, 18
CREATE TYPE, 18
CREATE USER, 18
CREATE VIEW, 18
DEBUG ANY PROCEDURE, 18
DELETE ANY CUBE DIMENSION, 18
DELETE ANY MEASURE FOLDER, 18
DELETE ANY TABLE, 18
DROP ANY CLUSTER, 18
DROP ANY CONTEXT, 18
DROP ANY CUBE, 18
DROP ANY CUBE BUILD PROCESS, 18
DROP ANY CUBE DIMENSION, 18
DROP ANY DIMENSION, 18
DROP ANY DIRECTORY, 18
DROP ANY INDEX, 18
DROP ANY INDEXTYPE, 18
DROP ANY LIBRARY, 18
DROP ANY MATERIALIZED VIEW, 18
DROP ANY MEASURE FOLDER, 18
DROP ANY MINING MODEL, 18
DROP ANY OPERATOR, 18
DROP ANY OUTLINE, 18
DROP ANY PROCEDURE, 18
DROP ANY ROLE, 18
DROP ANY SEQUENCE, 18
DROP ANY SQL PROFILE, 18
DROP ANY SYNONYM, 18
DROP ANY TABLE, 18
DROP ANY TRIGGER, 18
DROP ANY TYPE, 18
DROP ANY VIEW, 18
DROP PROFILE, 18
DROP PUBLIC DATABASE LINK, 18
DROP PUBLIC SYNONYM, 18
DROP ROLLBACK SEGMENT, 18
DROP TABLESPACE, 18
DROP USER, 18
EXECUTE ANY CLASS, 18
EXECUTE ANY INDEXTYPE, 18
EXECUTE ANY LIBRARY, 18
EXECUTE ANY OPERATOR, 18
EXECUTE ANY PROCEDURE, 18
EXECUTE ANY PROGRAM, 18
EXECUTE ANY TYPE, 18
EXEMPT ACCESS POLICY, 18
EXEMPT REDACTION POLICY, 18
FLASHBACK ANY TABLE, 18, 18, 18
FLASHBACK ARCHIVE ADMINISTER, 18
for job scheduler tasks, 18
for the Advisor framework, 18
FORCE ANY TRANSACTION, 18
FORCE TRANSACTION, 18
GLOBAL QUERY REWRITE, 18
GRANT ANY OBJECT PRIVILEGE, 18
GRANT ANY PRIVILEGE, 18
GRANT ANY ROLE, 18
granting, 15, 18
to a role, 18
to a user, 18
to PUBLIC, 18
INSERT ANY CUBE DIMENSION, 18
INSERT ANY MEASURE FOLDER, 18
INSERT ANY TABLE, 18
list of, 13, 18
LOCK ANY TABLE, 18
MANAGE SCHEDULER, 18
MANAGE TABLESPACE, 18
MERGE ANY VIEW, 18
ON COMMIT REFRESH, 18
QUERY REWRITE, 18
RESTRICTED SESSION, 18, 18
RESUMABLE, 18
revoking, 18
from a role, 18
from a user, 18
from PUBLIC, 18
SELECT ANY CUBE, 18
SELECT ANY CUBE DIMENSION, 18
SELECT ANY DICTIONARY, 18
SELECT ANY MINING MODEL, 18
SELECT ANY SEQUENCE, 18
SELECT ANY TABLE, 18
SYSDBA, 18
SYSOPER, 18
UNDER ANY TYPE, 18
UNDER ANY VIEW, 18
UNLIMITED TABLESPACE, 18
UPDATE ANY CUBE, 18
UPDATE ANY CUBE BUILD PROCESS, 18
UPDATE ANY CUBE DIMENSION, 18
UPDATE ANY TABLE, 18
SYSTEM tablespace
locally managed, 14
SYSTEM user
assigning password for, 14
SYSTIMESTAMP function, 5.8

T

TABLE clause
of ANALYZE, 13
of INSERT, 18
of SELECT, 19, 19
of TRUNCATE, 19
of UPDATE, 19, 19
TABLE collection expression, 19
table compression, 11, 12, 15, 16
basic, 16
during bulk load operations, 16
for archiving data, 16
Hybrid Columnar, 16
OLTP, 16
table locks
and queries, 18
disabling, 12
duration of, 18
enabling, 12
EXCLUSIVE, 18, 18
modes of, 18
on partitions, 18
on remote database, 18
on subpartitions, 18
ROW EXCLUSIVE, 18, 18
ROW SHARE, 18, 18
SHARE, 18
SHARE ROW EXCLUSIVE, 18
SHARE UPDATE, 18
table partitions
compression of, 12, 16
table REF constraints, 8
of CREATE TABLE, 16
tables
adding a constraint to, 12
adding rows to, 18
aliases, 3.9.5
in CREATE INDEX, 14
in DELETE, 17
allocating extents for, 12
assigning to a cluster, 16
changing degree of parallelism on, 12
changing existing values in, 19
collecting statistics on, 13
comments on, 13
compression of, 12, 16
creating, 16
multiple, 15
creating comments about, 13
data stored outside database, 16
deallocating unused space from, 12
default physical attributes
changing, 12
degree of parallelism
specifying, 16
disassociating statistics types from, 18
dropping
along with cluster, 17
along with owner, 18
indexes of, 18
partitions of, 18
enabling tracking, 16
external, 16
creating, 16
restrictions on, 16
externally organized, 16
flashing back to an earlier version, 18
granting system privileges for, 18
heap organized, 16
index-organized, 16
overflow segment for, 16
space in index block, 16
inserting rows with a subquery, 16
inserting using the direct-path method, 18
joining in a query, 19
LOB storage of, 8
locking, 18
logging
insert operations, 12
table creation, 16
migrated and chained rows in, 13
moving, 12
moving to a new segment, 12
moving, index-organized, 12
nested
storage characteristics, 16
object
creating, 16
querying, 16
of XMLType, creating, 16
organization, defining, 16
parallel creation of, 16
parallelism
setting default degree, 16
partition attributes of, 12
partitioning, 3.9.4, 16, 16
allowing rows to move between partitions, 12
default attributes of, 12
physical attributes
changing, 12
purging from the recycle bin, 18
read-only mode, 12
read/write mode, 12
reference-partitioned, 12, 12, 16
relational
creating, 16
remote, accessing, 14
removing from the database, 18
removing rows from, 17
renaming, 12, 18
restricting
records in a block, 12
retrieving data from, 19
saving blocks in a cache, 16
SQL examples, 16
storage attributes
defining, 16
storage characteristics
defining, 8
storage properties of, 16, 16
subpartition attributes of, 12
synonyms for, 16
tablespace for
defining, 16, 16
temporary
duration of data, 16
session-specific, 16
transaction specific, 16
unclustering, 17
updating through views, 17
validating structure, 13
XMLType, querying, 16
TABLESPACE clause
of ALTER INDEX ... REBUILD, 10.2
of CREATE CLUSTER, 14
of CREATE INDEX, 14
of CREATE MATERIALIZED VIEW, 15
of CREATE MATERIALIZED VIEW LOG, 15
of CREATE TABLE, 16
tablespaces, 12
allocating space for users, 17
allowing write operations on, 12
automatic segment-space management, 16
backing up data files, 12
bigfile, 16
database default, 14
default temporary, 14
resizing, 12
undo, 14
bringing online, 12, 16
coalescing free extents, 12
converting
from permanent to temporary, 12
from temporary to permanent, 12
creating, 16
data files
adding, 12
renaming, 12
default, 10.2
specifying for a user, 13
default permanent, 14
default temporary, 10.2
learning name of, 10.2
designing media recovery, 10.2
dropping contents, 18
encrypting, 8, 16
ending online backup, 12
extent size, 16
granting system privileges for, 18
in FLASHBACK mode, 12, 16
in FORCE LOGGING mode, 12, 16
locally managed, 8
altering, 12
logging attribute, 12, 16
managing extents of, 16
read only, 12
reconstructing lost or damaged, 10.2, 10.2
recovering, 10.2, 10.2
removing from the database, 18
renaming, 12
size of free extents in, 12
smallfile, 16
database default, 14
default temporary, 14
undo, 14
specifying
data files for, 16
for a table, 16
for a user, 17
for index rebuild, 12
taking offline, 12, 16
temp files
adding, 12
temporary
creating, 16
defining for the database, 14
shrinking, 12
specifying for a user, 13, 17
undo
altering, 12
creating, 14, 16
dropping, 18
TAN function, 5.8
TANH function, 5.8
TDE. See Transparent Data Encryption
temp files
bringing online, 10.2
defining for a tablespace, 16, 16, 16
defining for the database, 14
disabling autoextend, 10.2
dropping, 10.2, 12
enabling autoextend, 8, 10.2
extending automatically, 8
renaming, 10.2
resizing, 10.2
reusing, 8
shrinking, 12
size of, 8
specifying, 8, 8
taking offline, 10.2
TEMPFILE clause
of ALTER DATABASE, 10.2, 10.2
TEMPORARY clause
of ALTER TABLESPACE, 12
of CREATE TABLESPACE, 16
temporary tables
creating, 16, 16
session-specific, 16
transaction-specific, 16
TEMPORARY TABLESPACE clause
of ALTER USER, 13
of CREATE USER, 17
of ALTER USER. See CREATE USER
temporary tablespace groups
reassigning for a user, 13
specifying for a user, 17
temporary tablespaces
creating, 16
default, 10.2
specifying extent management during database creation, 14
specifying for a user, 13, 17
TEST clause
of ALTER DATABASE ... RECOVER, 10.2
testing for a set, 7.6.1
TH datetime format element suffix, 3.4.2.5
throughput
optimizing, 3.6.4.1
THSP datetime format element suffix, 3.4.2.5
TIME data type
DB2, 3.1.3, 3.1.3
SQL/DS, 3.1.3, 3.1.3
time format models
short, 3.4.1.1, 3.4.2.1.2
time zone
changing time zone data file, 5.8
converting data to particular, 6.7
determining for session, 5.8
formatting, 3.4.2.1.2
setting for the database, 14
TIME_ZONE session parameter, 11
timestamp
converting to local time zone, 6.7
TIMESTAMP data type, 3.1.1.11
DB2, 3.1.3, 3.1.3
SQL/DS, 3.1.3, 3.1.3
TIMESTAMP WITH LOCAL TIME ZONE data type, 3.1.1.13
TIMESTAMP WITH TIME ZONE data type, 3.1.1.12
TIMESTAMP_TO_SCN function, 5.8
TO SAVEPOINT clause
of ROLLBACK, 18
TO_BINARY_DOUBLE function, 5.8
TO_BINARY_FLOAT function, 5.8
TO_BLOB function, 5.8
TO_CHAR (character) function, 5.8
TO_CHAR (datetime) function, 5.8
format models, 3.4.2, 3.4.3
TO_CHAR (number) function, 5.8
format models, 3.4.1, 3.4.3
TO_CLOB function, 5.8
TO_DATE function, 5.8
format models, 3.4.2, 3.4.2.4, 3.4.3
TO_DSINTERVAL function, 5.8
TO_LOB function, 5.8
TO_MULTI_BYTE function, 5.8
TO_NCHAR (character) function, 5.8
TO_NCHAR (datetime) function, 5.8
TO_NCHAR (number) function, 5.8
TO_NCLOB function, 5.8
TO_NUMBER function, 5.8
format models, 3.4.1
TO_SINGLE_BYTE function, 5.8
TO_TIMESTAMP function, 5.8
TO_TIMESTAMP_TZ function, 5.8
TO_YMINTERVAL function, 5.8
top-level SQL statements, 13
top-N reporting, 2.9, 5.8, 5.8, 5.8
tracking
enabling for a table, 12, 16
transaction control statements, 10.1.3
PL/SQL support of, 10.1.3
transactions
allowing to complete, 11
assigning
rollback segment to, 19
automatically committing, 13
changes, making permanent, 13
commenting on, 13
distributed, forcing, 11
ending, 13
implicit commit of, 10.1.1, 10.1.2, 10.1.4, 10.1.5
in-doubt
committing, 13
forcing, 13
resolving, 19
isolation level, 19
locks, releasing, 13
naming, 19
read-only, 19
read/write, 19
rolling back, 11, 18
to a savepoint, 18
savepoints for, 19
TRANSLATE ... USING function, 5.8
TRANSLATE function, 5.8
Transparent Data Encryption, 16
master key, 11
TREAT function, 5.8
triggers
compiling, 13
creating, 16
database
altering, 13
dropping, 18, 18
disabling, 12, 13
enabling, 12, 13, 13, 16
granting system privileges for, 18
INSTEAD OF
dropping, 17
re-creating, 16
removing from the database, 18
renaming, 13
TRIM function, 5.8
TRUNC (date) function, 5.8
format models, 5.8
TRUNC (number) function, 5.8
TRUNCATE PARTITION clause
of ALTER TABLE, 12
TRUNCATE SUBPARTITION clause
of ALTER TABLE, 12
TRUNCATE_CLUSTER statement, 19
TRUNCATE_TABLE statement, 19
type constructor expressions, 6.14
types. See object types or data types
TYPES clause
of ASSOCIATE STATISTICS, 13, 13
of DISASSOCIATE STATISTICS, 17
TZ_OFFSET function, 5.8

U

UID function, 5.8
unary operators, 4.1.1
UNDER ANY TYPE system privilege, 18
UNDER ANY VIEW system privilege, 18
UNDER clause
of CREATE VIEW, 17
UNDER object privilege
on a type, 18
on a view, 18
UNDER_PATH condition, 7.9.2
undo
rollback, 11, 14
system managed, 11, 14
UNDO tablespace clause
of CREATE DATABASE, 14
of CREATE TABLESPACE, 16
undo tablespaces
creating, 14, 16
dropping, 18
modifying, 12
preserving unexpired data, 12, 16
UNDO_RETENTION initialization parameter
setting with ALTER SYSTEM, 18
UNIFORM clause
of CREATE TABLESPACE, 16
UNION ALL set operator, 4.5, 19
UNION set operator, 4.5, 19
UNIQUE clause
of CREATE INDEX, 14
of CREATE TABLE, 16
of SELECT, 19
unique constraints
conditional, 14
enabling, 16
index on, 16
unique elements of, 5.8
unique indexes, 14
unique queries, 19
UNISTR function, 5.8
universal rowids. See urowids
and foreign tables, 3.1.2.2
and index-organized tables, 3.1.2.2
description of, 3.1.2.2
UNLIMITED TABLESPACE system privilege, 18
UNNEST hint, 3.6.4.72
unnesting collections, 19
examples, 19
unnesting subqueries, 9.8
unpivot operations, 19
examples, 19
syntax, 19
UNQUIESCE clause
of ALTER SYSTEM, 11
UNRECOVERABLE, 10.2, 16
See also NOLOGGING clause
unsorted indexes, 14
UNUSABLE clause
of ALTER INDEX, 10.2
UNUSABLE LOCAL INDEXES clause
of ALTER MATERIALIZED VIEW, 11
of ALTER TABLE, 12
UPDATE ANY CUBE BUILD PROCESS system privilege, 18
UPDATE ANY CUBE DIMENSION system privilege, 18
UPDATE ANY CUBE system privilege, 18
UPDATE ANY TABLE system privilege, 18
UPDATE BLOCK REFERENCES clause
of ALTER INDEX, 10.2, 10.2
UPDATE GLOBAL INDEXES clause
of ALTER TABLE, 12
UPDATE object privilege
on a table, 18
on a view, 18
on an OLAP cube, 18
on an OLAP cube dimension, 18
update operations
collecting supplemental log data for, 10.2
UPDATE SET clause
of MERGE, 18
UPDATE statement, 19
updates
and simultaneous insert, 18
using MERGE, 18, 18
UPDATEXML function, 5.8
UPGRADE clause
of ALTER DATABASE, 10.2
of ALTER TABLE, 12
UPPER function, 5.8
URLs
generating, 5.8
UROWID data type, 3.1.2.2
USE_CONCAT hint, 3.6.4.73
USE_HASH hint, 3.6.4.74
USE_MERGE hint, 3.6.4.75
USE_NL hint, 3.6.4.76
USE_NL_WITH_INDEX hint, 3.6.4.77
USE_PRIVATE_OUTLINES session parameter, 11
USE_STORED_OUTLINES session parameter, 11, 11
USER function, 5.8
user groups
adding or dropping a member, 10.2
adding to a disk group, 10.2
dropping from a disk group, 10.2
USER SYS clause
of CREATE DATABASE, 14
USER SYSTEM clause
of CREATE DATABASE, 14
USER_COL_COMMENTS data dictionary view, 13
USER_INDEXTYPE_COMMENTS data dictionary view, 13
USER_MVIEW_COMMENTS data dictionary view, 13
USER_OPERATOR_COMMENTS data dictionary view, 13
USER_TAB_COMMENTS data dictionary view, 13
user-defined functions, 5.8
name precedence of, 5.8
naming conventions, 5.8
user-defined operators, 4.7
user-defined statistics
dropping, 17, 17, 17, 18, 18
user-defined types, 3.1.4
USERENV function, 5.8
USERENV namespace, 5.8
users
allocating space for, 17
and database links, 14
assigning
default roles, 13
profiles, 17
authenticating, 13
authenticating to a remote server, 14
changing authentication, 13
creating, 17
default tablespaces for, 13, 17
denying access to tables and views, S18
external, 15, 17
global, 15, 17
granting system privileges for, 18
local, 15, 17
locking accounts, 17
operating system
adding to a disk group, 10.2
dropping from a disk group, 10.2
password expiration of, 17
removing from the database, 18
SQL examples, 17
temporary tablespaces for, 13, 17
USING BFILE clause
of CREATE JAVA, 14, 14
USING BLOB clause
of CREATE JAVA, 14
USING clause
of ALTER INDEXTYPE, 10.2
of ASSOCIATE STATISTICS, 13, 13
of CREATE DATABASE LINK, 14
of CREATE INDEXTYPE, 14
USING CLOB clause
of CREATE JAVA, 14
USING INDEX clause
of ALTER MATERIALIZED VIEW, 11
of ALTER TABLE, 12
of constraints, 8
of CREATE MATERIALIZED VIEW, 15
of CREATE TABLE, 16
USING NO INDEX clause
of CREATE MATERIALIZED VIEW, 15
USING ROLLBACK SEGMENT clause
of ALTER MATERIALIZED VIEW ... REFRESH, 11
of CREATE MATERIALIZED VIEW, 15
UTC
extracting from a datetime value, 5.8
UTC offset
replacing with time zone region name, 3.3.3
UTLCHN.SQL script, 13
UTLEXPT1.SQL script, 12
UTLXPLAN.SQL script, 18

V

VALIDATE clause
of DROP TYPE, 18
VALIDATE REF UPDATE clause
of ANALYZE, 13
VALIDATE STRUCTURE clause
of ANALYZE, 13
validation
of clusters, 13
of database objects
offline, 13
of database objects, online, 13
of indexes, 13
of tables, 13
VALUE function, 5.8
VALUES clause
of CREATE INDEX, 14
of INSERT, 18
VALUES LESS THAN clause
of CREATE TABLE, 16
VAR_POP function, 5.8
VAR_SAMP function, 5.8
VARCHAR data type, 3.1.1.5
VARCHAR2 data type, 3.1.1.4
converting to NUMBER, 3.4.1
VARGRAPHIC data type
DB2, 3.1.3, 3.1.3
SQL/DS, 3.1.3, 3.1.3
VARIANCE function, 5.8
VARRAY clause
of ALTER TABLE, 12, 12
VARRAY column properties
of ALTER TABLE, 12, 12, 12
of CREATE MATERIALIZED VIEW, 15, 15
of CREATE TABLE, 16, 16
varrays, 3.1.4.3
changing returned value, 12
compared with nested tables, 3.2.5
comparison rules, 3.2.5
creating, 17
dropping the body of, 18
dropping the specification of, 18
modifying column properties, 12
storage characteristics, 12, 12, 16
storing out of line, 3.1.4.3
version queries
pseudocolumns for, 2.3
view constraints, 8, 17
and materialized views, 8
dropping, 18
modifying, 13
views
base tables
adding rows, 18
changing
definition, 18
values in base tables, 19
creating
before base tables, 17
comments about, 13
multiple, 15
creating object subviews, 17
defining, 17
dropping constraints on, 13
editioning, 17
granting system privileges for, 18
modifying constraints on, 13
object, creating, 17
recompiling, 13
re-creating, 17
remote, accessing, 14
removing
from the database, 18
rows from the base table of, 17
renaming, 18
retrieving data from, 19
subquery of, 17
restricting, 17
synonyms for, 16
updatable, 17
with joins
and key-preserved tables, 17
making updatable, 17
XMLType, 17
XMLType, creating, 17
XMLType, querying, 17
virtual columns
adding to a table, 12
creating, 16
modifying, 12
VSIZE function, 5.8

W

WHENEVER NOT SUCCESSFUL clause
of NOAUDIT, 18
WHENEVER SUCCESSFUL clause
of AUDIT sql_statements, 13
of NOAUDIT, 18
WHERE clause
of DELETE, 17
of queries and subqueries, 19
of SELECT, 9.3
of UPDATE, 19
WIDTH_BUCKET function, 5.8
WITH ... AS clause
of SELECT, 19
WITH ADMIN OPTION clause
of GRANT, 18
WITH CHECK OPTION clause
of CREATE VIEW, 17, 17
of DELETE, 17
of INSERT, 18
of SELECT, 19
of UPDATE, 19
WITH GRANT OPTION clause
of GRANT, 18
WITH HIERARCHY OPTION
of GRANT, 18
WITH INDEX CONTEXT clause
of CREATE OPERATOR, 15
WITH OBJECT ID clause
of CREATE MATERIALIZED VIEW LOG, 15
WITH OBJECT IDENTIFIER clause
of CREATE VIEW, 17
WITH OBJECT OID. See WITH OBJECT IDENTIFIER.
WITH PRIMARY KEY clause
of ALTER MATERIALIZED VIEW, 11
of CREATE MATERIALIZED VIEW ... REFRESH, 15
of CREATE MATERIALIZED VIEW LOG, 15
WITH READ ONLY clause
of CREATE VIEW, 17, 17
of DELETE, 17
of INSERT, 18
of SELECT, 19
of UPDATE, 19
WITH ROWID clause
of column ref constraints, 8
of CREATE MATERIALIZED VIEW ... REFRESH, 15
of CREATE MATERIALIZED VIEW LOG, 15
WITH SEQUENCE clause
of CREATE MATERIALIZED VIEW LOG, 15
WRITE clause
of COMMIT, 13
WRITE object privilege
on a directory, 18

X

XML
conditions, 7.9
data
storage of, 16
database repository
SQL access to, 7.9.1, 7.9.2
documents
producing from XML fragments, 5.8
retrieving from the database, 5.8
examples, F.2
format models, 3.4.5
fragments, 5.8
functions, 5.2.12
XMLAGG function, 5.8
XMLCAST function, 5.8
XMLCDATA function, 5.8
XMLCOLATTVAL function, 5.8
XMLCOMMENT function, 5.8
XMLCONCAT function, 5.8
XMLDATA pseudocolumn, 2.10
XMLDIFF function, 5.8
XMLELEMENT function, 5.8
XMLEXISTS function, 5.8
XMLFOREST function, 5.8
XMLGenFormatType object, 3.4.5
XMLIndex
creating, 14
modifying, 10.2
XMLISVALID function, 5.8
XMLPARSE function, 5.8
XMLPATCH function, 5.8
XMLPI function, 5.8
XMLQUERY function, 5.8
XMLROOT function, 5.8
XMLSchemas
adding to a table, 16
single and multiple, 16
XMLSEQUENCE function, 5.8
XMLSERIALIZE function, 5.8
XMLTABLE function, 5.8
XMLTRANSFORM function, 5.8
XMLType columns
properties of, 12, 16
storage of, 16, 16
storing in binary XML format, 16
XMLType storage clause
of CREATE TABLE, 16
XMLType tables
creating, 16, 16
creating index on, 14
XMLType views, 17
querying, 17
PK=dPKFJOEBPS/functions173.htm 3 STATS_MODE

STATS_MODE

Syntax

Description of stats_mode.gif follows

Purpose

STATS_MODE takes as its argument a set of values and returns the value that occurs with the greatest frequency. If more than one mode exists, then Oracle Database chooses one and returns only that one value.

To obtain multiple modes (if multiple modes exist), you must use a combination of other functions, as shown in the hypothetical query:

SELECT x FROM (SELECT x, COUNT(x) AS cnt1
   FROM t GROUP BY x)
   WHERE cnt1 =
      (SELECT MAX(cnt2) FROM (SELECT COUNT(x) AS cnt2 FROM t GROUP BY x));

Examples

The following example returns the mode of salary per department in the hr.employees table:

SELECT department_id, STATS_MODE(salary) FROM employees
   GROUP BY department_id
   ORDER BY department_id, stats_mode(salary);

DEPARTMENT_ID STATS_MODE(SALARY)
------------- ------------------
           10               4400
           20               6000
           30               2500
           40               6500
           50               2500
           60               4800
           70              10000
           80               9500
           90              17000
          100               6900
          110               8300
                            7000

If you need to retrieve all of the modes (in cases with multiple modes), you can do so using a combination of other functions, as shown in the next example:

SELECT commission_pct FROM
   (SELECT commission_pct, COUNT(commission_pct) AS cnt1 FROM employees
      GROUP BY commission_pct)
   WHERE cnt1 = 
      (SELECT MAX (cnt2) FROM
         (SELECT COUNT(commission_pct) AS cnt2
         FROM employees GROUP BY commission_pct))
   ORDER BY commission_pct;

COMMISSION_PCT
--------------
            .2
            .3
PKZ PKFJOEBPS/statements_10006.htmD TRUNCATE CLUSTER

TRUNCATE CLUSTER

Purpose


Caution:

You cannot roll back a TRUNCATE CLUSTER statement.

Use the TRUNCATE CLUSTER statement to remove all rows from a cluster. By default, Oracle Database also performs the following tasks:

  • Deallocates all space used by the removed rows except that specified by the MINEXTENTS storage parameter

  • Sets the NEXT storage parameter to the size of the last extent removed from the segment by the truncation process

Removing rows with the TRUNCATE statement can be more efficient than dropping and re-creating a cluster. Dropping and re-creating a cluster invalidates dependent objects of the cluster, requires you to regrant object privileges on the cluster, and requires you to re-create the indexes and cluster on the table and respecify its storage parameters. Truncating has none of these effects.

Removing rows with the TRUNCATE CLUSTER statement can be faster than removing all rows with the DELETE statement, especially if the cluster has numerous indexes and other dependencies.


See Also:


Prerequisites

To truncate a cluster, the cluster must be in your schema or you must have DROP ANY TABLE system privilege.

Syntax

truncate_cluster::=

Description of truncate_cluster.gif follows

Semantics

CLUSTER Clause

Specify the schema and name of the cluster to be truncated. You can truncate only an indexed cluster, not a hash cluster. If you omit schema, then the database assumes the cluster is in your own schema.

When you truncate a cluster, the database also automatically deletes all data in the indexes of the cluster tables.

STORAGE Clauses

The STORAGE clauses let you determine what happens to the space freed by the truncated rows. The DROP STORAGE clause and REUSE STORAGE clause also apply to the space freed by the data deleted from associated indexes.

DROP STORAGE Specify DROP STORAGE to deallocate all space from the deleted rows from the cluster except the space allocated by the MINEXTENTS parameter of the cluster. This space can subsequently be used by other objects in the tablespace. Oracle Database also sets the NEXT storage parameter to the size of the last extent removed from the segment in the truncation process. This is the default.

REUSE STORAGE Specify REUSE STORAGE to retain the space from the deleted rows allocated to the cluster. Storage values are not reset to the values when the table or cluster was created. This space can subsequently be used only by new data in the cluster resulting from insert or update operations. This clause leaves storage parameters at their current settings.

If you have specified more than one free list for the object you are truncating, then the REUSE STORAGE clause also removes any mapping of free lists to instances and resets the high-water mark to the beginning of the first extent.

Examples

Truncating a Cluster: Example The following statement removes all rows from all tables in the personnel cluster, but leaves the freed space allocated to the tables:

TRUNCATE CLUSTER personnel REUSE STORAGE;

The preceding statement also removes all data from all indexes on the tables in the personnel cluster.

PKi Type Constructor Expressions

Type Constructor Expressions

A type constructor expression specifies a call to a constructor method. The argument to the type constructor is any expression. Type constructors can be invoked anywhere functions are invoked.

type_constructor_expression::=

Description of type_constructor_expression.gif follows

The NEW keyword applies to constructors for object types but not for collection types. It instructs Oracle to construct a new object by invoking an appropriate constructor. The use of the NEW keyword is optional, but it is good practice to specify it.

If type_name is an object type, then the expressions must be an ordered list, where the first argument is a value whose type matches the first attribute of the object type, the second argument is a value whose type matches the second attribute of the object type, and so on. The total number of arguments to the constructor must match the total number of attributes of the object type.

If type_name is a varray or nested table type, then the expression list can contain zero or more arguments. Zero arguments implies construction of an empty collection. Otherwise, each argument corresponds to an element value whose type is the element type of the collection type.

Restriction on Type Constructor Invocation In an invocation of a type constructor method, the number of parameters (expr) specified cannot exceed 999, even if the object type has more than 999 attributes. This limitation applies only when the constructor is called from SQL. For calls from PL/SQL, the PL/SQL limitations apply.


See Also:

Oracle Database Object-Relational Developer's Guide for additional information on constructor methods and Oracle Database PL/SQL Language Reference for information on PL/SQL limitations on calls to type constructors

Expression Example This example uses the cust_address_typ type in the sample oe schema to show the use of an expression in the call to a constructor method (the PL/SQL is shown in italics):

CREATE TYPE address_book_t AS TABLE OF cust_address_typ; 
DECLARE 
   myaddr cust_address_typ := cust_address_typ( 
     '500 Oracle Parkway', 94065, 'Redwood Shores', 'CA','USA'); 
   alladdr address_book_t := address_book_t(); 
BEGIN 
   INSERT INTO customers VALUES ( 
      666999, 'Joe', 'Smith', myaddr, NULL, NULL, NULL, NULL, 
      NULL, NULL, NULL, NULL, NULL, NULL, NULL); 
END; 
/

Subquery Example This example uses the warehouse_typ type in the sample schema oe to illustrate the use of a subquery in the call to the constructor method.

CREATE TABLE warehouse_tab OF warehouse_typ;

INSERT INTO warehouse_tab 
   VALUES (warehouse_typ(101, 'new_wh', 201));

CREATE TYPE facility_typ AS OBJECT (
   facility_id NUMBER,
   warehouse_ref REF warehouse_typ);
   
CREATE TABLE buildings (b_id NUMBER, building facility_typ);

INSERT INTO buildings VALUES (10, facility_typ(102, 
   (SELECT REF(w) FROM warehouse_tab w 
      WHERE warehouse_name = 'new_wh')));

SELECT b.b_id, b.building.facility_id "FAC_ID",
   DEREF(b.building.warehouse_ref) "WH" FROM buildings b;

      B_ID     FAC_ID WH(WAREHOUSE_ID, WAREHOUSE_NAME, LOCATION_ID)
---------- ---------- ---------------------------------------------
        10        102 WAREHOUSE_TYP(101, 'new_wh', 201)
PKFf>PKFJOEBPS/functions174.htmH STATS_MW_TEST

STATS_MW_TEST

Syntax

Description of stats_mw_test.gif follows

Purpose

A Mann Whitney test compares two independent samples to test the null hypothesis that two populations have the same distribution function against the alternative hypothesis that the two distribution functions are different.

The STATS_MW_TEST does not assume that the differences between the samples are normally distributed, as do the STATS_T_TEST_* functions. This function takes three arguments and a return value of type VARCHAR2. expr1 classifies the data into groups. expr2 contains the values for each of the groups. The function returns one value, determined by the third argument. If you omit the third argument, then the default is TWO_SIDED_SIG. The meaning of the return values is shown in the table that follows.

The significance of the observed value of Z or U is the probability that the variances are different just by chance—a number between 0 and 1. A small value for the significance indicates that the variances are significantly different. The degree of freedom for each of the variances is the number of observations in the sample minus 1.

Table 5-7 STATS_MW_TEST Return Values

Return ValueMeaning

STATISTIC

The observed value of Z

U_STATISTIC

The observed value of U

ONE_SIDED_SIG

One-tailed significance of Z

TWO_SIDED_SIG

Two-tailed significance of Z


The one-tailed significance is always in relation to the upper tail. The final argument, expr3, indicates which of the two groups specified by expr1 is the high value (the value whose rejection region is the upper tail).

STATS_MW_TEST computes the probability that the samples are from the same distribution by checking the differences in the sums of the ranks of the values. If the samples come from the same distribution, then the sums should be close in value.

STATS_MW_TEST Example Using the Mann Whitney test, the following example determines whether the distribution of sales between men and women is due to chance:

SELECT STATS_MW_TEST
         (cust_gender, amount_sold, 'STATISTIC') z_statistic,
       STATS_MW_TEST
         (cust_gender, amount_sold, 'ONE_SIDED_SIG', 'F') one_sided_p_value
  FROM sh.customers c, sh.sales s
  WHERE c.cust_id = s.cust_id;

Z_STATISTIC ONE_SIDED_P_VALUE
----------- -----------------
 -1.4011509        .080584471
PKjZMHPKFJOEBPS/statements_10001.htmB SAVEPOINT

SAVEPOINT

Purpose

Use the SAVEPOINT statement to create a name for a system change number (SCN), to which you can later roll back.


See Also:


Prerequisites

None.

Syntax

savepoint::=

Description of savepoint.gif follows

Semantics

savepoint

Specify the name of the savepoint to be created.

Savepoint names must be distinct within a given transaction. If you create a second savepoint with the same identifier as an earlier savepoint, then the earlier savepoint is erased. After a savepoint has been created, you can either continue processing, commit your work, roll back the entire transaction, or roll back to the savepoint.

Example

Creating Savepoints: Example To update the salary for Banda and Greene in the sample table hr.employees, check that the total department salary does not exceed 314,000, then reenter the salary for Greene:

UPDATE employees 
    SET salary = 7000 
    WHERE last_name = 'Banda';
SAVEPOINT banda_sal;

UPDATE employees 
    SET salary = 12000 
    WHERE last_name = 'Greene';
SAVEPOINT greene_sal;

SELECT SUM(salary) FROM employees;

ROLLBACK TO SAVEPOINT banda_sal;
 
UPDATE employees 
    SET salary = 11000 
    WHERE last_name = 'Greene';
 
COMMIT; 
PKgkGBPKFJOEBPS/expressions013.htm Scalar Subquery Expressions

Scalar Subquery Expressions

A scalar subquery expression is a subquery that returns exactly one column value from one row. The value of the scalar subquery expression is the value of the select list item of the subquery. If the subquery returns 0 rows, then the value of the scalar subquery expression is NULL. If the subquery returns more than one row, then Oracle returns an error.

You can use a scalar subquery expression in most syntax that calls for an expression (expr). In all cases, a scalar subquery must be enclosed in its own parentheses, even if its syntactic location already positions it within parentheses (for example, when the scalar subquery is used as the argument to a built-in function).

Scalar subqueries are not valid expressions in the following places:

  • As default values for columns

  • As hash expressions for clusters

  • In the RETURNING clause of DML statements

  • As the basis of a function-based index

  • In CHECK constraints

  • In GROUP BY clauses

  • In statements that are unrelated to queries, such as CREATE PROFILE

PK^P  PKFJOEBPS/statements_1012.htm ALTER JAVA

ALTER JAVA

Purpose

Use the ALTER JAVA statement to force the resolution of a Java class schema object or compilation of a Java source schema object. (You cannot call the methods of a Java class before all its external references to Java names are associated with other classes.)


See Also:

Oracle Database Java Developer's Guide for more information on resolving Java classes and compiling Java sources

Prerequisites

The Java source or class must be in your own schema, or you must have the ALTER ANY PROCEDURE system privilege. You must also have the EXECUTE object privilege on Java classes.

Semantics

JAVA SOURCE

Use ALTER JAVA SOURCE to compile a Java source schema object.

JAVA CLASS

Use ALTER JAVA CLASS to resolve a Java class schema object.

object_name

Specify a previously created Java class or source schema object. Use double quotation marks to preserve lower- or mixed-case names.

RESOLVER

The RESOLVER clause lets you specify how schemas are searched for referenced fully specified Java names, using the mapping pairs specified when the Java class or source was created.

RESOLVE | COMPILE

RESOLVE and COMPILE are synonymous keywords. They let you specify that Oracle Database should attempt to resolve the primary Java class schema object.

  • When applied to a class, resolution of referenced names to other class schema objects occurs.

  • When applied to a source, source compilation occurs.

invoker_rights_clause

The invoker_rights_clause lets you specify whether the methods of the class execute with the privileges and in the schema of the user who defined it or with the privileges and in the schema of CURRENT_USER.

This clause also determines how Oracle Database resolves external names in queries, DML operations, and dynamic SQL statements in the member functions and procedures of the type.

AUTHID CURRENT_USER Specify CURRENT_USER if you want the methods of the class to execute with the privileges of CURRENT_USER. This clause is the default and creates an invoker-rights class.

This clause also specifies that external names in queries, DML operations, and dynamic SQL statements resolve in the schema of CURRENT_USER. External names in all other statements resolve in the schema in which the methods reside.

AUTHID DEFINER Specify DEFINER if you want the methods of the class to execute with the privileges of the user who defined the class.

This clause also specifies that external names resolve in the schema where the methods reside.


See Also:

Oracle Database PL/SQL Language Reference for information on how CURRENT_USER is determined

Examples

Resolving a Java Class: Example The following statement forces the resolution of a Java class:

ALTER JAVA CLASS "Agent"
   RESOLVER (("/usr/bin/bfile_dir/*" pm)(* public))
   RESOLVE;
PKU  PKFJOEBPS/functions108.htmE NLS_CHARSET_ID

NLS_CHARSET_ID

Syntax

Description of nls_charset_id.gif follows

Purpose

NLS_CHARSET_ID returns the character set ID number corresponding to character set name string. The string argument is a run-time VARCHAR2 value. The string value 'CHAR_CS' returns the database character set ID number of the server. The string value 'NCHAR_CS' returns the national character set ID number of the server.

Invalid character set names return null.

Examples

The following example returns the character set ID of a character set:

SELECT NLS_CHARSET_ID('ja16euc') 
  FROM DUAL; 

NLS_CHARSET_ID('JA16EUC')
------------------------- 
                      830

See Also:

Oracle Database Globalization Support Guide for a list of character sets

PK*KJ E PKFJOEBPS/ap_posix003.htm Perl-influenced Extensions in Oracle Regular Expressions

Perl-influenced Extensions in Oracle Regular Expressions

Oracle Database regular expression functions and conditions accept a number of Perl-influenced operators that are in common use, although not part of the POSIX standard. Table D-3 lists those operators. For more complete descriptions with examples, refer to Oracle Database Advanced Application Developer's Guide.

Table D-3 Perl-influenced Operators in Oracle Regular Expressions

OperatorDescription

\d

A digit character.

\D

A nondigit character.

\w

A word character.

\W

A nonword character.

\s

A whitespace character.

\S

A non-whitespace character.

\A

Matches only at the beginning of a string, or before a newline character at the end of a string.

\Z

Matches only at the end of a string.

*?

Matches the preceding pattern element 0 or more times (nongreedy).

+?

Matches the preceding pattern element 1 or more times (nongreedy).

??

Matches the preceding pattern element 0 or 1 time (nongreedy).

{n}?

Matches the preceding pattern element exactly n times (nongreedy).

{n,}?

Matches the preceding pattern element at least n times (nongreedy).

{n,m}?

Matches the preceding pattern element at least n but not more than m times (nongreedy).


PK&PKFJOEBPS/statements_8021.htm!v DROP MATERIALIZED VIEW

DROP MATERIALIZED VIEW

Purpose

Use the DROP MATERIALIZED VIEW statement to remove an existing materialized view from the database.

When you drop a materialized view, Oracle Database does not place it in the recycle bin. Therefore, you cannot subsequently either purge or undrop the materialized view.


Note:

The keyword SNAPSHOT is supported in place of MATERIALIZED VIEW for backward compatibility.


See Also:


Prerequisites

The materialized view must be in your own schema or you must have the DROP ANY MATERIALIZED VIEW system privilege. You must also have the privileges to drop the internal table, views, and index that the database uses to maintain the materialized view data.


See Also:

DROP TABLE, DROP VIEW, and DROP INDEX for information on privileges required to drop objects that the database uses to maintain the materialized view

Syntax

drop_materialized_view::=

Description of drop_materialized_view.gif follows

Semantics

schema

Specify the schema containing the materialized view. If you omit schema, then Oracle Database assumes the materialized view is in your own schema.

materialized_view

Specify the name of the existing materialized view to be dropped.

  • If you drop a simple materialized view that is the least recently refreshed materialized view of a master table, then the database automatically purges from the master table materialized view log only the rows needed to refresh the dropped materialized view.

  • If you drop a materialized view that was created on a prebuilt table, then the database drops the materialized view, and the prebuilt table reverts to its identity as a table.

  • When you drop a master table, the database does not automatically drop materialized views based on the table. However, the database returns an error when it tries to refresh a materialized view based on a master table that has been dropped.

  • If you drop a materialized view, then any compiled requests that were rewritten to use the materialized view will be invalidated and recompiled automatically. If the materialized view was prebuilt on a table, then the table is not dropped, but it can no longer be maintained by the materialized view refresh mechanism.

PRESERVE TABLE Clause

This clause lets you retain the materialized view container table and its contents after the materialized view object is dropped. The resulting table has the same name as the dropped materialized view.

Oracle Database removes all metadata associated with the materialized view. However, indexes created on the container table automatically during creation of the materialized view are preserved, with one exception: the index created during the creation of a rowid materialized view is dropped. Also, if the materialized view has any nested table columns, then the storage tables for those columns are preserved, along with their metadata.

Restriction on the PRESERVE TABLE Clause This clause is not valid for materialized views that have been imported from releases earlier than Oracle9i, when these objects were called "snapshots".

Examples

Dropping a Materialized View: Examples The following statement drops the materialized view emp_data in the sample schema hr:

DROP MATERIALIZED VIEW emp_data; 

The following statement drops the sales_by_month_by_state materialized view and the underlying table of the materialized view, unless the underlying table was registered in the CREATE MATERIALIZED VIEW statement with the ON PREBUILT TABLE clause:

DROP MATERIALIZED VIEW sales_by_month_by_state;
PK'Xl!!PKFJOEBPS/functions050.htmW DECOMPOSE

DECOMPOSE

Syntax

Description of decompose.gif follows

Purpose

DECOMPOSE is valid only for Unicode characters. DECOMPOSE takes as its argument a string in any data type and returns a Unicode string after decomposition in the same character set as the input. For example, an o-umlaut code point will be returned as the "o" code point followed by an umlaut code point.

  • string can be any of the data types CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, or NCLOB.

  • CANONICAL causes canonical decomposition, which allows recomposition (for example, with the COMPOSE function) to the original string. This is the default and returns the string in NFD normal form.

  • COMPATIBILITY causes decomposition in compatibility mode. In this mode, recomposition is not possible. This mode is useful, for example, when decomposing half-width and full-width katakana characters, where recomposition might not be desirable without external formatting or style information. It returns the string in NFKD normal form.

CLOB and NCLOB values are supported through implicit conversion. If char is a character LOB value, then it is converted to a VARCHAR value before the COMPOSE operation. The operation will fail if the size of the LOB value exceeds the supported length of the VARCHAR in the particular development environment.


See Also:


Examples

The following example decomposes the string "Châteaux" into its component code points:

SELECT DECOMPOSE ('Châteaux')
  FROM DUAL; 

DECOMPOSE
---------
Cha^teaux

Note:

The results of this example can vary depending on the character set of your operating system.

PKaPKFJOEBPS/functions081.htm ITERATION_NUMBER

ITERATION_NUMBER

Syntax

Description of iteration_number.gif follows

Purpose

The ITERATION_NUMBER function can be used only in the model_clause of the SELECT statement and then only when ITERATE(number) is specified in the model_rules_clause. It returns an integer representing the completed iteration through the model rules. The ITERATION_NUMBER function returns 0 during the first iteration. For each subsequent iteration, the ITERATION_NUMBER function returns the equivalent of iteration_number plus one.


See Also:

model_clause and "Model Expressions" for the syntax and semantics

Examples

The following example assigns the sales of the Mouse Pad for the years 1998 and 1999 to the sales of the Mouse Pad for the years 2001 and 2002 respectively:

SELECT country, prod, year, s
  FROM sales_view_ref
  MODEL
    PARTITION BY (country)
    DIMENSION BY (prod, year)
    MEASURES (sale s)
    IGNORE NAV
    UNIQUE DIMENSION
    RULES UPSERT SEQUENTIAL ORDER ITERATE(2)
      (
        s['Mouse Pad', 2001 + ITERATION_NUMBER] =
          s['Mouse Pad', 1998 + ITERATION_NUMBER]
      )
  ORDER BY country, prod, year;

COUNTRY       PROD                                         YEAR           S
----------    -----------------------------------      --------   ---------
France        Mouse Pad                                    1998     2509.42
France        Mouse Pad                                    1999     3678.69
France        Mouse Pad                                    2000     3000.72
France        Mouse Pad                                    2001     2509.42
France        Mouse Pad                                    2002     3678.69
France        Standard Mouse                               1998     2390.83
France        Standard Mouse                               1999     2280.45
France        Standard Mouse                               2000     1274.31
France        Standard Mouse                               2001     2164.54
Germany       Mouse Pad                                    1998     5827.87
Germany       Mouse Pad                                    1999     8346.44
Germany       Mouse Pad                                    2000     7375.46
Germany       Mouse Pad                                    2001     5827.87
Germany       Mouse Pad                                    2002     8346.44
Germany       Standard Mouse                               1998     7116.11
Germany       Standard Mouse                               1999     6263.14
Germany       Standard Mouse                               2000     2637.31
Germany       Standard Mouse                               2001     6456.13
 
18 rows selected.

The preceding example requires the view sales_view_ref. Refer to "The MODEL clause: Examples" to create this view.

PKFtɉPKFJOEBPS/functions022.htmE CARDINALITY

CARDINALITY

Syntax

Description of cardinality.gif follows

Purpose

CARDINALITY returns the number of elements in a nested table. The return type is NUMBER. If the nested table is empty, or is a null collection, then CARDINALITY returns NULL.

Examples

The following example shows the number of elements in the nested table column ad_textdocs_ntab of the sample table pm.print_media:

SELECT product_id, CARDINALITY(ad_textdocs_ntab) cardinality
  FROM print_media
  ORDER BY product_id;

PRODUCT_ID CARDINALITY
---------- -----------
      2056           3
      2268           3
      3060           3
      3106           3
PK TO_NUMBER

TO_NUMBER

Syntax

Description of to_number.gif follows

Purpose

TO_NUMBER converts expr to a value of NUMBER data type. The expr can be a number value of CHAR, VARCHAR2, NCHAR, NVARCHAR2, BINARY_FLOAT, or BINARY_DOUBLE data type.

  • If you specify an expr of CHAR, VARCHAR2, NCHAR, or NVARCHAR2 data type, then you can optionally specify the format model fmt.

  • If you specify an expr of BINARY_FLOAT or BINARY_DOUBLE data type, then you cannot specify a format model because a BINARY_FLOAT or BINARY_DOUBLE can be interpreted only by its internal representation.

Refer to "Format Models" for information on format models.

The 'nlsparam' argument in this function has the same purpose as it does in the TO_CHAR function for number conversions. Refer to TO_CHAR (number) for more information.

This function does not support CLOB data directly. However, CLOBs can be passed in as arguments through implicit data conversion.


See Also:

"Data Type Comparison Rules" for more information.

Examples

The following examples convert character string data into a number:

UPDATE employees SET salary = salary + 
   TO_NUMBER('100.00', '9G999D99')
   WHERE last_name = 'Perkins';
SELECT TO_NUMBER('-AusDollars100','L9G999D99',
   ' NLS_NUMERIC_CHARACTERS = '',.''
     NLS_CURRENCY            = ''AusDollars''
   ') "Amount"
     FROM DUAL;

    Amount
----------
      -100
PKu'3% PKFJOEBPS/functions106.htm 7 NEXT_DAY

NEXT_DAY

Syntax

Description of next_day.gif follows

Purpose

NEXT_DAY returns the date of the first weekday named by char that is later than the date date. The return type is always DATE, regardless of the data type of date. The argument char must be a day of the week in the date language of your session, either the full name or the abbreviation. The minimum number of letters required is the number of letters in the abbreviated version. Any characters immediately following the valid abbreviation are ignored. The return value has the same hours, minutes, and seconds component as the argument date.

Examples

This example returns the date of the next Tuesday after October 15, 2009:

SELECT NEXT_DAY('15-OCT-2009','TUESDAY') "NEXT DAY"
  FROM DUAL;

NEXT DAY
--------------------
20-OCT-2009 00:00:00
PK PKFJOEBPS/pseudocolumns002.htm/_ Sequence Pseudocolumns

Sequence Pseudocolumns

A sequence is a schema object that can generate unique sequential values. These values are often used for primary and unique keys. You can refer to sequence values in SQL statements with these pseudocolumns:

  • CURRVAL: Returns the current value of a sequence

  • NEXTVAL: Increments the sequence and returns the next value

You must qualify CURRVAL and NEXTVAL with the name of the sequence:

sequence.CURRVAL
sequence.NEXTVAL

To refer to the current or next value of a sequence in the schema of another user, you must have been granted either SELECT object privilege on the sequence or SELECT ANY SEQUENCE system privilege, and you must qualify the sequence with the schema containing it:

schema.sequence.CURRVAL
schema.sequence.NEXTVAL

To refer to the value of a sequence on a remote database, you must qualify the sequence with a complete or partial name of a database link:

schema.sequence.CURRVAL@dblink
schema.sequence.NEXTVAL@dblink

A sequence can be accessed by many users concurrently with no waiting or locking.


See Also:

"References to Objects in Remote Databases" for more information on referring to database links

Where to Use Sequence Values

You can use CURRVAL and NEXTVAL in the following locations:

  • The select list of a SELECT statement that is not contained in a subquery, materialized view, or view

  • The select list of a subquery in an INSERT statement

  • The VALUES clause of an INSERT statement

  • The SET clause of an UPDATE statement

Restrictions on Sequence Values You cannot use CURRVAL and NEXTVAL in the following constructs:

  • A subquery in a DELETE, SELECT, or UPDATE statement

  • A query of a view or of a materialized view

  • A SELECT statement with the DISTINCT operator

  • A SELECT statement with a GROUP BY clause or ORDER BY clause

  • A SELECT statement that is combined with another SELECT statement with the UNION, INTERSECT, or MINUS set operator

  • The WHERE clause of a SELECT statement

  • The DEFAULT value of a column in a CREATE TABLE or ALTER TABLE statement

  • The condition of a CHECK constraint

Within a single SQL statement that uses CURRVAL or NEXTVAL, all referenced LONG columns, updated tables, and locked tables must be located on the same database.

How to Use Sequence Values

When you create a sequence, you can define its initial value and the increment between its values. The first reference to NEXTVAL returns the initial value of the sequence. Subsequent references to NEXTVAL increment the sequence value by the defined increment and return the new value. Any reference to CURRVAL always returns the current value of the sequence, which is the value returned by the last reference to NEXTVAL.

Before you use CURRVAL for a sequence in your session, you must first initialize the sequence with NEXTVAL. Refer to CREATE SEQUENCE for information on sequences.

Within a single SQL statement containing a reference to NEXTVAL, Oracle increments the sequence once:

  • For each row returned by the outer query block of a SELECT statement. Such a query block can appear in the following places:

    • A top-level SELECT statement

    • An INSERT ... SELECT statement (either single-table or multitable). For a multitable insert, the reference to NEXTVAL must appear in the VALUES clause, and the sequence is updated once for each row returned by the subquery, even though NEXTVAL may be referenced in multiple branches of the multitable insert.

    • A CREATE TABLE ... AS SELECT statement

    • A CREATE MATERIALIZED VIEW ... AS SELECT statement

  • For each row updated in an UPDATE statement

  • For each INSERT statement containing a VALUES clause

  • For each INSERT ... [ALL | FIRST] statement (multitable insert). A multitable insert is considered a single SQL statement. Therefore, a reference to the NEXTVAL of a sequence will increase the sequence only once for each input record coming from the SELECT portion of the statement. If NEXTVAL is specified more than once in any part of the INSERT ... [ALL | FIRST ] statement, then the value will be the same for all insert branches, regardless of how often a given record might be inserted.

  • For each row merged by a MERGE statement. The reference to NEXTVAL can appear in the merge_insert_clause or the merge_update_clause or both. The NEXTVALUE value is incremented for each row updated and for each row inserted, even if the sequence number is not actually used in the update or insert operation. If NEXTVAL is specified more than once in any of these locations, then the sequence is incremented once for each row and returns the same value for all occurrences of NEXTVAL for that row.

  • For each input row in a multitable INSERT ALL statement. NEXTVAL is incremented once for each row returned by the subquery, regardless of how many occurrences of the insert_into_clause map to each row.

If any of these locations contains more than one reference to NEXTVAL, then Oracle increments the sequence once and returns the same value for all occurrences of NEXTVAL.

If any of these locations contains references to both CURRVAL and NEXTVAL, then Oracle increments the sequence and returns the same value for both CURRVAL and NEXTVAL.

Finding the next value of a sequence: Example This example selects the next value of the employee sequence in the sample schema hr:

SELECT employees_seq.nextval 
  FROM DUAL;

Inserting sequence values into a table: Example This example increments the employee sequence and uses its value for a new employee inserted into the sample table hr.employees:

INSERT INTO employees
  VALUES (employees_seq.nextval, 'John', 'Doe', 'jdoe', '555-1212',
          TO_DATE(SYSDATE), 'PU_CLERK', 2500, null, null, 30);

Reusing the current value of a sequence: Example This example adds a new order with the next order number to the master order table. It then adds suborders with this number to the detail order table:

INSERT INTO orders (order_id, order_date, customer_id)
  VALUES (orders_seq.nextval, TO_DATE(SYSDATE), 106);

INSERT INTO order_items (order_id, line_item_id, product_id)
  VALUES (orders_seq.currval, 1, 2359);

INSERT INTO order_items (order_id, line_item_id, product_id)
  VALUES (orders_seq.currval, 2, 3290);

INSERT INTO order_items (order_id, line_item_id, product_id)
  VALUES (orders_seq.currval, 3, 2381);
PKc//PKFJOEBPS/functions216.htmZ TRANSLATE

TRANSLATE

Syntax

Description of translate.gif follows

Purpose

TRANSLATE returns expr with all occurrences of each character in from_string replaced by its corresponding character in to_string. Characters in expr that are not in from_string are not replaced. The argument from_string can contain more characters than to_string. In this case, the extra characters at the end of from_string have no corresponding characters in to_string. If these extra characters appear in expr, then they are removed from the return value.

If a character appears multiple times in from_string, then the to_string mapping corresponding to the first occurrence is used.

You cannot use an empty string for to_string to remove all characters in from_string from the return value. Oracle Database interprets the empty string as null, and if this function has a null argument, then it returns null. To remove all characters in from_string, concatenate another character to the beginning of from_string and specify this character as the to_string. For example, TRANSLATE(expr, 'x0123456789', 'x') removes all digits from expr.

TRANSLATE provides functionality related to that provided by the REPLACE function. REPLACE lets you substitute a single string for another single string, as well as remove character strings. TRANSLATE lets you make several single-character, one-to-one substitutions in one operation.

This function does not support CLOB data directly. However, CLOBs can be passed in as arguments through implicit data conversion.


See Also:

"Data Type Comparison Rules" for more information and REPLACE

Examples

The following statement translates a book title into a string that could be used (for example) as a filename. The from_string contains four characters: a space, asterisk, slash, and apostrophe (with an extra apostrophe as the escape character). The to_string contains only three underscores. This leaves the fourth character in the from_string without a corresponding replacement, so apostrophes are dropped from the returned value.

SELECT TRANSLATE('SQL*Plus User''s Guide', ' */''', '___') FROM DUAL;

TRANSLATE('SQL*PLUSU
--------------------
SQL_Plus_Users_Guide
PKUPKFJOEBPS/statements_7002.htm CREATE TABLE

CREATE TABLE

Purpose

Use the CREATE TABLE statement to create one of the following types of tables:

  • A relational table, which is the basic structure to hold user data.

  • An object table, which is a table that uses an object type for a column definition. An object table is explicitly defined to hold object instances of a particular type.

You can also create an object type and then use it in a column when creating a relational table.

Tables are created with no data unless a subquery is specified. You can add rows to a table with the INSERT statement. After creating a table, you can define additional columns, partitions, and integrity constraints with the ADD clause of the ALTER TABLE statement. You can change the definition of an existing column or partition with the MODIFY clause of the ALTER TABLE statement.


See Also:


Prerequisites

To create a relational table in your own schema, you must have the CREATE TABLE system privilege. To create a table in another user's schema, you must have the CREATE ANY TABLE system privilege. Also, the owner of the schema to contain the table must have either space quota on the tablespace to contain the table or the UNLIMITED TABLESPACE system privilege.

In addition to these table privileges, to create an object table or a relational table with an object type column, the owner of the table must have the EXECUTE object privilege in order to access all types referenced by the table, or you must have the EXECUTE ANY TYPE system privilege. These privileges must be granted explicitly and not acquired through a role.

Additionally, if the table owner intends to grant access to the table to other users, then the owner must have been granted the EXECUTE object privilege on the referenced types WITH GRANT OPTION, or have the EXECUTE ANY TYPE system privilege WITH ADMIN OPTION. Without these privileges, the table owner has insufficient privileges to grant access to the table to other users.

To enable a unique or primary key constraint, you must have the privileges necessary to create an index on the table. You need these privileges because Oracle Database creates an index on the columns of the unique or primary key in the schema containing the table.

To create an external table, you must have the required read and write operating system privileges on the appropriate operating system directories. You must have the READ object privilege on the database directory object corresponding to the operating system directory in which the external data resides. You must also have the WRITE object privilege on the database directory in which the files will reside if you specify a log file or bad file in the opaque_format_spec or if you unload data into an external table from a database table by specifying the AS subquery clause.

To create an XMLType table in a different database schema from your own, you must have not only privilege CREATE ANY TABLE but also privilege CREATE ANY INDEX. This is because a unique index is created on column OBJECT_ID when you create the table. Column OBJECT_ID stores a system-generated object identifier.


See Also:


Syntax

create_table::=

Description of create_table.gif follows

(relational_table::=, object_table ::=, XMLType_table ::=)

relational_table::=

Description of relational_table.gif follows


Note:

Each of the clauses following the table name is optional for any given relational table. However, for every table you must at least specify either column names and data types using the relational_properties clause or an AS subquery clause using the table_properties clause.

(relational_properties::=, physical_properties::=, table_properties::=)

object_table ::=

Description of object_table.gif follows

(object_table_substitution ::=, object_properties::=, oid_clause::=, oid_index_clause::=, physical_properties::=, table_properties::=)

XMLType_table ::=

Description of xmltype_table.gif follows

(XMLType_storage::=, XMLSchema_spec::=, XMLType_virtual_columns::=, oid_clause::=, oid_index_clause::=, physical_properties::=, table_properties::=)

relational_properties::=

Description of relational_properties.gif follows

(column_definition::=, virtual_column_definition ::=, constraint::=, supplemental_logging_props ::=)

column_definition::=

Description of column_definition.gif follows

(encryption_spec ::=, constraint::=)

virtual_column_definition ::=

Description of virtual_column_definition.gif follows

(constraint::=)

encryption_spec ::=

Description of encryption_spec.gif follows

object_table_substitution ::=

Description of object_table_substitution.gif follows

object_properties::=

Description of object_properties.gif follows

(constraint::=, supplemental_logging_props ::=)

oid_clause::=

Description of oid_clause.gif follows

oid_index_clause::=

Description of oid_index_clause.gif follows

(physical_attributes_clause::=)

physical_properties::=

Description of physical_properties.gif follows

(deferred_segment_creation::=, segment_attributes_clause ::=, table_compression::=, index_org_table_clause ::=, external_table_clause ::=)

deferred_segment_creation::=

Description of deferred_segment_creation.gif follows

segment_attributes_clause ::=

Description of segment_attributes_clause.gif follows

(physical_attributes_clause::=, logging_clause::=)

physical_attributes_clause::=

Description of physical_attributes_clause.gif follows

(storage_clause::=)

table_compression::=

Description of table_compression.gif follows

table_properties::=

Description of table_properties.gif follows

(column_properties::=, table_partitioning_clauses ::=, parallel_clause ::=, enable_disable_clause ::=, row_movement_clause ::=, flashback_archive_clause::=, subquery::=)

column_properties::=

Description of column_properties.gif follows

(object_type_col_properties::=, nested_table_col_properties ::=, varray_col_properties ::=, LOB_storage_clause::=, LOB_partition_storage::=, XMLType_column_properties ::=)

object_type_col_properties::=

Description of object_type_col_properties.gif follows

substitutable_column_clause::=

Description of substitutable_column_clause.gif follows

nested_table_col_properties ::=

Description of nested_table_col_properties.gif follows

(substitutable_column_clause::=, object_properties::=, physical_properties::=, column_properties::=)

varray_col_properties ::=

Description of varray_col_properties.gif follows

(substitutable_column_clause::=, varray_storage_clause::=)

varray_storage_clause::=

Description of varray_storage_clause.gif follows

(LOB_parameters::=)

LOB_storage_clause::=

Description of lob_storage_clause.gif follows

(LOB_storage_parameters::=)

LOB_storage_parameters::=

Description of lob_storage_parameters.gif follows

(LOB_parameters::=, storage_clause::=)

LOB_parameters::=

Description of lob_parameters.gif follows

(LOB_deduplicate_clause::=, LOB_compression_clause::=, encryption_spec ::=, logging_clause::=)


Note:

Several of the LOB parameters are no longer needed if you are using SecureFiles for LOB storage. Refer to LOB_storage_parameters for more information.

LOB_retention_clause::=

Description of lob_retention_clause.gif follows

LOB_deduplicate_clause::=

Description of lob_deduplicate_clause.gif follows

LOB_compression_clause::=

Description of lob_compression_clause.gif follows

logging_clause::=

Description of logging_clause.gif follows

LOB_partition_storage::=

Description of lob_partition_storage.gif follows

(LOB_storage_clause::=, varray_col_properties ::=, LOB_partitioning_storage::=)

LOB_partitioning_storage::=

Description of lob_partitioning_storage.gif follows

XMLType_column_properties ::=

Description of xmltype_column_properties.gif follows

(XMLType_storage::=, XMLSchema_spec::=)

XMLType_storage::=

Description of xmltype_storage.gif follows

(LOB_parameters::=)

XMLSchema_spec::=

Description of xmlschema_spec.gif follows

XMLType_virtual_columns::=

Description of xmltype_virtual_columns.gif follows

row_movement_clause ::=

Description of row_movement_clause.gif follows

flashback_archive_clause::=

Description of flashback_archive_clause.gif follows

index_org_table_clause ::=

Description of index_org_table_clause.gif follows

(mapping_table_clauses::=, key_compression ::=, index_org_overflow_clause ::=)

mapping_table_clauses::=

Description of mapping_table_clauses.gif follows

key_compression ::=

Description of key_compression.gif follows

index_org_overflow_clause ::=

Description of index_org_overflow_clause.gif follows

(segment_attributes_clause ::=)

supplemental_logging_props ::=

Description of supplemental_logging_props.gif follows

supplemental_log_grp_clause::=

Description of supplemental_log_grp_clause.gif follows

supplemental_id_key_clause::=

Description of supplemental_id_key_clause.gif follows

external_table_clause ::=

Description of external_table_clause.gif follows

(external_data_properties::=)

external_data_properties::=

Description of external_data_properties.gif follows

(opaque_format_spec: This clause specifies all access parameters for the ORACLE_LOADER and ORACLE_DATAPUMP access drivers. See Oracle Database Utilities for descriptions of these parameters.)

table_partitioning_clauses ::=

Description of table_partitioning_clauses.gif follows

(range_partitions::=, list_partitions ::=, hash_partitions ::=, composite_range_partitions::=, composite_list_partitions::=, composite_hash_partitions::=, reference_partitioning::=, system_partitioning::=)

range_partitions::=

Description of range_partitions.gif follows

(range_values_clause::=, table_partition_description::=)

list_partitions ::=

Description of list_partitions.gif follows

(list_values_clause::=, table_partition_description::=)

hash_partitions ::=

Description of hash_partitions.gif follows

(individual_hash_partitions::=, hash_partitions_by_quantity::=)

individual_hash_partitions::=

Description of individual_hash_partitions.gif follows

(partitioning_storage_clause::=)

hash_partitions_by_quantity::=

Description of hash_partitions_by_quantity.gif follows

(table_compression::=, key_compression ::=)

composite_range_partitions::=

Description of composite_range_partitions.gif follows

(subpartition_by_range::=. subpartition_by_list::=, subpartition_by_hash::=, range_partition_desc::=)

composite_list_partitions::=

Description of composite_list_partitions.gif follows

(subpartition_by_range::=. subpartition_by_list::=, subpartition_by_hash::=, list_partition_desc::=)

composite_hash_partitions::=

Description of composite_hash_partitions.gif follows

(subpartition_by_range::=, subpartition_by_list::=, subpartition_by_hash::=, individual_hash_partitions::=, hash_partitions_by_quantity::=)

reference_partitioning::=

Description of reference_partitioning.gif follows

(constraint::=, reference_partition_desc::=)

reference_partition_desc::=

Description of reference_partition_desc.gif follows

(table_partition_description::=)

system_partitioning::=

Description of system_partitioning.gif follows

(reference_partition_desc::=)

range_partition_desc::=

Description of range_partition_desc.gif follows

(range_values_clause::=, table_partition_description::=, range_subpartition_desc::=, list_subpartition_desc::=, individual_hash_subparts::=, hash_subparts_by_quantity::=)

list_partition_desc::=

Description of list_partition_desc.gif follows

(list_values_clause::=, table_partition_description::=, range_subpartition_desc::=, list_subpartition_desc::=, individual_hash_subparts::=, hash_subparts_by_quantity::=)

subpartition_template::=

Description of subpartition_template.gif follows

(range_subpartition_desc::=, list_subpartition_desc::=, individual_hash_subparts::=)

subpartition_by_range::=

Description of subpartition_by_range.gif follows

(subpartition_template::=)

subpartition_by_list::=

Description of subpartition_by_list.gif follows

(subpartition_template::=)

subpartition_by_hash::=

Description of subpartition_by_hash.gif follows

(subpartition_template::=)

range_subpartition_desc::=

Description of range_subpartition_desc.gif follows

(range_values_clause::=, partitioning_storage_clause::=)

list_subpartition_desc::=

Description of list_subpartition_desc.gif follows

(list_values_clause::=, partitioning_storage_clause::=)

individual_hash_subparts::=

Description of individual_hash_subparts.gif follows

(partitioning_storage_clause::=)

hash_subparts_by_quantity::=

Description of hash_subparts_by_quantity.gif follows

range_values_clause::=

Description of range_values_clause.gif follows

list_values_clause::=

Description of list_values_clause.gif follows

table_partition_description::=

Description of table_partition_description.gif follows

(deferred_segment_creation::=, segment_attributes_clause ::=, table_compression::=, key_compression ::=, segment_attributes_clause ::=, LOB_storage_clause::=, varray_col_properties ::=, nested_table_col_properties ::=)

partitioning_storage_clause::=

Description of partitioning_storage_clause.gif follows

(table_compression::=, key_compression ::=, LOB_partitioning_storage::=)

LOB_partitioning_storage::=

Description of lob_partitioning_storage.gif follows

parallel_clause ::=

Description of parallel_clause.gif follows

enable_disable_clause ::=

Description of enable_disable_clause.gif follows

(using_index_clause ::=, exceptions_clause not supported in CREATE TABLE statements)

using_index_clause ::=

Description of using_index_clause.gif follows

(create_index::=, index_properties::=)

index_properties::=

Description of index_properties.gif follows

(global_partitioned_index::=, local_partitioned_index ::=—part of CREATE INDEX, index_attributes::=, domain_index_clause and XMLIndex_clause: not supported in using_index_clause)

index_attributes::=

Description of index_attributes.gif follows

(physical_attributes_clause::=, logging_clause::=, key_compression ::=, parallel_clause: not supported in using_index_clause)

Semantics

relational_table

GLOBAL TEMPORARY

Specify GLOBAL TEMPORARY to indicate that the table is temporary and that its definition is visible to all sessions with appropriate privileges. The data in a temporary table is visible only to the session that inserts the data into the table.

When you first create a temporary table, its table metadata is stored in the data dictionary, but no space is allocated for table data. Space is allocated for the table segment at the time of the first DML operation on the table. The temporary table definition persists in the same way as the definitions of regular tables, but the table segment and any data the table contains are either session-specific or transaction-specific data. You specify whether the table segment and data are session- or transaction-specific with the ON COMMIT keywords.

You can perform DDL operations (such as ALTER TABLE, DROP TABLE, CREATE INDEX) on a temporary table only when no session is bound to it. A session becomes bound to a temporary table by performing an INSERT operation on the table. A session becomes unbound to the temporary table by issuing a TRUNCATE statement or at session termination, or, for a transaction-specific temporary table, by issuing a COMMIT or ROLLBACK statement.


See Also:

Oracle Database Concepts for information on temporary tables and "Creating a Table: Temporary Table Example"

Restrictions on Temporary Tables Temporary tables are subject to the following restrictions:

  • Temporary tables cannot be partitioned, clustered, or index organized.

  • You cannot specify any foreign key constraints on temporary tables.

  • Temporary tables cannot contain columns of nested table.

  • You cannot specify the following clauses of the LOB_storage_clause: TABLESPACE, storage_clause, or logging_clause.

  • Parallel UPDATE, DELETE and MERGE are not supported for temporary tables.

  • The only part of the segment_attributes_clause you can specify for a temporary table is TABLESPACE, which allows you to specify a single temporary tablespace.

  • Distributed transactions are not supported for temporary tables.

schema

Specify the schema to contain the table. If you omit schema, then the database creates the table in your own schema.

table

Specify the name of the table or object table to be created. The name must satisfy the requirements listed in "Database Object Naming Rules".

relational_properties

The relational properties describe the components of a relational table.

column_definition

The column_definition lets you define the characteristics of the column.

column

Specify the name of a column of the table.

If you also specify AS subquery, then you can omit column and datatype unless you are creating an index-organized table. If you specify AS subquery when creating an index-organized table, then you must specify column, and you must omit datatype.

The absolute maximum number of columns in a table is 1000. When you create an object table or a relational table with columns of object, nested table, varray, or REF type, Oracle Database maps the columns of the user-defined types to relational columns, in effect creating hidden columns that count toward the 1000-column limit.

datatype

Specify the data type of a column.

Notes on Table Column Data Types The following notes apply to the data types of table columns:

  • If you specify AS subquery, then you can omit datatype. If you are creating an index-organized table and you specify AS subquery, then you must omit the data type.

  • You can also omit datatype if the statement designates the column as part of a foreign key in a referential integrity constraint. Oracle Database automatically assigns to the column the data type of the corresponding column of the referenced key of the referential integrity constraint.

  • Do not create a table with LONG columns. Use LOB columns (CLOB, NCLOB, BLOB) instead. LONG columns are supported only for backward compatibility.

Restriction on Table Column Data Types You can specify a column of type ROWID, but Oracle Database does not guarantee that the values in such columns are valid rowids.


See Also:

"Data Types" for information on LONG columns and on Oracle-supplied data types

SORT

The SORT keyword is valid only if you are creating this table as part of a hash cluster and only for columns that are also cluster columns.

This clause instructs the database to sort the rows of the cluster on this column after applying the hash function when performing a DML operation. Doing so may improve response time during subsequent operations on the clustered data.


See Also:

"CLUSTER Clause" for information on creating a cluster table

DEFAULT

The DEFAULT clause lets you specify a value to be assigned to the column if a subsequent INSERT statement omits a value for the column. The data type of the expression must match the data type of the column. The column must also be long enough to hold this expression.

The DEFAULT expression can include any SQL function as long as the function does not return a literal argument, a column reference, or a nested function invocation.

Restriction on Default Column Values A DEFAULT expression cannot contain references to PL/SQL functions or to other columns, the pseudocolumns CURRVAL, NEXTVAL, LEVEL, PRIOR, and ROWNUM, or date constants that are not fully specified.


See Also:

"About SQL Expressions" for the syntax of expr

encryption_spec

The ENCRYPT clause lets you use the Transparent Data Encryption (TDE) feature to encrypt the column you are defining. You can encrypt columns of type CHAR, NCHAR, VARCHAR2, NVARCHAR2, NUMBER, DATE, LOB, and RAW. The data does not appear in its encrypted form to authorized users, such as the user who encrypts the column.


Note:

Column encryption requires that a system administrator with appropriate privileges has initialized the security module, opened a wallet, and set an encryption key. Refer to Oracle Database Advanced Security Administrator's Guide for general information on encryption and to security_clauses for related ALTER SYSTEM statements.

USING 'encrypt_algorithm

Use this clause to specify the name of the algorithm to be used. Valid algorithms are AES256, AES192, AES128 and 3DES168. If you omit this clause, then the database uses AES192. If you encrypt more than one column in the same table, and if you specify the USING clause for one of the columns, then you must specify the same encryption algorithm for all the encrypted columns.

IDENTIFIED BY password If you specify this clause, then the database derives the column key from the specified password.

'integrity_algorithmUse this clause to specify the integrity algorithm to be used. Valid integrity algorithms are SHA-1 and NOMAC.

  • If you specify SHA-1, then TDE uses the Secure Hash Algorithm (SHA-1) and adds a 20-byte Message Authentication Code (MAC) to each encrypted value for integrity checking. This is the default.

  • If you specify NOMAC, then TDE does not add a MAC and does not perform the integrity check. This saves 20 bytes of disk space per encrypted value. Refer to Oracle Database Advanced Security Administrator's Guide for more information on using NOMAC to save disk space and improve performance.

All encrypted columns in a table must use the same integrity algorithm. If you already have a table column using the SHA-1 algorithm, then you cannot use the NOMAC parameter to encrypt another column in the same table. Refer to the REKEY encryption_spec clause of ALTER TABLE to learn how to change the integrity algorithm used by all encrypted columns in a table.

SALT | NO SALT Specify SALT to instruct the database to append a random string, called "salt," to the clear text of the column before encrypting it. This is the default.

Specify NO SALT to prevent the database from appending salt to the clear text of the column before encrypting it.

The following considerations apply when specifying SALT or NO SALT for encrypted columns:

  • If you want to use the column as an index key, then you must specify NO SALT. Refer to Oracle Database Advanced Security Administrator's Guide for a description of "salt" in this context.

  • If you specify table compression for the table, then the database does not compress the data in encrypted columns with SALT.

You cannot specify SALT or NO SALT for LOB encryption.

Restrictions on encryption_specThe following restrictions apply to column encryption:

  • Transparent Data Encryption is not supported by the traditional import and export utilities or by transportable-tablespace-based export. Use the Data Pump import and export utilities with encrypted columns instead.

  • To encrypt a column in an external table, the table must use ORACLE_DATAPUMP as its access type.

  • You cannot encrypt a column in tables owned by SYS.

  • You cannot encrypt a foreign key column.


See Also:

Oracle Database Advanced Security Administrator's Guide for more information about Transparent Data Encryption

virtual_column_definition

The virtual_column_definition clause lets you create a virtual column. A virtual column is not stored on disk. Rather, the database derives the values in a virtual column on demand by computing a set of expressions or functions. Virtual columns can be used in queries, DML, and DDL statements. They can be indexed, and you can collect statistics on them. Thus, they can be treated much as other columns. Exceptions and restrictions are listed below in "Notes on Virtual Columns" and "Restrictions on Virtual Columns".

  • For column, specify the name of the virtual column.

  • You can optionally specify the data type of the virtual column. If you omit datatype, then the database determines the data type of the column based on the data type of the underlying expressions. All Oracle scalar data types and XMLType are supported.

  • The keywords GENERATED ALWAYS are provided for syntactic clarity. They indicate that the column is not stored on disk, but is evaluated on demand.

  • The AS column_expression clause determines the content of the column. Refer to "Column Expressions" for more information on column_expression.

  • The keyword VIRTUAL is optional and for syntactic clarity.

Notes on Virtual Columns

  • If column_expression refers to a column on which column-level security is implemented, then the virtual column does not inherit the security rules of the base column. In such a case, you must ensure that data in the virtual column is protected, either by duplicating a column-level security policy on the virtual column or by applying a function that implicitly masks the data. For example, it is common for credit card numbers to be protected by a column-level security policy, while still allowing call center employees to view the last four digits of the credit card number for validation purposes. In such a case, you could define the virtual column to take a substring of the last four digits of the credit card number.

  • A table index defined on a virtual column is equivalent to a function-based index on the table.

  • You cannot directly update a virtual column. Thus, you cannot specify a virtual column in the SET clause of an UPDATE statement. However, you can specify a virtual column in the WHERE clause of an UPDATE statement. Likewise, you can specify a virtual column in the WHERE clause of a DELETE statement to delete rows from a table based on the derived value of the virtual column.

  • A query that specifies in its FROM clause a table containing a virtual column is eligible for result caching. Refer to "RESULT_CACHE Hint" for more information on result caching.

  • The column_expression can refer to a PL/SQL function if the function is explicitly designated DETERMINISTIC during its creation. However, if the function is subsequently replaced, definitions dependent on the virtual column are not invalidated. In such a case, if the table contains data, queries that reference the virtual column may return incorrect results if the virtual column is used in the definition of constraints, indexes, or materialized views or for result caching. Therefore, in order to replace the deterministic PL/SQL function for a virtual column.

    • Disable and re-enable any constraints on the virtual column.

    • Rebuild any indexes on the virtual column.

    • Fully refresh materialized views accessing the virtual column.

    • Flush the result cache if cached queries have accessed the virtual column.

    • Regather statistics on the table.

Restrictions on Virtual Columns

  • You can create virtual columns only in relational heap tables. Virtual columns are not supported for index-organized, external, object, cluster, or temporary tables.

  • The column_expression in the AS clause has the following restrictions:

    • It cannot refer to another virtual column by name.

    • Any columns referenced in column_expression must be defined on the same table.

    • It can refer to a deterministic user-defined function, but if it does, then you cannot use the virtual column as a partitioning key column.

    • The output of column_expression must be a scalar value.


    See Also:

    "Column Expressions" for additional information and restrictions on column_expression

  • The virtual column cannot be an Oracle supplied data type, a user-defined type, or LOB or LONG RAW.

  • You cannot specify a call to a PL/SQL function in the defining expression for a virtual column that you want to use as a partitioning column.


See Also:

"Adding a Virtual Table Column: Example" and Oracle Database Administrator's Guide for examples of creating tables with virtual columns

Constraint Clauses

Use these clauses to create constraints on the table columns. You must specify a PRIMARY KEY constraint for an index-organized table, and it cannot be DEFERRABLE. Refer to constraint for syntax and description of these constraints as well as examples.

inline_ref_constraint and out_of_line_ref_constraint  These clauses let you describe a column of type REF. The only difference between these clauses is that you specify out_of_line_ref_constraint from the table level, so you must identify the REF column or attribute you are defining. Specify inline_ref_constraint as part of the definition of the REF column or attribute.

inline_constraint  Use the inline_constraint to define an integrity constraint as part of the column definition.

You can create UNIQUE, PRIMARY KEY, and REFERENCES constraints on scalar attributes of object type columns. You can also create NOT NULL constraints on object type columns and CHECK constraints that reference object type columns or any attribute of an object type column.

out_of_line_constraint  Use the out_of_line_constraint syntax to define an integrity constraint as part of the table definition.

supplemental_logging_props

The supplemental_logging_props clause lets you instruct the database to put additional data into the log stream to support log-based tools.

supplemental_log_grp_clause Use this clause to create a named log group.

  • The NO LOG clause lets you omit from the redo log one or more columns that would otherwise be included in the redo for the named log group. You must specify at least one fixed-length column without NO LOG in the named log group.

  • If you specify ALWAYS, then during an update, the database includes in the redo all columns in the log group. This is called an unconditional log group (sometimes called an "always log group"), because Oracle Database supplementally logs all the columns in the log group when the associated row is modified. If you omit ALWAYS, then the database supplementally logs all the columns in the log group only if any column in the log group is modified. This is called a conditional log group.

You can query the appropriate USER_, ALL_, or DBA_LOG_GROUP_COLUMNS data dictionary view to determine whether any supplemental logging has already been specified.

supplemental_id_key_clause Use this clause to specify that all or a combination of the primary key, unique key, and foreign key columns should be supplementally logged. Oracle Database will generate either an unconditional log group or a conditional log group. With an unconditional log group, the database supplementally logs all the columns in the log group when the associated row is modified. With a conditional log group, the database supplementally logs all the columns in the log group only if any column in the log group is modified.

  • If you specify ALL COLUMNS, then the database includes in the redo log all the fixed-length maximum size columns of that row. Such a redo log is a system-generated unconditional log group.

  • If you specify PRIMARY KEY COLUMNS, then for all tables with a primary key, the database places into the redo log all columns of the primary key whenever an update is performed. Oracle Database evaluates which columns to supplementally log as follows:

    • First the database chooses columns of the primary key constraint, if the constraint is validated or marked RELY and is not marked as DISABLED or INITIALLY DEFERRED.

    • If no primary key columns exist, then the database looks for the smallest UNIQUE index with at least one NOT NULL column and uses the columns in that index.

    • If no such index exists, then the database supplementally logs all scalar columns of the table.

  • If you specify UNIQUE COLUMNS, then for all tables with a unique key or a bitmap index, if any of the unique key or bitmap index columns are modified, the database places into the redo log all other columns belonging to the unique key or bitmap index. Such a log group is a system-generated conditional log group.

  • If you specify FOREIGN KEY COLUMNS, then for all tables with a foreign key, if any foreign key columns are modified, the database places into the redo log all other columns belonging to the foreign key. Such a redo log is a system-generated conditional log group.

If you specify this clause multiple times, then the database creates a separate log group for each specification. You can query the appropriate USER_, ALL_, or DBA_LOG_GROUPS data dictionary view to determine whether any supplemental logging data has already been specified.

ON COMMIT

The ON COMMIT clause is relevant only if you are creating a temporary table. This clause specifies whether the data in the temporary table persists for the duration of a transaction or a session.

DELETE ROWS Specify DELETE ROWS for a transaction-specific temporary table. This is the default. Oracle Database will truncate the table (delete all its rows) after each commit.

PRESERVE ROWS Specify PRESERVE ROWS for a session-specific temporary table. Oracle Database will truncate the table (delete all its rows) when you terminate the session.

physical_properties

The physical properties relate to the treatment of extents and segments and to the storage characteristics of the table.

deferred_segment_creation

Use this clause to determine when the database should create the segment(s) for this table:

  • SEGMENT CREATION DEFERRED: This clause defers creation of the table segment — as well as segments for any LOB columns of the table, any indexes created implicitly as part of table creation, and any indexes subsequently explicitly created on the table — until the first row of data is inserted into the table. At that time, the segments for the table, LOB columns and indexes, and explicitly created indexes are all materialized and inherit any storage properties specified in this CREATE TABLE statement or, in the case of explicitly created indexes, the CREATE INDEX statement. These segments are created regardless whether the initial insert operation is uncommitted or rolled back. This is the default value.


    Caution:

    When creating many tables with deferred segment creation, ensure that you allocate enough space for your database so that when the first rows are inserted, there is enough space for all the new segments.

  • SEGMENT CREATION IMMEDIATE: The table segment is created as part of this CREATE TABLE statement.

Immediate segment creation is useful, for example, if your application depends upon the object appearing in the DBA_, USER_, and ALL_SEGMENTS data dictionary views, because the object will not appear in those views until the segment is created. This clause overrides the setting of the DEFERRED_SEGMENT_CREATION initialization parameter.

To determine whether a segment has been created for an existing table or its LOB columns or indexes, query the SEGMENT_CREATED column of USER_TABLES, USER_INDEXES, or USER_LOBS.

Notes on Tables Without Segments  The following rules apply to a table whose segment has not yet been materialized:

  • If you create this table with CREATE TABLE ... AS subquery, then if the source table has no rows, segment creation of the new table is deferred. If the source table has rows, then segment creation of the new table is not deferred.

  • If you specify ALTER TABLE ... ALLOCATE EXTENT before the segment is materialized, then the segment is materialized and then an extent is allocated. However the ALLOCATE EXTENT clause in a DDL statement on any indexes of the table will return an error.

  • In a DDL statement on the table or its LOB columns or indexes, any specification of DEALLOCATE UNUSED is silently ignored.

  • ONLINE operations on indexes of a table or table partition without a segment will silently be disabled; that is, they will proceed OFFLINE.

  • If any of the following DDL statements are executed on a table with one or more LOB columns, then the resulting partition(s) or subpartition(s) will be materialized:

    • ALTER TABLE SPLIT [SUB]PARTITION

    • ALTER TABLE MERGE [SUB]PARTITIONS

    • ALTER TABLE ADD [SUB]PARTITION (hash partition only)

    • ALTER TABLE COALESCE [SUB]PARTITION (hash partition only)

Restrictions on Deferred Segment Creation This clause is subject to the following restrictions:

  • You cannot defer segment creation for the following types of tables: index-organized tables, clustered tables, global temporary tables, session-specific temporary tables, internal tables, object tables, XMLType tables, AQ tables, external tables, and tables owned by SYS, SYSTEM, PUBLIC, OUTLN, or XDB.

  • Deferred segment creation is supported on partitions and subpartitions beginning with Oracle Database 11g Release 2 (11.2.0.2).

  • Deferred segment creation is not supported for bitmap join indexes and domain indexes.

  • Deferred segment creation is not supported in dictionary-managed tablespaces.

  • Deferred segment creation is not supported in the SYSTEM tablespace.

  • Serializable transactions do not work with deferred segment creation. Trying to insert data into an empty table with no segment created causes an error.


See Also:

Oracle Database Concepts for general information on segment allocation and Oracle Database Reference for more information about the DEFERRED_SEGMENT_CREATION initialization parameter

segment_attributes_clause

The segment_attributes_clause lets you specify physical attributes and tablespace storage for the table.

physical_attributes_clause The physical_attributes_clause lets you specify the value of the PCTFREE, PCTUSED, and INITRANS parameters and the storage characteristics of the table.

  • For a nonpartitioned table, each parameter and storage characteristic you specify determines the actual physical attribute of the segment associated with the table.

  • For partitioned tables, the value you specify for the parameter or storage characteristic is the default physical attribute of the segments associated with all partitions specified in this CREATE statement (and in subsequent ALTER TABLE ... ADD PARTITION statements), unless you explicitly override that value in the PARTITION clause of the statement that creates the partition.

If you omit this clause, then Oracle Database sets PCTFREE to 10, PCTUSED to 40, and INITRANS to 1.


See Also:


TABLESPACE  Specify the tablespace in which Oracle Database creates the table, object table OIDINDEX, partition, LOB data segment, LOB index segment, or index-organized table overflow data segment. If you omit TABLESPACE, then the database creates that item in the default tablespace of the owner of the schema containing the table.

For a heap-organized table with one or more LOB columns, if you omit the TABLESPACE clause for LOB storage, then the database creates the LOB data and index segments in the tablespace where the table is created.

For an index-organized table with one or more LOB columns, if you omit TABLESPACE, then the LOB data and index segments are created in the tablespace in which the primary key index segment of the index-organized table is created.

For nonpartitioned tables, the value specified for TABLESPACE is the actual physical attribute of the segment associated with the table. For partitioned tables, the value specified for TABLESPACE is the default physical attribute of the segments associated with all partitions specified in the CREATE statement and on subsequent ALTER TABLE ... ADD PARTITION statements, unless you specify TABLESPACE in the PARTITION description.


See Also:

CREATE TABLESPACE for more information on tablespaces

logging_clause

Specify whether the creation of the table and of any indexes required because of constraints, partition, or LOB storage characteristics will be logged in the redo log file (LOGGING) or not (NOLOGGING).The logging attribute of the table is independent of that of its indexes.

This attribute also specifies whether subsequent direct loader (SQL*Loader) and direct-path INSERT operations against the table, partition, or LOB storage are logged (LOGGING) or not logged (NOLOGGING).

Refer to logging_clause for a full description of this clause.

table_compression

The table_compression clause is valid only for heap-organized tables. Use this clause to instruct the database whether to compress data segments to reduce disk use. The COMPRESS keyword enables table compression. The NOCOMPRESS keyword disables table compression. NOCOMPRESS is the default.

  • When you enable table compression by specifying either COMPRESS or COMPRESS BASIC, you enable basic table compression. Oracle Database attempts to compress data during direct-path INSERT operations when it is productive to do so. The original import utility (imp) does not support direct-path INSERT, and therefore cannot import data in a compressed format.

    Tables with COMPRESS or COMPRESS BASIC use a PCTFREE value of 0 to maximize compression, unless you explicitly set a value for PCTFREE in the physical_attributes_clause.

    In earlier releases, this type of compression was called DSS table compression and was enabled using COMPRESS FOR DIRECT_LOAD OPERATIONS. This syntax has been deprecated.


    See Also:

    "Conventional and Direct-Path INSERT" for information on direct-path INSERT operations, including restrictions

  • When you enable table compression by specifying COMPRESS FOR OLTP, you enable OLTP table compression. Oracle Database compresses data during all DML operations on the table. This form of compression is recommended for OLTP environments.

    Tables with COMPRESS FOR OLTP or NOCOMPRESS use the PCTFREE default value of 10, to maximize compress while still allowing for some future DML changes to the data, unless you override this default explicitly.

    In earlier releases, OLTP table compression was enabled using COMPRESS FOR ALL OPERATIONS. This syntax has been deprecated.

  • When you specify COMPRESS FOR QUERY or COMPRESS FOR ARCHIVE, you enable Hybrid Columnar Compression. With Hybrid Columnar Compression, data can be compressed during bulk load operations. During the load process, data is transformed into a column-oriented format and then compressed. Oracle Database uses a compression algorithm appropriate for the level you specify. In general, the higher the level, the greater the compression ratio. Hybrid Columnar Compression can result in higher compression ratios, at a greater CPU cost. Therefore, this form of compression is recommended for data that is not frequently updated.

    COMPRESS FOR QUERY is useful in data warehousing environments. Valid values are LOW and HIGH, with HIGH providing a higher compression ratio. The default is HIGH.

    COMPRESS FOR ARCHIVE uses higher compression ratios than COMPRESS FOR QUERY, and is useful for compressing data that will be stored for long periods of time. Valid values are LOW and HIGH, with HIGH providing the highest possible compression ratio. The default is LOW.

    Tables with COMPRESS FOR QUERY or COMPRESS FOR ARCHIVE use a PCTFREE value of 0 to maximize compression, unless you explicitly set a value for PCTFREE in the physical_attributes_clause. For these tables, PCTFREE has no effect for blocks loaded using direct-path INSERT. PCTFREE is honored for blocks loaded using conventional INSERT, and for blocks created as a result of DML operations on blocks originally loaded using direct-path INSERT.


    See Also:

    Oracle Database Concepts for more information on Hybrid Columnar Compression, which is a feature of certain Oracle storage systems

You can specify table compression for the following portions of a heap-organized table:

  • For an entire table, in the physical_properties clause of relational_table or object_table

  • For a range partition, in the table_partition_description of the range_partitions clause

  • For a composite range partition, in the table_partition_description of the range_partition_desc

  • For a composite list partition, in the table_partition_description of the list_partition_desc

  • For a list partition, in the table_partition_description of the list_partitions clause

  • For a system or reference partition, in the table_partition_description of the reference_partition_desc

  • For the storage table of a nested table, in the nested_table_col_properties clause


    See Also:

    Oracle Database PL/SQL Packages and Types Reference for information about the DBMS_COMPRESSION package, which helps you choose the correct compression level for an application, and Oracle Database Administrator's Guide for more information about table compression, including examples

Restrictions on Table Compression Table compression is subject to the following restrictions:

  • COMPRESS FOR OLTP and COMPRESS BASIC are not supported for tables with more than 255 columns.

  • Data segments of BasicFiles LOBs are not compressed. For information on compression of SecureFiles LOBs, see LOB_compression_clause.

  • You cannot drop a column from a table that uses COMPRESS BASIC, although you can set such a column as unused. All of the operations of the ALTER TABLE ... drop_column_clause are valid for tables that use COMPRESS FOR OLTP, COMPRESS FOR QUERY, and COMPRESS FOR ARCHIVE.

  • If you specify COMPRESS FOR OLTP, then chained rows are not compressed unless the header for the row remains in the original block and all row columns are moved to another block. If the row chaining results in leaving just the row header in the block and moving all of the row's columns to the next block, and they all fit in the next block, then the columns can be compressed.

  • You cannot specify any type of table compression for an index-organized table, any overflow segment or partition of an overflow segment, or any mapping table segment of an index-organized table.

  • You cannot specify any type of table compression for external tables or for tables that are part of a cluster.

  • You cannot specify any type of table compression for tables with LONG or LONG RAW columns, tables that are owned by the SYS schema and reside in the SYSTEM tablespace, or tables with ROWDEPENDENCIES enabled.

  • You cannot specify Hybrid Columnar Compression on tables that are enabled for flashback archiving.

  • You cannot specify Hybrid Columnar Compression on the following object-relational features: object tables, XMLType tables, columns with abstract data types, collections stored as tables, or OPAQUE types, including XMLType columns stored as objects.

  • When you update a row in a table compressed with Hybrid Columnar Compression, the ROWID of the row may change.

  • In tables compressed with Hybrid Columnar Compression, updates to a single row may result in locks on multiple rows. Concurrency for write transactions may therefore be affected.

  • If a table compressed with Hybrid Columnar Compression has a foreign key constraint, and you insert data using INSERT with the APPEND hint, then the data will be compressed to a lesser level than is typical with Hybrid Columnar Compression. To compress the data with Hybrid Columnar Compression, disable the foreign key constraint, insert the data using INSERT with the APPEND hint, and then reenable the foreign key constraint.

RECOVERABLE | UNRECOVERABLE

These keywords are deprecated and have been replaced with LOGGING and NOLOGGING, respectively. Although RECOVERABLE and UNRECOVERABLE are supported for backward compatibility, Oracle strongly recommends that you use the LOGGING and NOLOGGING keywords.

Restrictions on [UN]RECOVERABLE This clause is subject to the following restrictions:

  • You cannot specify RECOVERABLE for partitioned tables or LOB storage characteristics.

  • You cannot specify UNRECOVERABLE for partitioned or index-organized tables.

  • You can specify UNRECOVERABLE only with AS subquery.

ORGANIZATION

The ORGANIZATION clause lets you specify the order in which the data rows of the table are stored.

HEAP HEAP indicates that the data rows of table are stored in no particular order. This is the default.

INDEX INDEX indicates that table is created as an index-organized table. In an index-organized table, the data rows are held in an index defined on the primary key for the table.

EXTERNAL EXTERNAL indicates that table is a read-only table located outside the database.

index_org_table_clause

Use the index_org_table_clause to create an index-organized table. Oracle Database maintains the table rows, both primary key column values and nonkey column values, in an index built on the primary key. Index-organized tables are therefore best suited for primary key-based access and manipulation. An index-organized table is an alternative to:

  • A noncluster table indexed on the primary key by using the CREATE INDEX statement

  • A cluster table stored in an indexed cluster that has been created using the CREATE CLUSTER statement that maps the primary key for the table to the cluster key

You must specify a primary key for an index-organized table, because the primary key uniquely identifies a row. The primary key cannot be DEFERRABLE. Use the primary key instead of the rowid for directly accessing index-organized rows.

If an index-organized table is partitioned and contains LOB columns, then you should specify the index_org_table_clause first, then the LOB_storage_clause, and then the appropriate table_partitioning_clauses.

You cannot use the TO_LOB function to convert a LONG column to a LOB column in the subquery of a CREATE TABLE ... AS SELECT statement if you are creating an index-organized table. Instead, create the index-organized table without the LONG column, and then use the TO_LOB function in an INSERT ... AS SELECT statement.

The ROWID pseudocolumn of an index-organized table returns logical rowids instead of physical rowids. A column that you create with the data type ROWID cannot store the logical rowids of the IOT. The only data you can store in a column of type ROWID is rowids from heap-organized tables. If you want to store the logical rowids of an IOT, then create a column of type UROWID instead. A column of type UROWID can store both physical and logical rowids.

Restrictions on Index-Organized Tables Index-organized tables are subject to the following restrictions:

  • The ROWID pseudocolumn of an index-organized table returns logical rowids instead of physical rowids. A column that you create of type ROWID cannot store the logical rowids of the IOT. The only data you can store in a ROWID column is rowids from heap-organized tables. If you want to store the logical rowids of an IOT, then create a column of type UROWID instead. A column of type UROWID can store both physical and logical rowids.

  • You cannot define a virtual column for an index-organized table.

  • You cannot specify the composite_range_partitions, composite_list_partitions, or composite_hash_partitions clauses for an index-organized table.

  • If the index-organized table is a nested table or varray, then you cannot specify table_partitioning_clauses.

PCTTHRESHOLD integer Specify the percentage of space reserved in the index block for an index-organized table row. PCTTHRESHOLD must be large enough to hold the primary key. All trailing columns of a row, starting with the column that causes the specified threshold to be exceeded, are stored in the overflow segment. PCTTHRESHOLD must be a value from 1 to 50. If you do not specify PCTTHRESHOLD, then the default is 50.

Restriction on PCTTHRESHOLD You cannot specify PCTTHRESHOLD for individual partitions of an index-organized table.

mapping_table_clauses Specify MAPPING TABLE to instruct the database to create a mapping of local to physical ROWIDs and store them in a heap-organized table. This mapping is needed in order to create a bitmap index on the index-organized table. If the index-organized table is partitioned, then the mapping table is also partitioned and its partitions have the same name and physical attributes as the base table partitions.

Oracle Database creates the mapping table or mapping table partition in the same tablespace as its parent index-organized table or partition. You cannot query, perform DML operations on, or modify the storage characteristics of the mapping table or its partitions.

key_compression  The key_compression clauses let you enable or disable key compression for index-organized tables.

  • Specify COMPRESS to enable key compression, which eliminates repeated occurrence of primary key column values in index-organized tables. Use integer to specify the prefix length, which is the number of prefix columns to compress.

    The valid range of prefix length values is from 1 to the number of primary key columns minus 1. The default prefix length is the number of primary key columns minus 1.

  • Specify NOCOMPRESS to disable key compression in index-organized tables. This is the default.

Restriction on Key Compression of Index-organized Tables At the partition level, you can specify COMPRESS, but you cannot specify the prefix length with integer.

index_org_overflow_clause  The index_org_overflow_clause lets you instruct the database that index-organized table data rows exceeding the specified threshold are placed in the data segment specified in this clause.

  • When you create an index-organized table, Oracle Database evaluates the maximum size of each column to estimate the largest possible row. If an overflow segment is needed but you have not specified OVERFLOW, then the database raises an error and does not execute the CREATE TABLE statement. This checking function guarantees that subsequent DML operations on the index-organized table will not fail because an overflow segment is lacking.

  • All physical attributes and storage characteristics you specify in this clause after the OVERFLOW keyword apply only to the overflow segment of the table. Physical attributes and storage characteristics for the index-organized table itself, default values for all its partitions, and values for individual partitions must be specified before this keyword.

  • If the index-organized table contains one or more LOB columns, then the LOBs will be stored out-of-line unless you specify OVERFLOW, even if they would otherwise be small enough be to stored inline.

  • If table is partitioned, then the database equipartitions the overflow data segments with the primary key index segments.

INCLUDING column_name Specify a column at which to divide an index-organized table row into index and overflow portions. The primary key columns are always stored in the index. column_name can be either the last primary key column or any non primary key column. All non primary key columns that follow column_name are stored in the overflow data segment.

If an attempt to divide a row at column_name causes the size of the index portion of the row to exceed the specified or default PCTTHRESHOLD value, then the database breaks up the row based on the PCTTHRESHOLD value.

Restriction on the INCLUDING Clause You cannot specify this clause for individual partitions of an index-organized table.

external_table_clause

Use the external_table_clause to create an external table, which is a read-only table whose metadata is stored in the database but whose data in stored outside the database. Among other capabilities, external tables let you query data without first loading it into the database.


See Also:

Oracle Database Data Warehousing Guide, Oracle Database Administrator's Guide, and Oracle Database Utilities for information on the uses for external tables

Because external tables have no data in the database, you define them with a small subset of the clauses normally available when creating tables.

  • Within the relational_properties clause, you can specify only column and datatype.

  • Within the physical_properties_clause, you can specify only the organization of the table (ORGANIZATION EXTERNAL external_table_clause).

  • Within the table_properties clause, you can specify only the parallel_clause. The parallel_clause lets you parallelize subsequent queries on the external data and subsequent operations that populate the external table.

  • You can populate the external table at create time by using the AS subquery clause.

No other clauses are permitted in the same CREATE TABLE statement.


See Also:


Restrictions on External Tables External tables are subject to the following restrictions:

  • An external table cannot be a temporary table.

  • You cannot specify constraints on an external table.

  • An external table cannot contain virtual columns.

  • You cannot create an index on an external table.

  • An external table cannot have object type, varray, or LONG columns. However, you can populate LOB columns of an external table with varray or LONG data from an internal database table.

TYPE  TYPE access_driver_type indicates the access driver of the external table. The access driver is the API that interprets the external data for the database. Oracle Database provides two access drivers: ORACLE_LOADER and ORACLE_DATAPUMP. If you do not specify TYPE, then the database uses ORACLE_LOADER as the default access driver. You must specify the ORACLE_DATAPUMP access driver if you specify the AS subquery clause to unload data from one Oracle Database and reload it into the same or a different Oracle Database.


See Also:

Oracle Database Utilities for information about the ORACLE_LOADER and ORACLE_DATAPUMP access drivers

DEFAULT DIRECTORY DEFAULT DIRECTORY lets you specify a default directory object corresponding to a directory on the file system where the external data sources may reside. The default directory can also be used by the access driver to store auxiliary files such as error logs.

ACCESS PARAMETERS The optional ACCESS PARAMETERS clause lets you assign values to the parameters of the specific access driver for this external table.

  • The opaque_format_spec specifies all access parameters for the ORACLE_LOADER and ORACLE_DATAPUMP access drivers. See Oracle Database Utilities for descriptions of these parameters.

    Field names specified in the opaque_format_spec must match columns in the table definition. Oracle Database ignores any field in the opaque_format_spec that is not matched by a column in the table definition.

  • USING CLOB subquery lets you derive the parameters and their values through a subquery. The subquery cannot contain any set operators or an ORDER BY clause. It must return one row containing a single item of data type CLOB.

Whether you specify the parameters in an opaque_format_spec or derive them using a subquery, the database does not interpret anything in this clause. It is up to the access driver to interpret this information in the context of the external data.

LOCATION The LOCATION clause lets you specify one or more external data sources. Usually the location_specifier is a file, but it need not be. Oracle Database does not interpret this clause. It is up to the access driver to interpret this information in the context of the external data. You cannot use wildcards in the location_specifier to specify multiple files.

REJECT LIMIT The REJECT LIMIT clause lets you specify how many conversion errors can occur during a query of the external data before an Oracle Database error is returned and the query is aborted. The default value is 0.

CLUSTER Clause

The CLUSTER clause indicates that the table is to be part of cluster. The columns listed in this clause are the table columns that correspond to the cluster columns. Generally, the cluster columns of a table are the column or columns that make up its primary key or a portion of its primary key. Refer to CREATE CLUSTER for more information.

Specify one column from the table for each column in the cluster key. The columns are matched by position, not by name.

A cluster table uses the space allocation of the cluster. Therefore, do not use the PCTFREE, PCTUSED, or INITRANS parameters, the TABLESPACE clause, or the storage_clause with the CLUSTER clause.

Restrictions on Cluster Tables Cluster tables are subject to the following restrictions:

  • Object tables and tables containing LOB columns or columns of the Any* Oracle-supplied types cannot be part of a cluster.

  • You cannot specify the parallel_clause or CACHE or NOCACHE for a table that is part of a cluster.

  • You cannot specify CLUSTER with either ROWDEPENDENCIES or NOROWDEPENDENCIES unless the cluster has been created with the same ROWDEPENDENCIES or NOROWDEPENDENCIES setting.

table_properties

The table_properties further define the characteristics of the table.

column_properties

Use the column_properties clauses to specify the storage attributes of a column.

object_type_col_properties

The object_type_col_properties determine storage characteristics of an object column or attribute or of an element of a collection column or attribute.

column For column, specify an object column or attribute.

substitutable_column_clause The substitutable_column_clause indicates whether object columns or attributes in the same hierarchy are substitutable for each other. You can specify that a column is of a particular type, or whether it can contain instances of its subtypes, or both.

  • If you specify ELEMENT, then you constrain the element type of a collection column or attribute to a subtype of its declared type.

  • The IS OF [TYPE] (ONLY type) clause constrains the type of the object column to a subtype of its declared type.

  • NOT SUBSTITUTABLE AT ALL LEVELS indicates that the object column cannot hold instances corresponding to any of its subtypes. Also, substitution is disabled for any embedded object attributes and elements of embedded nested tables and varrays. The default is SUBSTITUTABLE AT ALL LEVELS.

Restrictions on the substitutable_column_clause This clause is subject to the following restrictions:

  • You cannot specify this clause for an attribute of an object column. However, you can specify this clause for a object type column of a relational table and for an object column of an object table if the substitutability of the object table itself has not been set.

  • For a collection type column, the only part of this clause you can specify is [NOT] SUBSTITUTABLE AT ALL LEVELS.

LOB_storage_clause

The LOB_storage_clause lets you specify the storage attributes of LOB data segments. You must specify at least one clause after the STORE AS keywords. If you specify more than one clause, then you must specify them in the order shown in the syntax diagram, from top to bottom.

For a nonpartitioned table, this clause specifies the storage attributes of LOB data segments of the table.

For a partitioned table, Oracle Database implements this clause depending on where it is specified:

  • For a partitioned table specified at the table level—when specified in the physical_properties clause along with one of the partitioning clauses—this clause specifies the default storage attributes for LOB data segments associated with each partition or subpartition. These storage attributes apply to all partitions or subpartitions unless overridden by a LOB_storage_clause at the partition or subpartition level.

  • For an individual partition of a partitioned table—when specified as part of a table_partition_description—this clause specifies the storage attributes of the data segments of the partition or the default storage attributes of any subpartitions of the partition. A partition-level LOB_storage_clause overrides a table-level LOB_storage_clause.

  • For an individual subpartition of a partitioned table—when specified as part of subpartition_by_hash or subpartition_by_list—this clause specifies the storage attributes of the data segments of the subpartition. A subpartition-level LOB_storage_clause overrides both partition-level and table-level LOB_storage_clauses.

Restriction on the LOB_storage_clauseOnly the TABLESPACE clause is allowed when specifying the LOB_storage_clause in a subpartition.


See Also:


LOB_item

Specify the LOB column name or LOB object attribute for which you are explicitly defining tablespace and storage characteristics that are different from those of the table. Oracle Database automatically creates a system-managed index for each LOB_item you create.

SECUREFILE | BASICFILE

Use this clause to specify the type of LOB storage, either high-performance LOB (SecureFiles), or the traditional LOB (BasicFiles).


See Also:

Oracle Database SecureFiles and Large Objects Developer's Guide for more information about SecureFiles LOBs


Note:

You cannot convert a LOB from one type of storage to the other. Instead you must migrate to SecureFiles or BasicFiles by using online redefinition or partition exchange.

LOB_segname

Specify the name of the LOB data segment. You cannot use LOB_segname if you specify more than one LOB_item.

LOB_storage_parameters

The LOB_storage_parameters clause lets you specify various elements of LOB storage.

TABLESPACE Clause  Use this clause to specify the tablespace in which LOB data is to be stored.

storage_clause  Use the storage_clause to specify various aspects of LOB segment storage. Of particular interest in the context of LOB storage is the MAXSIZE clause of the storage_clause, which can be used in combination with the LOB_retention_clause of LOB_parameters. Refer to storage_clause for more information.

LOB_parameters

Several of the LOB_parameters are no longer needed if you are using SecureFiles for LOB storage. The PCTVERSION and FREEPOOLS parameters are valid and useful only if you are using BasicFiles LOB storage.

ENABLE STORAGE IN ROW  If you enable storage in row, then the LOB value is stored in the row (inline) if its length is less than approximately 4000 bytes minus system control information. This is the default.

Restriction on Enabling Storage in Row For an index-organized table, you cannot specify this parameter unless you have specified an OVERFLOW segment in the index_org_table_clause.

DISABLE STORAGE IN ROW  If you disable storage in row, then the LOB value is stored outside of the row out of line regardless of the length of the LOB value.

The LOB locator is always stored inline regardless of where the LOB value is stored. You cannot change the value of STORAGE IN ROW once it is set except by moving the table. See the move_table_clause in the ALTER TABLE documentation for more information.

CHUNK integer  Specify the number of bytes to be allocated for LOB manipulation. If integer is not a multiple of the database block size, then the database rounds up in bytes to the next multiple. For example, if the database block size is 2048 and integer is 2050, then the database allocates 4096 bytes (2 blocks). The maximum value is 32768 (32K), which is the largest Oracle Database block size allowed. The default CHUNK size is one Oracle Database block.

The value of CHUNK must be less than or equal to the value of NEXT, either the default value or that specified in the storage_clause. If CHUNK exceeds the value of NEXT, then the database returns an error. You cannot change the value of CHUNK once it is set.

PCTVERSION integer  

Specify the maximum percentage of overall LOB storage space used for maintaining old versions of the LOB. If the database is running in manual undo mode, then the default value is 10, meaning that older versions of the LOB data are not overwritten until they consume 10% of the overall LOB storage space.

You can specify the PCTVERSION parameter whether the database is running in manual or automatic undo mode. PCTVERSION is the default in manual undo mode. RETENTION is the default in automatic undo mode. You cannot specify both PCTVERSION and RETENTION.

This clause is not valid if you have specified SECUREFILE. If you specify both SECUREFILE and PCTVERSION, then the database silently ignores the PCTVERSION parameter.

LOB_retention_clause  Use this clause to specify whether you want the LOB segment retained for flashback purposes, consistent-read purposes, both, or neither.

You can specify the RETENTION parameter only if the database is running in automatic undo mode. Oracle Database uses the value of the UNDO_RETENTION initialization parameter to determine the amount of committed undo data to retain in the database. In automatic undo mode, RETENTION is the default value unless you specify PCTVERSION. You cannot specify both PCTVERSION and RETENTION.

You can specify the optional settings after RETENTION only if you are using SecureFiles. The SECUREFILE parameter of the LOB_storage_clause indicates that the database will use SecureFiles to manage storage dynamically, taking into account factors such as the undo mode of the database.

  • Specify MAX to signify that the undo should be retained until the LOB segment has reached MAXSIZE. If you specify MAX, then you must also specify the MAXSIZE clause in the storage_clause.

  • Specify MIN if the database is in flashback mode to limit the undo retention duration for the specific LOB segment to n seconds.

  • Specify AUTO if you want to retain undo sufficient for consistent read purposes only.

  • Specify NONE if no undo is required for either consistent read or flashback purposes.

If you do not specify the RETENTION parameter, or you specify RETENTION with no optional settings, then RETENTION is set to DEFAULT, which is functionally equivalent to AUTO.


See Also:


FREEPOOLS integer  Specify the number of groups of free lists for the LOB segment. Normally integer will be the number of instances in an Oracle Real Application Clusters environment or 1 for a single-instance database.

You can specify this parameter only if the database is running in automatic undo mode. In this mode, FREEPOOLS is the default unless you specify the FREELIST GROUPS parameter of the storage_clause. If you specify neither FREEPOOLS nor FREELIST GROUPS, then the database uses a default of FREEPOOLS 1 if the database is in automatic undo management mode and a default of FREELIST GROUPS 1 if the database is in manual undo management mode.

This clause is not valid if you have specified SECUREFILE. If you specify both SECUREFILE and FREEPOOLS, then the database silently ignores the FREEPOOLS parameter.

Restriction on FREEPOOLS You cannot specify both FREEPOOLS and the FREELIST GROUPS parameter of the storage_clause.

LOB_deduplicate_clause  This clause is valid only for SecureFiles LOBs. Use the LOB_deduplicate_clause to enable or disable LOB deduplication, which is the elimination of duplicate LOB data.

The DEDUPLICATE keyword instructs the database to eliminate duplicate copies of LOBs. Using a secure hash index to detect duplication, the database coalesces LOBs with identical content into a single copy, reducing storage consumption and simplifying storage management.

If you omit this clause, then LOB deduplication is disabled by default.

This clause implements LOB deduplication for the entire LOB segment. To enable or disable deduplication for an individual LOB, use the DBMS_LOB.SETOPTIONS procedure.


See Also:

Oracle Database SecureFiles and Large Objects Developer's Guide for more information about LOB deduplication and Oracle Database PL/SQL Packages and Types Reference for information about about the DBMS_LOB package

LOB_compression_clause  This clause is valid only for SecureFiles LOBs, not for BasicFiles LOBs. Use the LOB_compression_clause to instruct the database to enable or disable server-side LOB compression. Random read/write access is possible on server-side compressed LOB segments. LOB compression is independent from table compression or index compression. If you omit this clause, then NOCOMPRESS is the default.

You can specify HIGH, MEDIUM, or LOW to vary the degree of compression. The HIGH degree of compression incurs higher latency than MEDIUM but provides better compression. The LOW degree results in significantly higher decompression and compression speeds, at the cost of slightly lower compression ratio than either HIGH or MEDIUM. If you omit this optional parameter, then the default is MEDIUM.

This clause implements server-side LOB compression for the entire LOB segment. To enable or disable compression on an individual LOB, use the DBMS_LOB.SETOPTIONS procedure.


See Also:

Oracle Database SecureFiles and Large Objects Developer's Guide for more information on server-side LOB storage and Oracle Database PL/SQL Packages and Types Reference for information about client-side LOB compression using the UTL_COMPRESS supplied package and for information about the DBMS_LOB package

ENCRYPT | DECRYPT  These clauses are valid only for LOBs that are using SecureFiles for LOB storage. Specify ENCRYPT to encrypt all LOBs in the column. Specify DECRYPT to keep the LOB in cleartext. If you omit this clause, then DECRYPT is the default.

Refer to encryption_spec for general information on that clause. When applied to a LOB column, encryption_spec is specific to the individual LOB column, so the encryption algorithm can differ from that of other LOB columns and other non-LOB columns. Use the encryption_spec as part of the column_definition to encrypt the entire LOB column. Use the encryption_spec as part of the LOB_storage_clause in the table_partition_description to encrypt a LOB partition.

Restriction on encryption_spec for LOBs You cannot specify the SALT or NO SALT clauses of encryption_spec for LOB encryption.


See Also:

Oracle Database SecureFiles and Large Objects Developer's Guide for more information on LOB encryption and Oracle Database PL/SQL Packages and Types Reference for information the DBMS_LOB package

CACHE | NOCACHE | CACHE READS  Refer to CACHE | NOCACHE | CACHE READS for information on that clause.

LOB_partition_storage

The LOB_partition_storage clause lets you specify a separate LOB_storage_clause or varray_col_properties clause for each partition. You must specify the partitions in the order of partition position. You can find the order of the partitions by querying the PARTITION_NAME and PARTITION_POSITION columns of the USER_IND_PARTITIONS view.

If you do not specify a LOB_storage_clause or varray_col_properties clause for a particular partition, then the storage characteristics are those specified for the LOB item at the table level. If you also did not specify any storage characteristics for the LOB item at the table level, then Oracle Database stores the LOB data partition in the same tablespace as the table partition to which it corresponds.

Restrictions on LOB_partition_storageLOB_partition_storage is subject to the following restrictions:

  • In the LOB_parameters of the LOB_storage_clause, you cannot specify encryption_spec, because it is invalid to specify an encryption algorithm for partitions and subpartitions.

  • You can only specify the TABLESPACE clause for hash partitions and all types of subpartitions.

varray_col_properties

The varray_col_properties let you specify separate storage characteristics for the LOB in which a varray will be stored. If varray_item is a multilevel collection, then the database stores all collection items nested within varray_item in the same LOB in which varray_item is stored.

  • For a nonpartitioned table—when specified in the physical_properties clause without any of the partitioning clauses—this clause specifies the storage attributes of the LOB data segments of the varray.

  • For a partitioned table specified at the table level—when specified in the physical_properties clause along with one of the partitioning clauses—this clause specifies the default storage attributes for the varray LOB data segments associated with each partition (or its subpartitions, if any).

  • For an individual partition of a partitioned table—when specified as part of a table_partition_description—this clause specifies the storage attributes of the varray LOB data segments of that partition or the default storage attributes of the varray LOB data segments of any subpartitions of this partition. A partition-level varray_col_properties overrides a table-level varray_col_properties.

  • For an individual subpartition of a partitioned table—when specified as part of subpartition_by_hash or subpartition_by_list—this clause specifies the storage attributes of the varray data segments of this subpartition. A subpartition-level varray_col_properties overrides both partition-level and table-level varray_col_properties.

STORE AS [SECUREFILE | BASICFILE] LOB Clause If you specify STORE AS LOB, then:

  • If the maximum varray size is less than approximately 4000 bytes, then the database stores the varray as an inline LOB unless you have disabled storage in row.

  • If the maximum varray size is greater than approximately 4000 bytes or if you have disabled storage in row, then the database stores in the varray as an out-of-line LOB.

If you do not specify STORE AS LOB, then storage is based on the maximum possible size of the varray rather than on the actual size of a varray column. The maximum size of the varray is the number of elements times the element size, plus a small amount for system control information. If you omit this clause, then:

  • If the maximum size of the varray is less than approximately 4000 bytes, then the database does not store the varray as a LOB, but as inline data.

  • If the maximum size is greater than approximately 4000 bytes, then the database always stores the varray as a LOB.

    • If the actual size is less than approximately 4000 bytes, then it is stored as an inline LOB

    • If the actual size is greater than approximately 4000 bytes, then it is stored as an out-of-line LOB, as is true for other LOB columns.

substitutable_column_clause The substitutable_column_clause has the same behavior as described for object_type_col_properties.

Restriction on Varray Column Properties  You cannot specify this clause on an interval partitioned table or a composite-partitioned table.

nested_table_col_properties

The nested_table_col_properties let you specify separate storage characteristics for a nested table, which in turn enables you to define the nested table as an index-organized table. Unless you explicitly specify otherwise in this clause:

  • For a nonpartitioned table, the storage table is created in the same schema and the same tablespace as the parent table.

  • For a partitioned table, the storage table is created in the default tablespace of the schema. By default, nested tables are equipartitioned with the partitioned base table.

  • In either case, the storage table uses default storage characteristics, and stores the nested table values of the column for which it was created.

You must include this clause when creating a table with columns or column attributes whose type is a nested table. Clauses within nested_table_col_properties that function the same way they function for the parent table are not repeated here.

nested_item Specify the name of a column, or of a top-level attribute of the object type of the tables, whose type is a nested table.

COLUMN_VALUE If the nested table is a multilevel collection, then the inner nested table or varray may not have a name. In this case, specify COLUMN_VALUE in place of the nested_item name.


See Also:

"Creating a Table: Multilevel Collection Example" for examples using nested_item and COLUMN_VALUE

LOCAL | GLOBAL 

Specify LOCAL to equipartition the nested table with the base table. This is the default. Oracle Database automatically creates a local partitioned index for the partitioned nested table.

Specify GLOBAL to indicate that the nested table is a nonpartitioned nested table of a partitioned base table.

storage_table Specify the name of the table where the rows of nested_item reside.

You cannot query or perform DML statements on storage_table directly, but you can modify its storage characteristics by specifying its name in an ALTER TABLE statement.


See Also:

ALTER TABLE for information about modifying nested table column storage characteristics

RETURN [AS] Specify what Oracle Database returns as the result of a query.

  • VALUE returns a copy of the nested table itself.

  • LOCATOR returns a collection locator to the copy of the nested table.

    The locator is scoped to the session and cannot be used across sessions. Unlike a LOB locator, the collection locator cannot be used to modify the collection instance.

If you do not specify the segment_attributes_clause or the LOB_storage_clause, then the nested table is heap organized and is created with default storage characteristics.

Restrictions on Nested Table Column Properties Nested table column properties are subject to the following restrictions:

  • You cannot specify this clause for a temporary table.

  • You cannot specify this clause on an interval partitioned table or a composite-partitioned table.

  • You cannot specify the oid_clause.

  • At create time, you cannot use object_properties to specify an out_of_line_ref_constraint, inline_ref_constraint, or foreign key constraint for the attributes of a nested table. However, you can modify a nested table to add such constraints using ALTER TABLE.


See Also:


XMLType_column_properties

The XMLType_column_properties let you specify storage attributes for an XMLTYPE column.

XMLType_storage XMLType data can be stored in binary XML, CLOB, or object-relational columns.

  • Specify BINARY XML to store the XML data in compact binary XML format.

    Any LOB parameters you specify are applied to the underlying BLOB column created for storing the binary XML encoded value.

    In earlier releases, binary XML data is stored by default in a BasicFiles LOB. Beginning with Oracle Database 11g Release 2 (11.2.0.2), if the COMPATIBLE initialization parameter is 11.2 or higher and you do not specify BASICFILE or SECUREFILE, then binary XML data is stored in a SecureFiles LOB whenever possible. If SecureFiles LOB storage is not possible then the binary XML data is stored in a BasicFiles LOB. This can occur if either of the following is true:

    • The tablespace for the XMLType table does not use automatic segment space management.

    • A setting in file init.ora prevents SecureFiles LOB storage. For example, see parameter DB_SECUREFILE in Oracle Database Reference.

  • Specify CLOB if you want the database to store the XMLType data in a CLOB column. Storing data in a CLOB column preserves the original content and enhances retrieval time.

    If you specify LOB storage, then you can specify either LOB parameters or the XMLSchema_spec clause, but not both. Specify the XMLSchema_spec clause if you want to restrict the table or column to particular schema-based XML instances.

    If you do not specify BASICFILE or SECUREFILE with this clause, then the CLOB column is stored in a BasicFiles LOB.


    Note:

    Oracle recommends against storing XMLType data in a CLOB column. Use of the CLOB clause in the XMLType_storage clause may be deprecated in a future release.

  • Specify OBJECT RELATIONAL if you want the database to store the XMLType data in object-relational columns. Storing data objects relationally lets you define indexes on the relational columns and enhances query performance.

    If you specify object-relational storage, then you must also specify the XMLSchema_spec clause.

Use the ALL VARRAYS AS clause if you want the database to store all varrays in an XMLType column.

In earlier releases, XMLType data is stored in a CLOB column in a BasicFiles LOB by default. Beginning with Oracle Database 11g Release 2 (11.2.0.2), if the COMPATIBLE initialization parameter is 11.2 or higher and you do not specify the XMLType_storage clause, then XMLType data is stored in a binary XML column in a SecureFiles LOB. If SecureFiles LOB storage is not possible, then it is stored in a binary XML column in a BasicFiles LOB.


See Also:

Oracle Database SecureFiles and Large Objects Developer's Guide for more information on SecureFiles LOBs

XMLSchema_spec  

Refer to the XMLSchema_spec for the full semantics of this clause.


See Also:


XMLType_virtual_columns

This clause is valid only for XMLType tables with binary XML storage, which you designate in the XMLType_storage clause. Specify the VIRTUAL COLUMNS clause to define virtual columns, which can be used as in a function-based index or in the definition of a constraint. You cannot define a constraint on such a virtual column during creation of the table, but you can use a subsequent ALTER TABLE statement to add a constraint to the column.


See Also:

Oracle XML DB Developer's Guide for examples of how to use this clause in an XML environment

table_partitioning_clauses

Use the table_partitioning_clauses to create a partitioned table.

Notes on Partitioning in General The following notes pertain to all types of partitioning:

  • You can specify up to a total of 1024K-1 partitions and subpartitions.

  • You can create a partitioned table with just one partition. A table with one partition is different from a nonpartitioned table. For example, you cannot add a partition to a nonpartitioned table.

  • You can specify a name for every table and LOB partition and for every table and LOB subpartition, but you need not do so. If you omit the name, then the database generates names as follows:

    • If you omit a partition name, then the database generates a name of the form SYS_Pn. System-generated names for LOB data and LOB index partitions take the form SYS_LOB_Pn and SYS_IL_Pn, respectively.

    • If you specify a subpartition name in subpartition_template, then for each subpartition created with that template, the database generates a name by concatenating the partition name with the template subpartition name. For LOB subpartitions, the generated LOB subpartition name is a concatenation of the partition name and the template LOB segment name. In either case, if the concatenation exceeds 30 characters, then the database returns an error and the statement fails.

    • If you omit a subpartition name when specifying an individual subpartition, and you have not specified subpartition_template, then the database generates a name of the form SYS_SUBPn. The corresponding system-generated names for LOB data and index subpartitions are SYS_LOB_SUBPn and SYS_IL_SUBPn, respectively.

  • Tablespace storage can be specified at various levels in the CREATE TABLE statement for both table segments and LOB segments. The number of tablespaces does not have to equal the number of partitions or subpartitions. If the number of partitions or subpartitions is greater than the number of tablespaces, then the database cycles through the names of the tablespaces.

    The database evaluates tablespace storage in the following order of descending priority:

    • Tablespace storage specified at the individual table subpartition or LOB subpartition level has the highest priority, followed by storage specified for the partition or LOB in the subpartition_template.

    • Tablespace storage specified at the individual table partition or LOB partition level. Storage parameters specified here take precedence over the subpartition_template.

    • Tablespace storage specified for the table

    • Default tablespace storage specified for the user

  • By default, nested tables are equipartitioned with the partitioned base table.

Restrictions on Partitioning in General All partitioning is subject to the following restrictions:

  • You cannot partition a table that is part of a cluster.

  • You cannot partition a nested table or varray that is defined as an index-organized table.

  • You cannot partition a table containing any LONG or LONG RAW columns.

The storage of partitioned database entities in tablespaces of different block sizes is subject to several restrictions. Refer to Oracle Database VLDB and Partitioning Guide for a discussion of these restrictions.

range_partitions

Use the range_partitions clause to partition the table on ranges of values from the column list. For an index-organized table, the column list must be a subset of the primary key columns of the table.

column

Specify an ordered list of columns used to determine into which partition a row belongs. These columns are the partitioning key. You can specify virtual columns as partitioning key columns.

INTERVAL Clause

Use this clause to establish interval partitioning for the table. Interval partitions are partitions based on a numeric range or datetime interval. They extend range partitioning by instructing the database to create partitions of the specified range or interval automatically when data inserted into the table exceeds all of the range partitions.

  • For expr, specify a valid number or interval expression.

  • The optional STORE IN clause lets you specify one or more tablespaces into which the database will store interval partition data.

  • You must also specify at least one range partition using the PARTITION clause of range_partitions. The range partition key value determines the high value of the range partitions, which is called the transition point, and the database creates interval partitions for data beyond that transition point.

Restrictions on Interval Partitioning The INTERVAL clause is subject to the restrictions listed in "Restrictions on Partitioning in General" and "Restrictions on Range Partitioning". The following additional restrictions apply:

  • You can specify only one partitioning key column, and it must be of NUMBER, DATE, FLOAT, or TIMESTAMP data type.

  • This clause is not supported for index-organized tables.

  • This clause is not supported for tables containing nested table columns, varray columns, or XMLType columns.

  • You cannot create a domain index on an interval-partitioned table.

  • Interval partitioning is not supported at the subpartition level.

  • Serializable transactions do not work with interval partitioning. Trying to insert data into a partition of an interval partitioned table that does not yet have a segment causes an error.

  • In the VALUES clause:

    • You cannot specify MAXVALUE (an infinite upper bound), because doing so would defeat the purpose of the automatic addition of partitions as needed.

    • You cannot specify NULL values for the partitioning key column.


See Also:

Oracle Database VLDB and Partitioning Guide for more information on interval partitioning

PARTITION partition

If you specify a partition name, then the name partition must conform to the rules for naming schema objects and their part as described in "Database Object Naming Rules". If you omit partition, then the database generates a name as described in "Notes on Partitioning in General".

range_values_clause

Specify the noninclusive upper bound for the current partition. The value list is an ordered list of literal values corresponding to the column list in the range_partitions clause. You can substitute the keyword MAXVALUE for any literal in the value list. MAXVALUE specifies a maximum value that will always sort higher than any other value, including null.

Specifying a value other than MAXVALUE for the highest partition bound imposes an implicit integrity constraint on the table.


Note:

If table is partitioned on a DATE column, and if the date format does not specify the first two digits of the year, then you must use the TO_DATE function with the YYYY 4-character format mask for the year. The RRRR format mask is not supported in this clause. The date format is determined implicitly by NLS_TERRITORY or explicitly by NLS_DATE_FORMAT. Refer to Oracle Database Globalization Support Guide for more information on these initialization parameters.


See Also:

Oracle Database Concepts for more information about partition bounds and "Range Partitioning Example"

table_partition_description

Use the table_partition_description to define the physical and storage characteristics of the table.

The deferred_segment_creation clause, segment_attributes_clause and table_compression clause have the same function as described for the physical_properties of the table as a whole.

The key_compression clause and OVERFLOW clause have the same function as described for the index_org_table_clause .

LOB_storage_clause The LOB_storage_clause lets you specify LOB storage characteristics for one or more LOB items in this partition or in any range or list subpartitions of this partition. If you do not specify the LOB_storage_clause for a LOB item, then the database generates a name for each LOB data partition as described in "Notes on Partitioning in General".

varray_col_properties The varray_col_properties let you specify storage characteristics for one or more varray items in this partition or in any range or list subpartitions of this partition.

nested_table_col_properties 

The nested_table_col_properties let you specify storage characteristics for one or more nested table storage table items in this partition or in any range or list subpartitions of this partition. Storage characteristics specified in this clause override any storage attributes specified at the table level.

partitioning_storage_clause

Use the partitioning_storage_clause to specify storage characteristics for hash partitions and for range, list, and hash subpartitions.

Restrictions on partitioning_storage_clause This clause is subject to the following restrictions:

  • The OVERFLOW clause is relevant only for index-organized partitioned tables and is valid only within the individual_hash_partitions clause. It is not valid for range or hash partitions or for subpartitions of any type.

  • You can specify key_compression only for partitions of index-organized table, and you can specify COMPRESS or NOCOMPRESS, but you cannot specify the prefix length with integer.

Restrictions on Range Partitioning Range partitioning is subject to the restrictions listed in "Restrictions on Partitioning in General". The following additional restrictions apply:

  • You cannot specify more than 16 partitioning key columns.

  • Partitioning key columns must be of type CHAR, NCHAR, VARCHAR2, NVARCHAR2, VARCHAR, NUMBER, FLOAT, DATE, TIMESTAMP, TIMESTAMP WITH LOCAL TIMEZONE, or RAW.

  • You cannot specify NULL in the VALUES clause.

list_partitions

Use the list_partitions clause to partition the table on lists of literal values from column. List partitioning is useful for controlling how individual rows map to specific partitions.

list_values_clause The list_values_clause of each partition must have at least one value. No value, including NULL, can appear in more than one partition. List partitions are not ordered.

If you specify the literal NULL for a partition value in the VALUES clause, then to access data in that partition in subsequent queries, you must use an IS NULL condition in the WHERE clause, rather than a comparison condition.

The DEFAULT keyword creates a partition into which the database will insert any row that does not map to another partition. Therefore, you can specify DEFAULT for only one partition, and you cannot specify any other values for that partition. Further, the default partition must be the last partition you define. The use of DEFAULT is similar to the use of MAXVALUE for range partitions.

The string comprising the list of values for each partition can be up to 4K bytes. The total number of values for all partitions cannot exceed 64K-1.

table_partition_description  The subclauses of the table_partition_description have the same behavior as described for range partitions in table_partition_description.

Restrictions on List Partitioning List partitioning is subject to the restrictions listed in "Restrictions on Partitioning in General". The following additional restrictions apply:

  • You can specify only one partitioning key column.

  • The partitioning key column must be of type CHAR, NCHAR, VARCHAR2, NVARCHAR2, VARCHAR, NUMBER, FLOAT, DATE, TIMESTAMP, TIMESTAMP WITH LOCAL TIMEZONE, or RAW.

hash_partitions

Use the hash_partitions clause to specify that the table is to be partitioned using the hash method. Oracle Database assigns rows to partitions using a hash function on values found in columns designated as the partitioning key. You can specify individual hash partitions, or you can specify how many hash partitions the database should create.

column Specify an ordered list of columns used to determine into which partition a row belongs (the partitioning key).

individual_hash_partitions  Use this clause to specify individual partitions by name.

Restriction on Specifying Individual Hash Partitions The only clauses you can specify in the partitioning_storage_clause are the TABLESPACE clause and table compression.


Note:

If your enterprise has or will have databases using different character sets, then use caution when partitioning on character columns. The sort sequence of characters is not identical in all character sets. Refer to Oracle Database Globalization Support Guide for more information on character set support.

hash_partitions_by_quantity An alternative to defining individual partitions is to specify the number of hash partitions. In this case, the database assigns partition names of the form SYS_Pn. The STORE IN clause lets you specify one or more tablespaces where the hash partition data is to be stored. The number of tablespaces need not equal the number of partitions. If the number of partitions is greater than the number of tablespaces, then the database cycles through the names of the tablespaces.

For both methods of hash partitioning, for optimal load balancing you should specify a number of partitions that is a power of 2. When you specify individual hash partitions, you can specify both TABLESPACE and table compression in the partitioning_storage_clause. When you specify hash partitions by quantity, you can specify only TABLESPACE. Hash partitions inherit all other attributes from table-level defaults.

The table_compression clause has the same function as described for the table_properties of the table as a whole.

The key_compression clause and OVERFLOW clause have the same function as described for the index_org_table_clause .

Tablespace storage specified at the table level is overridden by tablespace storage specified at the partition level, which in turn is overridden by tablespace storage specified at the subpartition level.

In the individual_hash_partitions clause, the TABLESPACE clause of the partitioning_storage_clause determines tablespace storage only for the individual partition being created. In the hash_partitions_by_quantity clause, the STORE IN clause determines placement of partitions as the table is being created and the default storage location for subsequently added partitions.


See Also:

Oracle Database VLDB and Partitioning Guide for more information on hash partitioning

Restrictions on Hash Partitioning Hash partitioning is subject to the restrictions listed in "Restrictions on Partitioning in General". The following additional restrictions apply:

  • You cannot specify more than 16 partitioning key columns.

  • Partitioning key columns must be of type CHAR, NCHAR, VARCHAR2, NVARCHAR2, VARCHAR, NUMBER, FLOAT, DATE, TIMESTAMP, TIMESTAMP WITH LOCAL TIMEZONE, or RAW.

composite_range_partitions

Use the composite_range_partitions clause to first partition table by range, and then partition the partitions further into range, list, or hash subpartitions.

The INTERVAL clause has the same semantics for composite range partitioning that it has for range partitioning. Refer to "INTERVAL Clause" for more information.

Specify subpartition_by_range, subpartition_by_list, or subpartition_by_hash to indicate the type of subpartitioning you want for each composite range partition. Within these clauses you can specify a subpartition template, which establishes default subpartition characteristics for subpartitions created as part of this statement or subsequently created subpartitions.

After establishing the type of subpartitioning you want for the table, and optionally a subpartition template, you must define at least one range partition.

  • In the range_partition_desc, you must specify the range_values_clause , which has the same requirements as for noncomposite range partitions.

  • Use the table_partition_description to define the physical and storage characteristics of the each partition.

  • In the range_partition_desc, use range_subpartition_desc, list_subpartition_desc, individual_hash_subparts, or hash_subparts_by_quantity to specify characteristics for the individual subpartitions of the partition. The values you specify in these clauses supersede for these subpartitions any values you have specified in the subpartition_template.

  • The only characteristics you can specify for a list or hash subpartition or any LOB subpartition are TABLESPACE and table_compression.

Restrictions on Composite Range Partitioning Regardless of the type of subpartitioning, composite range partitioning is subject to the following restrictions:

  • The only physical attributes you can specify at the subpartition level are TABLESPACE and table compression.

  • You cannot specify composite partitioning for an index-organized table. Therefore, the OVERFLOW clause of the table_partition_description is not valid for composite-partitioned tables.

  • You cannot specify composite partitioning for tables containing nested table columns, varray columns, or XMLType columns.


See Also:

"Composite-Partitioned Table Examples" for examples of composite range partitioning and Oracle Database VLDB and Partitioning Guide for examples of composite list partitioning

composite_list_partitions

Use the composite_list_partitions clause to first partition table by list, and then partition the partitions further into range, list, or hash subpartitions.

Specify subpartition_by_range, subpartition_by_list, or subpartition_by_hash to indicate the type of subpartitioning you want for each composite list partition. Within these clauses you can specify a subpartition template, which establishes default subpartition characteristics for subpartitions created as part of this statement and for subsequently created subpartitions.

After establishing the type of subpartitioning you want for each composite partition, and optionally defining a subpartition template, you must define at least one list partition.

  • In the list_partition_desc, you must specify the list_values_clause, which has the same requirements as for noncomposite list partitions.

  • Use the table_partition_description to define the physical and storage characteristics of the each partition.

  • In the list_partition_desc, use range_subpartition_desc, list_subpartition_desc, individual_hash_subparts, or hash_subparts_by_quantity to specify characteristics for the individual subpartitions of the partition. The values you specify in these clauses supersede the for these subpartitions any values you have specified in the subpartition_template.

Restrictions on Composite List Partitioning Composite list partitioning is subject to the same restrictions as described in "Restrictions on Composite Range Partitioning".

composite_hash_partitions

Use the composite_hash_partitions clause to first partition table using the hash method, and then partition the partitions further into range, list, or hash subpartitions.

Specify subpartition_by_range, subpartition_by_list, or subpartition_by_hash to indicate the type of subpartitioning you want for each composite hash partition. Within these clauses you can specify a subpartition template, which establishes default subpartition characteristics for subpartitions created as part of this statement or subsequently created subpartitions.

After establishing the type of subpartitioning you want for the table, and optionally a subpartition template, you can define the hash partitions in one of the following ways:

  • Specify hash_partition_desc to define individual hash partitions. In the hash_partition_desc, use the partitioning_storage_clause to define the storage characteristics of the each partition. Use range_subpartition_desc, list_subpartition_desc, or individual_hash_subparts to specify characteristics for the individual subpartitions of each partition. The values you specify in these clauses supersede for these subpartitions any values you have specified in the subpartition_template.

  • Specify hash_partitions_by_quantity to specify the number of hash partitions. Each partition will have subpartitions as described in the subpartition template. If you do not specify a subpartition template, then each partition will have one subpartition.

  • If you omit these clauses, then Oracle Database creates a table with one hash partition. The partition will have subpartitions as described in the subpartition template. If you do not specify a subpartition template, then the partition will have one subpartition.

Restrictions on Composite Hash Partitioning Composite hash partitioning is subject to the same restrictions as described in "Restrictions on Composite Range Partitioning".

subpartition_template The subpartition_template is an optional element of range, list, and hash subpartitioning. The template lets you define default subpartitions for each table partition. Oracle Database will create these default subpartition characteristics in any partition for which you do not explicitly define subpartitions. This clause is useful for creating symmetric partitions. You can override this clause by explicitly defining subpartitions at the partition level, in range_subpartition_desc, list_subpartition_desc, individual_hash_subparts, or hash_subparts_by_quantity.

When defining subpartitions with a template, you can explicitly define range, list, or hash subpartitions, or you can define a quantity of hash subpartitions.

  • To explicitly define subpartitions, use range_subpartition_desc, list_subpartition_desc, or individual_hash_subparts. You must specify a name for each subpartition. If you specify the LOB_partitioning_clause of the partitioning_storage_clause, then you must specify LOB_segname.

  • To define a quantity of hash subpartitions, specify a positive integer for hash_subpartition_quantity. The database creates that number of subpartitions in each partition and assigns subpartition names of the form SYS_SUBPn.


Note:

When you specify tablespace storage for the subpartition template, it does not override any tablespace storage you have specified explicitly for the partitions of table. To specify tablespace storage for subpartitions, do one of these things:
  • Omit tablespace storage at the partition level and specify tablespace storage in the subpartition template.

  • Define individual subpartitions with specific tablespace storage.


Restrictions on Subpartition Templates Subpartition templates are subject to the following restrictions:

  • If you specify TABLESPACE for one LOB subpartition, then you must specify TABLESPACE for all of the LOB subpartitions of that LOB column. You can specify the same tablespace for more than one LOB subpartition.

  • If you specify separate LOB storage for list subpartitions using the partitioning_storage_clause, either in the subpartition_template or when defining individual subpartitions, then you must specify LOB_segname for both LOB and varray columns.

  • For range-hash and list-hash composite-partitioned tables, you can override the subpartition_template for an individual partition only by specifying the individual_hash_subparts clause of range_partition_desc or list_partition_desc. If you attempt to override the subpartition_template by specifying the hash_subparts_by_quantity clause of range_partition_desc or list_partition_desc, then an error occurs.

subpartition_by_range

Use the subpartition_by_range clause to indicate that the database should subpartition by range each partition in table. The subpartitioning column list is unrelated to the partitioning key but is subject to the same restrictions (see column).

You can use the subpartition_template to specify default subpartition characteristic values. See subpartition_template. The database uses these values for any subpartition in this partition for which you do not explicitly specify the characteristic.

You can also define range subpartitions individually for each partition using the range_subpartition_desc of range_partition_desc or list_partition_desc. If you omit both subpartition_template and the range_subpartition_desc, then the database creates a single MAXVALUE subpartition.

subpartition_by_list

Use the subpartition_by_list clause to indicate that the database should subpartition each partition in table by literal values from column. You can specify only one list subpartitioning key column.

You can use the subpartition_template to specify default subpartition characteristic values. See subpartition_template. The database uses these values for any subpartition in this partition for which you do not explicitly specify the characteristic.

You can also define list subpartitions individually for each partition using the list_subpartition_desc of range_partition_desc or list_partition_desc. If you omit both subpartition_template and the list_subpartition_desc, then the database creates a single DEFAULT subpartition.

Restrictions on List Subpartitioning List subpartitioning is subject to the same restrictions as described in Restrictions on Composite Range Partitioning.

subpartition_by_hash

Use the subpartition_by_hash clause to indicate that the database should subpartition by hash each partition in table. The subpartitioning column list is unrelated to the partitioning key but is subject to the same restrictions (see column).

You can define the subpartitions using the subpartition_template or the SUBPARTITIONS integer clause. See subpartition_template. In either case, for optimal load balancing you should specify a number of partitions that is a power of 2.

If you specify SUBPARTITIONS integer, then you determine the default number of subpartitions in each partition of table, and optionally one or more tablespaces in which they are to be stored. The default value is 1. If you omit both this clause and subpartition_template, then the database will create each partition with one hash subpartition.

Notes on Composite Partitions The following notes apply to composite partitions:

  • For all subpartitions, you can use the range_subpartition_desc, list_subpartition_desc, individual_hash_subparts, or hash_subparts_by_quantity to specify individual subpartitions by name, and optionally some other characteristics.

  • Alternatively, for list and hash subpartitions:

    • You can specify the number of subpartitions and optionally one or more tablespaces where they are to be stored. In this case, Oracle Database assigns subpartition names of the form SYS_SUBPn.

    • If you omit the subpartition description and if you have created a subpartition template, then the database uses the template to create subpartitions. If you have not created a subpartition template, then the database creates one DEFAULT list subpartition or one hash subpartition.

  • For all types of subpartitions, if you omit the subpartitions description entirely, then the database assigns subpartition names as follows:

    • If you have specified a subpartition template and you have specified partition names, then the database generates subpartition names of the form partition_name underscore (_) subpartition_name (for example, P1_SUB1).

    • If you have not specified a subpartition template or if you have specified a subpartition template but did not specify partition names, then the database generates subpartition names of the form SYS_SUBPn.

reference_partitioning

Use this clause to partition the table by reference. Partitioning by reference is a method of equipartitioning the table being created (the child table) by a referential constraint to an existing partitioned table (the parent table). When you partition a table by reference, partition maintenance operations subsequently performed on the parent table automatically cascade to the child table. Therefore, you cannot perform partition maintenance operations on a reference-partitioned table directly.

constraint  The partitioning referential constraint must meet the following conditions:

  • You must specify a referential integrity constraint defined on the table being created, which must refer to a primary key or unique constraint on the parent table. The constraint must be in ENABLE VALIDATE NOT DEFERRABLE state, which is the default when you specify a referential integrity constraint during table creation.

  • All foreign key columns referenced in constraint must be NOT NULL.

  • When you specify the constraint, you cannot specify the ON DELETE SET NULL clause of the references_clause.

  • The parent table referenced in the constraint must be an existing partitioned table. It can be partitioned by any method except interval partitioning.

  • The foreign and parent keys cannot contain any virtual columns that reference PL/SQL functions or LOB columns.

reference_partition_desc  Use this optional clause to specify partition names and to define the physical and storage characteristics of the partition. The subclauses of the table_partition_description have the same behavior as described for range partitions in table_partition_description.

Restrictions on Reference Partitioning Reference partitioning is subject to the restrictions listed in "Restrictions on Partitioning in General". The following additional restrictions apply:

  • Restrictions for reference partitioning are derived from the partitioning strategy of the parent table.

  • You cannot specify this clause for an index-organized table, an external table, or a domain index storage table.

  • The parent table can be partitioned by reference, but constraint cannot be self-referential. The table being created cannot be partitioned based on a reference to itself.

  • If ROW MOVEMENT is enabled for the parent table, it must also be enabled for the child table.


See Also:

Oracle Database VLDB and Partitioning Guide for more information on partitioning by reference and "Reference Partitioning Example"

system_partitioning

Use this clause to create system partitions. System partitioning does not entail any partitioning key columns, nor do system partitions have any range or list bounds or hash algorithms. Rather, they provide a way to equipartition dependent tables such as nested table or domain index storage tables with partitioned base tables.

  • If you specify only PARTITION BY SYSTEM, then the database creates one partition with a system-generated name of the form SYS_Pn.

  • If you specify PARTITION BY SYSTEM PARTITIONS integer, then the database creates as many partitions as you specify in integer, which can range from 1 to 1024K-1.

  • The description of the partition takes the same syntax as reference partitions, so they share the reference_partition_desc. You can specify additional partition attributes with the reference_partition_desc syntax. However, within the table_partition_description, you cannot specify the OVERFLOW clause.

Restrictions on System Partitioning System partitioning is subject to the following restrictions:

  • You cannot system partition an index-organized table or a table that is part of a cluster.

  • Composite partitioning is not supported with system partitioning.

  • You cannot split a system partition.

  • You cannot specify system partitioning in a CREATE TABLE ... AS SELECT statement.

  • To insert data into a system-partitioned table using an INSERT INTO ... AS subquery statement, you must use partition-extended syntax to specify the partition into which the values returned by the subquery will be inserted.


See Also:

Refer to Oracle Database Data Cartridge Developer's Guide for information on the uses for system partitioning and "References to Partitioned Tables and Indexes"

CACHE | NOCACHE | CACHE READS

Use these clauses to indicate how Oracle Database should store blocks in the buffer cache. For LOB storage, you can specify CACHE, NOCACHE, or CACHE READS. For other types of storage, you can specify only CACHE or NOCACHE.

If you omit these clauses, then:

  • In a CREATE TABLE statement, NOCACHE is the default.

  • In an ALTER TABLE statement, the existing value is not changed.

The behavior of CACHE and NOCACHE described in this section does not apply when Oracle Database chooses to use direct reads or to perform table scans using parallel query.

CACHE For data that is accessed frequently, this clause indicates that the blocks retrieved for this table are placed at the most recently used end of the least recently used (LRU) list in the buffer cache when a full table scan is performed. This attribute is useful for small lookup tables.


See Also:

Oracle Database Concepts for more information on how the database maintains the least recently used (LRU) list

As a parameter in the LOB_storage_clause, CACHE specifies that the database places LOB data values in the buffer cache for faster access. The database evaluates this parameter in conjunction with the logging_clause. If you omit this clause, then the default value for both BasicFiles and SecureFiles LOBs is NOCACHE LOGGING.

Restriction on CACHE You cannot specify CACHE for an index-organized table. However, index-organized tables implicitly provide CACHE behavior.

NOCACHE For data that is not accessed frequently, this clause indicates that the blocks retrieved for this table are placed at the least recently used end of the LRU list in the buffer cache when a full table scan is performed. NOCACHE is the default for LOB storage.

As a parameter in the LOB_storage_clause, NOCACHE specifies that the LOB values are not brought into the buffer cache. NOCACHE is the default for LOB storage.

Restriction on NOCACHE You cannot specify NOCACHE for an index-organized table.

CACHE READS CACHE READS applies only to LOB storage. It specifies that LOB values are brought into the buffer cache only during read operations but not during write operations.

logging_clause Use this clause to indicate whether the storage of data blocks should be logged or not.


See Also:

logging_clause for a description of the logging_clause when specified as part of LOB_parameters

RESULT_CACHE Clause

Use this clause to determine whether the results of statements or query blocks that name this table are considered for storage in the result cache. Two modes of result caching are available:

  • DEFAULT: Result caching is not determined at the table level. The query is considered for result caching if the RESULT_CACHE_MODE initialization parameter is set to FORCE, or if that parameter is set to MANUAL and the RESULT_CACHE hint is specified in the query. This is the default if you omit this clause.

  • FORCE: If all tables names in the query have this setting, then the query is always considered for caching unless the NO_RESULT_CACHE hint is specified for the query. If one or more tables named in the query are set to DEFAULT, then the effective table annotation for that query is considered to be DEFAULT, with the semantics described above.

You can query the RESULT_CACHE column of the DBA_, ALL_, and USER_TABLES data dictionary views to learn the result cache mode of the table.

The RESULT_CACHE and NO_RESULT_CACHE SQL hints take precedence over these result cache table annotations and the RESULT_CACHE_MODE initialization parameter. The RESULT_CACHE_MODE setting of FORCE in turn takes precedence over this table annotation clause.


Note:

The RESULT_CACHE_MODE setting of FORCE is not recommended, as it can cause significant performance and latching overhead, as database and clients will try to cache all queries.


See Also:


parallel_clause

The parallel_clause lets you parallelize creation of the table and set the default degree of parallelism for queries and the DML INSERT, UPDATE, DELETE, and MERGE after table creation.


Note:

The syntax of the parallel_clause supersedes syntax appearing in earlier releases of Oracle. Superseded syntax is still supported for backward compatibility but may result in slightly different behavior from that documented.

NOPARALLEL Specify NOPARALLEL for serial execution. This is the default.

PARALLEL  Specify PARALLEL if you want Oracle to select a degree of parallelism equal to the number of CPUs available on all participating instances times the value of the PARALLEL_THREADS_PER_CPU initialization parameter.

PARALLEL integer Specification of integer indicates the degree of parallelism, which is the number of parallel threads used in the parallel operation. Each parallel thread may use one or two parallel execution servers. Normally Oracle calculates the optimum degree of parallelism, so it is not necessary for you to specify integer.


See Also:

parallel_clause for more information on this clause

NOROWDEPENDENCIES | ROWDEPENDENCIES

This clause lets you specify whether table will use row-level dependency tracking. With this feature, each row in the table has a system change number (SCN) that represents a time greater than or equal to the commit time of the last transaction that modified the row. You cannot change this setting after table is created.

ROWDEPENDENCIES Specify ROWDEPENDENCIES if you want to enable row-level dependency tracking. This setting is useful primarily to allow for parallel propagation in replication environments. It increases the size of each row by 6 bytes.

Restriction on the ROWDEPENDENCIES Clause Oracle does not support table compression for tables that use row-level dependency tracking. If you specify both the ROWDEPENDENCIES clause and the table_compression clause, then the table_compression clause is ignored. To remove the ROWDEPENDENCIES attribute, you must redefine the table using the DBMS_REDEFINITION package or recreate the table.

NOROWDEPENDENCIES Specify NOROWDEPENDENCIES if you do not want table to use the row-level dependency tracking feature. This is the default.


See Also:

Oracle Database Advanced Replication for information about the use of row-level dependency tracking in replication environments

enable_disable_clause

The enable_disable_clause lets you specify whether Oracle Database should apply a constraint. By default, constraints are created in ENABLE VALIDATE state.

Restrictions on Enabling and Disabling Constraints Enabling and disabling constraints are subject to the following restrictions:

  • To enable or disable any integrity constraint, you must have defined the constraint in this or a previous statement.

  • You cannot enable a foreign key constraint unless the referenced unique or primary key constraint is already enabled.

  • In the index_properties clause of the using_index_clause, the INDEXTYPE IS ... clause is not valid in the definition of a constraint.


See Also:

constraint for more information on constraints and "Creating a Table: ENABLE/DISABLE Examples"

ENABLE Clause Use this clause if you want the constraint to be applied to the data in the table. This clause is described fully in "ENABLE Clause" in the documentation on constraints.

DISABLE Clause Use this clause if you want to disable the integrity constraint. This clause is described fully in "DISABLE Clause" in the documentation on constraints.

UNIQUE  The UNIQUE clause lets you enable or disable the unique constraint defined on the specified column or combination of columns.

PRIMARY KEY  The PRIMARY KEY clause lets you enable or disable the primary key constraint defined on the table.

CONSTRAINT  The CONSTRAINT clause lets you enable or disable the integrity constraint named constraint_name.

KEEP | DROP INDEX This clause lets you either preserve or drop the index Oracle Database has been using to enforce a unique or primary key constraint.

Restriction on Preserving and Dropping Indexes You can specify this clause only when disabling a unique or primary key constraint.

using_index_clause  The using_index_clause lets you specify an index for Oracle Database to use to enforce a unique or primary key constraint, or lets you instruct the database to create the index used to enforce the constraint. This clause is discussed fully in using_index_clause in the documentation on constraints.


See Also:


CASCADE  Specify CASCADE to disable any integrity constraints that depend on the specified integrity constraint. To disable a primary or unique key that is part of a referential integrity constraint, you must specify this clause.

Restriction on CASCADE You can specify CASCADE only if you have specified DISABLE.

row_movement_clause

The row_movement_clause lets you specify whether the database can move a table row. It is possible for a row to move, for example, during table compression or an update operation on partitioned data.


Caution:

If you need static rowids for data access, then do not enable row movement. For a normal (heap-organized) table, moving a row changes the rowid of the row. For a moved row in an index-organized table, the logical rowid remains valid, although the physical guess component of the logical rowid becomes inaccurate.

  • Specify ENABLE to allow the database to move a row, thus changing the rowid.

  • Specify DISABLE if you want to prevent the database from moving a row, thus preventing a change of rowid.

If you omit this clause, then the database disables row movement.

Restriction on Row Movement You cannot specify this clause for a nonpartitioned index-organized table.

flashback_archive_clause

You must have the FLASHBACK ARCHIVE object privilege on the specified flashback data archive to specify this clause. Use this clause to enable or disable historical tracking for the table.

  • Specify FLASHBACK ARCHIVE to enable tracking for the table. You can specify flashback_archive to designate a particular flashback data archive for this table. The flashback data archive you specify much already exist.

    If you omit flashback_archive, then the database uses the default flashback data archive designated for the system. If no default flashback data archive has been designated for the system, then you must specify flashback_archive.

  • Specify NO FLASHBACK ARCHIVE to disable tracking for the table. This is the default.

Restrictions on flashback_archive_clause Flashback data archives are subject to the following restrictions:

  • You cannot specify this clause for a nested table, clustered table, temporary table, remote table, or external table.

  • You cannot specify this clause for a table compressed with Hybrid Columnar Compression.

  • The table for which you are specifying this clause cannot contain any LONG or nested table columns.

  • If you specify this clause and subsequently copy the table to a different database—using the export and import utilities or the transportable tablespace feature—then the copied table will not be enabled for tracking and the archived data for the original table will not be available for the copied table.


See Also:


AS subquery

Specify a subquery to determine the contents of the table. The rows returned by the subquery are inserted into the table upon its creation.

For object tables, subquery can contain either one expression corresponding to the table type, or the number of top-level attributes of the table type. Refer to SELECT for more information.

If subquery returns the equivalent of part or all of an existing materialized view, then the database may rewrite the query to use the materialized view in place of one or more tables specified in subquery.


See Also:

Oracle Database Data Warehousing Guide for more information on materialized views and query rewrite

Oracle Database derives data types and lengths from the subquery. Oracle Database follows the following rules for integrity constraints and other column and table attributes:

  • Oracle Database automatically defines on columns in the new table any NOT NULL constraints that have a state of NOT DEFERRABLE and VALIDATE, and were explicitly created on the corresponding columns of the selected table if the subquery selects the column rather than an expression containing the column. If any rows violate the constraint, then the database does not create the table and returns an error.

  • NOT NULL constraints that were implicitly created by Oracle Database on columns of the selected table (for example, for primary keys) are not carried over to the new table.

  • In addition, primary keys, unique keys, foreign keys, check constraints, partitioning criteria, indexes, and column default values are not carried over to the new table.

  • If the selected table is partitioned, then you can choose whether the new table will be partitioned the same way, partitioned differently, or not partitioned. Partitioning is not carried over to the new table. Specify any desired partitioning as part of the CREATE TABLE statement before the AS subquery clause.

  • A column that is encrypted using Transparent Data Encryption in the selected table will not be encrypted in the new table unless you define the column in the new table as encrypted at create time.


    Note:

    Oracle recommends that you encrypt sensitive columns before populating them with data. This will avoid creating clear text copies of sensitive data.

If all expressions in subquery are columns, rather than expressions, then you can omit the columns from the table definition entirely. In this case, the names of the columns of table are the same as the columns in subquery.

You can use subquery in combination with the TO_LOB function to convert the values in a LONG column in another table to LOB values in a column of the table you are creating.


See Also:


parallel_clause If you specify the parallel_clause in this statement, then the database will ignore any value you specify for the INITIAL storage parameter and will instead use the value of the NEXT parameter.


See Also:

storage_clause for information on these parameters

ORDER BY The ORDER BY clause lets you order rows returned by the subquery.

When specified with CREATE TABLE, this clause does not necessarily order data across the entire table. For example, it does not order across partitions. Specify this clause if you intend to create an index on the same key as the ORDER BY key column. Oracle Database will cluster data on the ORDER BY key so that it corresponds to the index key.

Restrictions on the Defining Query of a Table The table query is subject to the following restrictions:

  • The number of columns in the table must equal the number of expressions in the subquery.

  • The column definitions can specify only column names, default values, and integrity constraints, not data types.

  • You cannot define a foreign key constraint in a CREATE TABLE statement that contains AS subquery unless the table is reference partitioned and the constraint is the table's partitioning referential constraint. In all other cases, you must create the table without the constraint and then add it later with an ALTER TABLE statement.

object_table

The OF clause lets you explicitly create an object table of type object_type. The columns of an object table correspond to the top-level attributes of type object_type. Each row will contain an object instance, and each instance will be assigned a unique, system-generated object identifier when a row is inserted. If you omit schema, then the database creates the object table in your own schema.

Object tables, as well as XMLType tables, object views, and XMLType views, do not have any column names specified for them. Therefore, Oracle defines a system-generated pseudocolumn OBJECT_ID. You can use this column name in queries and to create object views with the WITH OBJECT IDENTIFIER clause.

object_table_substitution

Use the object_table_substitution clause to specify whether row objects corresponding to subtypes can be inserted into this object table.

NOT SUBSTITUTABLE AT ALL LEVELS NOT SUBSTITUTABLE AT ALL LEVELS indicates that the object table being created is not substitutable. In addition, substitution is disabled for all embedded object attributes and elements of embedded nested tables and arrays. The default is SUBSTITUTABLE AT ALL LEVELS.


See Also:


object_properties

The properties of object tables are essentially the same as those of relational tables. However, instead of specifying columns, you specify attributes of the object.

For attribute, specify the qualified column name of an item in an object.

oid_clause

The oid_clause lets you specify whether the object identifier of the object table should be system generated or should be based on the primary key of the table. The default is SYSTEM GENERATED.

Restrictions on the oid_clause This clause is subject to the following restrictions:

  • You cannot specify OBJECT IDENTIFIER IS PRIMARY KEY unless you have already specified a PRIMARY KEY constraint for the table.

  • You cannot specify this clause for a nested table.


Note:

A primary key object identifier is locally unique but not necessarily globally unique. If you require a globally unique identifier, then you must ensure that the primary key is globally unique.

oid_index_clause

This clause is relevant only if you have specified the oid_clause as SYSTEM GENERATED. It specifies an index, and optionally its storage characteristics, on the hidden object identifier column.

For index, specify the name of the index on the hidden system-generated object identifier column. If you omit index, then the database generates a name.

physical_properties and table_properties

The semantics of these clauses are documented in the corresponding sections under relational tables. See physical_properties and table_properties.

XMLType_table

Use the XMLType_table syntax to create a table of data type XMLType. Most of the clauses used to create an XMLType table have the same semantics that exist for object tables. The clauses specific to XMLType tables are described in this section.

Object tables, as well as XMLType tables, object views, and XMLType views, do not have any column names specified for them. Therefore, Oracle defines a system-generated pseudocolumn OBJECT_ID. You can use this column name in queries and to create object views with the WITH OBJECT IDENTIFIER clause.

XMLSchema_spec

This clause lets you specify the URL of a registered XMLSchema, either in the XMLSCHEMA clause or as part of the ELEMENT clause, and an XML element name.

You must specify an element, although the XMLSchema URL is optional. If you do specify an XMLSchema URL, then you must already have registered the XMLSchema using the DBMS_XMLSCHEMA package.

The optional ALLOW | DISALLOW clauses are valid only if you have specified BINARY XML storage.

  • ALLOW NONSCHEMA indicates that non-schema-based documents can be stored in the XMLType column.

  • DISALLOW NONSCHEMA indicates that non-schema-based documents cannot be stored in the XMLType column. This is the default.

  • ALLOW ANYSCHEMA indicates that any schema-based document can be stored in the XMLType column.

  • DISALLOW ANYSCHEMA indicates that any schema-based document cannot be stored in the XMLType column. This is the default.


See Also:


Examples

Creating Tables: General Examples

This statement shows how the employees table owned by the sample human resources (hr) schema was created. A hypothetical name is given to the table and constraints so that you can duplicate this example in your test database:

CREATE TABLE employees_demo
    ( employee_id    NUMBER(6)
    , first_name     VARCHAR2(20)
    , last_name      VARCHAR2(25) 
         CONSTRAINT emp_last_name_nn_demo NOT NULL
    , email          VARCHAR2(25) 
         CONSTRAINT emp_email_nn_demo     NOT NULL
    , phone_number   VARCHAR2(20)
    , hire_date      DATE  DEFAULT SYSDATE 
         CONSTRAINT emp_hire_date_nn_demo  NOT NULL
    , job_id         VARCHAR2(10)
       CONSTRAINT     emp_job_nn_demo  NOT NULL
    , salary         NUMBER(8,2)
       CONSTRAINT     emp_salary_nn_demo  NOT NULL
    , commission_pct NUMBER(2,2)
    , manager_id     NUMBER(6)
    , department_id  NUMBER(4)
    , dn             VARCHAR2(300)
    , CONSTRAINT     emp_salary_min_demo
                     CHECK (salary > 0) 
    , CONSTRAINT     emp_email_uk_demo
                     UNIQUE (email)
    ) ;

This table contains twelve columns. The employee_id column is of data type NUMBER. The hire_date column is of data type DATE and has a default value of SYSDATE. The last_name column is of type VARCHAR2 and has a NOT NULL constraint, and so on.

Creating a Table: Storage Example To define the same employees_demo table in the example tablespace with a small storage capacity, issue the following statement:

CREATE TABLE employees_demo
    ( employee_id    NUMBER(6)
    , first_name     VARCHAR2(20)
    , last_name      VARCHAR2(25) 
         CONSTRAINT emp_last_name_nn_demo NOT NULL
    , email          VARCHAR2(25) 
         CONSTRAINT emp_email_nn_demo     NOT NULL
    , phone_number   VARCHAR2(20)
    , hire_date      DATE  DEFAULT SYSDATE 
         CONSTRAINT emp_hire_date_nn_demo  NOT NULL
    , job_id         VARCHAR2(10)
       CONSTRAINT     emp_job_nn_demo  NOT NULL
    , salary         NUMBER(8,2)
       CONSTRAINT     emp_salary_nn_demo  NOT NULL
    , commission_pct NUMBER(2,2)
    , manager_id     NUMBER(6)
    , department_id  NUMBER(4)
    , dn             VARCHAR2(300)
    , CONSTRAINT     emp_salary_min_demo
                     CHECK (salary > 0) 
    , CONSTRAINT     emp_email_uk_demo
                     UNIQUE (email)
    ) 
   TABLESPACE example 
   STORAGE (INITIAL 8M);

Creating a Table: Temporary Table Example The following statement creates a temporary table today_sales for use by sales representatives in the sample database. Each sales representative session can store its own sales data for the day in the table. The temporary data is deleted at the end of the session.

CREATE GLOBAL TEMPORARY TABLE today_sales
   ON COMMIT PRESERVE ROWS 
   AS SELECT * FROM orders WHERE order_date = SYSDATE;

Creating a Table with Deferred Segment Creation: Example 

The following statement creates a table with deferred segment creation. Oracle Database will not create a segment for the data of this table until data is inserted into the table:

CREATE TABLE later (col1 NUMBER, col2 VARCHAR2(20))    SEGMENT CREATION DEFERRED;

Substitutable Table and Column Examples The following statements create a type hierarchy, which can be used to create a substitutable table. Type employee_t inherits the name and ssn attributes from type person_t and in addition has department_id and salary attributes. Type part_time_emp_t inherits all of the attributes from employee_t and, through employee_t, those of person_t and in addition has a num_hrs attribute. Type part_time_emp_t is final by default, so no further subtypes can be created under it.

CREATE TYPE person_t AS OBJECT (name VARCHAR2(100), ssn NUMBER) 
   NOT FINAL;
/

CREATE TYPE employee_t UNDER person_t 
   (department_id NUMBER, salary NUMBER) NOT FINAL;
/

CREATE TYPE part_time_emp_t UNDER employee_t (num_hrs NUMBER);
/

The following statement creates a substitutable table from the person_t type:

CREATE TABLE persons OF person_t;

The following statement creates a table with a substitutable column of type person_t:

CREATE TABLE books (title VARCHAR2(100), author person_t);

When you insert into persons or books, you can specify values for the attributes of person_t or any of its subtypes. Examples of insert statements appear in "Inserting into a Substitutable Tables and Columns: Examples".

You can extract data from such tables using built-in functions and conditions. For examples, see the functions TREAT and SYS_TYPEID, and the "IS OF type Condition" condition.

Creating a Table: Parallelism Examples The following statement creates a table using an optimum number of parallel execution servers to scan employees and to populate dept_80:

CREATE TABLE dept_80
   PARALLEL
   AS SELECT * FROM employees
   WHERE department_id = 80;

Using parallelism speeds up the creation of the table, because the database uses parallel execution servers to create the table. After the table is created, querying the table is also faster, because the same degree of parallelism is used to access the table.

The following statement creates the same table serially. Subsequent DML and queries on the table will also be serially executed.

CREATE TABLE dept_80
   AS SELECT * FROM employees
   WHERE department_id = 80;

Creating a Table: ENABLE/DISABLE Examples The following statement shows how the sample table departments was created. The example defines a NOT NULL constraint, and places it in ENABLE VALIDATE state. A hypothetical name is given to the table so that you can duplicate this example in your test database:

CREATE TABLE departments_demo
    ( department_id    NUMBER(4)
    , department_name  VARCHAR2(30)
           CONSTRAINT  dept_name_nn  NOT NULL
    , manager_id       NUMBER(6)
    , location_id      NUMBER(4)
    , dn               VARCHAR2(300)
    ) ;

The following statement creates the same departments_demo table but also defines a disabled primary key constraint:

CREATE TABLE departments_demo
    ( department_id    NUMBER(4)   PRIMARY KEY DISABLE
    , department_name  VARCHAR2(30)
           CONSTRAINT  dept_name_nn  NOT NULL
    , manager_id       NUMBER(6)
    , location_id      NUMBER(4)
    , dn               VARCHAR2(300)
    ) ;

Nested Table Example The following statement shows how the sample table pm.print_media was created with a nested table column ad_textdocs_ntab:

CREATE TABLE print_media
    ( product_id        NUMBER(6)
    , ad_id             NUMBER(6)
    , ad_composite      BLOB
    , ad_sourcetext     CLOB
    , ad_finaltext      CLOB
    , ad_fltextn        NCLOB
    , ad_textdocs_ntab  textdoc_tab
    , ad_photo          BLOB
    , ad_graphic        BFILE
    , ad_header         adheader_typ
    ) NESTED TABLE ad_textdocs_ntab STORE AS textdocs_nestedtab;

Creating a Table: Multilevel Collection Example The following example shows how an account manager might create a table of customers using two levels of nested tables:

CREATE TYPE phone AS OBJECT (telephone NUMBER);
/
CREATE TYPE phone_list AS TABLE OF phone;
/
CREATE TYPE my_customers AS OBJECT (
   cust_name VARCHAR2(25),
   phones phone_list);
/
CREATE TYPE customer_list AS TABLE OF my_customers;
/
CREATE TABLE business_contacts (
   company_name VARCHAR2(25),
   company_reps customer_list)
   NESTED TABLE company_reps STORE AS outer_ntab
   (NESTED TABLE phones STORE AS inner_ntab);

The following variation of this example shows how to use the COLUMN_VALUE keyword if the inner nested table has no column or attribute name:

CREATE TYPE phone AS TABLE OF NUMBER;    
/
CREATE TYPE phone_list AS TABLE OF phone;
/
CREATE TABLE my_customers (
   name VARCHAR2(25),
   phone_numbers phone_list)
   NESTED TABLE phone_numbers STORE AS outer_ntab
   (NESTED TABLE COLUMN_VALUE STORE AS inner_ntab);

Creating a Table: LOB Column Example The following statement is a variation of the statement that created the pm.print_media table with some added LOB storage characteristics:

CREATE TABLE print_media_new
    ( product_id        NUMBER(6)
    , ad_id             NUMBER(6)
    , ad_composite      BLOB
    , ad_sourcetext     CLOB
    , ad_finaltext      CLOB
    , ad_fltextn        NCLOB
    , ad_textdocs_ntab  textdoc_tab
    , ad_photo          BLOB
    , ad_graphic        BFILE
    , ad_header         adheader_typ
    ) NESTED TABLE ad_textdocs_ntab STORE AS textdocs_nestedtab_new
    LOB (ad_sourcetext, ad_finaltext) STORE AS
      (TABLESPACE example
       STORAGE (INITIAL 6144)
       CHUNK 4000
       NOCACHE LOGGING);

In the example, the database rounds the value of CHUNK up to 4096 (the n^earest multiple of the block size of 2048).

Index-Organized Table Example The following statement is a variation of the sample table hr.countries, which is index organized:

CREATE TABLE countries_demo
    ( country_id      CHAR(2)
      CONSTRAINT country_id_nn_demo NOT NULL
    , country_name    VARCHAR2(40)
    , currency_name   VARCHAR2(25)
    , currency_symbol VARCHAR2(3)
    , region          VARCHAR2(15)
    , CONSTRAINT    country_c_id_pk_demo
                    PRIMARY KEY (country_id ) )
    ORGANIZATION INDEX 
    INCLUDING   country_name 
    PCTTHRESHOLD 2 
    STORAGE 
     ( INITIAL  4K ) 
   OVERFLOW 
    STORAGE 
      ( INITIAL  4K ); 

External Table Example The following statement creates an external table that represents a subset of the sample table hr.departments. The opaque_format_spec is shown in italics. Refer to Oracle Database Utilities for information on the ORACLE_LOADER access driver and how to specify values for the opaque_format_spec.

CREATE TABLE dept_external (
   deptno     NUMBER(6),
   dname      VARCHAR2(20),
   loc        VARCHAR2(25) 
)
ORGANIZATION EXTERNAL
(TYPE oracle_loader
 DEFAULT DIRECTORY admin
 ACCESS PARAMETERS
 (
  RECORDS DELIMITED BY newline
  BADFILE 'ulcase1.bad'
  DISCARDFILE 'ulcase1.dis'
  LOGFILE 'ulcase1.log'
  SKIP 20
  FIELDS TERMINATED BY ","  OPTIONALLY ENCLOSED BY '"'
  (
   deptno     INTEGER EXTERNAL(6),
   dname      CHAR(20),
   loc        CHAR(25)
  )
 )
 LOCATION ('ulcase1.ctl')
)
REJECT LIMIT UNLIMITED;

See Also:

"Creating a Directory: Examples" to see how the admin directory was created

XMLType Examples

This section contains brief examples of creating an XMLType table or XMLType column. For a more expanded version of these examples, refer to "Using XML in SQL Statements".

XMLType Table Examples The following example creates a very simple XMLType table with one implicit binary XML column:

CREATE TABLE xwarehouses OF XMLTYPE;

The following example creates an XMLSchema-based table. The XMLSchema must already have been created (see "Using XML in SQL Statements" for more information):

CREATE TABLE xwarehouses OF XMLTYPE
   XMLSCHEMA "http://www.example.com/xwarehouses.xsd"
   ELEMENT "Warehouse";

You can define constraints on an XMLSchema-based table, and you can also create indexes on XMLSchema-based tables, which greatly enhance subsequent queries. You can create object-relational views on XMLType tables, and you can create XMLType views on object-relational tables.


See Also:


XMLType Column Examples The following example creates a table with an XMLType column stored as a CLOB. This table does not require an XMLSchema, so the content structure is not predetermined:

CREATE TABLE xwarehouses (
   warehouse_id        NUMBER,
   warehouse_spec      XMLTYPE)
   XMLTYPE warehouse_spec STORE AS CLOB
   (TABLESPACE example
    STORAGE (INITIAL 6144)
    CHUNK 4000
    NOCACHE LOGGING);

The following example creates a similar table, but stores XMLType data in an object relational XMLType column whose structure is determined by the specified schema:

CREATE TABLE xwarehouses (
   warehouse_id    NUMBER,
   warehouse_spec  XMLTYPE)
   XMLTYPE warehouse_spec STORE AS OBJECT RELATIONAL
      XMLSCHEMA "http://www.example.com/xwarehouses.xsd"
      ELEMENT "Warehouse";

The following example creates another similar table with an XMLType column stored as a SecureFiles CLOB. This table does not require an XMLSchema, so the content structure is not predetermined. SecureFiles LOBs require a tablespace with automatic segment-space management, so the example uses the tablespace created in "Specifying Segment Space Management for a Tablespace: Example".

CREATE TABLE xwarehouses (
  warehouse_id   NUMBER,
  warehouse_spec XMLTYPE)
  XMLTYPE        warehouse_spec STORE AS SECUREFILE CLOB
  (TABLESPACE auto_seg_ts
  STORAGE (INITIAL 6144)
  CACHE);

Partitioning Examples

Range Partitioning Example The sales table in the sample schema sh is partitioned by range. The following example shows an abbreviated variation of the sales table. Constraints and storage elements have been omitted from the example.

CREATE TABLE range_sales
    ( prod_id        NUMBER(6)
    , cust_id        NUMBER
    , time_id        DATE
    , channel_id     CHAR(1)
    , promo_id       NUMBER(6)
    , quantity_sold  NUMBER(3)
    , amount_sold         NUMBER(10,2)
    ) 
PARTITION BY RANGE (time_id)
  (PARTITION SALES_Q1_1998 VALUES LESS THAN (TO_DATE('01-APR-1998','DD-MON-YYYY')),
   PARTITION SALES_Q2_1998 VALUES LESS THAN (TO_DATE('01-JUL-1998','DD-MON-YYYY')),
   PARTITION SALES_Q3_1998 VALUES LESS THAN (TO_DATE('01-OCT-1998','DD-MON-YYYY')),
   PARTITION SALES_Q4_1998 VALUES LESS THAN (TO_DATE('01-JAN-1999','DD-MON-YYYY')),
   PARTITION SALES_Q1_1999 VALUES LESS THAN (TO_DATE('01-APR-1999','DD-MON-YYYY')),
   PARTITION SALES_Q2_1999 VALUES LESS THAN (TO_DATE('01-JUL-1999','DD-MON-YYYY')),
   PARTITION SALES_Q3_1999 VALUES LESS THAN (TO_DATE('01-OCT-1999','DD-MON-YYYY')),
   PARTITION SALES_Q4_1999 VALUES LESS THAN (TO_DATE('01-JAN-2000','DD-MON-YYYY')),
   PARTITION SALES_Q1_2000 VALUES LESS THAN (TO_DATE('01-APR-2000','DD-MON-YYYY')),
   PARTITION SALES_Q2_2000 VALUES LESS THAN (TO_DATE('01-JUL-2000','DD-MON-YYYY')),
   PARTITION SALES_Q3_2000 VALUES LESS THAN (TO_DATE('01-OCT-2000','DD-MON-YYYY')),
   PARTITION SALES_Q4_2000 VALUES LESS THAN (MAXVALUE))
;

For information about partitioned table maintenance operations, see Oracle Database VLDB and Partitioning Guide.

Interval Partitioning Example The following example creates a variation of the oe.customers table that is partitioned by interval on the credit_limit column. One range partition is created to establish the transition point. All of the original data in the table is within the bounds of the range partition. Then data is added that exceeds the range partition, and the database creates a new interval partition.

CREATE TABLE customers_demo (
  customer_id number(6),
  cust_first_name varchar2(20),
  cust_last_name varchar2(20),
  credit_limit number(9,2))
PARTITION BY RANGE (credit_limit)
INTERVAL (1000)
(PARTITION p1 VALUES LESS THAN (5001));
 
INSERT INTO customers_demo
  (customer_id, cust_first_name, cust_last_name, credit_limit)
  (select customer_id, cust_first_name, cust_last_name, credit_limit
  from customers);

Query the USER_TAB_PARTITIONS data dictionary view before the database creates the interval partition:

SELECT partition_name, high_value FROM user_tab_partitions  WHERE table_name = 'CUSTOMERS_DEMO';

PARTITION_NAME                 HIGH_VALUE
------------------------------ ---------------
P1                             5001
 

Insert data into the table that exceeds the high value of the range partition:

INSERT INTO customers_demo
  VALUES (699, 'Fred', 'Flintstone', 5500);

Query the USER_TAB_PARTITIONS view again after the insert to learn the system-generated name of the interval partition created to accommodate the inserted data. (The system-generated name will vary for each session.)

SELECT partition_name, high_value FROM user_tab_partitions
  WHERE table_name = 'CUSTOMERS_DEMO'
  ORDER BY partition_name;

PARTITION_NAME                 HIGH_VALUE
------------------------------ ---------------
P1                             5001
SYS_P44                        6001

List Partitioning Example The following statement shows how the sample table oe.customers might have been created as a list-partitioned table. Some columns and all constraints of the sample table have been omitted in this example.

CREATE TABLE list_customers 
   ( customer_id             NUMBER(6)
   , cust_first_name         VARCHAR2(20) 
   , cust_last_name          VARCHAR2(20)
   , cust_address            CUST_ADDRESS_TYP
   , nls_territory           VARCHAR2(30)
   , cust_email              VARCHAR2(30))
   PARTITION BY LIST (nls_territory) (
   PARTITION asia VALUES ('CHINA', 'THAILAND'),
   PARTITION europe VALUES ('GERMANY', 'ITALY', 'SWITZERLAND'),
   PARTITION west VALUES ('AMERICA'),
   PARTITION east VALUES ('INDIA'),
   PARTITION rest VALUES (DEFAULT));

Partitioned Table with LOB Columns Example This statement creates a partitioned table print_media_demo with two partitions p1 and p2, and a number of LOB columns. The statement uses the sample table pm.print_media.

CREATE TABLE print_media_demo
   ( product_id NUMBER(6)
   , ad_id NUMBER(6)
   , ad_composite BLOB
   , ad_sourcetext CLOB
   , ad_finaltext CLOB
   , ad_fltextn NCLOB
   , ad_textdocs_ntab textdoc_tab
   , ad_photo BLOB
   , ad_graphic BFILE
   , ad_header adheader_typ
   ) NESTED TABLE ad_textdocs_ntab STORE AS textdocs_nestedtab_demo
      LOB (ad_composite, ad_photo, ad_finaltext)
      STORE AS(STORAGE (INITIAL 20M))
   PARTITION BY RANGE (product_id)
      (PARTITION p1 VALUES LESS THAN (3000) TABLESPACE tbs_01
         LOB (ad_composite, ad_photo)
         STORE AS (TABLESPACE tbs_02 STORAGE (INITIAL 10M))
         NESTED TABLE ad_textdocs_ntab STORE AS nt_p1 (TABLESPACE example),
       PARTITION P2 VALUES LESS THAN (MAXVALUE)
         LOB (ad_composite, ad_finaltext)
         STORE AS SECUREFILE (TABLESPACE auto_seg_ts)
         NESTED TABLE ad_textdocs_ntab STORE AS nt_p2
       )
   TABLESPACE tbs_03;

Partition p1 will be in tablespace tbs_01. The LOB data partitions for ad_composite and ad_photo will be in tablespace tbs_02. The LOB data partition for the remaining LOB columns will be in tablespace tbs_01. The storage attribute INITIAL is specified for LOB columns ad_composite and ad_photo. Other attributes will be inherited from the default table-level specification. The default LOB storage attributes not specified at the table level will be inherited from the tablespace tbs_02 for columns ad_composite and ad_photo and from tablespace tbs_01 for the remaining LOB columns. LOB index partitions will be in the same tablespaces as the corresponding LOB data partitions. Other storage attributes will be based on values of the corresponding attributes of the LOB data partitions and default attributes of the tablespace where the index partitions reside. The nested table partition for ad_textdocs_ntab will be stored as nt_p1 in tablespace example.

Partition p2 will be in the default tablespace tbs_03. The LOB data for ad_composite and ad_finaltext will be in tablespace auto_seg_ts as SecureFiles LOBs. The LOB data for the remaining LOB columns will be in tablespace tbs_03. The LOB index for columns ad_composite and ad_finaltext will be in tablespace auto_seg_ts. The LOB index for the remaining LOB columns will be in tablespace tbs_03. The nested table partition for ad_textdocs_ntab will be stored as nt_p2 in the default tablespace tbs_03.

Hash Partitioning Example The sample table oe.product_information is not partitioned. However, you might want to partition such a large table by hash for performance reasons, as shown in this example. The tablespace names are hypothetical in this example.

CREATE TABLE hash_products 
    ( product_id          NUMBER(6)   PRIMARY KEY
    , product_name        VARCHAR2(50) 
    , product_description VARCHAR2(2000) 
    , category_id         NUMBER(2) 
    , weight_class        NUMBER(1) 
    , warranty_period     INTERVAL YEAR TO MONTH 
    , supplier_id         NUMBER(6) 
    , product_status      VARCHAR2(20) 
    , list_price          NUMBER(8,2) 
    , min_price           NUMBER(8,2) 
    , catalog_url         VARCHAR2(50) 
    , CONSTRAINT          product_status_lov_demo 
                          CHECK (product_status in ('orderable' 
                                                  ,'planned' 
                                                  ,'under development' 
                                                  ,'obsolete') 
 ) ) 
 PARTITION BY HASH (product_id) 
 PARTITIONS 4 
 STORE IN (tbs_01, tbs_02, tbs_03, tbs_04); 

Reference Partitioning Example The next statement uses the hash_products partitioned table created in the preceding example. It creates a variation of the oe.order_items table that is partitioned by reference to the hash partitioning on the product id of hash_products. The resulting child table will be created with five partitions. For each row of the child table part_order_items, the database evaluates the foreign key value (product_id) to determine the partition number of the parent table hash_products to which the referenced key belongs. The part_order_items row is placed in its corresponding partition.

CREATE TABLE part_order_items (
    order_id        NUMBER(12) PRIMARY KEY,
    line_item_id    NUMBER(3),
    product_id      NUMBER(6) NOT NULL,
    unit_price      NUMBER(8,2),
    quantity        NUMBER(8),
    CONSTRAINT product_id_fk
    FOREIGN KEY (product_id) REFERENCES hash_products(product_id))
 PARTITION BY REFERENCE (product_id_fk);

Composite-Partitioned Table Examples The table created in the "Range Partitioning Example" divides data by time of sale. If you plan to access recent data according to distribution channel as well as time, then composite partitioning might be more appropriate. The following example creates a copy of that range_sales table but specifies range-hash composite partitioning. The partitions with the most recent data are subpartitioned with both system-generated and user-defined subpartition names. Constraints and storage attributes have been omitted from the example.

CREATE TABLE composite_sales
    ( prod_id        NUMBER(6)
    , cust_id        NUMBER
    , time_id        DATE
    , channel_id     CHAR(1)
    , promo_id       NUMBER(6)
    , quantity_sold  NUMBER(3)
    , amount_sold         NUMBER(10,2)
    ) 
PARTITION BY RANGE (time_id)
SUBPARTITION BY HASH (channel_id)
  (PARTITION SALES_Q1_1998 VALUES LESS THAN (TO_DATE('01-APR-1998','DD-MON-YYYY')),
   PARTITION SALES_Q2_1998 VALUES LESS THAN (TO_DATE('01-JUL-1998','DD-MON-YYYY')),
   PARTITION SALES_Q3_1998 VALUES LESS THAN (TO_DATE('01-OCT-1998','DD-MON-YYYY')),
   PARTITION SALES_Q4_1998 VALUES LESS THAN (TO_DATE('01-JAN-1999','DD-MON-YYYY')),
   PARTITION SALES_Q1_1999 VALUES LESS THAN (TO_DATE('01-APR-1999','DD-MON-YYYY')),
   PARTITION SALES_Q2_1999 VALUES LESS THAN (TO_DATE('01-JUL-1999','DD-MON-YYYY')),
   PARTITION SALES_Q3_1999 VALUES LESS THAN (TO_DATE('01-OCT-1999','DD-MON-YYYY')),
   PARTITION SALES_Q4_1999 VALUES LESS THAN (TO_DATE('01-JAN-2000','DD-MON-YYYY')),
   PARTITION SALES_Q1_2000 VALUES LESS THAN (TO_DATE('01-APR-2000','DD-MON-YYYY')),
   PARTITION SALES_Q2_2000 VALUES LESS THAN (TO_DATE('01-JUL-2000','DD-MON-YYYY'))
      SUBPARTITIONS 8,
   PARTITION SALES_Q3_2000 VALUES LESS THAN (TO_DATE('01-OCT-2000','DD-MON-YYYY'))
     (SUBPARTITION ch_c,
      SUBPARTITION ch_i,
      SUBPARTITION ch_p,
      SUBPARTITION ch_s,
      SUBPARTITION ch_t),
   PARTITION SALES_Q4_2000 VALUES LESS THAN (MAXVALUE)
      SUBPARTITIONS 4)
;

The following examples creates a partitioned table of customers based on the sample table oe.customers. In this example, the table is partitioned on the credit_limit column and list subpartitioned on the nls_territory column. The subpartition template determines the subpartitioning of any subsequently added partitions, unless you override the template by defining individual subpartitions. This composite partitioning makes it possible to query the table based on a credit limit range within a specified region:

CREATE TABLE customers_part (
   customer_id        NUMBER(6),
   cust_first_name    VARCHAR2(20),
   cust_last_name     VARCHAR2(20),
   nls_territory      VARCHAR2(30),
   credit_limit       NUMBER(9,2)) 
   PARTITION BY RANGE (credit_limit)
   SUBPARTITION BY LIST (nls_territory)
      SUBPARTITION TEMPLATE 
         (SUBPARTITION east  VALUES 
            ('CHINA', 'JAPAN', 'INDIA', 'THAILAND'),
          SUBPARTITION west VALUES 
             ('AMERICA', 'GERMANY', 'ITALY', 'SWITZERLAND'),
          SUBPARTITION other VALUES (DEFAULT))
      (PARTITION p1 VALUES LESS THAN (1000),
       PARTITION p2 VALUES LESS THAN (2500),
       PARTITION p3 VALUES LESS THAN (MAXVALUE));

Object Column and Table Examples

Creating Object Tables: Examples Consider object type department_typ:

CREATE TYPE department_typ AS OBJECT
   ( d_name   VARCHAR2(100), 
     d_address VARCHAR2(200) );
/
 

Object table departments_obj_t holds department objects of type department_typ:

CREATE TABLE departments_obj_t OF department_typ; 

The following statement creates object table salesreps with a user-defined object type, salesrep_typ:

CREATE OR REPLACE TYPE salesrep_typ AS OBJECT
  ( repId NUMBER,
    repName VARCHAR2(64));

CREATE TABLE salesreps OF salesrep_typ;

Creating a Table with a User-Defined Object Identifier: Example This example creates an object type and a corresponding object table whose object identifier is primary key based:

CREATE TYPE employees_typ AS OBJECT 
   (e_no NUMBER, e_address CHAR(30));
/

CREATE TABLE employees_obj_t OF employees_typ (e_no PRIMARY KEY)
   OBJECT IDENTIFIER IS PRIMARY KEY;

You can subsequently reference the employees_obj_t object table using either inline_ref_constraint or out_of_line_ref_constraint syntax:

CREATE TABLE departments_t 
   (d_no    NUMBER,
    mgr_ref REF employees_typ SCOPE IS employees_obj_t);

CREATE TABLE departments_t (
    d_no NUMBER,
    mgr_ref REF employees_typ 
       CONSTRAINT mgr_in_emp REFERENCES employees_obj_t);

Specifying Constraints on Type Columns: Example The following example shows how to define constraints on attributes of an object type column:

CREATE TYPE address_t AS OBJECT
  ( hno    NUMBER,
    street VARCHAR2(40),
    city   VARCHAR2(20),
    zip    VARCHAR2(5),
    phone  VARCHAR2(10) );
/

CREATE TYPE person AS OBJECT
  ( name        VARCHAR2(40),
    dateofbirth DATE,
    homeaddress address_t,
    manager     REF person );
/

CREATE TABLE persons OF person
  ( homeaddress NOT NULL,
      UNIQUE (homeaddress.phone),
      CHECK (homeaddress.zip IS NOT NULL),
      CHECK (homeaddress.city <> 'San Francisco') );
PKz*PKFJOEBPS/functions101.htme MOD

MOD

Syntax

Description of mod.gif follows

Purpose

MOD returns the remainder of n2 divided by n1. Returns n2 if n1 is 0.

This function takes as arguments any numeric data type or any nonnumeric data type that can be implicitly converted to a numeric data type. Oracle determines the argument with the highest numeric precedence, implicitly converts the remaining arguments to that data type, and returns that data type.


See Also:

Table 3-10, "Implicit Type Conversion Matrix" for more information on implicit conversion and "Numeric Precedence" for information on numeric precedence

Examples

The following example returns the remainder of 11 divided by 4:

SELECT MOD(11,4) "Modulus"
  FROM DUAL;

   Modulus
----------
         3

This function behaves differently from the classical mathematical modulus function when m is negative. The classical modulus can be expressed using the MOD function with this formula:

n2 - n1 * FLOOR(n2/n1)

The following table illustrates the difference between the MOD function and the classical modulus:

n2n1MOD(n2,n1)Classical Modulus
11433
11-43-1
-114-31
-11-4-3-3


See Also:

FLOOR and REMAINDER, which is similar to MOD, but uses ROUND in its formula instead of FLOOR

PKojePKFJOEBPS/statements_8028.htm DROP RESTORE POINT

DROP RESTORE POINT

Purpose

Use the DROP RESTORE POINT statement to remove a normal restore point or a guaranteed restore point from the database.

  • You need not drop normal restore points. The database automatically drops the oldest restore points when necessary, as described in the semantics for restore_point. However, you can drop a normal restore point if you want to reuse the name.

  • Guaranteed restore points are not dropped automatically. Therefore, if you want to remove a guaranteed restore point from the database, then you must do so explicitly using this statement.


See Also:

CREATE RESTORE POINT, FLASHBACK DATABASE, and FLASHBACK TABLE for information on creating and using restore points

Prerequisites

To drop a normal restore point, you must have either the SELECT ANY DICTIONARY or the FLASHBACK ANY TABLE system privilege. To drop a guaranteed restore point, you must have the SYSDBA system privilege.

Syntax

Description of drop_restore_point.gif follows

Semantics

restore_point Specify the name of the restore point you want to drop.

Examples

Dropping a Restore Point: Example The following example drops the good_data restore point, which was created in "Creating and Using a Restore Point: Example":

DROP RESTORE POINT good_data;
PK \TPKFJOEBPS/functions059.htmz) EXTRACT (datetime)

EXTRACT (datetime)

Syntax

extract_datetime::=

Description of extract_datetime.gif follows

Purpose

EXTRACT extracts and returns the value of a specified datetime field from a datetime or interval expression. The expr can be any expression that evaluates to a datetime or interval data type compatible with the requested field:

  • If YEAR or MONTH is requested, then expr must evaluate to an expression of data type DATE, TIMESTAMP, TIMESTAMP WITH TIME ZONE, TIMESTAMP WITH LOCAL TIME ZONE, or INTERVAL YEAR TO MONTH.

  • If DAY is requested, then expr must evaluate to an expression of data type DATE, TIMESTAMP, TIMESTAMP WITH TIME ZONE, TIMESTAMP WITH LOCAL TIME ZONE, or INTERVAL DAY TO SECOND.

  • If HOUR, MINUTE, or SECOND is requested, then expr must evaluate to an expression of data type TIMESTAMP, TIMESTAMP WITH TIME ZONE, TIMESTAMP WITH LOCAL TIME ZONE, or INTERVAL DAY TO SECOND. DATE is not valid here, because Oracle Database treats it as ANSI DATE data type, which has no time fields.

  • If TIMEZONE_HOUR, TIMEZONE_MINUTE, TIMEZONE_ABBR, TIMEZONE_REGION, or TIMEZONE_OFFSET is requested, then expr must evaluate to an expression of data type TIMESTAMP WITH TIME ZONE or TIMESTAMP WITH LOCAL TIME ZONE.

EXTRACT interprets expr as an ANSI datetime data type. For example, EXTRACT treats DATE not as legacy Oracle DATE but as ANSI DATE, without time elements. Therefore, you can extract only YEAR, MONTH, and DAY from a DATE value. Likewise, you can extract TIMEZONE_HOUR and TIMEZONE_MINUTE only from the TIMESTAMP WITH TIME ZONE data type.

When you specify TIMEZONE_REGION or TIMEZONE_ABBR (abbreviation), the value returned is a VARCHAR2 string containing the appropriate time zone region name or abbreviation. When you specify any of the other datetime fields, the value returned is an integer value of NUMBER data type representing the datetime value in the Gregorian calendar. When extracting from a datetime with a time zone value, the value returned is in UTC. For a listing of time zone region names and their corresponding abbreviations, query the V$TIMEZONE_NAMES dynamic performance view.

This function can be very useful for manipulating datetime field values in very large tables, as shown in the first example below.


Note:

Time zone region names are needed by the daylight saving feature. These names are stored in two types of time zone files: one large and one small. One of these files is the default file, depending on your environment and the release of Oracle Database you are using. For more information regarding time zone files and names, see Oracle Database Globalization Support Guide.

Some combinations of datetime field and datetime or interval value expression result in ambiguity. In these cases, Oracle Database returns UNKNOWN (see the examples that follow for additional information).


See Also:


Examples

The following example returns from the oe.orders table the number of orders placed in each month:

SELECT EXTRACT(month FROM order_date) "Month", COUNT(order_date) "No. of Orders"
  FROM orders
  GROUP BY EXTRACT(month FROM order_date)
  ORDER BY "No. of Orders" DESC, "Month";

     Month No. of Orders
---------- -------------
        11            15
         6            14
         7            14
         3            11
         5            10
         2             9
         9             9
         8             7
        10             6
         1             5
        12             4
         4             1
 
12 rows selected.

The following example returns the year 1998.

SELECT EXTRACT(YEAR FROM DATE '1998-03-07')
  FROM DUAL;

EXTRACT(YEARFROMDATE'1998-03-07')
---------------------------------
                             1998

The following example selects from the sample table hr.employees all employees who were hired after 2007:

SELECT last_name, employee_id, hire_date
  FROM employees
  WHERE EXTRACT(YEAR FROM TO_DATE(hire_date, 'DD-MON-RR')) > 2007
  ORDER BY hire_date;

LAST_NAME                 EMPLOYEE_ID HIRE_DATE
------------------------- ----------- ---------
Johnson                           179 04-JAN-08
Grant                             199 13-JAN-08
Marvins                           164 24-JAN-08
. . .

The following example results in ambiguity, so Oracle returns UNKNOWN:

SELECT EXTRACT(TIMEZONE_REGION FROM TIMESTAMP '1999-01-01 10:00:00 -08:00')
  FROM DUAL;

EXTRACT(TIMEZONE_REGIONFROMTIMESTAMP'1999-01-0110:00:00-08:00')
----------------------------------------------------------------
UNKNOWN

The ambiguity arises because the time zone numerical offset is provided in the expression, and that numerical offset may map to more than one time zone region name.

PK.)z)PKFJOEBPS/functions088.htm( LENGTH

LENGTH

Syntax

length::=

Description of length.gif follows

Purpose

The LENGTH functions return the length of char. LENGTH calculates 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.

char can be any of the data types CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, or NCLOB. The exceptions are LENGTHC, LENGTH2, and LENGTH4, which do not allow char to be a CLOB or NCLOB. The return value is of data type NUMBER. If char has data type CHAR, then the length includes all trailing blanks. If char is null, then this function returns null.

Restriction on LENGTHB The LENGTHB function is supported for single-byte LOBs only. It cannot be used with CLOB and NCLOB data in a multibyte character set.

Examples

The following example uses the LENGTH function using a single-byte database character set:

SELECT LENGTH('CANDIDE') "Length in characters"
  FROM DUAL;

Length in characters
--------------------
                   7

The next example assumes a double-byte database character set.

SELECT LENGTHB ('CANDIDE') "Length in bytes"
  FROM DUAL;
 
Length in bytes
---------------
             14
PKdPKFJOEBPS/pseudocolumns005.htm~ OBJECT_ID Pseudocolumn

OBJECT_ID Pseudocolumn

The OBJECT_ID pseudocolumn returns the object identifier of a column of an object table or view. Oracle uses this pseudocolumn as the primary key of an object table. OBJECT_ID is useful in INSTEAD OF triggers on views and for identifying the ID of a substitutable row in an object table.


Note:

In earlier releases, this pseudocolumn was called SYS_NC_OID$. That name is still supported for backward compatibility. However, Oracle recommends that you use the more intuitive name OBJECT_ID.


See Also:

Oracle Database Object-Relational Developer's Guide for examples of the use of this pseudocolumn

PKf ~ PKFJOEBPS/statements_10008.htm UPDATE

UPDATE

Purpose

Use the UPDATE statement to change existing values in a table or in the base table of a view or the master table of a materialized view.

Prerequisites

For you to update values in a table, the table must be in your own schema or you must have the UPDATE object privilege on the table.

For you to update values in the base table of a view:

  • You must have the UPDATE object privilege on the view, and

  • Whoever owns the schema containing the view must have the UPDATE object privilege on the base table.

The UPDATE ANY TABLE system privilege also allows you to update values in any table or in the base table of any view.

You must also have the SELECT object privilege on the object you want to update if:

  • The object is on a remote database or

  • The SQL92_SECURITY initialization parameter is set to TRUE and the UPDATE operation references table columns, such as the columns in a where_clause.

error_logging_clause::=

Description of error_logging_clause.gif follows

Semantics

hint

Specify a comment that passes instructions to the optimizer on choosing an execution plan for the statement.

You can place a parallel hint immediately after the UPDATE keyword to parallelize both the underlying scan and UPDATE operations.


See Also:


DML_table_expression_clause

The ONLY clause applies only to views. Specify ONLY syntax if the view in the UPDATE clause is a view that belongs to a hierarchy and you do not want to update rows from any of its subviews.

schema

Specify the schema containing the object to be updated. If you omit schema, then the database assumes the object is in your own schema.

table | view | materialized_view |subquery

Specify the name of the table, view, materialized view, or the columns returned by a subquery to be updated. Issuing an UPDATE statement against a table fires any UPDATE triggers associated with the table.

  • If you specify view, then the database updates the base table of the view. You cannot update a view except with INSTEAD OF triggers if the defining query of the view contains one of the following constructs:

    A set operator
    A DISTINCT operator
    An aggregate or analytic function
    A GROUP BY, ORDER BY, MODEL, CONNECT BY, or START WITH clause
    A collection expression in a SELECT list
    A subquery in a SELECT list
    A subquery designated WITH READ ONLY
    A recursive WITH clause
    Joins, with some exceptions, as documented in Oracle Database Administrator's Guide
  • You cannot update more than one base table through a view.

  • In addition, if the view was created with the WITH CHECK OPTION, then you can update the view only if the resulting data satisfies the view's defining query.

  • If table or the base table of view contains one or more domain index columns, then this statement executes the appropriate indextype update routine.

  • You cannot update rows in a read-only materialized view. If you update rows in a writable materialized view, then the database updates the rows from the underlying container table. However, the updates are overwritten at the next refresh operation. If you update rows in an updatable materialized view that is part of a materialized view group, then the database also updates the corresponding rows in the master table.


See Also:


partition_extension_clause

Specify the name or partition key value of the partition or subpartition within table targeted for updates. You need not specify the partition name when updating values in a partitioned table. However in some cases specifying the partition name can be more efficient than a complicated where_clause.

dblink

Specify a complete or partial name of a database link to a remote database where the object is located. You can use a database link to update a remote object only if you are using Oracle Database distributed functionality.

If you omit dblink, then the database assumes the object is on the local database.


See Also:

"References to Objects in Remote Databases" for information on referring to database links

subquery_restriction_clause

Use the subquery_restriction_clause to restrict the subquery in one of the following ways:

WITH READ ONLY Specify WITH READ ONLY to indicate that the table or view cannot be updated.

WITH CHECK OPTION Specify WITH CHECK OPTION to indicate that Oracle Database prohibits any changes to the table or view that would produce rows that are not included in the subquery. When used in the subquery of a DML statement, you can specify this clause in a subquery in the FROM clause but not in subquery in the WHERE clause.

CONSTRAINT constraint Specify the name of the CHECK OPTION constraint. If you omit this identifier, then Oracle automatically assigns the constraint a name of the form SYS_Cn, where n is an integer that makes the constraint name unique within the database.

table_collection_expression

The table_collection_expression lets you inform Oracle that the value of collection_expression should be treated as a table for purposes of query and DML operations. The collection_expression can be a subquery, a column, a function, or a collection constructor. Regardless of its form, it must return a collection value—that is, a value whose type is nested table or varray. This process of extracting the elements of a collection is called collection unnesting.

The optional plus (+) is relevant if you are joining the TABLE collection expression with the parent table. The + creates an outer join of the two, so that the query returns rows from the outer table even if the collection expression is null.


Note:

In earlier releases of Oracle, when collection_expression was a subquery, table_collection_expression was expressed as THE subquery. That usage is now deprecated.

You can use a table_collection_expression to update rows in one table based on rows from another table. For example, you could roll up four quarterly sales tables into a yearly sales table.

t_alias

Specify a correlation name (alias) for the table, view, or subquery to be referenced elsewhere in the statement. This alias is required if the DML_table_expression_clause references any object type attributes or object type methods.

Restrictions on the DML_table_expression_clause This clause is subject to the following restrictions:

  • You cannot execute this statement if table or the base table of view contains any domain indexes marked IN_PROGRESS or FAILED.

  • You cannot insert into a partition if any affected index partitions are marked UNUSABLE.

  • You cannot specify the order_by_clause in the subquery of the DML_table_expression_clause.

  • If you specify an index, index partition, or index subpartition that has been marked UNUSABLE, then the UPDATE statement will fail unless the SKIP_UNUSABLE_INDEXES session parameter has been set to TRUE.


See Also:

ALTER SESSION for information on the SKIP_UNUSABLE_INDEXES session parameter

update_set_clause

The update_set_clause lets you set column values.

column

Specify the name of a column of the object that is to be updated. If you omit a column of the table from the update_set_clause, then the value of that column remains unchanged.

If column refers to a LOB object attribute, then you must first initialize it with a value of empty or null. You cannot update it with a literal. Also, if you are updating a LOB value using some method other than a direct UPDATE SQL statement, then you must first lock the row containing the LOB. See for_update_clause for more information.

If column is a virtual column, you cannot specify it here. Rather, you must update the values from which the virtual column is derived.

If column is part of the partitioning key of a partitioned table, then UPDATE will fail if you change a value in the column that would move the row to a different partition or subpartition, unless you enable row movement. Refer to the row_movement_clause of CREATE TABLE or ALTER TABLE.

In addition, if column is part of the partitioning key of a list-partitioned table, then UPDATE will fail if you specify a value for the column that does not already exist in the partition_key_value list of one of the partitions.

subquery

Specify a subquery that returns exactly one row for each row updated.

  • If you specify only one column in the update_set_clause, then the subquery can return only one value.

  • If you specify multiple columns in the update_set_clause, then the subquery must return as many values as you have specified columns.

  • If the subquery returns no rows, then the column is assigned a null.

  • If this subquery refers to remote objects, then the UPDATE operation can run in parallel as long as the reference does not loop back to an object on the local database. However, if the subquery in the DML_table_expression_clause refers to any remote objects, then the UPDATE operation will run serially without notification.

You can use the flashback_query_clause within the subquery to update table with past data. Refer to the flashback_query_clause of SELECT for more information on this clause.


See Also:


expr

Specify an expression that resolves to the new value assigned to the corresponding column.


See Also:

Chapter 6, "Expressions" for the syntax of expr and "Updating an Object Table: Example"

DEFAULT Specify DEFAULT to set the column to the value previously specified as the default value for the column. If no default value for the corresponding column has been specified, then the database sets the column to null.

Restriction on Updating to Default Values You cannot specify DEFAULT if you are updating a view.

VALUE Clause

The VALUE clause lets you specify the entire row of an object table.

Restriction on the VALUE clause You can specify this clause only for an object table.


Note:

If you insert string literals into a RAW column, then during subsequent queries, Oracle Database will perform a full table scan rather than using any index that might exist on the RAW column.

where_clause

The where_clause lets you restrict the rows updated to those for which the specified condition is true. If you omit this clause, then the database updates all rows in the table or view. Refer to Chapter 7, "Conditions" for the syntax of condition.

The where_clause determines the rows in which values are updated. If you do not specify the where_clause, then all rows are updated. For each row that satisfies the where_clause, the columns to the left of the equality operator (=) in the update_set_clause are set to the values of the corresponding expressions to the right of the operator. The expressions are evaluated as the row is updated.

returning_clause

The returning clause retrieves the rows affected by a DML statement. You can specify this clause for tables and materialized views and for views with a single base table.

When operating on a single row, a DML statement with a returning_clause can retrieve column expressions using the affected row, rowid, and REFs to the affected row and store them in host variables or PL/SQL variables.

When operating on multiple rows, a DML statement with the returning_clause stores values from expressions, rowids, and REFs involving the affected rows in bind arrays.

expr Each item in the expr list must be a valid expression syntax.

INTO The INTO clause indicates that the values of the changed rows are to be stored in the variable(s) specified in data_item list.

data_item Each data_item is a host variable or PL/SQL variable that stores the retrieved expr value.

For each expression in the RETURNING list, you must specify a corresponding type-compatible PL/SQL variable or host variable in the INTO list.

Restrictions The following restrictions apply to the RETURNING clause:

  • The expr is restricted as follows:

    • For UPDATE and DELETE statements each expr must be a simple expression or a single-set aggregate function expression. You cannot combine simple expressions and single-set aggregate function expressions in the same returning_clause. For INSERT statements, each expr must be a simple expression. Aggregate functions are not supported in an INSERT statement RETURNING clause.

    • Single-set aggregate function expressions cannot include the DISTINCT keyword.

  • If the expr list contains a primary key column or other NOT NULL column, then the update statement fails if the table has a BEFORE UPDATE trigger defined on it.

  • You cannot specify the returning_clause for a multitable insert.

  • You cannot use this clause with parallel DML or with remote objects.

  • You cannot retrieve LONG types with this clause.

  • You cannot specify this clause for a view on which an INSTEAD OF trigger has been defined.


See Also:

Oracle Database PL/SQL Language Reference for information on using the BULK COLLECT clause to return multiple values to collection variables

error_logging_clause

The error_logging_clause has the same behavior in an UPDATE statement as it does in an INSERT statement. Refer to the INSERT statement error_logging_clause for more information.

Examples

Updating a Table: Examples The following statement gives null commissions to all employees with the job SH_CLERK:

UPDATE employees
   SET commission_pct = NULL
   WHERE job_id = 'SH_CLERK';

The following statement promotes Douglas Grant to manager of Department 20 with a $1,000 raise:

UPDATE employees SET 
    job_id = 'SA_MAN', salary = salary + 1000, department_id = 120 
    WHERE first_name||' '||last_name = 'Douglas Grant'; 

The following statement increases the salary of an employee in the employees table on the remote database:

UPDATE employees@remote
   SET salary = salary*1.1
   WHERE last_name = 'Baer';

The next example shows the following syntactic constructs of the UPDATE statement:

  • Both forms of the update_set_clause together in a single statement

  • A correlated subquery

  • A where_clause to limit the updated rows

UPDATE employees a 
    SET department_id = 
        (SELECT department_id 
            FROM departments 
            WHERE location_id = '2100'), 
        (salary, commission_pct) = 
        (SELECT 1.1*AVG(salary), 1.5*AVG(commission_pct) 
          FROM employees b 
          WHERE a.department_id = b.department_id) 
    WHERE department_id IN 
        (SELECT department_id 
          FROM departments
          WHERE location_id = 2900 
              OR location_id = 2700); 

The preceding UPDATE statement performs the following operations:

  • Updates only those employees who work in Geneva or Munich (locations 2900 and 2700)

  • Sets department_id for these employees to the department_id corresponding to Bombay (location_id 2100)

  • Sets each employee's salary to 1.1 times the average salary of their department

  • Sets each employee's commission to 1.5 times the average commission of their department

Updating a Partition: Example The following example updates values in a single partition of the sales table:

UPDATE sales PARTITION (sales_q1_1999) s
   SET s.promo_id = 494
   WHERE amount_sold > 1000;

Updating an Object Table: Example The following statement creates two object tables, people_demo1 and people_demo2, of the people_typ object created in Table Collections: Examples. The example shows how to update a row of people_demo1 by selecting a row from people_demo2:

CREATE TABLE people_demo1 OF people_typ;

CREATE TABLE people_demo2 OF people_typ;

UPDATE people_demo1 p SET VALUE(p) =
   (SELECT VALUE(q) FROM people_demo2 q
    WHERE p.department_id = q.department_id)
   WHERE p.department_id = 10;

The example uses the VALUE object reference function in both the SET clause and the subquery.

Correlated Update: Example For an example that uses a correlated subquery to update nested table rows, refer to "Table Collections: Examples".

Using the RETURNING Clause During UPDATE: Example The following example returns values from the updated row and stores the result in PL/SQL variables bnd1, bnd2, bnd3:

UPDATE employees
  SET job_id ='SA_MAN', salary = salary + 1000, department_id = 140
  WHERE last_name = 'Jones'
  RETURNING salary*0.25, last_name, department_id
    INTO :bnd1, :bnd2, :bnd3;

The following example shows that you can specify a single-set aggregate function in the expression of the returning clause:

UPDATE employees
   SET salary = salary * 1.1
   WHERE department_id = 100
   RETURNING SUM(salary) INTO :bnd1;
PK7,qPKFJOEBPS/functions025.htm CHARTOROWID

CHARTOROWID

Syntax

Description of chartorowid.gif follows

Purpose

CHARTOROWID converts a value from CHAR, VARCHAR2, NCHAR, or NVARCHAR2 data type to ROWID data type.

This function does not support CLOB data directly. However, CLOBs can be passed in as arguments through implicit data conversion.


See Also:

"Data Type Comparison Rules" for more information.

Examples

The following example converts a character rowid representation to a rowid. (The actual rowid is different for each database instance.)

SELECT last_name
  FROM employees
  WHERE ROWID = CHARTOROWID('AAAFd1AAFAAAABSAA/');
 
LAST_NAME
-------------------------
Greene
PKH4C  PKFJOEBPS/statements_6010.htmY~ CREATE PROFILE

CREATE PROFILE


Note:

Oracle recommends that you use the Database Resource Manager rather than this SQL statement to establish resource limits. The Database Resource Manager offers a more flexible means of managing and tracking resource use. For more information on the Database Resource Manager, refer to Oracle Database Administrator's Guide.

Purpose

Use the CREATE PROFILE statement to create a profile, which is a set of limits on database resources. If you assign the profile to a user, then that user cannot exceed these limits.


See Also:

Oracle Database Security Guide for a detailed description and explanation of how to use password management and protection

Prerequisites

To create a profile, you must have the CREATE PROFILE system privilege.

To specify resource limits for a user, you must:

  • Enable resource limits dynamically with the ALTER SYSTEM statement or with the initialization parameter RESOURCE_LIMIT. This parameter does not apply to password resources. Password resources are always enabled.

  • Create a profile that defines the limits using the CREATE PROFILE statement

  • Assign the profile to the user using the CREATE USER or ALTER USER statement


See Also:


Syntax

create_profile::=

Description of create_profile.gif follows

resource_parameters::=

Description of resource_parameters.gif follows

(size_clause::=

password_parameters ::=

Description of password_parameters.gif follows

Semantics

profile

Specify the name of the profile to be created. The name must satisfy the requirements listed in "Database Object Naming Rules". Use profiles to limit the database resources available to a user for a single call or a single session.

Oracle Database enforces resource limits in the following ways:

  • If a user exceeds the CONNECT_TIME or IDLE_TIME session resource limit, then the database rolls back the current transaction and ends the session. When the user process next issues a call, the database returns an error.

  • If a user attempts to perform an operation that exceeds the limit for other session resources, then the database aborts the operation, rolls back the current statement, and immediately returns an error. The user can then commit or roll back the current transaction, and must then end the session.

  • If a user attempts to perform an operation that exceeds the limit for a single call, then the database aborts the operation, rolls back the current statement, and returns an error, leaving the current transaction intact.


Notes:

  • You can use fractions of days for all parameters that limit time, with days as units. For example, 1 hour is 1/24 and 1 minute is 1/1440.

  • You can specify resource limits for users regardless of whether the resource limits are enabled. However, Oracle Database does not enforce the limits until you enable them.


UNLIMITED

When specified with a resource parameter, UNLIMITED indicates that a user assigned this profile can use an unlimited amount of this resource. When specified with a password parameter, UNLIMITED indicates that no limit has been set for the parameter.

DEFAULT

Specify DEFAULT if you want to omit a limit for this resource in this profile. A user assigned this profile is subject to the limit for this resource specified in the DEFAULT profile. The DEFAULT profile initially defines unlimited resources. You can change those limits with the ALTER PROFILE statement.

Any user who is not explicitly assigned a profile is subject to the limits defined in the DEFAULT profile. Also, if the profile that is explicitly assigned to a user omits limits for some resources or specifies DEFAULT for some limits, then the user is subject to the limits on those resources defined by the DEFAULT profile.

resource_parameters

SESSIONS_PER_USER Specify the number of concurrent sessions to which you want to limit the user.

CPU_PER_SESSION  Specify the CPU time limit for a session, expressed in hundredth of seconds.

CPU_PER_CALL  Specify the CPU time limit for a call (a parse, execute, or fetch), expressed in hundredths of seconds.

CONNECT_TIME Specify the total elapsed time limit for a session, expressed in minutes.

IDLE_TIME Specify the permitted periods of continuous inactive time during a session, expressed in minutes. Long-running queries and other operations are not subject to this limit.

LOGICAL_READS_PER_SESSION Specify the permitted number of data blocks read in a session, including blocks read from memory and disk.

LOGICAL_READS_PER_CALL Specify the permitted number of data blocks read for a call to process a SQL statement (a parse, execute, or fetch).

PRIVATE_SGA Specify the amount of private space a session can allocate in the shared pool of the system global area (SGA). Refer to size_clause for information on that clause.


Note:

This limit applies only if you are using shared server architecture. The private space for a session in the SGA includes private SQL and PL/SQL areas, but not shared SQL and PL/SQL areas.

COMPOSITE_LIMIT  Specify the total resource cost for a session, expressed in service units. Oracle Database calculates the total service units as a weighted sum of CPU_PER_SESSION, CONNECT_TIME, LOGICAL_READS_PER_SESSION, and PRIVATE_SGA.


See Also:


password_parameters

Use the following clauses to set password parameters. Parameters that set lengths of time—that is, all the password parameters except FAILED_LOGIN_ATTEMPTS and PASSWORD_REUSE_MAX—are interpreted in number of days. For testing purposes you can specify minutes (n/1440) or even seconds (n/86400) for these parameters. You can also use a decimal value for this purpose (for example .0833 for approximately one hour). The minimum value is 1 second. The maximum value is 24855 days. For FAILED_LOGIN_ATTEMPTS and PASSWORD_REUSE_MAX, you must specify an integer.

FAILED_LOGIN_ATTEMPTS  Specify the number of consecutive failed attempts to log in to the user account before the account is locked. If you omit this clause, then the default is 10 times.

PASSWORD_LIFE_TIME  Specify the number of days the same password can be used for authentication. If you also set a value for PASSWORD_GRACE_TIME, then the password expires if it is not changed within the grace period, and further connections are rejected. If you omit this clause, then the default is 180 days.


See Also:

Oracle Database Security Guide for information on setting PASSWORD_LIFE_TIME to a low value

PASSWORD_REUSE_TIME and PASSWORD_REUSE_MAX  These two parameters must be set in conjunction with each other. PASSWORD_REUSE_TIME specifies the number of days before which a password cannot be reused. PASSWORD_REUSE_MAX specifies the number of password changes required before the current password can be reused. For these parameter to have any effect, you must specify a value for both of them.

  • If you specify a value for both of these parameters, then the user cannot reuse a password until the password has been changed the number of times specified for PASSWORD_REUSE_MAX during the number of days specified for PASSWORD_REUSE_TIME.

    For example, if you specify PASSWORD_REUSE_TIME to 30 and PASSWORD_REUSE_MAX to 10, then the user can reuse the password after 30 days if the password has already been changed 10 times.

  • If you specify a value for either of these parameters and specify UNLIMITED for the other, then the user can never reuse a password.

  • If you specify DEFAULT for either parameter, then Oracle Database uses the value defined in the DEFAULT profile. By default, all parameters are set to UNLIMITED in the DEFAULT profile. If you have not changed the default setting of UNLIMITED in the DEFAULT profile, then the database treats the value for that parameter as UNLIMITED.

  • If you set both of these parameters to UNLIMITED, then the database ignores both of them. This is the default if you omit both parameters.

PASSWORD_LOCK_TIME  Specify the number of days an account will be locked after the specified number of consecutive failed login attempts. If you omit this clause, then the default is 1 day.

PASSWORD_GRACE_TIME  Specify the number of days after the grace period begins during which a warning is issued and login is allowed. If you omit this clause, then the default is 7 days.

PASSWORD_VERIFY_FUNCTION  The PASSWORD_VERIFY_FUNCTION clause lets a PL/SQL password complexity verification script be passed as an argument to the CREATE PROFILE statement. Oracle Database provides a default script, but you can create your own routine or use third-party software instead.

  • For function, specify the name of the password complexity verification routine. The function must exist in the SYS schema and you must have EXECUTE privilege on the function.

  • Specify NULL to indicate that no password verification is performed.

If you specify expr for any of the password parameters, then the expression can be of any form except scalar subquery expression.

Restriction on Password Parameters When you assign a profile to an external user or a global user, the password parameters do not take effect for that user.

Examples

Creating a Profile: Example The following statement creates the profile new_profile:

CREATE PROFILE new_profile
  LIMIT PASSWORD_REUSE_MAX 10
        PASSWORD_REUSE_TIME 30;