oracle重建口令文件,重建口令文件

1.检查是否存在密码文件

[oracle@host01 ~]$ cd /u01/app/oracle/product/11.2.0/dbhome_1/dbs/

[oracle@host01 dbs]$ ls orapwPROD1

orapwPROD1

2.可以通过连接字符串(即远程方式)以sysdba身份登录数据库

[oracle@host01 ~]$ sqlplus sys/oracle@PROD1 as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Tue Dec 20 09:53:15 2016

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

3.删除密码文件,则无法用以上方式连接数据库

[oracle@host01 dbs]$ mv orapwPROD1 orapwPROD1.bak

[oracle@host01 dbs]$ ls orapwPROD1

ls: orapwPROD1: No such file or directory

[oracle@host01 ~]$ sqlplus sys/oracle@PROD1 as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Tue Dec 20 09:55:27 2016

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

ERROR:

ORA-01017: invalid username/password; logon denied

Enter user-name:

ERROR:

ORA-01017: invalid username/password; logon denied

Enter user-name:

ERROR:

ORA-01017: invalid username/password; logon denied

SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus

当然,以系统方式验证,还是可以登录数据库的

[oracle@host01 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Tue Dec 20 09:55:52 2016

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

4.创建密码文件

[oracle@host01 dbs]$ orapwdfile=orapwPROD1 password=oracle entries=30

5.再次远程通过密码验证,以sysdba身份登录数据库

[oracle@host01 ~]$ sqlplus sys/oracle@PROD1 as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Tue Dec 20 09:58:43 2016

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

总结

-密码文件可有可无,一般情况下都应该存在

-密码文件的格式orapw+实例名(此处是orapw非orapwd)

-注意,创建密码文件时,等号两段不能有空格

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值