Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to store the results of several scripts in a table

Re: How to store the results of several scripts in a table

From: Mladen Gogala <mgogala_at_adelphia.net>
Date: Sat, 14 Jun 2003 17:39:59 GMT
Message-Id: <pan.2003.06.14.17.39.48.732637@adelphia.net>


On Sat, 14 Jun 2003 08:59:30 -0700, fawad wrote:

> Hello,
> I am using a main script which contains several sub scripts which I
> run to evaluate the performance of the database
> These scripts generate result files(text files) .But now I want that
> these scripts should not create result files but put the result into a
> following table every time when I run the main script.
>
> The table something like this: "result_id, script_id (Foreign Key),
> time_stamp, result (Text)"
>
> I have also a table structure, that manages my scripts. The columns
> of that table are "script_id, category, description, script".
>
> I can&#8217;t understand how to do this .Could some one please give me
> suggestion/coding.
>
> Regards
>
> Fawad

Use external tables.
You can do something like this:
SQL> create or replace directory bdump as '/oracle/admin/o9i/bdump'   2 /  

Directory created.  

SQL> grant read on directory bdump to public   2 /  

Grant succeeded.  

SQL> create table alert_log_ext (
  2 line varchar2(2000) )
  3 organization external
  4 (
  5 type oracle_loader
  6 default directory bdump
  7 access parameters
  8 (

  9        records delimited by newline
 10        nobadfile nologfile nodiscardfile
 11        fields (line char(132)

 12 )
 13 )
 14 location('alert_o9i.log') )
 15 reject limit unlimited
 16 /  

Table created.  

SQL> After that, the access is enormously complicated:

select * from alert_log_ext
/
......
LINE

--------------------------------------------------------------------------------starting up 1 dispatcher(s) for network address '(ADDRESS=(PARTIAL=YES)(PROTOCOL=IPC))'...
 

Sat Jun 14 13:08:45 2003
ALTER DATABASE MOUNT
Sat Jun 14 13:08:49 2003
Successful mount of redo thread 1, with mount id 2499258397. Sat Jun 14 13:08:49 2003
Database mounted in Exclusive Mode.
Completed: ALTER DATABASE MOUNT
Sat Jun 14 13:08:50 2003  

LINE

--------------------------------------------------------------------------------ALTER DATABASE OPEN
Sat Jun 14 13:08:50 2003
Thread 1 opened at log sequence 76
  Current log# 1 seq# 76 mem# 0: /data/oradata/redo/redo01.rdo Successful open of redo thread 1.
Sat Jun 14 13:08:50 2003
SMON: enabling cache recovery
Sat Jun 14 13:08:51 2003
Undo Segment 1 Onlined
Undo Segment 2 Onlined
Undo Segment 3 Onlined  

LINE

--------------------------------------------------------------------------------Undo Segment 4 Onlined
Undo Segment 5 Onlined
Undo Segment 6 Onlined
Undo Segment 7 Onlined
Undo Segment 8 Onlined
Undo Segment 9 Onlined
Undo Segment 10 Onlined
Successfully onlined Undo Tablespace 1.
Sat Jun 14 13:08:52 2003
SMON: enabling tx recovery
Sat Jun 14 13:08:52 2003  

LINE

--------------------------------------------------------------------------------Database Characterset is WE8ISO8859P1
replication_dependency_tracking turned off (no async multimaster replication found)  

Completed: ALTER DATABASE OPEN  

10696 rows selected.  

SQL>

-- 
Mladen Gogala
Software is like sex, it is better when it is free.
Linus Torvalds 
Received on Sat Jun 14 2003 - 12:39:59 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US