分享

案例解读:Oracle目录由于TFA触发bug导致jdb文件未自动清理引起空间不足

 数据和云 2021-03-16

墨墨导读:本文来自墨天轮用户 刘宗宝 投稿,记录一次由于TFA的jdb文件无限积累造成大量空间被占用,导致数据库目录使用率比较高的问题。

墨天轮主页:https://www./u/6322

数据库目录空间使用问题的坑,本次遇到的这个比较特殊。

这个案例是客户的一个12c的集群环境,由于TFA的jdb文件无限积累造成大量空间被占用,导致数据库目录使用率比较高。

[root@orcl2 database]# du -sh *
25.1G BERKELEY_JE_DB
[root@orcl2 database]# pwd
/u01/app/grid/tfa/orcl2/database/
[root@ orcl2 database]# cd ./BERKELEY_JE_DB/
[root@ orcl2 BERKELEY_JE_DB]#
[root@ orcl2 BERKELEY_JE_DB]# ll
… …
-rw-r--r-- 1 root root 9999986 12月 29 14:53 00001fbb.jdb
-rw-r--r-- 1 root root 9999987 1月 4 11:26 00001fbd.jdb
-rw-r--r-- 1 root root 9999971 1月 12 15:18 00001fc0.jdb
-rw-r--r-- 1 root root 9999995 1月 13 10:59 00001fc1.jdb
-rw-r--r-- 1 root root 9999976 1月 16 23:05 00001fc2.jdb
-rw-r--r-- 1 root root 9999983 1月 18 00:31 00001fc3.jdb
-rw-r--r-- 1 root root 899218 1月 18 10:42 00001fc4.jdb

可以看到tfa的BERKELEY_JE_DB目录占用了25G的磁盘空间,累积了大量的000开头.jdb结尾的文件。一般情况下,tfa对该目录下的jdb文件是自动维护的,不会引起持续的积累引起文件目录堆积占用过多的空间,既然出现了问题,直接处理就行了。Tfa只是Oracle日子采集分析的一个小工具,不影响数据库及集群的整体运行,直接通过tfactl停止tfa服务,然后删除文件,再起tfa服务即可(若是删了tfa起不来,大不了重新配置一下tfa)。思路有了,以下是处理过程。

[grid@orcl2 ~]$ tfactl stop
Access Denied: Only TFA Admin can run this command
[grid@orcl2 ~]$
[grid@orcl2 ~]$ exit
logout
[root@orcl2 database]# cd /u01/app/12.1.0/grid/bin/
[root@orcl2 bin]# ./tfactl stop
Stopping TFA
TFA is running - Will wait 5 seconds (up to 3 times)
TFA is running - Will wait 5 seconds (up to 3 times)
TFA is running - Will wait 5 seconds (up to 3 times)
TFAmain Force Stopped Successfully
. . .
Successfully stopped TFA..
[root@orcl2 bin]#
[root@orcl2 bin]# cd /u01/app/grid/tfa/orcl2/database/BERKELEY_JE_DB
[root@orcl2 BERKELEY_JE_DB]# rm -f ./00000*.jdb
[root@orcl2 BERKELEY_JE_DB]# cd /u01/app/12.1.0/grid/bin/
[root@orcl2 bin]# ./tfactl start
Starting TFA..
start: Job is already running: oracle-tfa
Waiting up to 100 seconds for TFA to be started..
. . . . .
. . . . .
. . . . .
Successfully started TFA Process..
. . . . .
TFA Started and listening for commands
[root@orcl2 bin]#
[root@orcl2 bin]# cd /u01/app/grid/tfa/orcl2/database
[root@orcl2 database]# du -sh *
9.9M BERKELEY_JE_DB
[root@orcl2 database]#

可以看到,结果很理想,不仅空间清理了,tfa服务也起来了,皆大欢喜。

墨天轮原文链接:https://www./db/44185(复制到浏览器中打开或者点击“阅读原文”立即查看)

- end -

    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多