重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 3584|回复: 0
打印 上一主题 下一主题

[认证考试] OCP课程30:管理Ⅰ之用户安全

[复制链接]
跳转到指定楼层
楼主
发表于 2016-1-25 12:42:25 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

课程目标:

  • 创建和管理数据库用户账户
  • 授权和回收权限
  • 创建和管理角色
  • 创建和管理资源文件

1、数据库用户账户

每一个数据库用户账户都有:

  • 一个唯一的用户名,不超过30个字节,以字母开头,不能包含特殊字符
  • 一种认证方式,最常用的就是密码
  • 一个默认表空间,注意授权和配额
  • 一个临时表空间,用于排序和临时表,无需配额
  • 一个用户资源文件,用于资源和密码限制
  • 一个初始消费组,用于资源管理器
  • 一个账户状态,打开、锁住和过期状态

模式:

  • 用户对象的集合
  • 与用户账户同名

2、预定义的管理账户

  • SYS账户
    • 授予DBA角色及其他角色
    • 可以进行启动、关闭数据库以及其他维护命令
    • 用于数据字典和自动负载知识库(Automatic Workload Repository AWR)
  • SYSTEM账户被授予DBA,MGMT_USER和AQ_ADMINISTRATOR_ROLE角色
  • DBSNMP账户被授予OEM_MONITOR角色
  • SYSMAN账户被授予MGMT_USER,RESOURCE和SELECT_CATALOG_ROLE角色

SYS和SYSTEM账户默认授予DBA角色。此外,SYS帐户拥有所有权限和数据字典。连接到SYS帐户,如果是数据库实例必须使用AS SYSDBA,如果是ASM实例必须使用AS SYSASM。被授予SYSDBA权限的任何用户都可以使用AS SYSDBA连接到SYS帐户。只有被授予了SYSDBA、SYSOPER或者SYSASM权限的用户才可以启动和关闭实例。SYSTEM帐户没有SYSDBA权限,被授予MGMT_USER和AQ_ADMINISTRATOR_ROLE角色。在数据库中SYS和SYSTEM账户是必需的,他们不能被删除。

DBSNMP账户用于EM监控和管理数据库的管理代理,SYSMAN帐户是用来执行EM管理任务。这两个都没有SYSDBA权限。


3、创建一个用户

创建数据库用户:

(1)在EM中单击“服务器”选项卡,然后单击“安全”部分中的“用户”。

(2)点击“创建”按钮。

提供所需信息。强制项(如名字)都标有星号(*)。

指定默认表空间和临时表空间。如果用户在创建对象时没有指定表空间,该对象将在对象所有者的默认表空间中创建。如果不指定一个默认表空间,则将使用系统定义的默认永久表空间。临时表空间的情况类似:如果不指定表空间,使用系统定义的临时表空间。

例子:使用EM创建数据库用户


4、认证用户

创建用户的时候,必须选择身份验证技术:

  • Password:在设置密码时,可以立即将该密码过期,迫使用户在第一次登录后更改密码。在11g中创建的所有密码是默认区分大小写。升级到11g的数据库的密码不区分大小,但是修改后就区分大小写了。
  • External: Oracle将身份验证委托给外部服务,比如操作系统,网络认证服务或者外部认证服务,不需要输入口令。如果使用操作系统认证,设置OS_AUTHENT_PREFIX初始化参数,创建同名的操作系统用户和数据库用户,并在数据库用户名前面使用此参数作为前缀,此参数默认为OPS$字符串。当OS_AUTHENT_PREFIX为空时,表示如果操作系统上存在与数据库用户同名的用户即可直接登录数据库。
  • Global:通过Oracle Internet Directory认证用户

例子:创建操作系统用户test,创建数据库用户test,用户名前缀为OPS$的用户,测试是否进行外部认证

先创建操作系统用户test并设置密码,然后切换到该用户,设置环境变量

[root@oracletest1 ~]# useradd test

[root@oracletest1 ~]# passwd test

Changing password for user test.

New password:

BAD PASSWORD: it is too simplistic/systematic

BAD PASSWORD: is too simple

Retype new password:

passwd: all authentication tokens updated successfully.

[root@oracletest1 ~]# su - test

[test@oracletest1 ~]$ id test

uid=502(test) gid=502(test) groups=502(test)

[test@oracletest1 ~]$ export ORACLE_SID=stone

[test@oracletest1 ~]$ export PATH=/u01/app/oracle/product/11.2.0/dbhome_1/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/oracle/bin

[test@oracletest1 ~]$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1

创建数据库用户test并授予权限

SQL> show parameter os_authent_prefix

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

os_authent_prefix                    string      ops$

SQL> create user ops$test identified by external;

User created.

SQL> grant connect to ops$test;

Grant succeeded.

在操作系统用户test上是使用外部认证登录数据库

[test@oracletest1 ~]$ sqlplus  /

SQL*Plus: Release 11.2.0.4.0 Production on Mon Dec 21 15:49:24 2015

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options

SQL>


5、管理员身份验证

操作系统安全,在UNIX和Linux系统,DBA默认属于oinstall组。

  • DBA必须有创建和删除文件的操作系统权限
  • 一般用户不能有创建和删除文件的操作系统权限

管理安全

对于授权用户SYSDBA,SYSOPER和SYSASM的连接,只有在使用密码文件或者操作系统权限验证后才能批准。如果使用了操作系统身份验证,数据库不使用提供的用户名和密码。如果没有密码文件,提供的用户名或密码不在该文件中,或没有提供用户名和密码,则使用操作系统身份验证。在Oracle 11g密码文件中的密码默认区分大小。

但是,如果通过密码文件验证成功,该连接将以用户名登录。如果通过操作系统的身份验证成功,则使用”CONNECT /”连接并不记录用户。

注意:如果你是操作系统的OSDBA和OSOPER组的成员,使用as sysdba或者sysoper进行连接,不论指定了什么用户名和密码,都会带有相关管理权限进行连接。对于sysasm,不要指定任何用户和密码(例如,sqlplus / SYSASM)

例子:密码文件重命名后,本地登录正常,远程登录失败

重命名密码文件:

[oracle@oracletest ~]$ mv /u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwstone /u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwstone1

本地登录正常:

[oracle@oracletest ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Fri Dec 18 00:01:18 2015

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

远程登录失败:

C:\Users\shilei>sqlplus sys/123456@192.168.230.138:1521/stone as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on 星期五 12月 18 00:02:41 2015

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

ERROR:

ORA-01017: invalid username/password; logon denied

请输入用户名:

ERROR:

ORA-12560: TNS: 协议适配器错误


6、解锁用户账户和重置密码

如果没有在安装和创建数据库的时候解锁和重置密码,可以在EM中解锁和重置密码。


7、权限

两种类型:

系统权限:允许用户对数据库执行特定操作,例如创建表空间就是一个系统权限,有超过170种系统权限,很多系统权限包括ANY关键字

对象权限:允许用户对数据库对象执行特定的操作,如果不另外授权,用户只能访问自己的对象。


8、系统权限

如果要授予系统权限,可以在“编辑用户”页面点击“系统权限”标签,选择合适的权限。

授予带有“ANY”关键字的权限表示可以跨模式。如果只有CREATE TABLE的权限,只能在自己的模式下创建表,如果有SELECT ANY TABLE权限则可以查看其他用户的表。SYS用户和有DBA角色的用户被授予了所有带“ANY”关键字的权限,可以对任何数据对象进行任何操作。

选择“管理选项”(Admin Option)复选框表示用户可以将该系统权限进行转授权。

授予系统权限的SQL语法:

GRANT TO [WITH ADMIN OPTION]

授予管理员的系统权限有:

  • RESTRICTED SESSION:即使数据库在restricted模式,也可以登录
  • SYSDBA和SYSOPER:这两个权限可以进行关闭启动数据库,执行恢复以及其他管理任务,但是SYSOPER不能查看用户数据。包含如下系统权限:
    • STARTUP and SHUTDOWN
    • CREATE SPFILE
    • ALTER DATABASE OPEN/MOUNT/BACKUP
    • ALTER DATABASE ARCHIVELOG
    • ALTER DATABASE RECOVER (Complete recovery only. Any form of incomplete recovery, such as UNTIL TIME|CHANGE|CANCEL|CONTROLFILE, requires connecting as SYSDBA.)
    • RESTRICTED SESSION
  • SYSDBA系统权限还可以进行不完全恢复以及删除数据库。SYSDBA系统权限允许用户使用SYS用户进行连接。
  • SYSASM:该权限允许启动、关闭和管理ASM实例。
  • DROP ANY object:该权限删除任何对象的权限,允许删除其他模式用户的对象。
  • CREATE,MANAGER,DROP和ALTER TABLESPACE:该权限允许创建、管理、删除和修改表空间。
  • CREATE LIBRARY:Oracle数据库允许开发人员从PL/SQL创建和调用外部代码(例如一个C库)。该库必须由数据库中的库对象命名。创建库的权限允许用户创建一个任意的代码库。
  • CREATE ANY DIRECTORY:作为一个安全措施,操作系统目录下的代码必须链接到一个数据库虚拟目录对象。使用创建任何目录权限,可以调用不安全的代码的对象。 创建任何目录的权限允许用户创建一个目录对象(具有读写访问),对应可以访问的任何目录。这意味着用户可以在这些目录中访问外部程序。用户可以尝试直接读取和写入任何数据库文件,如数据文件、重做日志和审计日志。
  • GRANT ANY OBJECT PRIVILEGE:允许在不拥有的对象上授予对象权限。
  • ALTER DATABASE and ALTER SYSTEM:允许修改数据库和实例(例如,重命名一个数据文件或刷新缓冲区高速缓存)。

9、对象权限

如果要授予对象权限,可以在“编辑用户”页面点击“对象权限”标签,选择对象类型并点击“添加”。

授予对象权限的SQL语法:

GRANT ONTO
[WITH GRANT OPTION]



10、回收系统权限
可以使用REVOKE回收系统权限。有“ADMIN OPTION”选项系统权限的用户可以回收授予给其他用户的这个系统权限,权限回收者与最开始的授予者可以不是同一个人。
系统权限不级联。
回收系统权限的SQL语法:
REVOKE FROM
例子:系统权限的回收
创建用户
SQL> create user user001 identified by user001;
User created.
SQL> create user user002 identified by user002;
User created.
授予权限
SQL> conn / as sysdba
Connected.
SQL> grant create table to user001 with admin option;
Grant succeeded.
SQL> conn user001/user001
Connected.
SQL> grant create table to user002;
Grant succeeded.
SQL> conn / as sysdba
Connected.
SQL> select * from dba_sys_privs where (grantee='USER001' or grantee='USER002') and privilege='CREATE TABLE';
GRANTEE                        PRIVILEGE                                ADM
------------------------------ ---------------------------------------- ---
USER001                        CREATE TABLE                             YES
USER002                        CREATE TABLE                             NO
回收权限:
SQL> conn / as sysdba
Connected.
SQL> revoke create table from user001;
Revoke succeeded.
SQL> select * from dba_sys_privs where (grantee='USER001' or grantee='USER002') and privilege='CREATE TABLE';
GRANTEE                        PRIVILEGE                                ADM
------------------------------ ---------------------------------------- ---
USER002                        CREATE TABLE                             NO

11、回收对象权限
对象权限级联回收,且权限的回收者与授予者须是同一个人。前面SQL章节已经讲过了。

12、角色
更简单的权限管理:使用角色来简化权限管理。你可以将权限授予一个角色,然后给每个用户授予这个角色,而不是给予相同的权限集。
动态权限管理:当角色的权限被修改时,所有被授予角色的用户都会自动获得修改后的权限。
权限的选择可用性:角色可以启用或者禁用,用于临时打开或者关闭权限。

13、授予权限给角色和授予角色给用户
角色就是一组相关权限的集合,使用角色可以简化权限的管理。
角色:
  • 可以对角色进行授予和回收权限。
  • 角色可以授予给其他用户或者角色,也可以从其他用户和角色回收。
  • 角色可以包括系统权限和对象权限
  • 可以对用户进行启动或者禁用角色
  • 角色可以使用启用密码
  • 角色不属于任何人,它们不属于任何模式

14、预定义角色
当运行数据库创建脚本时,会自动定义数据库的几个角色。CONNECT角色自动授予给使用EM创建的任何用户。出于安全考虑,从10.2.0版本起,CONNECT角色只有CREATE SESSION权限。
注意授予RESOURCE角色包括UNLIMMITED TABLESPACE权限。

15、创建角色
创建角色的步骤:
(1)在EM中,请单击“服务器”选项卡,然后单击“安全性”标题下的“角色”。
(2)点击“创建”按钮。
(3)在“一般信息”选项卡中输入角色的名称。
(4)根据需要添加系统权限、对象权限和其他角色。
(5)单击“确定”完成。

16、安全角色
默认情况下角色通常是启用的,这意味着如果一个角色被授予用户,那么用户就有所赋予的权限。
当角色授予用户时可以取消选择“默认值”复选框,用户使用前必须显式启用角色。
角色默认无需认证,也可以增加认证。
例子:将角色授予用户,并取消“默认值”
SQL> conn user001/user001
Connected.
SQL> select * from user_role_privs;
USERNAME                       GRANTED_ROLE                   ADM DEF OS_
------------------------------ ------------------------------ --- --- ---
USER001                        CONNECT                        NO  YES NO
USER001                        MANAGER                        NO  NO  NO
SQL> conn / as sysdba
Connected.
SQL> ALTER USER "USER001" DEFAULT ROLE ALL;
User altered.
SQL> conn user001/user001
Connected.
SQL> select * from user_role_privs;
USERNAME                       GRANTED_ROLE                   ADM DEF OS_
------------------------------ ------------------------------ --- --- ---
USER001                        CONNECT                        NO  YES NO
USER001                        MANAGER                        NO  YES NO
例子:修改角色增加口令验证
SQL> select * from dba_roles where role='MANAGER';
ROLE                           PASSWORD AUTHENTICAT
------------------------------ -------- -----------
MANAGER                        YES      PASSWORD
SQL> ALTER ROLE "MANAGER" NOT IDENTIFIED;
Role altered.
SQL> select * from dba_roles where role='MANAGER';
ROLE                           PASSWORD AUTHENTICAT
------------------------------ -------- -----------
MANAGER                        NO       NONE

17、授予角色给用户
可以使用角色来管理数据库权限。可以将权限添加到角色,并授予用户角色。用户可以启用角色,使用角色里面的权限。角色包含授予的所有权限以及授予它的其他角色的所有权限。
默认情况下,EM自动授予新用户CONNECT角色。允许用户连接到数据库。
给用户分配角色:
(1)在EM中,请单击“服务器”选项卡,然后单击“安全性”标题下的“用户”。
(2)选择用户并单击“编辑”按钮。
(3)单击“角色”选项卡,然后单击“编辑列表”按钮。
(4)选择所需的角色。
(5)单击“应用”按钮完成。

18、资源文件和用户
资源文件profile可以用来对用户所能使用的数据库资源进行限制,用户一次只能分配一个资源文件,通过资源文件可以控制用户的资源消耗,管理账户状态以及密码失效条件。如果用户在更改其配置文件时已登录,该更改将下一次登录生效。
默认的资源文件作为所有其他资源文件的基础。资源文件中的限制可以显式指定,也可以无限时,还可以参考默认资源文件。
资源文件生效需要将初始化参数RESOURCE_LIMIT设置为true,默认为false,但资源文件密码设置仍强制有效。
管理员可以使用资源文件控制下面系统资源:
  • Cpu_per_session:指定会话的CPU时间限制,单位为百分之一秒。
  • Cpu_per_call:指定一次调用(解析、执行和提取)的CPU时间限制,单位为百分之一秒。
  • Network/Memory:可以指定如下:
    • Connect_time:指定会话的总的连接时间,以分钟为单位。
    • Idle_time:指定会话允许连续不活动的总的时间,以分钟为单位,超过该时间,会话将断开。但是长时间运行查询和其他操作的不受此限制。
    • Concurrent Sessions:表示使用数据库用户帐户可以创建多个并发会话。
    • Private_sga:指定一个会话可以在共享池(SGA)中所允许分配的最大空间,以字节为单位。(该限制只在使用共享服务器结构时才有效,会话在SGA中的私有空间包括私有的SQL和PL/SQL,但不包括共享的SQL和PL/SQL)。
  • Disk I/O:限制用户可以在每一个会话级或每一个call级别读取的数据量。包括从内存和磁盘读取的总量。可以限制I/O密集型语句过度使用内存和磁盘。
创建一个配置文件,单击“服务器”选项卡,然后单击“安全”标题下的“概要文件”。在“概要文件”页上,单击“创建”按钮。

19、密码安全
使用资源文件进行密码管理。
帐户锁定:登录失败超过指定次数自动锁定帐户。
  • failed_login_attempts:锁定前的登录尝试次数
  • password_lock_time:尝试登录失败后锁定天数
密码老化和过期:设置密码有效期
  • password_life_time:密码有效天数
  • password_grace_time:密码过期后的宽限时间
密码历史:确保密码不被重复使用
  • password_reuse_time:用户不能使用重复密码的天数
  • password_reuse_max:要再次使用当前密码需要更换成其他密码的次数
如果两个密码历史参数都是UNLIMITED,数据库都会忽略。用户可以随时重用密码。
如果一个参数被设置为一个数字,而另一个参数被指定为UNLIMITED,那么用户可以不重用密码。
密码复杂度验证:对密码进行复杂度检查,以验证其是否符合特定规则。确保密码满足一定的复杂度要求。参数PASSWORD_VERIFY_FUNCTION指定复杂度检查的PL/SQL函数。可以运行utlpwdmg.sql脚本获取函数。

20、创建一个密码资源文件

22、密码验证函数VERIFY_FUNCTION_11G
Oracle提供了两个密码复杂度验证函数,verify_function和verify_function_11g。使用脚本/rdbms/admin/utlpwdmg.sql创建。
VERIFY_FUNCTION_11G函数确保密码满足如下条件:
  • 至少8位
  • 与用户名,用户名加数字,用户名反写不同
  • 与数据库名字,数据库名字加数字不同
  • 至少包括数字和字符
  • 与先前的密码至少有3个字符不一样

23、给用户指定配额
配额是表空间的可用空间,默认情况下用户没有任何表空间的配额,可以通过如下三个选项设置配额:
  • Unlimited:对表空间的使用无限制
  • Value:指定用户可以使用多少KB或者MB
  • UNLIMITED TABLESPACE system privilege:覆盖对所有表空间的配额设置,用户可以无限制的使用所有表空间,包括SYSTEM和SYSAUX表空间,RESOURCE角色就包括这个权限
不要给用户SYSTEM和SYSAUX表空间的配额,一般只有SYS和SYSTEM用户才可以在SYSTEM和SYSAUX表空间创建对象。
分配临时表空间和undo表空间不需要设置配额。在数据库中插入,更新和删除数据不需要配额,只有拥有数据库对象的用户才需要配额。
  • 当用户创建或者扩展段的时候Oracle实例会去检查配额
  • 只有使用空间的活动才会涉及到配额,不使用空间的活动,比如创建视图或者使用临时表空间不会影响到配额
  • 用户使用PURGE选项删除对象或者清空回收站可以回收配额

24、应用最小权限原则
保护数据字典:参数O7_DICTIONARY_ACCESSIBILITY默认设置为FALSE,可以阻止有ANY TABLE系统权限的的用户访问数据字典基表,同时确保SYS用户只能使用AS SYSDBA登录。
从PUBLIC用户回收不必要的权限:
从PUBLIC回收不必要的权限:PUBLIC有以下包的执行权限:utl_smtp,utl_tcp,utl_http和utl_file。在Oracle 11g,通过访问控制列表(ACL)可以允许特定的用户访问特定的网络服务。网络访问默认被拒绝。可以创建ACL允许网络访问。通过utl_file访问文件可以在2个级别进行控制:在操作系统级别上的文件和目录的权限,以及在数据库上的DIRECTORY对象。
可能被误用的的软件包有:
  • utl_smtp:利用数据库作为简单邮件传输协议(SMTP)邮件服务器发生电子邮件。使用ACL来控制哪个用户可以访问哪个机器。
  • utl_tcp:允许通过TCP 建立连接,从网络上得到可执行文件。使用ACL控制访问。
  • utl_http:允许用户通过HTTP 访问外部资源包括恶意的web 代码和文件。利用ACL控制访问。
  • utl_file:允许用户读取服务器上的文件。
限制访问操作系统目录:数据库的DIRECTORY对象允许DBA映射目录到操作系统,并就这些目录的权限赋予给用户。
限制用户拥有管理权限:不要提供给用户多与的权限。非管理员不得授予DBA角色。要实现最小权限管理,限制下列类型的权限:
  • 系统和对象权限的授予
  • 系统权限级的数据库连接,如SYSDBA和SYSOPER
  • 其他DBA权限,如删除任何表
限制远程操作系统数据库认证:remote_os_authent静态参数默认设置为false。如果为true,则可以远程使用操作系统认证。
在远程身份验证过程中:
  • 数据库用户在外部进行身份验证
  • 远程系统的用户进行身份验证
  • 用户登录到数据库中,无需进一步验证
例子:修改remote_os_authent为true,在其他机器上使用test操作系统账户远程登录数据库不需要输入用户名和密码(参考前面第4节的设置)
SQL> alter system set remote_os_authent=true scope=spfile;
SQL> select name,value,issys_modifiable from v$parameter where name='remote_os_authent';
NAME                                     VALUE                ISSYS_MOD
---------------------------------------- -------------------- ---------
remote_os_authent                        TRUE                 FALSE
[root@oracletest ~]# su - test
[test@oracletest ~]$ export ORACLE_SID=stone
[test@oracletest ~]$  export PATH=/u01/app/oracle/product/11.2.0/dbhome_1/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/oracle/bin
[test@oracletest ~]$  export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
[test@oracletest ~]$ sqlplus /@192.168.230.139:1521/stone
SQL*Plus: Release 11.2.0.4.0 Production on Mon Dec 21 17:08:05 2015
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
SQL>

25、保护授权账户
授权账户可以通过以下方式进行保护:
  • 使用大小写敏感的密码文件
  • 为管理员角色启用强认证
有SYSDBA,SYSOPER或者SYSASM权限的用户必须被认证。当本地连接的时候,作为授权的操作系统组成员,用户可以通过操作系统认证。如果是远程连接,使用密码文件进行认证授权。如果配置了密码文件,优先使用密码文件。在Oracle 11g,密码是大小写敏感的。
当使用dbca创建的数据库,密码文件大小敏感。如果升级早期的数据库,可以通过如下操作系统命令将密码文件设置为大小写敏感:
orapwd file=orapworcl entries=5 ignorecase=N

26、相关习题
(1)Examine the command:
SQL>ALTER USR skd ACCOUNT LOCK;
Which two statements are true after the command is executed? (Choose two.)
A. The SKD user cannot log in to the database instance
B. The objects owned by the SKD user are not accessible to any user
C. The other users can access the objects owned by the SKD user, on which they have access
D. The password for the SKD user expires and the user is forced to change the password at the next log in
答案:AC
(2)You executed the following command to create a password file in the database server:
$ orapwd file = orapworcl entries = 5 ignorecase=N
Which statement describes the purpose of the above password file?
A. It records usernames and passwords of users when granted the DBA role
B. It contains usernames and passwords of users for whom auditing is enabled
C. It is used by Oracle to authenticate users for remote database administrator
D. It records usernames and passwords of all users when they are added to OSDBA or OSOPER operating groups
答案:C
(3)View the Exhibit and examine the privileges granted to the MGR_ROLE role. The user SKD has been granted the CONNECT and RESOURCE roles only. The database administrator (DBA) grants MGR_ROLE to the user SKD by executing the command:
SQL> GRANT MGR_ROLE TO SKD WITH ADMIN OPTION;
Which statement is true about the user SKD after he/she is granted this role?
A. The user SKD can grant only the MGR_ROLE role to other users, but not the privileges in it
B. The user SKD can revoke the MGR_ROLE only from the users for whom he/she is the grantor
C. The user SKD can grant the privileges in the MGR_ROLE role to other users but not with ADMIN OPTION
D. The user SKD can grant the privileges in the MGR_ROLE role to other users, but cannot revoke privileges from them
答案:A
(4)Examine the following steps performed on a database instance:
   1. The DBA grants the CREATE TABLE system privilege to the SKD user with
ADMIN OPTION
   2. The SKD user creates a table
   3. The SKD user grants the CREATE TABLE system privilege to the HR user
   4. The HR user creates a table
   5. The DBA revokes the CREATE TABLE system privilege from SKD
Which statement is true after step 5 is performed?
A.  The table created by SKD is not accessible and SKD cannot create new tables
B.  The tables created by SKD and HR remain, but both cannot create new tables
C.  The table created by HR remains and HR still has the CREATE TABLE system privilege
D.  The table created by HR remains and HR can grant the CREATE TABLE system privilege to other users
答案:C
(5)View the Exhibit and examine the privileges granted to the SL_REP user.
The EMP table is owned by the SCOTT user. The SL_REP user executes the following command:
   SQL> GRANT SELECT ON scott.emp TO hr;
Which statement describes the outcome of the command?

A.  The command executes successfully
B.  The command produces an error because the EMP table is owned by SCOTT
C.  The command produces an error because SL_REP has the GRANT ANY OBJECT PRIVILEGE without ADMIN_OPTION
D.  The  command  produces  an  error  because  SL_REP  does  not  have  the  SELECT  privilege  with GRANT_OPTION on the EMP table
答案:A
(6)The HR user creates a stand-alone procedure as follows and grants the EXECUTE privilege on the procedure to many database users:
   CREATE OR REPLACE PROCEDURE create_dept ( v_deptno NUMBER, v_dname
VARCHAR2,  v_mgr NUMBER, v_loc NUMBER)
   BEGIN
         INSERT INTO hr.departments VALUES (v_deptno, v_dname, v_mgr, v_loc);  
   END;
The  users  having  permission  to  execute  the  procedure  are  able  to  insert  records  into  the DEPARTMENTS table even though they do not have the INSERT privilege on the table. You want  only  those  users  who  have  privileges  on  the  DEPARTMENTS  table  to  be  able  to execute the procedure successfully.
What would you suggest to the PL/SQL developers to achieve this?
A.  Create the procedure with definer's right.
B.  Create the procedure with invoker's right.
C.  Grant the EXECUTE privilege with GRANT OPTION on the procedure to selected users.
D.  Create the procedure as part of a PL/SQL package and grant the EXECUTE privilege on the package to selected users.
答案:B
(7)The database instance has the following parameter setting:
   OS_AUTHENT_PREFIX = OPS$
   OS_ROLES = FALSE
   REMOTE_OS_AUTHENT = FALSE
   REMOTE_OS_ROLES = FALSE
   TIMED_OS_STATISTICS = 0
You  have  a  local  operating  system  user  SKD.  You  create  a  database  user  OPS$SKD,  and then  assign  external  authentication.  The  user  OPS$SKD  has  the  CREATE  SESSION privilege.
What would you achieve by the above process?
A.  The database user OPS$SKD will be able to administer the database.
B.  The authentication detail for the database user OPS$SKD is recorded in the password file.
C.  The  local  operating  system  user  SKD  will  be  able  to  access  the  database  instance  without  specifying  the username and password.
D.  The  database  user  OPS$SKD  has  to  login  with  the  password  of  the  local  operating  system  user  SKD  to access the database instance.
答案:C
(8)See the Exhibit to observe the roles assigned to the SL_REP user.
Which statement is true about the assignment of the SELECT_CATALOG_ROLE role to the SL_REP user?

A.  The user must enable the role explicitly
B.  The user can grant the role to other users
C.  The user cannot user the role until the DBA enables it explicitly
D.  The user can start using the role immediately without any changes
答案:A
(9)A  user,  who  is  authenticated  externally,  logs  in  to  a  remote  machine  and  connects  to  the database instance.
What  action  would  you  take  to  ensure  that  a  user  cannot  connect  to  the  database instance by merely logging in to a remote machine?
A.  Set REMOTE_OS_ROLES to FALSE
B.  Set OS_ROLES parameter to FALSE
C.  Set the REMOTE_OS_AUTHENT parameter to FALSE
D.  Set the REMOTE_LOGIN_PASSWORD_FILE parameter to NONE
答案:C
(10)You want to create a role to meet these requirements:
   1. The role is to be protected from unauthorized usage.
   2. The password of the role is not to be embedded in the application source code or stored in a table.
Which method would you use to restrict enabling of such roles?
A.  Create the role with external authentication.
B.  Create the role as a secure application role.
C.  Create the role as a password-protected role.
D.  Create a role and use Fine-Grained Access Control (FGAC) to secure the role.
答案:B
(11)In your database instance, the user sessions are connected to the database server from the remote machines. You want to achieve the following for these users:
   1. The user account must be locked after four unsuccessful login attempts.
   2. The user must be prompted to change the password at regular intervals.
   3. The user may not have more than three simultaneous sessions.
   4. The user session must automatically be logged off if more than 10 minutes elapsed time used.
How would you accomplish the above?
A.  By assigning profiles for the users
B.  By implementing Fine-Grained Auditing (FGA)
C.  By granting a secure application role to the users
D.  By implementing the Database Resource Manager plan
答案:A
(12)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
答案:B
(13)A constraint in a table is defined with the INITIALLY IMMEDIATE clause.  You executed  the ALTER  TABLE  command  with  the  ENABLE  VALIDATE  option  to  enable  the  constraint  that was disabled.
What are the two effects of this command? (Choose two.)
A.  It fails if any existing row violates the constraint.
B.  It does not validate the existing data in the table.
C.  It enables the constraint to be enforced at the end of each transaction.
D.  It prevents insert, update, and delete operations on the table while the constraint is in the process of being enabled.
答案:AD
(14)View the Exhibit1, which shows the options that are selected to create the user SL_REP.  View the Exhibit2 and examine the contents of DATABASE_PROPERTIES.
Which two statements are true regarding this user? (Choose two.)
Exhibit1 (exhibit):

Exhibit2 (exhibit):

A.  The user is authenticated by the operating system.
B.  The objects created by the user are placed in the USERS tablespace.
C.  The user does not require quota on the TEMP tablespace to perform sort operations.
D.  The user is forced to change the password at the first login to the database instance.
E.  The objects created by the user in future are unlocked to be accessed by all the users in the database by default
答案:BC
(15)Some  non-DBA  users  in  your  database  have  been  granted  ANY  TABLE  system  privileges and they are able to access data dictionary base tables. You decide to restrict their access to data dictionary objects.
Which method would you adopt to achieve this objective?
A. Revoke the RESOURCE role from the users.
B. Set the value of the OS_ROLES parameter to TRUE.
C. Use Database Resource Manager to restrict user access to objects.
D. Grant ANY TABLE system privileges again without ADMIN OPTION.
E.  Set the value of the O7_DICTIONARY_ACCESSIBILITY parameter to FALSE.
答案:E


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-5-5 18:11 , Processed in 0.120501 second(s), 20 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表