数据库:oracle11.2.0.4
系统:anolisos7.9
环境:系统中安装过11g数据库实例,同时也安装了19.3数据库软件.
问题描述:
在
/u01/app/oracle/product/19.3.0/db_1目录下使用deinstall命令后,11g数据库状态显示正常,但连接报错ORA-09925,如下所示:
[oracle@leo~]$ cat .bash_profile
……
exportORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
#exportORACLE_HOME=$ORACLE_BASE/product/19.3.0/db_1
……
[oracle@leobin]$ pwd
/u01/app/oracle/product/11.2.0/db_1/bin
[oracle@leobin]$ ./sqlplus / as sysdba
SQL*Plus:Release 11.2.0.4.0 Production on Sat Aug 20 10:46:30 2022
Copyright(c) 1982, 2013, Oracle. All rightsreserved.
ERROR:
ORA-09925:Unable to create audit trail file
Linux-x86_64Error: 2: No such file or directory
Additionalinformation: 9925
ORA-01075:you are currently logged on
Enteruser-name:
ERROR:
ORA-01017:invalid username/password; logon denied
Enteruser-name:
ERROR:
ORA-01017:invalid username/password; logon denied
SP2-0157:unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
异常原因:
无法创建审计文件,若以sysdba用户登陆数据库都会被强制审计,如果审计文件无法写入,肯定会有问题.
解决过程:
使用strings查看二进制spfile文件.
[oracle@leodbs]$ strings spfileorcl.ora
……
*.audit_file_dest='/u01/app/oracle/admin/orcl/adump'
……
[oracle@leodbs]$ ll /u01/app/oracle/admin/orcl/
ls:cannot access /u01/app/oracle/admin/orcl/: No such file or directory
发现该目录不存在,判断为deinstall19c时该目录被删除.
新建该目录后,连接无异常.
[oracle@leodbs]$ mkdir -p /u01/app/oracle/admin/orcl/adump
[oracle@leobin]$ sqlplus / as sysdba
SQL*Plus:Release 11.2.0.4.0 Production on Sat Aug 20 10:56:26 2022
Copyright(c) 1982, 2013, Oracle. All rightsreserved.
Connectedto:
OracleDatabase 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With thePartitioning, OLAP, Data Mining and Real Application Testing options
查看该目录下生成新文件.
[oracle@leo~]$ ll /u01/app/oracle/admin/orcl/adump
total 4
-rw-r----- 1 oracleoinstall 798 Aug 20 10:56 orcl_ora_21760_20220820105626701318143795.aud