Sponsored Content
Top Forums Shell Programming and Scripting Help searching for dates - Oracle ALERT log Post 302977258 by RudiC on Friday 15th of July 2016 07:50:29 AM
Old 07-15-2016
Not sure I understand your request. You want to print lines containing a keyword together with the last timestamp encountered? Try
Code:
LC_ALL=C locale abmon abday |  awk -vSRCH="$1" '
NR <= 2         {gsub (/;/, "|")
                 if (NR == 1)   MONS = $0
                   else         DAYS = $0
                 next
                }
$1 ~ DAYS &&
$2 ~ MONS       {DATE = $0
                }
                {TMP = tolower ($0)
                }
TMP ~ SRCH      {print DATE ": " $0
                }
' - /tmp/x.txt
Sun Jul 10 16:54:33 2016: Some indexes or index [sub]partitions of table TEST_XX have been marked unusable
Sun Jul 10 16:54:33 2016: Some indexes or index [sub]partitions of table TEST_XX_HISTORY have been marked unusable
Sun Jul 10 17:33:30 2016: Some indexes or index [sub]partitions of table TEST_XX have been marked unusable
Sun Jul 10 17:33:30 2016: Some indexes or index [sub]partitions of table TEST_XX_HISTORY have been marked unusable
Sun Jul 10 17:36:41 2016: Some indexes or index [sub]partitions of table TEST_XX have been marked unusable
Sun Jul 10 17:36:41 2016: Some indexes or index [sub]partitions of table TEST_XX_HISTORY have been marked unusable
Mon Jul 11 04:34:49 2016: Some indexes or index [sub]partitions of table TEST_XX have been marked unusable
Mon Jul 11 04:34:49 2016: Some indexes or index [sub]partitions of table TEST_XX_HISTORY have been marked unusable

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Searching between dates

Hello people, I have a file containing dated entries. Is there a way to search between dates? for example, in a file <file.text> with entries 04-jul-2005 login: pty0 xxxxxx xxxxxx 09-jul-2005 logout pty34 xxxxxx xxxxxx 11-aug-2005 arp port17 xxxxxx xxxxxx 30-sep-2005... (9 Replies)
Discussion started by: Khoomfire
9 Replies

2. Shell Programming and Scripting

help searching log file with dates

Im tyring to create a script that will show me any lines in a file with todays date and yesterdays, the date format in the file is as follows ----- amqxfdcx.c : 728 -------------------------------------------------------- 07/12/05 09:53:20 AMQ6109: An internal WebSphere MQ error has... (3 Replies)
Discussion started by: csaunders
3 Replies

3. UNIX for Advanced & Expert Users

Select entries between two dates by converting Unix timestamp in Oracle Database.

Hi, I need to select the entries between two dates from an Oracle db. The Oracle db has a column with Unix timestamps. I use the following querry, but it doesnt seem to be working as desired. select count(*) from reporter_status where to_char(FIRSTOCCURRENCE, 'mm-dd-yy') between ('08-07-06')... (1 Reply)
Discussion started by: amitsayshii
1 Replies

4. Shell Programming and Scripting

find log file between two dates

Dear All, Please can you help me to crack this query? If the log files for the task above all had a naming convention of myoutput_YearMonthDay.log (i.e. myoutput_20060215) How would you find only those log files created between the 10th and the 20th of each month going back the last 365 days.... (1 Reply)
Discussion started by: justin_mca
1 Replies

5. Shell Programming and Scripting

Getting list of all the log files between two dates

I need to get the list of all the log files for a particular duration, say between two dates,i.e I need to get the list of all the log files between date1 and date2.The two dates are entered by the user. The format of the log file is : /path_name/graph_name_20080801180308.log. I dont... (1 Reply)
Discussion started by: avishekp
1 Replies

6. Shell Programming and Scripting

Pull log between two dates.

Hi, I am trying to pull out lines from logs between two dates, the logs has lines like this : conn=552 op=3 msgId=17228 - RESULT err=0 tag=97 nentries=0 etime=0 dn="cn=amldapuser,ou=dsame u sers,dc=abc,dc=com" conn=553 op=-1 msgId=-1 - fd=34 slot=34 LDAP connection from 52.99.164.14 to... (4 Replies)
Discussion started by: john_prince
4 Replies

7. Shell Programming and Scripting

Oracle Alert log script

Hi, I'm trying to write a shell script on HP-UX to search through Oracle alert logs for errors which always start with ORA-. If it does find an error I'd like it to print the date line (which precedes the error by a line or two normally) as well as the error line. So in the example below I'd like... (1 Reply)
Discussion started by: capesong
1 Replies

8. Shell Programming and Scripting

Check log file size every 10 minute. Alert if log not update

How to check log size every 10min. by script (can use crontab) if log size not change with alert "Log not update" Base run on SunOS 5.8 Generic_Virtual sun4u sparc SUNW,SPARC-Enterprise logFiles="log1.log log2.log" logLocation="/usr/home/test/log/" Out put. Tue Jan 31... (3 Replies)
Discussion started by: ooilinlove
3 Replies

9. Shell Programming and Scripting

Grepping only dates from a log file

Hi All, I have a log file where every line contains a date and some other data, i want to grep only the date from every line to a different file. Please help how to get this. Thanks in advance !! (25 Replies)
Discussion started by: nanz143
25 Replies
DBIx::Class::Storage::DBI::Oracle::WhereJoins(3)	User Contributed Perl Documentation	  DBIx::Class::Storage::DBI::Oracle::WhereJoins(3)

NAME
DBIx::Class::Storage::DBI::Oracle::WhereJoins - Oracle joins in WHERE syntax support (instead of ANSI). PURPOSE
This module is used with Oracle < 9.0 due to lack of support for standard ANSI join syntax. SYNOPSIS
DBIx::Class should automagically detect Oracle and use this module with no work from you. DESCRIPTION
This class implements Oracle's WhereJoin support. Instead of: SELECT x FROM y JOIN z ON y.id = z.id It will write: SELECT x FROM y, z WHERE y.id = z.id It should properly support left joins, and right joins. Full outer joins are not possible due to the fact that Oracle requires the entire query be written to union the results of a left and right join, and by the time this module is called to create the where query and table definition part of the SQL query, it's already too late. METHODS
See DBIx::Class::SQLMaker::OracleJoins for implementation details. BUGS
Does not support full outer joins. Probably lots more. SEE ALSO
DBIx::Class::SQLMaker DBIx::Class::SQLMaker::OracleJoins DBIx::Class::Storage::DBI::Oracle::Generic DBIx::Class AUTHOR
Justin Wheeler "<jwheeler@datademons.com>" CONTRIBUTORS
David Jack Olrik "<djo@cpan.org>" LICENSE
This module is licensed under the same terms as Perl itself. perl v5.16.2 2012-08-16 DBIx::Class::Storage::DBI::Oracle::WhereJoins(3)
All times are GMT -4. The time now is 02:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy