OCP 1Z0 052 170
2014-06-23 11:34
190 查看
170. A constraint in a table is defined with the INITIALLY IMMEDIATE clause. You executed the ALTER
TABLE command with the ENABLE VALIDATE option to enable the constraint that was disabled.
What are the two effects of this command? (Choose two.)
A.It fails if any existing row violates the constraint.
B.It does not validate the existing data in the table.
C.It enables the constraint to be enforced at the end of each transaction.
D.It prevents insert, update, and delete operations on the table while the constraint is in the process of
being enabled.
Answer: AD
http://docs.oracle.com/cd/E11882_01/server.112/e41084/clauses002.htm#SQLRF52221
Restriction on [NOT] DEFERRABLE You cannot specify either of these parameters for a view constraint.
INITIALLY Clause The
The
Specify
indicate that Oracle should check this constraint at the end of each subsequent SQL statement. If you do not specify
If you declare a new constraint
is committed or the statement will fail.
Specify
should check this constraint at the end of subsequent transactions.
This clause is not valid if you have declared the constraint to be
is automatically
VALIDATE | NOVALIDATE The behavior of
depends on whether the constraint is enabled or disabled, either explicitly or by default. Therefore they are described in the context of "ENABLE
Clause" and "DISABLE Clause".
ENABLE Clause Specify
to be applied to the data in the table.
If you enable a unique or primary key constraint, and if no index exists on the key, then Oracle Database creates a unique index. Unless you specify
and the database rebuilds the index every time the constraint is reenabled.
You can also avoid rebuilding the index and eliminate redundant indexes by creating new primary key and unique constraints initially disabled. Then create (or use existing) nonunique indexes to enforce the constraint. Oracle does not drop a nonunique index
when the constraint is disabled, so subsequent
that all old and new data also complies with the constraint. An enabled validated constraint guarantees that all data is and will continue to be valid.
If any row in the table violates the integrity constraint, then the constraint remains disabled and Oracle returns an error. If all rows comply with the constraint, then Oracle enables the constraint. Subsequently,
if new data violates the constraint, then Oracle does not execute the statement and returns an error indicating the integrity constraint violation.
If you place a primary key constraint in
no nulls. To avoid this overhead, mark each column in the primary key
on the constrained data comply with the constraint. This clause does not ensure that existing data in the table complies with the constraint.
If you specify neither
If you change the state of any single constraint from
be performed in parallel, and does not block reads, writes, or other DDL operations.
TABLE command with the ENABLE VALIDATE option to enable the constraint that was disabled.
What are the two effects of this command? (Choose two.)
A.It fails if any existing row violates the constraint.
B.It does not validate the existing data in the table.
C.It enables the constraint to be enforced at the end of each transaction.
D.It prevents insert, update, and delete operations on the table while the constraint is in the process of
being enabled.
Answer: AD
http://docs.oracle.com/cd/E11882_01/server.112/e41084/clauses002.htm#SQLRF52221
Restriction on [NOT] DEFERRABLE You cannot specify either of these parameters for a view constraint.
INITIALLY Clause The
INITIALLYclause establishes the default checking behavior for constraints that are
DEFERRABLE.
The
INITIALLYsetting can be overridden by a
SET
CONSTRAINT(
S) statement in a subsequent transaction.
Specify
INITIALLY
IMMEDIATEto
indicate that Oracle should check this constraint at the end of each subsequent SQL statement. If you do not specify
INITIALLYat all, then the default is
INITIALLY
IMMEDIATE.
If you declare a new constraint
INITIALLY
IMMEDIATE, then it must be valid at the time the
CREATE
TABLEor
ALTER
TABLEstatement
is committed or the statement will fail.
Specify
INITIALLY
DEFERREDto indicate that Oracle
should check this constraint at the end of subsequent transactions.
This clause is not valid if you have declared the constraint to be
NOT
DEFERRABLE, because a
NOT
DEFERRABLEconstraint
is automatically
INITIALLY
IMMEDIATEand cannot ever be
INITIALLY
DEFERRED.
VALIDATE | NOVALIDATE The behavior of
VALIDATEand
NOVALIDATEalways
depends on whether the constraint is enabled or disabled, either explicitly or by default. Therefore they are described in the context of "ENABLE
Clause" and "DISABLE Clause".
ENABLE Clause Specify
ENABLEif you want the constraint
to be applied to the data in the table.
If you enable a unique or primary key constraint, and if no index exists on the key, then Oracle Database creates a unique index. Unless you specify
KEEP INDEXwhen subsequently disabling the constraint, this index is dropped
and the database rebuilds the index every time the constraint is reenabled.
You can also avoid rebuilding the index and eliminate redundant indexes by creating new primary key and unique constraints initially disabled. Then create (or use existing) nonunique indexes to enforce the constraint. Oracle does not drop a nonunique index
when the constraint is disabled, so subsequent
ENABLEoperations are facilitated.
ENABLE
VALIDATEspecifies
that all old and new data also complies with the constraint. An enabled validated constraint guarantees that all data is and will continue to be valid.
If any row in the table violates the integrity constraint, then the constraint remains disabled and Oracle returns an error. If all rows comply with the constraint, then Oracle enables the constraint. Subsequently,
if new data violates the constraint, then Oracle does not execute the statement and returns an error indicating the integrity constraint violation.
If you place a primary key constraint in
ENABLE
VALIDATEmode, then the validation process will verify that the primary key columns contain
no nulls. To avoid this overhead, mark each column in the primary key
NOT
NULLbefore entering data into the column and before enabling the primary key constraint of the table.
ENABLE
NOVALIDATEensures that all new DML operations
on the constrained data comply with the constraint. This clause does not ensure that existing data in the table complies with the constraint.
If you specify neither
VALIDATEnor
NOVALIDATE, then the default is
VALIDATE.
If you change the state of any single constraint from
ENABLE
NOVALIDATEto
ENABLE
VALIDATE, then the operation can
be performed in parallel, and does not block reads, writes, or other DDL operations.
相关文章推荐
- OCP-1Z0-052-V8.02-170题
- OCP题库笔记1z0-052
- [每日一题] 11gOCP 1z0-052 :2013-08-30 差异的增量备份..................................................
- OCP-1Z0-052-V8.02-10-11题
- [每日一题] 11gOCP 1z0-052 :2013-09-4 block header grows............................................A33
- [每日一题] 11gOCP 1z0-052 :2013-09-15 Enterprise Manager Support Workbench..................B9
- [每日一题] 11gOCP 1z0-052 :2013-09-17 DRA--Data Recovery Advisor.............................B31
- OCP-1Z0-052-V8.02-165题
- [每日一题] 11gOCP 1z0-052 :2013-09-28 ORA-01555: snapshot too old......................C52
- OCP-1Z0-052-V8.02-26题
- OCP-1Z0-052-V8.02-36题
- OCP-1Z0-052-V8.02-1题
- OCP-1Z0-052-V8.02-63题
- OCP-1Z0-052-V8.02-131题
- OCP-1Z0-052-V8.02-107题
- OCP-1Z0-052-V8.02-153题
- OCP-1Z0-052-V8.02-133题
- OCP-1Z0-052-V8.02-182题
- OCP-1Z0-052-V8.02-98题
- OCP-1Z0-052-V8.02-105题