Script for insert a lot of files in oracle database.
Hello everybody,
I have a directory with a lot of log files, i want to insert the logs (*.log and *.trt.log) in database. log files are like this: 11/04/2017 12:00:02 11959 trt_ret_tp START Chargement des fichiers HREREC (trt_ret_tp) 11/04/2017 12:00:02 11959 trt_ret_tp Aucun fichier ▒ traiter 11/04/2017 12:00:02 11959 trt_ret_tp Mise a jour de la date de dernier recouvrement 11/04/2017 12:02:42 11959 trt_ret_tp STOP Chargement des fichiers HREREC (trt_ret_tp) I need a script that select specific files (.log and .trt_.log) and insert them into a table!!! Any suggestion!!! thanks for your help... |
Hi shirin,
Welcome to LQ. You question is kind of wide open. Oracle has a plethora of tools to import data into a table. Do you want to put the entire log file in a field, have that field be the entire record, and the table to be single column? |
hi AwesomeMachine,
thanks for your reply, i want a table with 5 column, (date_time,num_process,shell,event,comment), and i want insert a lot of file with same structure one after another in the table, something like this(example with two file, but i have more than 1000 file like this): date_time num_process shell event comment 11/04/2017 12:00:02 11959 trt_ret_tp START Chargement des fichiers HREREC (trt_ret_tp) 11/04/2017 12:00:02 11959 trt_ret_tp Aucun fichier ▒ traiter 11/04/2017 12:00:02 11959 trt_ret_tp Mise a jour de la date de dernier recouvrement 11/04/2017 12:02:42 11959 trt_ret_tp STOP Chargement des fichiers HREREC (trt_ret_tp) 12/05/2017 12:00:02 11959 trt_ret_tp START Chargement des fichiers HREREC (trt_ret_tp) 12/05/2017 12:00:02 11959 trt_ret_tp Aucun fichier ▒ traiter 12/05/2017 12:00:02 11959 trt_ret_tp Mise a jour de la date de dernier recouvrement 12/05/2017 12:02:42 11959 trt_ret_tp STOP Chargement des fichiers HREREC (trt_ret_tp) did i answer your question? |
Quote:
thanks for your reply, i want a table with 5 column, (date_time,num_process,shell,event,comment), and i want insert a lot of file with same structure one after another in the table, something like this(example with two file, but i have more than 1000 file like this): date_time num_process shell event comment 11/04/2017 12:00:02 11959 trt_ret_tp START Chargement des fichiers HREREC (trt_ret_tp) 11/04/2017 12:00:02 11959 trt_ret_tp Aucun fichier ▒ traiter 11/04/2017 12:00:02 11959 trt_ret_tp Mise a jour de la date de dernier recouvrement 11/04/2017 12:02:42 11959 trt_ret_tp STOP Chargement des fichiers HREREC (trt_ret_tp) 12/05/2017 12:00:02 11959 trt_ret_tp START Chargement des fichiers HREREC (trt_ret_tp) 12/05/2017 12:00:02 11959 trt_ret_tp Aucun fichier ▒ traiter 12/05/2017 12:00:02 11959 trt_ret_tp Mise a jour de la date de dernier recouvrement 12/05/2017 12:02:42 11959 trt_ret_tp STOP Chargement des fichiers HREREC (trt_ret_tp) did i answer your question? |
Quote:
Please review the Site FAQ for information related to how to ask an effective question as well as how to prepare the information for your question. Please note a few things here:
|
All times are GMT -5. The time now is 09:49 AM. |