QUESTION 26
Choose three
Which three actions can you perform only with system
privileges?
A) Truncate a table in another schema.
B) Access flat files via a database, which are stored in
an operating system directory.
C) Log in to a database.
D) Query any table in a database.
E) Use the WITH GRANT OPTION clause.
F) Execute a procedure in another schema.
Correct Answer: CDF
考察对象权限与系统权限
解析:
访问平台操作系统文件,可以理解为 directory 的可读可写权限,不属于系统权限。
with admin option是用在系统权限上的
with grant option是用在对象权限上的。
SQL语句:
GRANT CREATE SESSION TO emi WITH ADMIN OPTION; GRANT
CREATE SESSION TO role WITH ADMIN OPTION; GRANT role1 to role2 WITH ADMIN
OPTION; GRANT select ON customers1 TO bob WITH GRANT OPTION; GRANT select ON
customers1 TO hr_manager(role) WITH GRANT OPTION;
例如:grant create any table to global with
admin option;
此句中的with admin option是什么意思?
(级联的意思就是第一个用户的权限再授予其他用户,如果第一个用户被取消了该权限,那么通过其他通过第一个用户授予该权限的用户也被波及到,权限同时被取消,不级联的话其他用户就不会被波及。)
1、with
admin option
with admin option的意思是被授予该权限的用户有权将某个权限(如create any table)授予其他用户或角色,取消是不级联的。
如授予A系统权限create
session with admin option,然后A又把create
session权限授予B,但管理员收回A的create session权限时,B依然拥有create session的权限。但管理员可以显式收回B create session的权限,即直接revoke create session from B.
2、with
grant option
with grant option的意思是:权限赋予/取消是级联的,如将with grant option用于对象授权时,被授予的用户也可把此对象权限授予其他用户或角色,不同的是但管理员收回用with grant option授权的用户对象权限时,权限会因传播而失效,如grant
select on table with grant option to A,A用户把此权限授予B,但管理员收回A的权限时,B的权限也会失效,但管理员不可以直接收回B的SELECT ON TABLE 权限。
授权时,添加了with grant option参数,在撤销时,只能撤销直接授权的用户;不能间接跨越撤销.
https://www.cnblogs.com/arcer/p/3200997.html
select * from dba_sys_privs where grantee =‘DBA’ and privilege like
‘%tr%’ order by privilege;
QUESTION 27
Choose two.
Which two statements are true about the DUAL table?
A) It can display multiple rows and columns.
B) It can be accessed only by the SYS user.
C) It can be accessed by any user who has the SELECT
privilege in any schema
D) It can display multiple rows but only a single column.
E) It consists of a single row and single column of
VARCHAR2 data type.
F) It can be used to display only constants or pseudo
columns.
Correct Answer: AC
dual 这个虚拟的表可以显示多行多列;任何用户都可以访问它。这道题的难点就是对 Answer:C 的理解:在任何模式中拥有 select 权限的用户都可以访问它。
每个用户的 select 权限是不需要单独给的,只要是自己的东西,自然就有 select 的权限。
QUESTION 28
choose two
The ORDERS table has a column ORDER_DATE of date type DATE
The default display format for a date is DD-MON-RR
Which two WHERE conditions demonstrate the correct usage of conversion
functions?
A) WHERE ordet_date > TO_CRAR(ADD_MONTHS(SYSDATE, 6), ‘MON DD YYYY’)
B) WHERE TO_CHAR(order_date, ‘MON DD YYYY’) = ‘JAN 20 2019’
C ) WHERE order_date > TO_DATE(‘JUL 10 2018’, ‘MON DD YYYY’)
D) WHERE order_date IN (TO_DATE (‘Oct 21 2018’, ‘MON DD YYYY’),
TO_CHAR(‘Nov 21 2018’,‘MON DD YYYY’))
E) WHERE order_date > TO_DATE(ADD_MONTHS(SYSDATE,6),‘MON DD YYYY’)
Correct Answer: BC
QUESTION 29
choose two.
·MANAGER is an existing role with no privileges or roles.
·EMP is an existing role containing the CREATE TABLE
privilege.
·EMPLOYEES is an existing table in the HR schema.
Which two commands execute successfully?
A) GRANT CREATE SEQUENCE TO manager, emp;
B) GRANT SELECT, INSERT ON hr.employees TO manager WITH GRANT OPTION:
C) GRANT CREATE TABLE, emp TO manager;
D) GRANT CREATE TABLE, SELECT ON hr. employees TO manager ;
E) GRANT CREATE ANY SESSION, CREATE ANY TABLE TO manager;
Correct Answer: AC
GRANT
CREATE ANY SESSION TO dcmstest; 无此权限
GRANT CREATE TABLE , SELECT ON hr.EMP TO
role2 ; ->单独执行正确,一起执行错误
QUESTION 30
choose two
Evalute these conmands which execate sucestully
CREATE SEQUENCE ord_seq
INCREMENT BY 1
START WITH 1
MAXVALUE 100000
CYCLE
CACHE 5000;
Create table ord_items(
ord_no number(4) default ord_seq.nextval not null,
Item_no number(3),
Qty number(3),
Expiry_date date,
Constraint it_pk primary key(ord_no,item_no),
Constraint ord_fk foreign key (ord_no) references
orders(ord_no));
Which two statements are true about the ORD_ITEMS table
and the ORD_SEQ sequence?
A) Any user inserting rows into table ORD_ITEMS must have
been granted access to sequence ORD_SEQ.
B) Column ORD_NO gets the next number from squence
ORD_SEQ whenever a row is inserted into ORD_ITEMS and no explict value is given
for ORD_NO.
C) Sepuence ORD_SEQ cycles back to 1 after every 5000
numbers and can cycle 20 times
D) IF sequence ORD_SEQ is dropped then the default value
for column ORD_NO will be NULL for rows inserted into ORD_ITEMS.
E) Sequence ORD_SEQ is guaranteed not to genenate
duplicate numbers.
Correct Answer: AB
解析:如果序列被删除,在插入数据时会报序列不存在Oracle
12c中,可以使用序列的NEXTVAL and CURRVAL的值作为默认值,来实现列自增!
语义Semantics:
INCREMENT BY:指定序列增长步长。能够为正(升序)、负整数(降序)。但不能为0。最高精度28。
START WITH: 指定序列起始数。默觉得序列最小值。
MAXVALUE :指定序列最大值。最大28位。必须大于等于起始值且大于等于序列最小值。
NOMAXVALUE: 无最大值(实际为10^27或-1)。default
MINVALUE :指定序列最小值。
NOMINVALUE :无最小值(实际为1或-10^26)。Default
CYCLE
:指定序列达到最大值或最小值后继续从头開始生成。
NOCYCLE :不循环生成。Default.
CACHE :指定数据库内存中预分配的序列值个数,以便高速获取。最小cache值为2。Cache參数最大值为:
(CEIL (MAXVALUE - MINVALUE)) / ABS
(INCREMENT)
注意1:假设系统发生问题。全部缓存的没有被DML语句使用并提交的序列值将丢失。潜在丢失值数量等于cache的数量。
NOCACHE
:不指定缓存数,默认缓存20
ORDER :指定order条件保证序列按请求顺序生成。此条件适用于RAC环境。
NOORDER :不保证序列按请求顺序生成。