1. 环境说明
操作系统:CnetOS7.3
数据库:Oracle 12c Release 1
2. 问题说明
尝试使用system用户登录,始终显示无效的用户名/密码。猜想可能是密码不正确,或者用户被锁定了。
[oracle@localhost ~]$ sqlplus
SQL*Plus: Release 12.1.0.2.0 Production on Wed Nov 8 16:05:32 2017
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Enter user-name: system
Enter password:
ERROR:
ORA-01017: invalid username/password; logon denied
Enter user-name:
3. 解决方案
3.1 使用dba登录
执行命令sqlplus / as sysdba登录
[oracle@localhost ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Wed Nov 8 16:08:45 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, OLAP, Advanced Analytics and Real Application Testing options
SQL>
3.2 查看用户
执行select username from dba_users查看所有用户
SQL> select username from dba_users;
USERNAME
--------------------------------------------------------------------------------
ORACLE_OCM
OJVMSYS
SYSKM
XS$NULL
GSMCATUSER
MDDATA
SYSBACKUP
DIP
SYSDG
APEX_PUBLIC_USER
SPATIAL_CSW_ADMIN_USR
USERNAME
--------------------------------------------------------------------------------
SPATIAL_WFS_ADMIN_USR
GSMUSER
AUDSYS
FLOWS_FILES
DVF
3.3 解锁账户并设置密码
解锁用户命令格式为:ALTER USER 用户名 UNLOCK
SQL> alter user system account unlock;
User altered.
设置新密码命令格式为:ALTER USER 用户名 IDENTIFIED BY 新密码
SQL> alter user system identified by 123456;
User altered.
3.4 测试登录
使用system用户登录
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
[oracle@localhost ~]$ sqlplus
SQL*Plus: Release 12.1.0.2.0 Production on Wed Nov 8 16:25:20 2017
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Enter user-name: system
Enter password:
Last Successful login time: Wed Nov 08 2017 16:09:27 +08:00
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL>