【OCP最新題庫解析(052)–題49】Examine these facts about a database.

  • 2019 年 10 月 10 日
  • 筆記

該系列專題為2018年4月OCP-052考題變革後的最新題庫。題庫為小麥苗解答,若解答有不對之處,可留言,也可聯繫小麥苗進行修改。

註:OCP-052最新題庫完整詳細解答版請聯繫小麥苗私聊。解題不易,請大家尊重原創。

QQ:646634621

QQ群:547200174、618766405

微訊號:lhrbestxh

Q

題目

Examine these facts about a database.

1. The database default tabpespace is tuue.

2. DEFERRED_SEGMENT_CREATION is TRUE.

3. The default tablespace of USER1 is tbs1.

4. USER1 has only these privileges:

· CREATE SESSION

· CREATE TABLE

· UNLIMITED quota on tbs1

Examine these commands executed by USER1:

SQL> CREATE TABLE emp (eno NUMBER, ename VARCHAR2(20)) TABLESPACE TBS1;

Table created.

SQL> CREATE INDEX emp_inx ON emp(eno) TABLESPACE USERS;

Index created.

SQL> INSERT INTO emp VALUES (NULL,'Alan');

What will be the outcome of the INSERT operation and why?

A. It will fail because an indexed column cannot have NULL values.

B. A row will be inserted into EMP and an index entry will be made into EMP_IDX.

C. It will fail because USER1 has no quota on USERS.

D. A row will be inserted into EMP and an index entry will be inserted into a virtual column of EMP because USER1 has no quota an USERS.

E. A row will be inserted into EMP but no index entry will be made into EXP_IDX.

A

答案

Answer:C

SYS@OCPLHR1> create tablespace tuue datafile '/u01/app/oracle/oradata/OCPLHR1/tuue01.dbf' size 10m;

Tablespace created.

SYS@OCPLHR1> alter database default tablespace tuue;

Database altered.

SYS@OCPLHR1> show parameter DEFERRED_SEGMENT_CREATION

NAME TYPE VALUE

———————————— ———– ——————————

deferred_segment_creation boolean TRUE

SYS@OCPLHR1>

SYS@OCPLHR1> create tablespace tbs1 datafile '/u01/app/oracle/oradata/OCPLHR1/tbs101.dbf' size 10m;

Tablespace created.

SYS@OCPLHR1> create user user1 identified by lhr default tablespace tbs1 quota UNLIMITED on tbs1;

User created.

SYS@OCPLHR1> grant create session,create table to user1;

Grant succeeded.

SYS@OCPLHR1> conn user1/lhr

Connected.

USER1@OCPLHR1> CREATE TABLE emp (eno NUMBER, ename VARCHAR2(20)) TABLESPACE TBS1;

Table created.

USER1@OCPLHR1> CREATE INDEX emp_inx ON emp(eno) TABLESPACE USERS;

Index created.

USER1@OCPLHR1> select * from user_segments;

no rows selected

USER1@OCPLHR1> INSERT INTO emp VALUES (NULL,'Alan');

INSERT INTO emp VALUES (NULL,'Alan')

*

ERROR at line 1:

ORA-01950: no privileges on tablespace 'USERS'

USER1@OCPLHR1>