Use dbms_metadata.get_ddl to extract user and replace create with alter.
oracle@arrow ~ $ sqlplus / as sysdba SQL*Plus: Release 12.1.0.2.0 Production on Sat Jun 10 15:31:13 2017 Copyright (c) 1982, 2014, Oracle. All rights reserved. Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics and Real Application Testing options SQL> select username, expiry_date, account_status from dba_users where username like '%MONITOR%'; USERNAME -------------------------------------------------------------------------------- EXPIRY_DA ACCOUNT_STATUS --------- -------------------------------- C##MONITOR 10-JUN-17 EXPIRED SQL> show con_name CON_NAME ------------------------------ CDB$ROOT SQL> set long 1000000 longchunksize 32000 linesize 32000 pages 0 newpage none SQL> set heading off tab off echo off define off sqlprefix off blockterminator off timing off verify off feedb off SQL> set sqlblanklines on embedded on trimspool on SQL> select dbms_metadata.get_ddl('USER','C##MONITOR') from dual; CREATE USER "C##MONITOR" IDENTIFIED BY VALUES 'S:***' DEFAULT TABLESPACE "USERS" TEMPORARY TABLESPACE "TEMP" PASSWORD EXPIRE SQL> ALTER USER "C##MONITOR" IDENTIFIED BY VALUES 'S:***' SQL> select username, expiry_date, account_status from dba_users where username like '%MONITOR%'; C##MONITOR 07-DEC-17 OPEN SQL>
