SELECT top two longest running steps from a log file

Simplified example.
Our jobs write records to our own internal log file. I want to write a query that will pull log records for a specific job, between specific dates. This will help determine if the job is running slower than usual and to find the steps within the job that
are the longest running.
Jobs are identified by the Type field. Type=1 is a specific job name.
Each job writes a DESC=START record to the log at the beginning of the job. the Desc=START record will be updated at the end of the job with the ENDDT.
I want to pull the top two longest running steps (ENDDT-BEGINDT) for each job (Type) where the step startdr and enddt falls between the START startDT and end dt.
I also want to always pull key step names, like DESC=START and DESC=xya for each job.
LOG RECORDS
DESC,TYPE,BEGINDT,ENDDT
START,1,2014-10-22 07:56:56.000,2014-10-22 09:56:56.000
aaa,1,2014-10-22 07:57:56.000,2014-10-22 08:57:56.000
bbb,1,2014-10-22 08:57:56.000,2014-10-22 09:01:56.000
ccc,1,2014-10-22 09:01:56.000,2014-10-22 09:56:56.000
xya,1,2014-10-22 09:55:56.000,2014-10-22 09:56:56.000
START,1,2014-10-21 11:56:56.000,2014-10-22 02:56:56.000
aaa,1,2014-10-21 11:57:56.000,2014-10-22 01:57:56.000
bbb,1,2014-10-22 01:57:56.000,2014-10-22 02:56:56.000
ccc,1,2014-10-22 02:56:56.000,2014-10-22 02:56:56.000
xya,1,2014-10-22 09:55:56.000,2014-10-22 09:56:56.000
Desired result set.
If pulling job type 1 records for last 2 days, would end up with this result set. START and xya are always pulled and then the top 2 longest running steps for each of the START records.
DESC,TYPE,BEGINDT,ENDDT,Duration
START,1,2014-10-22 07:56:56.000,2014-10-22 09:56:56.000
aaa,1,2014-10-22 07:57:56.000,2014-10-22 08:57:56.000
ccc,1,2014-10-22 09:01:56.000,2014-10-22 09:56:56.000
xya,1,2014-10-22 09:01:56.000,2014-10-22 09:56:56.000
START,1,2014-10-21 11:56:56.000,2014-10-22 02:56:56.000
aaa,1,2014-10-21 11:57:56.000,2014-10-22 01:57:56.000
bbb,1,2014-10-22 01:57:56.000,2014-10-22 02:56:56.000
xya,1,2014-10-22 09:55:56.000,2014-10-22 09:56:56.000
I am asking for help in how to create this query. Thanks

Hi TheBrenda,
According to your description, I have written a sample query and tested it in my local environment.
The following sample query is for your reference:
--create table log_records
CREATE TABLE log_records ([DESC] varchar(10),[TYPE] int,BEGINDT datetime,ENDDT datetime)
--insert values to table log_records
INSERT INTO log_records VALUES
('START',1,'2014-10-22 07:56:56.000','2014-10-22 09:56:56.000'),
('aaa',1,'2014-10-22 07:57:56.000','2014-10-22 08:57:56.000'),
('bbb',1,'2014-10-22 08:57:56.000','2014-10-22 09:01:56.000'),
('ccc',1,'2014-10-22 09:01:56.000','2014-10-22 09:56:56.000'),
('xya',1,'2014-10-22 09:55:56.000','2014-10-22 09:56:56.000'),
('START',1,'2014-10-21 11:56:56.000','2014-10-22 02:56:56.000'),
('aaa',1,'2014-10-21 11:57:56.000','2014-10-22 01:57:56.000'),
('bbb',1,'2014-10-22 01:57:56.000','2014-10-22 02:56:56.000'),
('ccc',1,'2014-10-22 02:56:56.000','2014-10-22 02:56:56.000'),
('xya',1,'2014-10-22 02:56:56.000','2014-10-22 02:56:56.000')
--run the following main query to get top two longest running steps
WITH A AS
(SELECT BEGINDT,ENDDT FROM log_records WHERE [DESC]='START'),
B AS
SELECT LR.[DESC], LR.TYPE, LR.BEGINDT BEGINDT1, LR.ENDDT ENDDT1, A.BEGINDT BEGINDT2, A.ENDDT ENDDT2,DATEDIFF(SECOND,LR.BEGINDT,LR.ENDDT) AS timediff,ROW_NUMBER() OVER(PARTITION BY A.BEGINDT ORDER BY DATEDIFF(SECOND,LR.BEGINDT,LR.ENDDT) DESC ) AS rn FROM log_records LR JOIN A
ON LR.BEGINDT >= A.BEGINDT AND LR.ENDDT<=A.ENDDT
SELECT [DESC],[TYPE],BEGINDT1 BEGINDT,ENDDT1 ENDDT FROM B WHERE rn<4 or [DESC]='xya' ORDER BY BEGINDT2,rn
The result of the main query is:
DESC      TYPE     
BEGINDT                                             
ENDDT
START   1              2014-10-21 11:56:56.000                2014-10-22 02:56:56.000
aaa         1              2014-10-21 11:57:56.000                2014-10-22
01:57:56.000
bbb        1              2014-10-22 01:57:56.000                2014-10-22 02:56:56.000
xya         1              2014-10-22 02:56:56.000                2014-10-22
02:56:56.000
START   1              2014-10-22 07:56:56.000                2014-10-22 09:56:56.000
aaa         1              2014-10-22 07:57:56.000                2014-10-22
08:57:56.000
ccc          1              2014-10-22 09:01:56.000                2014-10-22
09:56:56.000
xya         1              2014-10-22 09:55:56.000                2014-10-22
09:56:56.000
If you have any question, please feel free to let me know.
Regards,
Jerry Li

Similar Messages

  • Apply exakt steps from History log file to another image?

    Alright. If you edit an image and the history log option is turned on, you can look at the exakt steps you've made with all the settings for the individual tools and effects used. Also steps you make can be recorded with the actions tool.
    My question is, are there any way to "play" the steps listed in the history log file, as if it were an action?
    I need to apply alot of steps to several images but I never recorded the steps I've made with the actions tool. However they are "recorded" in the history log file and I could go in and look and recreate all those steps manually, but that would take too much time...
    Are there any plug-ins or are there any other way to do what I need to get done?
    Cheers
    Martin

    1. you can set your preferences to record the history to a txt file or the files metadata.
    I assumed that is what the OP already did as indicated in
    If you edit an image and the history log option is turned on,
    wonder why there are no feature in Photoshop to replay all one have done, to any image?
    As you know there is, it’s Actions (as with Scripting not all functionality records; Edit: and not all functionality is applicable to all files because of Color Mode and Bit Depth for example). But it is up to you to employ the necessary foresight to know what to record beforehand.
    Also a non-destructive workflow can help make many effects/compositions/etc. easily transfer-/recreateable. 

  • Help on Reading and Reporting From A log File

    Hi there
    I need any assistance on developing a class that is able to read from a log file and then be filtered and put into a report. I need to be able to search on the log files per criteria.

    Chainsaw:
    http://logging.apache.org/log4j/docs/chainsaw.html

  • Read data from a log file to flex textarea while deploying

    Hi,
    I am new to flex. I am able to read data from a log file that placed in C drive and able to write that data into flex textarea, but I am unable to read the same file while it is deployed into weblogic sever.
    Could anyone please tell me how to solve this problem.
    Thanks,
    Sri.

    Do you have it trying to read that same file on your C drive or is the file actually deployed somewhere on the server?

  • Is there a way to select a certain box of elements from a csv file and read that into LabVIEW?

    Hello all, I was wondering if there was a way to select only a certain "box" of elements from a .csv file in LabVIEW? I have LabVIEW 2011 and my main goal is to take two arrays and graph them against each other. I can import the .csv file just fine and separate each row and each column to be its own, but say I have an 8X8 but want to graph the middle 4X5 or something like that. Is there any way to extract an array without starting at the beginning and without ending at the end? Thank you in advance.
    Solved!
    Go to Solution.

    Hi Szklanam,
    as a CSV file is just a TXT file with a different suffix you can read a certain number of lines of that file. So you can limit the number of rows in your resultung array. To limit the number of columns you still have to use ArraySubset, so maybe it's a lot easier to read the full CSV file and pick the interesting spots with ArraySubset...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Recover from currnet log file corruption in archive mode

    Hi,
    I am using oracle 10.2.0 on windows xp. my database is in archivelog mode. I am learning recovery. I take backup of database using
    RMAN> backup database;
    Starting backup at 03-SEP-09
    using channel ORA_DISK_1
    channel ORA_DISK_1: starting full datafile backupset
    channel ORA_DISK_1: specifying datafile(s) in backupset
    input datafile fno=00004 name=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF
    input datafile fno=00001 name=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF
    input datafile fno=00003 name=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSAUX01.DBF
    input datafile fno=00002 name=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\UNDOTBS01.DBF
    channel ORA_DISK_1: starting piece 1 at 03-SEP-09which completed.
    my current logfile and current sequence no is
    SQL> select * from v$log;
        GROUP#    THREAD#  SEQUENCE#      BYTES    MEMBERS ARC STATUS
    FIRST_CHANGE# FIRST_TIM
             1          1         88   52428800          1 NO  CURRENT
          4475270 01-SEP-09
             2          1         86   52428800          1 YES INACTIVE
          4426127 31-AUG-09
             3          1         87   52428800          1 YES INACTIVEThen i delete my only one redolog file in my current group. my instance crashes i want to recover now first i try
    SQL> startup
    ORACLE instance started.
    Total System Global Area  289406976 bytes
    Fixed Size                  1248576 bytes
    Variable Size              92275392 bytes
    Database Buffers          188743680 bytes
    Redo Buffers                7139328 bytes
    Database mounted.
    ORA-00313: open failed for members of log group 1 of thread 1
    ORA-00312: online log 1 thread 1:
    'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO01.LOG'
    ORA-27041: unable to open file
    OSD-04002: unable to open file
    O/S-Error: (OS 2) The system cannot find the file specified.
    SQL> select open_mode from v$database;
    OPEN_MODE
    MOUNTED
    SQL> recover database until cancel;
    ORA-00279: change 4500421 generated at 09/03/2009 10:49:48 needed for thread 1
    ORA-00289: suggestion : D:\1\ARC00088_0693601900.001
    ORA-00280: change 4500421 for thread 1 is in sequence #88
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
    cancel
    ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
    ORA-01194: file 1 needs more recovery to be consistent
    ORA-01110: data file 1: 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF'
    ORA-01112: media recovery not startedit doesn't work then i do
    RMAN> restore database
    2> ;
    Starting restore at 03-SEP-09
    using target database control file instead of recovery catalog
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=156 devtype=DISK
    channel ORA_DISK_1: starting datafile backupset restore
    channel ORA_DISK_1: specifying datafile(s) to restore from backup set
    restoring datafile 00001 to D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF
    restoring datafile 00002 to D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\UNDOTBS01.DBF
    restoring datafile 00003 to D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSAUX01.DBF
    restoring datafile 00004 to D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF
    channel ORA_DISK_1: reading from backup piece D:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2009_09_03
    KP
    channel ORA_DISK_1: restored backup piece 1
    piece handle=D:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2009_09_03\O1_MF_NNNDF_TAG20090903T104947_5
    channel ORA_DISK_1: restore complete, elapsed time: 00:02:16
    Finished restore at 03-SEP-09
    RMAN>
    RMAN> recover database until sequence 87;
    Starting recover at 03-SEP-09
    using channel ORA_DISK_1
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of recover command at 09/03/2009 11:06:06
    RMAN-06556: datafile 1 must be restored from backup older than scn 4444743It means i need an older backup but i have new backup how to restore or get my database up.
    Thanks
    umesh

    Thanks for reply
    i have this in my hand
    RMAN> list backupset;
    List of Backup Sets
    ===================
    BS Key  Type LV Size       Device Type Elapsed Time Completion Time
    1       Full    1.38G      DISK        00:02:21     03-SEP-09
            BP Key: 1   Status: AVAILABLE  Compressed: NO  Tag: TAG20090903T104947
            Piece Name: D:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2009_09_03\O1_MF_NNNDF_TAG20090903T104947_59YNHNSK_.BKP
      List of Datafiles in backup set 1
      File LV Type Ckp SCN    Ckp Time  Name
      1       Full 4500421    03-SEP-09 D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF
      2       Full 4500421    03-SEP-09 D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\UNDOTBS01.DBF
      3       Full 4500421    03-SEP-09 D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSAUX01.DBF
      4       Full 4500421    03-SEP-09 D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF
    BS Key  Type LV Size       Device Type Elapsed Time Completion Time
    2       Full    6.80M      DISK        00:00:03     03-SEP-09
            BP Key: 2   Status: AVAILABLE  Compressed: NO  Tag: TAG20090903T104947
            Piece Name: D:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2009_09_03\O1_MF_NCSNF_TAG20090903T104947_59YNN8J9_.BKP
      Control File Included: Ckp SCN: 4500486      Ckp time: 03-SEP-09
      SPFILE Included: Modification time: 03-SEP-09
    RMAN> restore database preview;
    Starting restore at 03-SEP-09
    using channel ORA_DISK_1
    List of Backup Sets
    ===================
    BS Key  Type LV Size       Device Type Elapsed Time Completion Time
    1       Full    1.38G      DISK        00:02:21     03-SEP-09
            BP Key: 1   Status: AVAILABLE  Compressed: NO  Tag: TAG20090903T104947
            Piece Name: D:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2009_09_03\O1_MF_NNNDF_TAG20090903T104947_59YNHNSK_.BKP
      List of Datafiles in backup set 1
      File LV Type Ckp SCN    Ckp Time  Name
      1       Full 4500421    03-SEP-09 D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF
      2       Full 4500421    03-SEP-09 D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\UNDOTBS01.DBF
      3       Full 4500421    03-SEP-09 D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSAUX01.DBF
      4       Full 4500421    03-SEP-09 D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF
    archive logs generated after SCN 4500421 not found in repository
    Media recovery start SCN is 4500421
    Recovery must be done beyond SCN 4500421 to clear data files fuzziness
    Finished restore at 03-SEP-09
    RMAN> backup archivelog all ;
    Starting backup at 03-SEP-09
    using channel ORA_DISK_1
    channel ORA_DISK_1: starting archive log backupset
    channel ORA_DISK_1: specifying archive log(s) in backup set
    input archive log thread=1 sequence=60 recid=3 stamp=694522772
    input archive log thread=1 sequence=61 recid=4 stamp=694543115
    input archive log thread=1 sequence=62 recid=5 stamp=694693173
    input archive log thread=1 sequence=63 recid=6 stamp=694707783
    input archive log thread=1 sequence=64 recid=7 stamp=694785054
    input archive log thread=1 sequence=65 recid=8 stamp=694787797
    input archive log thread=1 sequence=66 recid=9 stamp=694794198
    input archive log thread=1 sequence=67 recid=10 stamp=694799765
    input archive log thread=1 sequence=68 recid=11 stamp=694806827
    input archive log thread=1 sequence=69 recid=12 stamp=694809124
    input archive log thread=1 sequence=70 recid=13 stamp=694868744
    input archive log thread=1 sequence=71 recid=14 stamp=695132728
    input archive log thread=1 sequence=72 recid=15 stamp=695210729
    input archive log thread=1 sequence=73 recid=16 stamp=695330401
    input archive log thread=1 sequence=74 recid=17 stamp=695399695
    input archive log thread=1 sequence=75 recid=18 stamp=695412690
    input archive log thread=1 sequence=76 recid=19 stamp=695511043
    input archive log thread=1 sequence=77 recid=20 stamp=695557945
    input archive log thread=1 sequence=78 recid=21 stamp=695597432
    input archive log thread=1 sequence=79 recid=22 stamp=695728451
    input archive log thread=1 sequence=80 recid=23 stamp=695729334
    input archive log thread=1 sequence=81 recid=24 stamp=695729976
    input archive log thread=1 sequence=82 recid=25 stamp=695835471
    input archive log thread=1 sequence=83 recid=26 stamp=695988878
    input archive log thread=1 sequence=84 recid=27 stamp=696160938
    input archive log thread=1 sequence=85 recid=28 stamp=696333853
    input archive log thread=1 sequence=86 recid=29 stamp=696360658
    input archive log thread=1 sequence=87 recid=30 stamp=696454218
    channel ORA_DISK_1: starting piece 1 at 03-SEP-09
    channel ORA_DISK_1: finished piece 1 at 03-SEP-09
    piece handle=D:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2009_09_03\O1_MF_ANNNN_TAG20090903T115246_59YR5VRV_.BKP tag=TAG20090903T1
    =NONE
    channel ORA_DISK_1: backup set complete, elapsed time: 00:01:08
    Finished backup at 03-SEP-09
    RMAN> restore database preview;
    Starting restore at 03-SEP-09
    using channel ORA_DISK_1
    List of Backup Sets
    ===================
    BS Key  Type LV Size       Device Type Elapsed Time Completion Time
    1       Full    1.38G      DISK        00:02:21     03-SEP-09
            BP Key: 1   Status: AVAILABLE  Compressed: NO  Tag: TAG20090903T104947
            Piece Name: D:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2009_09_03\O1_MF_NNNDF_TAG20090903T104947_59YNHNSK_.BKP
      List of Datafiles in backup set 1
      File LV Type Ckp SCN    Ckp Time  Name
      1       Full 4500421    03-SEP-09 D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF
      2       Full 4500421    03-SEP-09 D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\UNDOTBS01.DBF
      3       Full 4500421    03-SEP-09 D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSAUX01.DBF
      4       Full 4500421    03-SEP-09 D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF
    archive logs generated after SCN 4500421 not found in repository
    Media recovery start SCN is 4500421
    Recovery must be done beyond SCN 4500421 to clear data files fuzziness
    Finished restore at 03-SEP-09now i have two backup one is full database backup which will not work another is backup of all archivelog upto sequence 87 i think it should work.
    but rman is choosing full database backup for restore.
    so i need to force rman to choose archivelog backups for restore but don't know how to do it. please suggest.
    Thanks
    umesh

  • Job number from alert log file to information

    Hello!
    I have a question about job numbers in alert log file. Today one of our Oracle 10g R2 [10.2.0.4] RAC nodes crashed. After examining alert log file for one of the nodes I saw a lot of messages like:
    Tue Jul 26 11:52:43 2011
    Errors in file /u01/app/oracle/admin/zeme/bdump/zeme2_j002_28952.trc:
    ORA-12012: error on auto execute of job *20627358*
    ORA-12705: Cannot access NLS data files or invalid environment specified
    Tue Jul 26 11:52:43 2011
    Errors in file /u01/app/oracle/admin/zeme/bdump/zeme2_j001_11018.trc:
    ORA-12012: error on auto execute of job *20627357*
    ORA-12705: Cannot access NLS data files or invalid environment specified
    Tue Jul 26 11:52:43 2011
    Errors in file /u01/app/oracle/admin/zeme/bdump/zeme2_j000_9684.trc:
    ORA-12012: error on auto execute of job *20627342*
    ORA-12705: Cannot access NLS data files or invalid environment specified
    After examining trc files I have found no further information about error except session ids.
    My question is: how to find what job caused these messages to appear in alert log file.
    How do I map number in alert log file to some "real" information (owner, statement executed, schedule)?
    Marx.

    Sorry for the delay
    Try this to find the job :
    select job, what from dba_jobs ;
    How do I find NLS_LANG version?SQL> show parameter NLS_LANG
    Do you mean ALTER SESSION inside a job?I meant anywhere, but your question is better.
    ORA-12705 - Common Reasons and How to Resolve Them [ID 158654.1]
    If OS is Windows lookout for NLS_LANG=NA in the registry
    Is it possible you are doing this somewhere ?
    ALTER SESSION SET NLS_DATE_FORMAT = 'RRRR-MM-DD\"T\"HH24:MI:SS';NLS database settings are superseded by NLS instance settings
    SELECT * from NLS_SESSION_PARAMETERS;
    These are the settings used for the current SQL session.
    NLS_LANG could be set in a profile for example.
    NLS_LANG=_AMERICA.WE8ISO8859P1     ( correct )
    NLS_LANG=AMERICA.WE8ISO8859P1 ( Incorrect )
    you need to set the "_" as separator.
    Windows
    set NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1
    Unix
    export NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1
    mseberg
    Edited by: mseberg on Jul 28, 2011 3:51 PM
    Edited by: mseberg on Jul 29, 2011 4:05 AM

  • Display string from a log file on a Dashboard?

    Hello everyone,
    I need a little guidance on how to solve this problem in SCOM 2012 R2.
    I need SCOM to do this:
    Read a log file on a specific application server (say its hostname is server21)
    Look for the text: Total number of users: 15
    Display the text “Users on Server21 =
     15” on a SCOM dashboard (or something to that effect)
    Sounds simple enough? Well, I am stumped :-(
    I have read and followed tutorials on internet, telling me how to create a rule and alerts. However I don’t want alerts. I want this data to be simply shown on a dashboard.
    How can I do that?
    PS: I hear that I may have to create my own management pack with only server21 in it. Is that right?
    -Rajeev rajdude.com

    Thanks for the tip. The powershell grid widget is pretty powerful. However it will take me quite some time and effort to write a PS script which can extract the exact info I need from that application's log file. I was hoping SCOM's own log parsing
    capabilities would do it.
    By the way, yes, we can create a MP and have only one server in it. We can use the (free) 
    MPAuthor to make a MP with only one server in it. Here is a video showing how to do it...
    http://www.silect.com/static/mpauthor/MP_Author_Creating_a_New_Single_Server_Application_MP.mp4
    I tried doing what I want using MPAuthor, but it again boiled down to me writing a PS script which can extract the exact info I need
    from that application's log file.
    -Rajeev rajdude.com

  • How to recover from deleting log file?

    Hi,
    In a case on Mondayitis I accidentally deleted C:\ORACLEXE\APP\ORACLE\FLASH_RECOVERY_AREA\XE\ONLINELOG\O1_MF_1_35N72N5G_.LOG'
    and now can't start my database. (see error below)
    Tue Jun 12 12:40:29 2007
    Errors in file c:\oraclexe\app\oracle\admin\xe\bdump\xe_lgwr_3544.trc:
    ORA-00313: open failed for members of log group 1 of thread 1
    ORA-00312: online log 1 thread 1: 'C:\ORACLEXE\APP\ORACLE\FLASH_RECOVERY_AREA\XE\ONLINELOG\O1_MF_1_35N72N5G_.LOG'
    ORA-27041: unable to open file
    OSD-04002: unable to open file
    O/S-Error: (OS 2) The system cannot find the file specified.
    Tue Jun 12 12:40:30 2007
    ORA-313 signalled during: ALTER DATABASE OPEN...
    Can someone guide me on how I can create a new log file and get my database up and running.
    Thanks
    Anthony

    After a bit more research I fixed the problem.
    But just in case anyone else does the same stupid thing - here is how I fixed it.
    connect / as sysdba
    RECOVER DATABASE UNTIL CANCEL;
    ALTER DATABASE OPEN RESETLOGS;
    And database is up and running.
    Regards
    Anthony

  • How to call SQL job step by step from windows batch file

    Hi ,
    I have a SQL agent job [POC_IOD_RunPkgJob]  which is being called from bat file with below command.
    Could you please tell me how to call only one step of this job, what command I need to mention in the batch file.
    SQLCMD -Sabcwi\SQLI01,51565 -E -Q"exec msdb.dbo.sp_start_job [POC_IOD_RunPkgJob]"

    Hi RameshDravid,
    Regarding your description,though not aware of what is the purposed to call only one step of that job, the below sample can somewhat help to achieve your requirement.
    --find the job steps
    SELECT
    steps.step_id,steps.step_name,steps.subsystem,steps.command
    FROM msdb.dbo.sysjobsteps steps
    JOIN msdb.dbo.sysjobs jobs
    ON steps.job_id = jobs.job_id
    WHERE jobs.name = 'youJobName'
    --find the command runs in that step, usually that is some command exec stored procedure
    SQLCMD -Sabcwi\SQLI01,51565 -E -Q"exec stored procedure found in the above query"
    If you have any question, feel free to let me know
    Eric Zhang
    TechNet Community Support

  • Calling a new shell to run mySQL from an input file

    I'm trying this.
    Runtime r = Runtime.getRuntime();
         Process pr = null;
         try
         String str="cmd C:\\mysql\\bin\\mysql -u root < C:\\java\\jfb\\myfile.txt /C";
         pr = r.exec(str);
         pr.waitFor();
         catch (Exception e)
         e.printStackTrace();
    nothing is getting updated in my database. myfile.txt is correct. i'm really wondering about the String str being correctly formatted. thank you.

    it's need not to be
    c:\windows\system32\cmd.exe /c C:\\mysql\\bin\\mysql -u root < C:\\java\\jfb\\myfile.txt it could be like this.
    cmd /c C:\\mysql\\bin\\mysql -u root < C:\\java\\jfb\\myfile.txt but remember, /c must come next to the cmd. in some environments, this wont work. i dun knw why if it's so use the following.
    cmd start  /c C:\\mysql\\bin\\mysql -u root < C:\\java\\jfb\\myfile.txt /Cheers,
    -MadGuy
    [A Guy From the pearl of Indian Ocean... A Srilankan...]

  • Compile and generate using adadmin step cant display log file

    Below is the output of the compile and generate step (1-4).
    UTL_FILE.READ_ERROR DIRECTORY: LOG_INSTANCE_1703FILE: script_10438.sh.logProcess Returned: 0 Results in: /mwiz/oracle/mwizdb/10.2.0/eof/log/INSTANCE_1703/script_10438.sh (49 bytes)
    I manually went and reviewed the logfile and everything seems like it ran fine and completed normally.
    How do I correct this issue that it couldn't display the log?
    Note, the logs from prior commands seem to have completed successfully.
    Thanks, Dean

    I have only error seen the UTL_FILE.READ_ERROR as a result of improper configuration. It is an oracle package error. What is the RDBMS release running the MW tool?
    This error is generated when the file permissions or owner are incorrect. I have logged a bug to have the entire 11i Pre-Upgrade Patching section removed. The patches being merged and applied are applied again later in the functional steps so that section is really not necessary.

  • To get names of reports/objects, Object list from any log files..

    Hi All,
    I have a query, how does OBIEE allocate names to its objects like reports/dashboards dynamically which we see in Session queries. Is there a way that we could get this information from any system variables or any internal file ? This information is to get and run some automation testing post migration, so that validation and verification effort will come down.
    I have one more query, is there way to list of all the objects? Reports/dashboards/tables/variables/MV or any other which are part of our OBIEE reports.
    So that If we can get a list and any log which tells these are modified or not..so that post migration validation/verification will be easy.
    Thanks in advance.
    Thanks!!

    Hi user8732477,
    From my experience I noticed that OBIEE does not use internal identifiers for reports and dashboards. That is a bit of a pain point because if you had a Navigation Drill setup, and you change the name of the target report, your drill will fail. However, there is a "Smart Rename" in the Catalog Manager tool. That will go through the catalog and fix any reference. But in short, there are no internal identifiers for the reports and dashboards. Just the names themselves and the folder path are the unique identifiers.
    Secondly, you can easily run such a report using the Catalog manager tool. Just log into your catalog and go to Tools->Create Report. You have to run one report for Dashboards and any request part of a dashboard and a separate report for any Answer requests that didn't happen to be put into a dashboard. The report creation process is pretty straight forward. It lets you specify what data points you want and it does the rest. It generates a tab delimited file I believe (it could have been comma though, I can't quite remember). Easy to import it into Excel and work with.
    Hope this helps and if you found this post useful, please award points!
    Best regards,
    -Joe

  • Is it possible to to parse data from a log file and dump to an evt or evtx

    Have a need to query a set of servers and look for a particular event code. I need to dump the identified events to an .evt or evtx format so it can be read by windows event viewer as well as be read by splunk.
    This is the bit I have setup for running against my set of servers:
    $servers = "host1","host2",...
    foreach ($host in $servers)  {
    Get-WinEvent -ComputerName $host -filterhashtable @{logname='security';id=4738}
    Right now I have it so it pipes the output to a text file, but have not found a way to pipe out only the events I want to an evt or evtx file.
    Any suggestions or ideas?
    Eric

    - <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
    - <System>
      <Provider Name="Microsoft-Windows-Security-Auditing" Guid="{54849625-5478-4994-A5BA-3E3B0328C30D}" />
      <EventID>4738</EventID>
      <Version>0</Version>
      <Level>0</Level>
      <Task>13824</Task>
      <Opcode>0</Opcode>
      <Keywords>0x8020000000000000</Keywords>
      <TimeCreated SystemTime="2015-01-18T17:47:40.357063000Z" />
      <EventRecordID>5276578090</EventRecordID>
      <Correlation />
      <Execution ProcessID="692" ThreadID="6160" />
      <Channel>Security</Channel>
      <Computer>somedchostname</Computer>
      <Security />
      </System>
    - <EventData>
      <Data Name="Dummy">-</Data>
      <Data Name="TargetUserName">someaccountname</Data>
      <Data Name="TargetDomainName">somedomainname</Data>
      <Data Name="TargetSid">S-something</Data>
      <Data Name="SubjectUserSid">S-somethingelse</Data>
      <Data Name="SubjectUserName">accountmakingchange</Data>
      <Data Name="SubjectDomainName">domainofaccountmakingchange</Data>
      <Data Name="SubjectLogonId">0xidofaccount</Data>
      <Data Name="PrivilegeList">-</Data>
      <Data Name="SamAccountName">-</Data>
      <Data Name="DisplayName">-</Data>
      <Data Name="UserPrincipalName">-</Data>
      <Data Name="HomeDirectory">-</Data>
      <Data Name="HomePath">-</Data>
      <Data Name="ScriptPath">-</Data>
      <Data Name="ProfilePath">-</Data>
      <Data Name="UserWorkstations">-</Data>
      <Data Name="PasswordLastSet">-</Data>
      <Data Name="AccountExpires">-</Data>
      <Data Name="PrimaryGroupId">-</Data>
      <Data Name="AllowedToDelegateTo">-</Data>
      <Data Name="OldUacValue">0x1014</Data>
      <Data Name="NewUacValue">0x14</Data>
      <Data Name="UserAccountControl">%%2060</Data>
      <Data Name="UserParameters">-</Data>
      <Data Name="SidHistory">-</Data>
      <Data Name="LogonHours">-</Data>
      </EventData>
      </Event>

  • A real task..( to search and display few lines from a log file)

    have a look at the following link
    http://computing.unn.ac.uk/staff/cgpb2/public_html/log.html
    i need to display to the users only the Hourly Transmission Statistics (Bytes Sent Requests Time) on a tabular format from the above mentioned link.
    t
    his is not easy
    can any one write down the code please..
    thank you very much.

    What have you done so far?
    What kind of approach are you going to take (aside from asking others to do it all for you)?
    Have you written the algorithm in psuedo-code? If so, can we see it? We might be able to give you a few pointers.

Maybe you are looking for

  • Ipod Syncing Slowly With Windows 7....26 hours of slowly...

    I got a new Windows 7 computer which is running 64 version. I am a big music fan and I have a huge library so I have the Ipod 160GB and thusly use Itunes 9.0.2.25 64 Bit Version. I had a Windows Vista 32 Bit dinosaur before which lagged a lot but Itu

  • Itunes wont recognise ipod and ipod not playing!!

    My ipod is being recognised in windows but not in itunes. When i connect it a message pops up to say that problems have occured and to scan and fix them but when i do it says no problems were found yet it still doesn't pop up in the sources in itunes

  • HP OJ Pro 8600 Pro crashes when trying to login to print Google Calendar

    I get a hard reboot crash when I try to login with the correct password using the Google Calendar App.  If I use the incorrect password it handles that gracefully. HP OfficeJet Pro 8600 Pro, brand new out of box I have not hooked the printer up to th

  • Not showing Menubar item and Title text in Menu painter screen

    I have prepare the Menubar items & Text title in Menu painter, but at final when i execute the program, it shows the fields & buttons but not the menu bar item and title that i have created. I am missing some step or what. Please help me. Thanks in a

  • Dual display bug

    seems to be a bug in the display preferences. if i use dual monitors, it does not extend desktop like it used to. you can only mirror the two displays