解决sqlplus /as sysdba登陆oracle无效

安装完oracle,然后执行完下面的自动配置脚本后,没有任何地方设置过密码。

# /etc/init.d/oracledb_ORCLCDB-19c configure

   
   

    在这个命令执行完成后,会提醒查看完整日志的地方:

    Look at the log file “/opt/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB.log” for further details.
    Database configuration completed successfully. The passwords were auto generated,
    you must change them by connecting to the database using ‘sqlplus / as sysdba’ as the oracle user.

    然后执行sqlplus / as sysdba,死活登录不上去,网上各种密码都试过了。查看该日志:/opt/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB.log 上面只有个SID的名字,也没有什么密码信息。。

    最后发现别人说了using ‘sqlplus / as sysdba’ as the oracle user。 我一直用的root用户。。su oracle 后就可以了, Enter password 的密码是 change_on_install

    [root@localhost dbhome_1]# su oracle
    [oracle@localhost dbhome_1]$ sqlplus
    SQL*Plus: Release 19.0.0.0.0 - Production on Mon Nov 4 21:42:22 2019
    Version 19.3.0.0.0
    Copyright (c) 1982, 2019, Oracle.  All rights reserved.
    Enter user-name: sys / as sysdba
    Enter password: 
    Connected to an idle instance.
    SQL> 
    
       
       

    linux下查看用户:cut -d : -f 1 /etc/passwd 要从root用户切换到oracle用户,然后oracle用户没有密码 然后执行sqlplus,输入sys /as sysdba,没有密码,即可连接上oralce

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

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

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

    请填写红包祝福语或标题

    红包个数最小为10个

    红包金额最低5元

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

    抵扣说明:

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

    余额充值