The log file $ ORACLE_BASE/admin/orasid/bdump/alert_orasid.log of the ORACLE database records the duplicate
For log conversion, database startup and shutdown, database structure change, rollback segment modification, deadlock, internal error and other information
The database administrator needs to check whether this file has a ORA-error and regularly archive the log file.
In UNIX, you can use the grep command to save errors in alert_orasid.log to another file. Then go
Cause.
$ Grep ORA-alert_orasid.log> error. log
As we all know, the larger the file, the higher the overhead of opening and reading/writing. If the log file is too large (more than 5 MB), you must
It is not a good method to directly delete it and re-generate ORACLE. Because ORACLE uses a pointer to a file
When the database is running, this file is deleted. ORACLE still uses the original file pointer for write operations. It is possible to write
Use the following method: $ tail-100 $ ORACLE_BASE/admin/orasid/bdump/alert_orasid.log>/tmp/oracle_temp.log
$ Cp/tmp/oracle_temp.log $ ORACLE_BASE/admin/orasid/bdump/alert_orasid.log
$ Rm/tmp/oracle_temp.log
Truncate log files.
The listener log File $ ORACLE_HOME/network/log/listener. log records that are processed by listener.
Network request information, which includes the client request time, connection method (dedicated or shared), Connection Program, network protocol
We also need to periodically truncate it by stopping the log recording of listener first:
$ Lsnrctl set log_status off
Then process the file (Save the original log to the backup folder and leave the original listener. log empty)
$ Cp $ ORACLE_HOME/network/log/listener. log $ ORACLE_BACKUP/network
$ Cp/dev/$ ORACLE_HOME/network/log/listener. log
After the file operation is complete, open listener to log:
$ Lsnrctl set log_status on
If you write a simple shell program, you can solidify the above steps into a script, set a timetable, and let the operation
The following is a file named auto_listener.sh that saves listener. log by day.
Rq = 'date + "% d "'
Cp $ ORACLE_HOME/network/log/listener. log $ ORACLE_BACKUP/network/
Su-oracle-c "lsnrctl set log_status off"
Cp/dev/$ ORACLE_HOME/network/log/listener. log
Su-oracle-c "lsnrctl set log_status on"
You can define the environment variables ORACLE_HOME and ORACLE_BACKUP as needed or directly change them to the actual
Then, the root user of the operating system can run the shell script at to split the log files.
Author "justplayoop1"