Kron Script to connect to oracle and execute queries automatically
Posted on 2006-06-29
I have couple of questions.
1. How can we connect to Oracle Sql directly form KRON script?
2. I have some log information in one table, how to fire a select query to get data from that table, after getting results i want to store those results into one file.
3. File name should be current system date, how can we create that text file in a specified location and store/append sql results into that file.
4. After creating and appending results,
I have one more log file called "trace.log". in that file i have some oracle log information.
How to grep oracle related errors from that file and append results to the newly created textfile.for ex todays date is 29062006, somy filename should be like "29-06-2006.txt"
Finally my text file must contatin sql query results + greped trace.log file results.
I need all these in only one script. Once i run that script, that is able to connect to oracle, fire a select query, get the results, create a new text file with present system date, get grepped results from trace.log file and append results to "$Sysdate.txt" file.
Thanks in advance
and its very very urjent i have to complete this task by tomarrow. I need quick responces.