- Oracle Database 12c Security Cookbook
- Zoran Pavlovi? Maja Veselica
- 242字
- 2021-07-02 16:43:13
Locking a user account
In this recipe, you'll learn to lock and unlock user accounts.
Getting ready
To complete this recipe, you'll need an existing (for example, OS-authenticated) user who has alter user
privilege (you may use user who has a DBA role) and another existing user (for example, mike
).
How to do it...
- Connect to the database as a user who has
alter user
privilege:$ sqlplus /
- Lock the account of user
mike
:SQL> alter user mike account lock;
- Unlock the account of user
mike
:SQL> alter user mike account unlock;
How it works...
In step 1, you used OS authentication to connect to the database.
In step 2, you locked the account of user mike
. This means that user mike
cannot connect to the database:
SQL> alter user mike account lock; User altered SQL> connect mike/welcome1 ERROR: ORA-28000: the account is locked
However, objects in mike's schema are available, so users can access them (considering that they have necessary privileges):
SQL> select a, b from mike.table1; A B ---------- --------- 1 3 2 4 4 9
In step 3, you unlocked the account of user mike
. Now user mike
can successfully connect to the database:
SQL> alter user mike account unlock; User altered. SQL> conn mike/welcome1 Connected.
See also
- Creating and using OS-authenticated users
推薦閱讀
- OpenDaylight Cookbook
- LabVIEW程序設計基礎與應用
- MySQL 8 DBA基礎教程
- Modern JavaScript Applications
- Hands-On Automation Testing with Java for Beginners
- HTML5從入門到精通 (第2版)
- INSTANT Adobe Edge Inspect Starter
- 計算機應用基礎教程(Windows 7+Office 2010)
- Cocos2d-x Game Development Blueprints
- Machine Learning for Developers
- 從Excel到Python數據分析:Pandas、xlwings、openpyxl、Matplotlib的交互與應用
- Building Slack Bots
- 軟件工程與UML案例解析(第三版)
- 從“1”開始3D編程
- 可視化H5頁面設計與制作:Mugeda標準教程