logging_clause

Syntax

logging_clause::=

De.ion of logging_clause.gif follows
Description of the illustration logging_clause.gif

Semantics

This section describes the semantics of the logging_clause. For additional information, refer to the SQL statement in which you set or reset logging characteristics for a particular database object.

Specify LOGGING if you want the creation of a database object, as well as subsequent inserts into the object, to be logged in the redo log file.

Specify NOLOGGING if you do not want these operations to be logged.

  • For a nonpartitioned object, the value specified for this clause is the actual physical attribute of the segment associated with the object.

  • For partitioned objects, the value specified for this clause is the default physical attribute of the segments associated with all partitions specified in the CREATE statement (and in subsequent ALTER ... ADD PARTITION statements), unless you specify the logging attribute in the PARTITION description.

If the object for which you are specifying the logging attributes resides in a database or tablespace in force logging mode, then Oracle Database ignores any NOLOGGING setting until the database or tablespace is taken out of force logging mode.

If the database is run in archivelog mode, then media recovery from a backup made before the LOGGING operation re-creates the object. However, media recovery from a backup made before the NOLOGGING operation does not re-create the object.

The size of a redo log generated for an operation in NOLOGGING mode is significantly smaller than the log generated in LOGGING mode.

In NOLOGGING mode, data is modified with minimal logging (to mark new extents INVALID and to record dictionary changes). When applied during media recovery, the extent invalidation records mark a range of blocks as logically corrupt, because the redo data is not fully logged. Therefore, if you cannot afford to lose the database object, then you should take a backup after the NOLOGGING operation.

NOLOGGING is supported in only a subset of the locations that support LOGGING. Only the following operations support the NOLOGGING mode:

DML:  

  • Direct-path INSERT (serial or parallel) resulting either from an INSERT or a MERGE statement. NOLOGGING is not applicable to any UPDATE operations resulting from the MERGE statement.

  • Direct Loader (SQL*Loader)

DDL:  

  • CREATE TABLE ... AS SELECT

  • CREATE TABLE ... LOB_storage_clause ... LOB_parameters ... NOCACHE | CACHE READS

  • ALTER TABLE ... LOB_storage_clause ... LOB_parameters ... NOCACHE | CACHE READS (to specify logging of newly created LOB columns)

  • ALTER TABLE ... modify_LOB_storage_clause ... modify_LOB_parameters ... NOCACHE | CACHE READS (to change logging of existing LOB columns)

  • ALTER TABLE ... MOVE

  • ALTER TABLE ... (all partition operations that involve data movement)

    • ALTER TABLE ... ADD PARTITION (hash partition only)

    • ALTER TABLE ... MERGE PARTITIONS

    • ALTER TABLE ... SPLIT PARTITION

    • ALTER TABLE ... MOVE PARTITION

    • ALTER TABLE ... MODIFY PARTITION ... ADD SUBPARTITION

    • ALTER TABLE ... MODIFY PARTITION ... COALESCE SUBPARTITION

  • CREATE INDEX

  • ALTER INDEX ... REBUILD

  • ALTER INDEX ... REBUILD [SUB]PARTITION

  • ALTER INDEX ... SPLIT PARTITION

For objects other than LOBs, if you omit this clause, then the logging attribute of the object defaults to the logging attribute of the tablespace in which it resides.

For LOBs, if you omit this clause:

  • If you specify CACHE, then LOGGING is used (because you cannot have CACHE NOLOGGING).

  • If you specify NOCACHE or CACHE READS, then the logging attribute defaults to the logging attribute of the tablespace in which it resides.

NOLOGGING does not apply to LOBs that are stored inline with row data. That is, if you specify NOLOGGING for LOBs with values less than 4000 bytes and you have not disabled STORAGE IN ROW, then Oracle ignores the NOLOGGING specification and treats the LOB data the same as other table data.

 

source:http://docs.oracle.com/cd/B19306_01/server.102/b14200/clauses005.htm

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7583803/viewspace-716295/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/7583803/viewspace-716295/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值