数据库:oracle 11.2.0.4
系统:anolisos 7.9
环境:系统中安装过11g数据库实例,同时也安装了19.3数据库软件.
问题描述:
在/u01/app/oracle/product/19.3.0/db_1目录下使用deinstall命令后,11g数据库状态显示正常,但连接报错ORA-09925,如下所示:
[oracle@leo ~]$ cat .bash_profile
……
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
#export ORACLE_HOME=$ORACLE_BASE/product/19.3.0/db_1
……
[oracle@leo bin]$ pwd
/u01/app/oracle/product/11.2.0/db_1/bin
[oracle@leo bin]$ ./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 rights reserved.
ERROR:
ORA-09925: Unable to create audit trail file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 9925
ORA-01075: you are currently logged on
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
异常原因:
无法创建审计文件,若以sysdba用户登陆数据库都会被强制审计,如果审计文件无法写入,肯定会有问题.
解决过程:
使用strings查看二进制spfile文件.
[oracle@leo dbs]$ strings spfileorcl.ora
……
*.audit_file_dest='/u01/app/oracle/admin/orcl/adump'
……
[oracle@leo dbs]$ ll /u01/app/oracle/admin/orcl/
ls: cannot access /u01/app/oracle/admin/orcl/: No such file or directory
发现该目录不存在,判断为deinstall 19c时该目录被删除.
新建该目录后,连接无异常.
[oracle@leo dbs]$ mkdir -p /u01/app/oracle/admin/orcl/adump
[oracle@leo bin]$ 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 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
查看该目录下生成新文件.
[oracle@leo ~]$ ll /u01/app/oracle/admin/orcl/adump
total 4
-rw-r----- 1 oracle oinstall 798 Aug 20 10:56 orcl_ora_21760_20220820105626701318143795.aud