以oracle10g作为测试版本,删除10g的密码文件:
[oracle@oracle ~]$ rm /u01/oracle/10g/dbs/orapwjadl10g
远程登录数据库,密码文件在远程登录时才会起作用:(此时远程登录不能连接上DB)
[oracle@oracle ~]$ sqlplus sys/123456@192.168.1.187:1521/jadl10g as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Thu Nov 6 09:11:13 2014
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
ERROR:
ORA-01031: insufficient privileges
Enter user-name:
执行以下的命令创建10g的密码文件:
[oracle@oracle ~]$ 10g
[oracle@oracle ~]$ orapwd file=$ORACLE_HOME/dbs/orapwjadl10g password=123456 force=y;
创建完成后,远程登录DB,发现是可以连接的:
[oracle@oracle ~]$ sqlplus sys/123456@192.168.1.187:1521/jadl10g as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Thu Nov 6 09:13:07 2014
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining Scoring Engine
and Real Application Testing options
SQL>
11g 增加了一个 ignorecase是否区分大写;
orapwd file=$ORACLE_HOME/dbs/orapwjadl10g password=123456 force=y ignorecase=true/false;
12c
orapwd file=$ORACLE_HOME/dbs/orapwjadl10g password=123456 force=y format=12 sysbackup=y syskm=y sysdg=y;
设置3个密码;注意12c多了几个特权用户,可以执行以下SQL比较10g/11g/12c三个版本的差异性:
select * from v$pwfile_users;
12c的pdb是不存在密码文件,只有cdb存在密码文件。
【密码文件丢失--恢复-1】
原文:http://blog.csdn.net/u012625036/article/details/42152079