- 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
推薦閱讀
- Vue.js 3.x快速入門
- Design Principles for Process:driven Architectures Using Oracle BPM and SOA Suite 12c
- Three.js開發指南:基于WebGL和HTML5在網頁上渲染3D圖形和動畫(原書第3版)
- Mastering Julia
- PHP網絡編程學習筆記
- 用Flutter極速構建原生應用
- Windows內核編程
- 西門子S7-200 SMART PLC編程從入門到實踐
- ElasticSearch Cookbook(Second Edition)
- Test-Driven JavaScript Development
- JavaScript動態網頁編程
- Laravel Application Development Blueprints
- Java并發編程之美
- 深度學習程序設計實戰
- Learning Grunt