1.查看alert日志大小

[root@db01 trace]# du -sm alert_orcl.log 
384M alert_orcl.log

2.移动alert日志

[root@db01 trace]# mv alert_orcl.log alert_orcl.`date +%Y%m%d`.bak
[root@db01 trace]# ll alert_orcl.20211012.bak
-rw-r----- 1 oracle oinstall 586181 Oct 12 21:25 alert_orcl.20211012.bak

3.重新touch alert_orcl.log日志

[root@db01 trace]# touch alert_orcl.log
[root@db01 trace]# chown oracle.oinstall alert_orcl.log

4.切换日志,

SQL> alter system switch logfile;

System altered.

5.查看新的日志文件能否正常写入信息

[root@db01 trace]# chown oracle.oinstall alert_orcl.log 
[root@db01 trace]# tail -f alert_orcl.
alert_orcl.20211012.bak alert_orcl.log
[root@db01 trace]# tail -f alert_orcl.log
2021-10-12T21:27:07.969955+08:00
Resize operation completed for file# 4, old size 983040K, new size 993280K
2021-10-12T21:27:18.571428+08:00
Resize operation completed for file# 4, old size 993280K, new size 1003520K
2021-10-12T21:27:29.484811+08:00
Resize operation completed for file# 4, old size 1003520K, new size 1013760K
2021-10-12T21:27:39.187417+08:00
Resize operation completed for file# 1, old size 1290240K, new size 1300480K
2021-10-12T21:27:40.481765+08:00
Resize operation completed for file# 4, old size 1013760K, new size 1024000K



2021-10-12T21:27:48.716758+08:00
Thread 1 advanced to log sequence 35 (LGWR switch), current SCN: 3492381
Current log# 2 seq# 35 mem# 0: /oradata/ORCL/redo02.log
2021-10-12T21:27:54.415960+08:00
Thread 1 cannot allocate new log, sequence 36
Checkpoint not complete
Current log# 2 seq# 35 mem# 0: /oradata/ORCL/redo02.log
2021-10-12T21:27:54.421991+08:00
ARC3 (PID:1771): Archived Log entry 37 added for T-1.S-34 ID 0x60233299 LAD:1
2021-10-12T21:27:57.073535+08:00
Resize operation completed for file# 4, old size 1024000K, new size 1034240K
2021-10-12T21:27:58.406590+08:00
Thread 1 advanced to log sequence 36 (LGWR switch), current SCN: 3492502
Current log# 3 seq# 36 mem# 0: /oradata/ORCL/redo03.log
2021-10-12T21:27:59.038854+08:00
ARC0 (PID:1763): Archived Log entry 38 added for T-1.S-35 ID 0x60233299 LAD:1

版权声明:本文为博主原创文章,未经博主允许不得转载。

Linux,oracle