My database is an XE 18. My user has create user and I can create an user in SQL Plus, using this :
ALTER SESSION SET "_ORACLE_SCRIPT" = true;
CREATE USER auxiliar IDENTIFIED BY auxiliar2020 ;
Then I create a package with a function that should be create users dynamically and the lines are above:
EXECUTE IMMEDIATE 'alter session set "_ORACLE_SCRIPT"=true';
vSql := 'CREATE USER :1 IDENTIFIED BY ":2" ' ;
EXECUTE IMMEDIATE vSql USING vNome_Usuario,vSenha_Usuario;
I get this error:
Relatório de erros -
ORA-65096: nome de atribuição ou de usuário comum inválido
ORA-06512: em "TOKEN.PRC_CRIA_USUARIO", line 3
ORA-06512: em line 3
65096. 00000 - "invalid common user or role name"
*Cause: An attempt was made to create a common user or role with a name that was not valid for common users or roles. In addition to the usual rules for user and role names, common user and role names must consist only of ASCII characters, and must contain the prefix specified in common_user_prefix parameter.
*Action: Specify a valid common user or role name.