159. View the Exhibit and examine the user information. 

The user has been granted CONNECT and RESOURCE roles and no individual system privileges. The 
SL_REP user executes this command to create a table: 
SQL> CREATE TABLE orders(oid number(6), odate date, ccode number(4), oamt  
number(10,2)) TABLESPACE purchase_space; 
The  PURCHASE_SPACE  tablespace  already  exists  in  the  database. Which  statement  describes  the 
effect of the command? 
A.The command executes successfully and creates the table in the USERS tablespace. 
B.The command executes successfully and creates the table in the PURCHASE_SPACE tablespace. 
C.The command produces an error because the user does not have the privilege to create the table. 
D.The command produces an error because  the user does not have quota  in  the PURCHASE_SPACE 
tablespace. 

Answer: B   

SQL> create user sl_rep identified by sl_rep;

User created.

SQL> grant resource,connect to sl_rep;

Grant succeeded.

SQL> SELECT username, default_tablespace FROM dba_users WHERE username = 'SL_REP';

USERNAME                       DEFAULT_TABLESPACE
------------------------------ ------------------------------
SL_REP                         USERS

SQL> conn sl_rep/sl_rep
Connected.
SQL> create table test(id number) tablespace ts_test;

Table created.

SQL> insert into test values(1);

1 row created.

SQL> col segment_name form a20
SQL> SELECT segment_name,tablespace_name,bytes FROM user_segments;

SEGMENT_NAME         TABLESPACE_NAME                     BYTES
-------------------- ------------------------------ ----------
TEST                 TS_TEST                             65536

SQL> SELECT *
  2    FROM role_sys_privs
  3   WHERE role IN ('RESOURCE', 'CONNECT')
  4   ORDER BY 1;

ROLE                           PRIVILEGE                                ADM
------------------------------ ---------------------------------------- ---
CONNECT                        CREATE SESSION                           NO
RESOURCE                       CREATE CLUSTER                           NO
RESOURCE                       CREATE INDEXTYPE                         NO
RESOURCE                       CREATE OPERATOR                          NO
RESOURCE                       CREATE PROCEDURE                         NO
RESOURCE                       CREATE SEQUENCE                          NO
RESOURCE                       CREATE TABLE                             NO
RESOURCE                       CREATE TRIGGER                           NO
RESOURCE                       CREATE TYPE                              NO

9 rows selected.


resouce-->create table

更多推荐

OCP 1Z0 052 159