162.You created a profile APP_USER and assigned it to the users. After a month, you decide to drop t

本文介绍在Oracle数据库中创建和删除profile的过程。演示了当profile已分配给用户时,直接删除会遇到错误,并展示了如何先解除profile与用户的关联再进行删除操作。
162.You created a profile APP_USER and assigned it to the users. After a month, you decide to drop the
profile.
Some user sessions are currently connected to the database instance and are using the APP_USER
profile. This command is used to drop the profile:
SQL> DROP PROFILE app_user;
Which statement describes the result?
A.The command produces an error.
B.The profile is dropped and current user sessions use the DEFAULT profile immediately.
C.The profile is dropped and only the subsequent user sessions use the DEFAULT profile.
D.The profile is dropped, the sessions are terminated, and the subsequent user sessions use the DEFAULT profile.
答案:A
解析:profile分配给用户后,必须取消才可以删除profile文件
--创建profile
SQL> create profile wwww limit failed_login_attempts 7; 
Profile created.

--指定profile
SQL> alter user skd profile wwww;
User altered.

--查看skd的profile
SQL> select PROFILE from dba_users where username='SKD';
PROFILE
------------------------------
WWWW
--测试删除,删除失败
SQL> drop profile wwww;
drop profile wwww
*
ERROR at line 1:
ORA-02382: profile WWWW has users assigned, cannot drop without CASCADE

--修改为默认的profile
SQL> alter user skd profile default;
User altered.
--测试删除,删除成功
SQL> drop profile wwww;
Profile dropped.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值