Oracle 12c CDB 环境 dbsnmp 用户已锁定。无法以“SYS”用户身份解锁

问题描述 投票:0回答:1
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
oracle12c cdb
1个回答
0
投票

在处理可插拔数据库时,您必须更改会话以告诉 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>
© www.soinside.com 2019 - 2024. All rights reserved.