I am writing a perl script to automate certain processes on our Oracle databases. One portion of the script involves putting the script to sleep until the alert log shows the database open.
I intend to do a sleep until (logevalmodule). The logevalmodule will be a sub procedure that opens and monitors the alert log using tail -f returning a true when the word OPEN appears in the log.
Can anyone help me with possible solutions. I have two hurdles to make this work. The path to the alert log will not be in the same place for all the databases on the Oracle server, for example 'apps13/oracle/admin/db1/bdump' and 'apps14/oracle/admin/db2/bdump'. The other hurdle is to format the tail -f into the script.
Thanks.
tail -f. You should open the file for reading in Perl and seek to the end then just keep reading in a loop and look for "OPEN" using pattern matching. As for the file locations it depends on how complex the variations are, whether they're in constant locations, whether you want to specify them via CL parameter, config file, hardcoded, regex, globbing, etc. – Dennis Williamson Dec 2 '09 at 22:00