Oracle密码文件维护
说明
ORACLE密码文件-
该文件不知道是什么,这么丑,cat命令还无法看,就把它删除了
/u01/app/oracle/product/12.2.0/db_1/dbs/orapworcl
-
直到PLSQL Developer无法登录sys 账号才知道删除错文件了(肯定账号密码正确)
ORA-01017:invalid username/password;logon denied
-
任意密码都可以登录sys用户
SQL> connect sys/1 as sysdba
Connected.
SQL> show user
USER is "SYS"
- 因为登录方式默认是系统验证
/u01/app/oracle/product/12.2.0/db_1/network/admin/sqlnet.ora/orapworcl
#SQLNET.AUTHENTICATION_SERVICES= (NTS)
恢复误删除的ORACLE密码文件
- 设置sqlplus非系统验证登录oracle数据库
-
orapwd.exe重新创建密码文件,密码难度有要求
/u01/app/oracle/product/12.2.0/db_1/bin/orapwd file=$ORACLE_HOME/dbs/orapw$ORACLE_SID password=oracle entries=5 force=y
-
报错密码精度不够
OPW-00029: Password complexity failed for SYS user : Password must contain at least 8 characters.
-
修改复杂密码
/u01/app/oracle/product/12.2.0/db_1/bin/orapwd file=$ORACLE_HOME/dbs/orapw$ORACLE_SID password=ABCabc18312550321@ entries=5 force=y
-
完蛋了,密码有@符号
sqlplus sys/ABCabc18312550321@ as sysdba
无法识别特殊符号登录 -
删除文件重新创建
/u01/app/oracle/product/12.2.0/db_1/bin/orapwd file=$ORACLE_HOME/dbs/orapw$ORACLE_SID password=ABCabc18312550321! entries=5 force=y
-
终于登录成功
SQL> connect sys/ABCabc18312550321! as sysdba
SQL> alter user sys identified by oracle ;
- 查看$ORACLE_SID值
select * from global_name;--==$ORACLE_SID
[oracle@oracle dbs]$ echo $ORACLE_SID
orcl
- 重新生成orapworcl文件,PLSQL Developer可以登录sys 账号