oracle忘记dba用户密码的解决办法

1、如果记得 sys 或者 system 其中一个账户的密码的话,那么就用已知的账户以 sysdba 身份登录:

sqlplus sys/密码 as sysdba;
或者
sqlplus system/密码 as sysdba;

然后解锁账户并更改密码:

alter user system account unlock;    //解锁用户
alter user system identified by 新的密码;

 

2、如果全部忘记,那么用 cmd 执行:

(这个办法没有试过,转载:https://www.cnblogs.com/liuhua4451/p/5615962.html

#输入
orapwd

#输出
Usage: orapwd file=<fname> entries=<users> force=<y/n> ignorecase=<y/n> nosysdba=<y/n>

  where
    file - name of password file (required),
    password - password for SYS will be prompted if not specified at command line,
    entries - maximum number of distinct DBA (optional),
    force - whether to overwrite existing file (optional),
    ignorecase - passwords are case-insensitive (optional),
    nosysdba - whether to shut out the SYSDBA logon (optional Database Vault only).
    
  There must be no spaces around the equal-to (=) character.

按照这个格式写命令:

orapwd file=D:\Oracle\product\11.2.0\dbhome_1\database\PWD****.ora password=****** entries=5 force=y

(注意,执行重建密码文件命令之前,最好将原来的文件备份一下)

执行命令后,新的密码文件会覆盖原有的密码文件。

重启ORACLE数据库服务后,就可以用新的密码登录SYS了。

转载于:https://my.oschina.net/patch/blog/1672003

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值