解决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

    你可能感兴趣的:(笔记,oracle,centos)