We have several oracle 19c servers with daily exports. I would like to find a way to run a command to read the export log file to find the success message for the day. e.g. I would like to putty into the linux server have a command I can copy and paste that will read the daily export log file and tell me in one command/output that the export was successful or not? or any better ideas to automate reporting that daily exports are successful on 40+ servers?
2 Answers
Assume that you always start your export log files with 'expdp_' and always end them with '.log'. Then
egrep -c '(^Job)(?!(successfully))' expdp_*.log
will give you a listing of the log filenames and the number of times 'Job' but not 'successfully' occured in that file. Get a zero count and the export was successful, get a non-zero count and the export had a problem.
I admit that it is not a command line solution but datapump has control tables and these could be analyzed with SQL
ansible
. This is the kind of automation it was designed for.