- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script solution on oracle alert logfile
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-21-2009 04:49 PM
тАО08-21-2009 04:49 PM
i have a script to check for oracle alert logfile and when the logfile has any "ORA-" it will send those alert to me.
my solution so far is, if it sees the ORA- the script will copy that alert.log to alert.log.xxxx and zero out the file
Question:
is there a way to either to remove those lines with ORA- or somehow makes the script ignore the old error in the alert.log so it only grep the new ORA- only.
Please give me some advices and syntax.
Thanks in advance.
Tom
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-21-2009 05:50 PM
тАО08-21-2009 05:50 PM
Re: Script solution on oracle alert logfile
Or if you use "grep -n", you can get the line number of each line and next time ignore those with lines less than a value you save from last time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-23-2009 07:48 AM
тАО08-23-2009 07:48 AM
Re: Script solution on oracle alert logfile
i did use change/rename
the grep -n seems complicate because when the file grow to certain size it will be reduced to zero and start over again.
Do you have syntax for this.
Thanks,
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-23-2009 06:20 PM
тАО08-23-2009 06:20 PM
SolutionHere is how I would approach that.
1 - rename the current file to an intermediate name
2 - use 'touch' to create a fresh file log file
- Oracle will create as needed, but I'd like one to be there all the time
- Don't zero out as Oracle might just have snuck a new one in.
3 - grep / perl / process that intermediate file as you like.
4 - append the intermediate file to a long duration log.
- Instead of the append you could datestamp the chunks. But a single somewhat larger file may be more handy than many smaller ones.
5 - roll the long duration log as needed (timestamped).
Something like...
$ mv alert.log alert.current
$ touch alert.log
$ grep -n '-ORA' alert.current > alert_ora.txt
$ cat alert.current >> alert.archive
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-24-2009 01:30 AM
тАО08-24-2009 01:30 AM
Re: Script solution on oracle alert logfile
If you did that, you don't have to worry about the same contents.
>the grep -n seems complicate because when the file grow to certain size it will be reduced to zero and start over again.
Then remember the size and if smaller, then reset you scan max position.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-27-2009 01:00 PM
тАО08-27-2009 01:00 PM
Re: Script solution on oracle alert logfile
Good idea Hein, i will use this approach.
Dennis, the reason for this was if Oracle error out to the alert.log repeatedly, then it will generate so many small alert.log file because the script will rename and zero out the file.
Thanks for you helps.
Regards,
Tom