kup*_*upa 15 oracle oracle-11g-r2 disk-space
我想释放 Linux 机器上的磁盘空间。我已经深入研究了空间使用情况,发现以下目录的大小很大
/u01/app/11.2.0/grid/cv/log
/u01/app/11.2.0/grid/log/diag/tnslsnr/r1n1/listener_scan2/alert (Contains xml files)
/u01/app/11.2.0/grid/rdbms/audit(Contains .aud files)
/home/oracle/oradiag_oracle/diag/clients/user_oracle/host_XXXXXXXXXX/alert(Contains xml files)
/u01/app/oracle/diag/rdbms/crimesys/crimesys1/alert (Contains xml files)
Run Code Online (Sandbox Code Playgroud)
我可以删除这些目录中的内容吗?注意:我的意思是内容而不是目录。
您可以更改 oracle 日志和跟踪文件的默认保留策略。
资料来源: https : //streetkiter.wordpress.com/2011/04/06/do-you-really-need-one-year-old-logs-and-traces-for-your-oracle-database/
相关摘录:
有两个参数:SHORTP_POLICY(默认720小时)和LONGP_POLICY(默认8720小时)。所以 SHORTP_POLICY 是 30 天,而 LONGP_POLICY 是 365 天。
从命令行运行“adrci”。在 adrci 中,使用以下命令。
adrci> show homes
....(homes are listed)...
adrci> set home diag/....(the location)
adrci> show control
.... (current settings are listed) ....
adrci> set control (SHORTP_POLICY = 168)
adrci> set control (LONGP_POLICY = 720)
Run Code Online (Sandbox Code Playgroud)
现在,一周 (SHORTP) 或一个月 (LONGP) 后痕迹会消失。
小智 6
几乎所有文件都可以手动安全删除。通常最好保留:
alert_+ASM1.log (or the one related to your instance)
trace.xml
listener.xml (or the one related to your listener)
Run Code Online (Sandbox Code Playgroud)
除了这些还有一些注意事项:
Oracle 还建议您使用 adrci 命令清除旧日志。您可以运行adrci并执行以下命令
purge -age 60 -type ALERT
Run Code Online (Sandbox Code Playgroud)
这将仅清除标记为警报的 XML 日志文件。所以 trace.xml 日志。Adrci 不适用于文本文件:它们必须手动管理。这是预期的行为。此外,已经报告了有关adrci purge功能的各种错误。我仍然更喜欢通过 shell 脚本手动删除它们,使最新的文件在线保持在线。对于 alert.log 我只是这样做:
zip alert.log (your log name may differ)
> alert.log
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
88233 次 |
| 最近记录: |