Erro ORA-65048 ao alterar a senha do usuário no container  database (CDB)

Erro ORA-65048 ao alterar a senha do usuário no container database (CDB)

Ao tentar alterar a senha de um usuário ocorreu o erro ORA-65048. Esta é uma instância 12R1:


$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Thu Jun 19 07:15:51 2020

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, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options

SQL> alter user "C##USRMASTER" identified by values password container=all;

ERROR at line 1:
ORA-65048: error encountered when processing the current DDL statement in pluggable database HPDBSERV
ORA-01918: user 'C##USRMASTER' does not exist

O HPDBSERV foi criado sem a tablespace USERS que impede que o PDB seja sincronizado com o container. A pdb_plug_in_violations continha a seguinte mensagem:


'CREATE USER C##USRMASTER
IDENTIFIED BY * DEFAULT TABLESPACE USERS
TEMPORARY TABLESPACE TEMP
PROFILE DEFAULT
ACCOUNT UNLOCK container = all'

Corrigi o problema da seguinte forma:

1. Conecte-se ao container com a tablespace ausente:


SQL> alter session set container=HPDBSERV;
Session altered.

SQL> show con_name

CON_NAME
------------------------------
HPDBSERV

2. Crie a tablespace:


SQL> create tablespace USERS datafile size 8M autoextend on next 2M maxsize 3G;
Tablespace created.

3. Feche e reabra o pluggable database:


SQL> alter pluggable database HPDBSERV close;
Pluggable database altered.

SQL> alter pluggable database HPDBSERV open read write;

Pluggable database altered.

4. Mude a senha do usuário:


SQL> alter user "C##USRMASTER" identified by values password container=all;

User altered.