该系列专题为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>