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

Home -> Community -> Usenet -> c.d.o.misc -> Parsing the spool file.....

Parsing the spool file.....

From: <amerar_at_iwc.net>
Date: 4 Oct 2006 14:04:24 -0700
Message-ID: <1159995864.019710.188750@b28g2000cwb.googlegroups.com>


Hi all,

I have a question. We have a dumb ass configuration management team. Basically they want us to prepare Unix script with the necessary code to apply the changes to the Oracle database, and the CM team will apply the changes out to the field.

Here is an example script:

sqlplus /@$1 <<EOF

   GRANT SELECT ON dba_tab_columns TO mirs_dynamic_data;
   GRANT SELECT ON dba_synonyms TO mirs_dynamic_data;
   GRANT SELECT ON dba_objects TO mirs_dynamic_data;

@crdb_mirs_arads_feedback_tables

   ALTER SESSION SET CURRENT_SCHEMA = MIRS_DYNAMIC_DATA;
@replicate_tables
@get_columns
@tt_utl
@process_status_package_body
@name_change
@spf_change
@ssan_change
@forms_library_body

  exit
EOF Now, this will create a nice long log file. Does anyone know of a good way to parse this file? Sometimes the file grows to 5000 lines long, and to have a non-unix or non-oracle person trying to understand the file is crazy.

I'd like to get something that will go through the file and when it finds an ORA- error, it prints out the previous say 10 lines so one can see what led up to the error.

Additionally, a typical log file would look like this:

Synonym created.

Grant succeeded.

Table altered.

Table dropped.

Table created.

Warning: Trigger created with compilation errors.

SELECT * FROM OLD_A_FDBK_DD2246
              *
ERROR at line 9:
ORA-00942: table or view does not exist

Where it says the Trigger had warnings, how do I know the trigger name??? Is there any way to echo the name of the procedure or object it is working with???

Thanks!! Received on Wed Oct 04 2006 - 16:04:24 CDT

Original text of this message

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