Deleting Method of Warning Log and Listening Log of oracle 11g

  • 2021-12-04 11:37:24
  • OfStack

The oracle 11g listening log and warning log are both in the/u01/oracle/diag/tnslsnr/oracle/listener directory and/u01/oracle/diag/rdbms/db1/db1 directory, both of which are referred to as listener directory and db1 directory respectively. There are the following directories under these two directories: alert cdump hm incident incpkg ir lck metadata stage sweep trace
The warning log is in the alert directory, and the listening log is in the trace directory. listener directory generated log files are relatively large, is the main object to clean up, and db1 directory generated files are relatively small, basically do not need to clean up. In the listener directory, the listening log is a file named listener. log, while the warning log log. xml is divided into a log of log_XXXX. xml every 11M, which is gradually accumulated. In the db1 directory, the two logs are just the opposite. The listening log is divided into many files with. trc. trm, while the warning log has only one file with log. xml. I don't know what oracle is doing, and I don't know what the principle is. I hope to have friends who know about it to give me some advice.

The method to delete the listening log is as follows:
Switch to oracle user
su oracle
$lsnrctl set log_status off
$mv listener.log /backup/
$lsnrctl set log_status on
After the listening log is started, a brand-new listener. log file will be automatically created, and the backed-up files can be deleted. If you delete listener. log without executing the above command, the system will not be created.

Warning logs can be moved or deleted with the following command
find . -mtime +10 -exec mv {} /backup/alert_log/ \;

To see the warning log, you can execute adrci under oracle user
$adrci
In the adrci directory, you can enter help and see the help command. Enter help show alert to see the detailed usage of show alert.

show alert
You will be prompted to select the directory of the log or exit
adrci > show alert

Choose the alert log from the following homes to view:

1: diag/rdbms/db1/db1
2: diag/tnslsnr/oracle/listener
Q: to quit
Please select option: 1
Enter 1 to look at db1, enter 2 to look at listener directory, enter q to exit.
After reading the log of alert, enter: q exits, and the operation method is similar to vi command.

SHOW TRACEFILE
You can see the listening log file
diag/rdbms/db1/db1/trace/db1_vktm_17064.trc
diag/rdbms/db1/db1/trace/db1_m000_25175.trc
diag/tnslsnr/oracle/listener/trace/ora_7795_139913618966240.trc
diag/tnslsnr/oracle/listener/trace/listener.log
It can be seen from the above that there are logs in both directories.


Related articles: