返回顶部
首页 > 资讯 > 数据库 >验证一个052考试题
  • 197
分享到

验证一个052考试题

2024-04-02 19:04:59 197人浏览 安东尼
摘要

8 、Examine the following statement: sql> ALTER TABLE SALES MODIFY CONSTRaiNT pk DISABLE

8 、Examine the following statement:

sql> ALTER TABLE SALES MODIFY CONSTRaiNT pk DISABLE VALIDATE; 

Which three statements are true?

A)Rows may be inserted into the table.

B) The PK index is made unusable.

C)The PK index is dropped.

D)The constraint is still enforced for updated rows. 

E)The constraint is still enforced for inserted rows.

Answer:CDE

--=====================

SQL> create table tt(id int primary key) ;

表已创建。

SQL> desc dba_constraints
 名称                                      是否为空? 类型
 ----------------------------------------- -------- ----------------------------
 OWNER                                              VARCHAR2(60)
 CONSTRAINT_NAME                           NOT NULL VARCHAR2(30)
 CONSTRAINT_TYPE                                    VARCHAR2(1)
 TABLE_NAME                                NOT NULL VARCHAR2(30)
 SEARCH_CONDITioN                                   LONG
 R_OWNER                                            VARCHAR2(60)
 R_CONSTRAINT_NAME                                  VARCHAR2(30)
 DELETE_RULE                                        VARCHAR2(9)
 STATUS                                             VARCHAR2(8)
 DEFERRABLE                                         VARCHAR2(14)
 DEFERRED                                           VARCHAR2(9)
 VALIDATED                                          VARCHAR2(13)
 GENERATED                                          VARCHAR2(14)
 BAD                                                VARCHAR2(3)
 RELY                                               VARCHAR2(4)
 LAST_CHANGE                                        DATE
 INDEX_OWNER                                        VARCHAR2(30)
 INDEX_NAME                                         VARCHAR2(30)
 INVALID                                            VARCHAR2(7)
 VIEW_RELATED                                       VARCHAR2(14)

SQL> SELECT CONSTRAINT_NAME,CONSTRAINT_type from dba_constraints where table_name='TT';

CONSTRAINT_NAME                C
------------------------------ -
SYS_C006993                    P

SQL> alter table tt modify constraint SYS_C006993 disable validate;

表已更改。

SQL> SELECT CONSTRAINT_NAME,CONSTRAINT_type,status from dba_constraints where table_name='TT';

CONSTRAINT_NAME                C STATUS
------------------------------ - --------
SYS_C006993                    P DISABLED

SQL> SELECT CONSTRAINT_NAME,CONSTRAINT_type,status,validated from dba_constraints where table_name='TT';

CONSTRAINT_NAME                C STATUS   VALIDATED
------------------------------ - -------- -------------
SYS_C006993                    P DISABLED VALIDATED

SQL> SELECT CONSTRAINT_NAME,CONSTRAINT_type,status,validated,index_name from dba_constraints where table_name='TT';

CONSTRAINT_NAME                C STATUS   VALIDATED
------------------------------ - -------- -------------
INDEX_NAME
------------------------------
SYS_C006993                    P DISABLED VALIDATED


SQL> set linesize 120
SQL> SELECT CONSTRAINT_NAME,CONSTRAINT_type,status,validated,index_name from dba_constraints where table_name='TT';

CONSTRAINT_NAME                C STATUS   VALIDATED     INDEX_NAME
------------------------------ - -------- ------------- ------------------------------
SYS_C006993                    P DISABLED VALIDATED

SQL> select index_name from dba_indexes where table_name='TT';

未选定行

SQL> insert into tt values(1);
insert into tt values(1)
*
第 1 行出现错误:
ORA-25128: 不能对带有禁用和验证约束条件 (XYS.SYS_C006993) 的表进行插入/更新/删除


SQL>

您可能感兴趣的文档:

--结束END--

本文标题: 验证一个052考试题

本文链接: https://lsjlt.com/news/49795.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作