数据库正在运行着,如何清理太大的alert.log文件?
不能用mv方法.
官方建议:
how do you reduce the size of an alert log that is too large to edit while the db is running? (doc id 296354.1)
goal:
how do you reduce the size of the alert log while the database is still running and is too large to edit?
solution:
there really is no way to reduce the size other than start a new file
1) copy the alert log to a new name
example:
cp alert_mysid.log alert_mysid.2004 首先保障2倍空间,但是如果很大会不会?
2) delete the existing alert log
example:
rm alert_mysid.log
after this the database should recreate an empty file and continue logging to it.
if the log will not delete due to file locking ... you will need to delete the copy and try steps
1 and 2 again until it succeeds ... if you continue to fail ... you will need to shutdown to do
the process.
你看,最后一段说明,多麻烦,还是定期重启数据库大 法好,重启时趁机改名字或rm岂不简单。
阅读(5199) | 评论(0) | 转发(0) |