SQL> connect sys as sysdba
Enter password:
Connected.
SQL> ALTER USER DBSNMP account UNLOCK;
ALTER USER DBSNMP account UNLOCK
*
ERROR at line 1:
ORA-01031: insufficient privileges
SQL> SHOW parameter pluggable
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
enable_pluggable_database boolean TRUE
SQL> col username FOR a20
SQL> SELECT username,account_status,password_versions,ORACLE_MAINTAINED FROM dba_users WHERE username='DBSNMP';
USERNAME ACCOUNT_STATUS PASSWORD_VER O
-------------------- -------------------------------- ------------ -
DBSNMP EXPIRED & LOCKED 10G 11G 12C Y
SQL> conn / AS sysdba
Connected.
SQL> ALTER USER DBSNMP account UNLOCK;
ALTER USER DBSNMP account UNLOCK
*
ERROR at line 1:
ORA-01031: insufficient privileges
在处理可插拔数据库时,您必须更改会话以告诉 Oracle 您的目标容器是什么。使用 cmd (show pdbs;) 查看容器,然后使用 (alter session) 设置容器。喜欢:
[oracle@ora_oemdb ~]$ . oraenv
ORACLE_SID = [prodoem] ?
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@ora_oemdb ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Mon Aug 14 16:19:41 2023
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> select instance_name from v$instance;
INSTANCE_NAME
----------------
prodoem
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDBPDEM READ WRITE NO
SQL> alter session set container=PDBPDEM;
Session altered.
SQL> ALTER USER DBSNMP account UNLOCK;
User altered.
SQL>