一、經過sqlplus / as sysdba在服務器上沒法登陸oracle,並提示一下錯誤
ERROR:
ORA-09817: Write to audit file failed.
Linux-x86_64 Error: 28: No space left on device
Additional information: 12
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*Plussql
二、分析:
提示此錯誤通常是oracle所在的服務器的磁盤空間已經被佔用滿了,須要清理沒必要要的磁盤文件,重啓數據庫便可。
#查看磁盤使用狀況
df -h
#查找oracle的trace文件目錄
find / -name trace -type d
eg:/u01/app/oracle/diag/rdbms/ipems/ipems/trace
#進入trace目錄,查尋、刪除指定天數之前的文件
find -ctime +10 | more
#查看當前目錄下文件個數
find ./ -type f | wc -l
find -type f | wc -l
#查看目錄下各文件的大小,並按順序顯示(從小到大)
du -sh * | sort -n
#查看告警日誌文件的大小
du -sh alert_ipems.log
#告警日誌能夠直接刪除(如無特殊查看須要的化),刪除後系統會自動建立(記錄啓動,關閉,鏈接錯誤信息)
#查看監聽日誌(經過以下命令能夠查看到監聽告警日誌的目錄,監聽日誌的目錄在trace目錄下,alter和trace目錄下都得清理)
lsnrctl status
[oracle@db trace]$ ll
total 3754948
-rw-r----- 1 oracle oinstall 3843788210 Nov 6 09:00 listener.log
-rw-r----- 1 oracle oinstall 0 Feb 27 2017 ora_11364_139845928687360.trc
-rw-r-----. 1 oracle oinstall 0 May 13 2014 ora_31962_139886341228288.trc
-rw-r----- 1 oracle oinstall 0 Aug 8 2015 ora_3456_140354969544448.trc
[oracle@db trace]$ lsnrctl set log_status off數據庫
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 06-NOV-2017 09:02:36服務器
Copyright (c) 1991, 2009, Oracle. All rights reserved.oracle
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
LISTENER parameter "log_status" set to OFF
The command completed successfully
[oracle@db trace]$ mv listener.log listener.log.bak
[oracle@db trace]$ ls
listener.log.bak ora_11364_139845928687360.trc ora_31962_139886341228288.trc ora_3456_140354969544448.trc
[oracle@db trace]$ ll
total 3754948
-rw-r----- 1 oracle oinstall 3843788210 Nov 6 09:00 listener.log.bak
-rw-r----- 1 oracle oinstall 0 Feb 27 2017 ora_11364_139845928687360.trc
-rw-r-----. 1 oracle oinstall 0 May 13 2014 ora_31962_139886341228288.trc
-rw-r----- 1 oracle oinstall 0 Aug 8 2015 ora_3456_140354969544448.trc
[oracle@db trace]$ lsnrctl set log_status onapp
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 06-NOV-2017 09:03:16ui
Copyright (c) 1991, 2009, Oracle. All rights reserved.spa
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
LISTENER parameter "log_status" set to ON
The command completed successfully
[oracle@db trace]$ ls
listener.log listener.log.bak ora_11364_139845928687360.trc ora_31962_139886341228288.trc ora_3456_140354969544448.trc
[oracle@db trace]$ ll
total 3754952
-rw-r----- 1 oracle oinstall 63 Nov 6 09:03 listener.log
-rw-r----- 1 oracle oinstall 3843788210 Nov 6 09:00 listener.log.bak
-rw-r----- 1 oracle oinstall 0 Feb 27 2017 ora_11364_139845928687360.trc
-rw-r-----. 1 oracle oinstall 0 May 13 2014 ora_31962_139886341228288.trc
-rw-r----- 1 oracle oinstall 0 Aug 8 2015 ora_3456_140354969544448.trc.net
要看警告日誌能夠在oracle用戶下執行adrci
[oracle@db oracle]$ adrci日誌
ADRCI: Release 11.2.0.1.0 - Production on Mon Nov 6 09:14:50 2017orm
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
ADR base = "/u01/app/oracle"
adrci> show alert
Choose the alert log from the following homes to view:
1: diag/tnslsnr/db/listener 2: diag/rdbms/ipems/ipems Q: to quit