linux - How view data that comes from a .GZ File Format on ORACLE SQL? -


explanation of condition , problem figuring

i find bit complicated, maybe because new event , world of linux.

  1. so here on pc (windows 7) need make sql based reporting site data need not in oracle yet.
  2. i need view data in oracle sql comes many files controller -> pc (unix).
  3. the format of file .gz physically file format machinedump.log.gz05052012 (its still .gz -> inside .log still .txt content)

note: controller/personal computer connecting has username, password , port number.

inside each .log.gz data has data like:

20120806_161944: 08.06 16:17:29.574 t_cm_03 c3011099140000 at_sts       =    0  20120806_161944: 08.06 16:17:29.574 t_cm_03 c3011099140000 at_sts       =    1 20120806_161944: 08.06 16:17:29.574 t_cm_03 c3011099140000 at_sts       =    2 20120806_161944: 08.06 16:17:29.574 t_cm_03 c3011099140000 at_sts       =    3 20120806_161944: 08.06 16:17:29.574 t_cm_03 c3011099140000 at_sts       =    4  20120806_161944: 08.06 16:17:29.574 t_cm_03 c3011099140000 at_sts       =    5 20120806_161944: 08.06 16:17:29.574 t_cm_03 c3011099140000 at_sts       =    6 20120806_161944: 08.06 16:17:29.574 t_cm_03 c3011099140000 at_sts       =    7 

but there more bigger problem see: machinedump.log.gz files many like:

machinedump.log.gz05052012 machinedump.log.gz05062012 machinedump.log.gz05072012 machinedump.log.gz05082012 etc. 

so here question , need problem:

  1. i wanna ask guys best way store these file contents single table? .log.gz files single table?

  2. regarding on 1st question, possible make data fetching based on "date" automated? meaning if there file match present date, execute , save data desired table?

  3. is there way guys show me do?

  4. in addition guys, there here must study deeply?

i need make these data usefull , readable report on using atleast sql(oracle or there better way) , netbeans rest of job(these know).

moderators

is possible have previous failed question deleted? thanks...

you don't version of oracle you're using. matters because oracle adds new capabilities arsenal each release. following solution work on 11.0.1.7 (i.e. last patch release of 11gr1) or later; earlier versions require more wrangling.

but first:

do need stiore information in table? sufficient read once? because relational database oracle not best fit storing machine logs. there plenty of free (or free-ish) document dbs might better suited - mongodb, cassandra, etc. or there's splunk intended that.

anyway, first way read files inthe database build external table on file. reguilar table except data in os file rather tablespace. in 11gr2 oracle introduced preprocessor clause, allows associate shell script table, run before select statement executes. particularly pertinent in case, because can use preprocessor script uncompress file.

so basic workflow is:

  1. a script locates gz file in 1 directory, unzips file standard name.
  2. an external table whioch reads standard name file , has script preprocess script
  3. an insert statement selects external table , writes target table

a more precise version of require more details have given regarding business rules, should able figure out yourself.

find out more on external tables in documentation.

read adrian billington's excellent articles on preprocessor scripts here , here.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -