Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Extract ORA errors with sql statement from the log file.

N_RajJan 17 2018 — edited Feb 8 2018

Hi All,

We have oracle 11.2.0.4 on Aix 7.

Every weekend ,we run index rebuild scripts based on schemas. Each schema has one index rebuild script.some schema has less than 50 indexes and others has more than 100 indexes.

Schema names are Test1,test2,test3 etc. The rebuild script is stored  at /u05/scripts/test1/,/u05/scripts/test2,/u05/scripts/test3 etc.

Last three months,the rebuild index scripts ( some of the indexes ) was failed due to an error ORA-00054.

Script :  For the  Test1 schema

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

export ORACLE_HOME=/u01/app/oracle

export ORACLE_SID=TEST

export PATH=$ORACLE_HOME/bin:$PATH

sqlplus -s "username/password@test" << EOF

spool Test1_Index_rebuild.log

@/u05/scripts/Test1_Index_rebuild.sql

EOF

spool off;

exit;

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

1a,I am asked to extract the error ORA-00054 with sql statement from Test1_Index_rebuild.log,save it as Test1_Index_rebuild_1.log

1b,Then,extract only sql statement from Test1_Index_rebuild_1.log,save it as Test1_Index_rebuild_1.sql.

1c,Finally send the Test1_Index_rebuild.sql file to mail.

2,I have to do the same thing for others schema's Test2,Test3 etc.

Any Suggestions

Thanks & Regards,

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 8 2018
Added on Jan 17 2018
18 comments
952 views