排查
-
发现server-10.1.0.205的C盘容量已满
- 查看存档模式
SQL> archive log list;
数据库日志模式 非存档模式
自动存档 禁用
存档终点 USE_DB_RECOVERY_FILE_DEST
最早的联机日志序列 8909
当前日志序列 8911
- 查看redo日志位置
SQL> select member from v$logfile;
MEMBER
-------------------------------------
D:\ORACLE\ORCL\REDO03.LOG
D:\ORACLE\ORCL\REDO02.LOG
D:\ORACLE\ORCL\REDO01.LOG
- 查看日志目录
SQL> show linesize;
linesize 80
SQL> set linesize 200;
SQL> show parameter dump;
NAME TYPE VALUE
-------------------- ------- ------------------------------------
background_core_dump string partial
background_dump_dest string c:\oracle\diag\rdbms\orcl\orcl\trace
core_dump_dest string c:\oracle\diag\rdbms\orcl\orcl\cdump
max_dump_file_size string unlimited
shadow_core_dump string none
user_dump_dest string c:\oracle\diag\rdbms\orcl\orcl\trace
- 找到一个listener.log文件过大,
lsnrctl status
也可以查找listener.log日志过大的位置
清理listener.log
- lsnrctl set log_status off
- cp listener.log listener.log.20161201
- echo /dev/null > listener.log
- lsnrctl set log_status on
- 当然也可以移走监听日志文件(listener.log),数据库实例会自动创建一个listener.log文件。
◇:
lsnrctl set log_status off
◇:
mv listener.log listener.yyyymmdd
◇:
lsnrctl set log_status on
清理alert日志
- Oracle-11G使用adrci(Automatic Diagnostic Repository Command Interpreter)清理 ALERT|INCIDENT|TRACE|CDUMP|HM|UTSCDMP目录下的文件
[root@kmb2b-db01 ~]# su - oracle
[oracle@kmb2b-db01 ~]$ adrci
ADRCI: Release 11.2.0.4.0 - Production on 星期二 5月 19 09:59:42 2020
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
ADR base = "/u01/app/oracle/rdbms"
adrci> show alert
Choose the alert log from the following homes to view:
1: diag/tnslsnr/kmb2b-db01/kmb2b
2: diag/tnslsnr/kmb2b-db01/listener
3: diag/clients/user_oracle/host_777249608_80
4: diag/rdbms/kmb2b/kmb2b
Q: to quit
Please select option: q
adrci> show tracefile;
........................
diag/rdbms/kmb2b/kmb2b/trace/kmb2b_j003_4574.trc
diag/rdbms/kmb2b/kmb2b/trace/kmb2b_j000_30332.trc
adrci>
- purge
adrci> show home
ADR Homes:
diag/tnslsnr/kmb2b-db01/kmb2b
diag/tnslsnr/kmb2b-db01/listener
diag/clients/user_oracle/host_777249608_80
diag/rdbms/kmb2b/kmb2b
adrci> set homepath diag/tnslsnr/kmb2b-db01/listener
[oracle@kmb2b-db01 listener]$ du -sh *
657M alert
4.0K cdump
4.0K incident
4.0K incpkg
adrci> show home
ADR Homes:
diag/tnslsnr/kmb2b-db01/listener
adrci> purge -age 43200 -type alert; # 清理72小时钱的alert日志
[oracle@KMVS-CENTOS listener]$ du -sh *
87M alert
4.0K cdump
4.0K incident
4.0K incpkg
- oracle 11g的监听日志在/home/oracle/app/diag/tnslsnr/KMVS-CENTOS/listener/listener
- oracle 11g的告警日志格式在/home/oracle/app/diag/rdbms/orcl/orcl/alert/log.xml
- oracle 11g的告警日志在/home/oracle/app/diag/tnslsnr/KMVS-CENTOS/listener/alert
- 查找Oracle用户目录
[root@kmb2b-db01 alert]# su - oracle
[oracle@kmb2b-db01 ~]$ export | grep ORACLE_HOME
declare -x ORACLE_HOME="/u01/app/oracle/rdbms/product/11.2.0"
- 物理日志目录在: /u01/app/oracle/rdbms/diag/tnslsnr/kmb2b-db01/listener。即ORACLE_HOME下"show home"的位置。
- 将系统下的物理日志也删除掉
[root@kmb2b-db01 ~]# cd /home/oracle/app/diag/tnslsnr/KMVS-CENTOS/listener/
[root@kmb2b-db01 ~]# find ./alert -mtime +3 -name “log_*.xml” | xargs rm -f
网友评论