Oracle Tutorial

  • Home
  • Start Here
  • Basics
  • Advanced
    • Oracle View
    • Oracle Index
    • Oracle Synonym
    • Oracle Sequence
    • Oracle Administration
  • PL/SQL
  • Functions
    • Aggregate Functions
    • Analytic Functions
    • Comparison Functions
    • Date Functions
    • String Functions
  • API
    • Python Oracle
Home / Oracle Database Administration / How To Unlock a User in Oracle

How To Unlock a User in Oracle

Summary: in this tutorial, you will learn how to unlock a user in Oracle by using the ALTER USER ACCOUNT UNLOCK statement.

To unlock a user in Oracle, you follow these steps:

  • First, log in to the Oracle Database as a SYS user.
  • Then, use ALTER USER statement to unlock the user as follows:
ALTER USER username IDENTIFIED BY password ACCOUNT UNLOCK;
oracle unlock user

Note that if you unlock an account without resetting the password, then the password remains expired, therefore, the IDENTIFIED BY password clause is necessary. The first time the user logs in to the Oracle Database, he needs to change his password.

Let’s see an example of unlock a user.

Suppose user alice is locked. When alice logs in, she will see the following message:

Enter user-name: alice@pdborcl Enter password: ERROR: ORA-28000: the account is locked

To unlock the user alice, you use these steps:

First, log in to the Oracle Database using theot user:

Enter user-name: ot@orclpdb Enter password: <ot_password>

Then, use the ALTER USER statement to unlock user alice:

ALTER USER alice IDENTIFIED BY abcd1234 ACCOUNT UNLOCK;

Note that abcd1234 is the new password that alice will use to log in the Oracle Database.

Now the user alice should be able to log in the database with the new password.

In this tutorial, you have learned how to unlock a user in the Oracle Database by using the ALTER USER ACCOUNT UNLOCK statement.

  • Was this tutorial helpful?
  • YesNo
Previous How To Grant SELECT Object Privilege On One or More Tables to a User
Next How To List Users in the Oracle Database

Getting Started

  • What Is Oracle Database
  • Install Oracle Database Server
  • Download Oracle Sample Database
  • Create Oracle Sample Database
  • Connect To Oracle Database Server

Oracle Data Manipulation

  • SELECT
  • Oracle DUAL Table
  • ORDER BY
  • SELECT DISTINCT
  • WHERE
  • Table & Column Aliases
  • AND
  • OR
  • FETCH
  • BETWEEN
  • IN
  • LIKE
  • IS NULL
  • Joins
  • INNER JOIN
  • LEFT JOIN
  • RIGHT JOIN
  • FULL OUTER JOIN
  • CROSS JOIN
  • Self Join
  • GROUP BY
  • HAVING
  • UNION
  • INTERSECT
  • MINUS
  • GROUPING SETS
  • CUBE
  • ROLLUP
  • PIVOT
  • UNPIVOT
  • INSERT
  • INSERT INTO SELECT
  • INSERT ALL
  • UPDATE
  • DELETE
  • MERGE
  • Subquery
  • Correlated Subquery
  • EXISTS
  • NOT EXISTS
  • ANY
  • ALL

Oracle Data Types

  • Oracle Data Types
  • NUMBER
  • FLOAT
  • BINARY_FLOAT
  • CHAR
  • NCHAR
  • VARCHAR2
  • NVARCHAR2
  • DATE
  • INTERVAL
  • TIMESTAMP
  • TIMESTAMP WITH TIME ZONE

Oracle Data Definition

  • CREATE TABLE
  • Identity Column
  • ALTER TABLE
  • ALTER TABLE ADD Column
  • ALTER TABLE MODIFY Column
  • Drop Columns
  • DROP TABLE
  • TRUNCATE TABLE
  • RENAME Table
  • Oracle Virtual Column

Oracle Constraints

  • PRIMARY KEY
  • FOREIGN KEY
  • UNIQUE
  • CHECK
  • NOT NULL

Oracle Views

  • CREATE VIEW
  • DROP VIEW
  • Updatable Views
  • Inline Views
  • WITH CHECK OPTION

About Oracle Tutorial

OracleTututorial.com website provides Developers and Database Administrators with the updated Oracle tutorials, scripts, and tips.

Search

Recent Tutorials

  • Oracle Implicit Statement Results
  • Calling PL/SQL Stored Functions in Python
  • Calling PL/SQL Procedures in Python
  • Managing Transaction in Python
  • Deleting Data From Oracle Database in Python

Site Links

  • Oracle Books
  • About
  • Contact
  • Privacy Policy
  • Terms of Use

Copyright © 2021 Oracle Tutorial. All Rights Reserved.