Skip to main content

Gradual Password Rollover in Oracle Database 19c: Secure Password Changes Without Downtime

Overview

Gradual Password Rollover in Oracle allows both the old and new password to remain valid for a temporary period after a password change, helping applications avoid connection failures during credential updates. It is controlled using the profile parameter PASSWORD_ROLLOVER_TIME, which defines the grace period. This feature was first introduced in Oracle 21c and later backported to Oracle 19c starting from Release Update 19.12. In Oracle 19c, it is available only if the database is running 19.12 or higher. It is mainly used for seamless password rotation in application environments.

Key Concept: PASSWORD_ROLLOVER_TIME

The profile parameter PASSWORD_ROLLOVER_TIME defines the duration (in days, fractional values supported) during which both the old and new passwords remain valid after a password change.

During this window, the user account enters the OPEN & IN ROLLOVER state, which is visible in DBA_USERS.ACCOUNT_STATUS.escription


StateDescription
OPENNormal state. Only the current password is valid.
OPEN & IN ROLLOVERBoth old and new passwords are accepted. Rollover window is active.
OPENRollover complete. Only the new password is accepted (old invalidated).


NOTE:
PASSWORD_ROLLOVER_TIME accepts fractional values (e.g., 1.5 = 36 hours). Setting it to 0 immediately ends the rollover — the old password is rejected at the next login attempt after reconnection.

Step-by-Step Lab Walkthrough  (testuser)

The following steps demonstrate the full lifecycle: profile creation, user setup, password change, rollover observation, and rollover termination.

Create the Rollover Profile

CREATE PROFILE rollover_profile LIMIT PASSWORD_ROLLOVER_TIME 1;
-- Profile created.



Creates a profile named rollover_profile with a 1-day (24-hour) rollover window.

Create User and Assign Profile

CREATE USER testuser IDENTIFIED BY old_password; 
GRANT CREATE SESSION TO testuser;
ALTER USER testuser PROFILE rollover_profile; 

Creates the testuser, grants login privilege, and assigns the rollover-enabled profile.

Optionally Extend Rollover Window

ALTER PROFILE rollover_profile LIMIT PASSWORD_ROLLOVER_TIME 1.5;
-- Sets rollover window to 1.5 days (36 hours)


Change the Password (Trigger Rollover)

ALTER USER testuser IDENTIFIED BY new_password; 
-- User altered.


This is the moment the rollover begins. Oracle records the PASSWORD_CHANGE_DATE and puts the account into OPEN & IN ROLLOVER state.

Verify Rollover State

SELECT username, account_status, PASSWORD_CHANGE_DATE
FROM   dba_users
WHERE  username = 'TESTUSER';

Confirm Both Passwords Work

CONN testuser/old_password   -- Connected (old password still valid)
CONN testuser/new_password   -- Connected (new password also valid)


End the Rollover Early (Set Rollover to 0)

CONN / AS SYSDBA
ALTER PROFILE rollover_profile LIMIT PASSWORD_ROLLOVER_TIME 0;
-- Profile altered.



Setting PASSWORD_ROLLOVER_TIME to 0 terminates the rollover period immediately. The account status remains OPEN & IN ROLLOVER in DBA_USERS until the next login attempt with the old password fails.

Verify Old Password is Now Rejected

CONN testuser/old_password
ERROR:
ORA-01017: invalid username/password; logon denied
CONN locker/new_password   -- Still connects successfully


NOTE: The DBA_USERS row may still show OPEN & IN ROLLOVER briefly after setting PASSWORD_ROLLOVER_TIME=0. The status clears on the next successful login with the new password.

Full Command Summary

StepSQL CommandOutcome
1CREATE PROFILE rollover_profile LIMIT PASSWORD_ROLLOVER_TIME 1;Profile created with 24h window
2CREATE USER testuser IDENTIFIED BY old_password;User created
3GRANT CREATE SESSION TO testuser;Login privilege granted
4ALTER USER locker PROFILE rollover_profile;Profile assigned to locker
5ALTER PROFILE rollover_profile LIMIT PASSWORD_ROLLOVER_TIME 1.5;Window extended to 36 hours
6ALTER USER testuser IDENTIFIED BY new_password;Password changed — rollover begins
7SELECT username, account_status ... FROM dba_users;Status: OPEN & IN ROLLOVER
8CONN testuser/old_passwordConnected (old still valid)
9CONN testuser/new_passwordConnected (new also valid)
10ALTER PROFILE rollover_profile LIMIT PASSWORD_ROLLOVER_TIME 0;Rollover terminated immediately
11CONN testuser/old_passwordORA-01017 — old password rejected

Important Notes & Gotchas

Privilege Requirement

Only SYSDBA or a user with the ALTER PROFILE privilege can modify PASSWORD_ROLLOVER_TIME. Attempting it as a normal user results in ORA-01031: insufficient privileges.

 

Status Lag After Setting to 0

DBA_USERS.ACCOUNT_STATUS may still display OPEN & IN ROLLOVER even after setting the rollover to 0. The old password is functionally rejected, but the status column only refreshes on the next successful login.

 

Profile Already Exists

Re-running CREATE PROFILE for an existing profile raises ORA-02379: profile already exists. Use ALTER PROFILE to modify existing profiles.

 

Fractional Days

PASSWORD_ROLLOVER_TIME accepts fractional values. For example, 0.5 = 12 hours, 1.5 = 36 hours. Use these to fine-tune the rollover window for your application deployment windows.

DBA_USERS Reference Columns

SELECT username,

       account_status,

       PASSWORD_CHANGE_DATE,

       profile

FROM   dba_users

WHERE  username = 'TESTUSER';

Production Use Cases

PASSWORD_ROLLOVER_TIME is designed for zero-downtime credential rotation in production environments:

•  Application deployments:  Deploy new app version with new credentials while old connection pools drain gracefully.

•  Secrets manager rotation:  HashiCorp Vault or AWS Secrets Manager can rotate credentials without immediate service impact.

•  Multi-node environments:  Rolling restarts of app servers can complete within the rollover window.

•  GoldenGate / Replication users:  Rotate capture/apply user passwords without halting replication.

Comments

Popular posts from this blog

πŸš€ Automating Oracle Database Patching with Ansible: A Complete Guide

Oracle database patching has long been the bane of DBAs everywhere. It's a critical task that requires precision, expertise, and often results in extended maintenance windows. What if I told you that you could automate this entire process, reducing both risk and downtime while ensuring consistency across your Oracle estate? πŸ’‘ In this comprehensive guide, I'll walk you through a production-ready Ansible playbook that completely automates Oracle patch application using OPatch. Whether you're managing a single Oracle instance or hundreds of databases across your enterprise, this solution will transform your patch management strategy! 🎯 πŸ”₯ The Challenge: Why Oracle Patching is Complex Before diving into the solution, let's understand why Oracle patching is so challenging: πŸ”— Multiple dependencies : OPatch versions, Oracle Home configurations, running processes ⚠️ Risk of corruption : Incorrect patch application can render databases unusable ⏰ Downtime requirements : Da...

🐳Oracle 19c Database Deployment with Docker

Oracle 19c Database Deployment with Docker 🐳 Oracle 19c Database Deployment with Docker Welcome to this comprehensive guide on deploying, configuring, and managing Oracle 19c Database using Docker containers. This blog will walk you through the entire process from setup to production best practices with practical code examples. Docker provides an excellent way to run Oracle databases in isolated, portable containers, making it easy to deploy and manage Oracle 19c instances for development, testing, and production environments. This approach offers numerous benefits: πŸ”’ Isolation : Run Oracle in a containerized environment without affecting your host system 🚚 Portability : Easily move your database between different environments πŸ”„ Reproducibility : Quickly spin up identical database instances ⚡ Resource Efficiency : Use Docker's resource management capabilities to control CPU, memory, and stor...

Oracle Enterprise Manager: A Step-by-Step Guide to Agent Patching

Keeping your Oracle Enterprise Manager (OEM) agents up-to-date is crucial for maintaining system security and performance. In this blog post, we'll walk through the complete process of applying patches to OEM agents using the Enterprise Manager interface. This guide is suitable for database administrators and IT professionals who manage Oracle environments. Prerequisites Before starting the patching process, ensure you have: Administrator access to Oracle Enterprise Manager The latest patch files downloaded from Oracle Support A maintenance window scheduled for your target systems The Patching Process Step 1: Navigate to Patches & Updates Begin by accessing the Enterprise Manager console and navigating to the Enterprise → Patches & Updates section. This is your central hub for all patching operations. Step 2: Upload the Latest Patch Click the UPLOAD button in the interface Select the patch file from your local system Wait for the upload process to complete ...