Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 E-mail Us
 Oracle Articles
New Oracle Articles

 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog

 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Oracle Support

 SQL Tuning

 Oracle UNIX
 Oracle Linux
 Remote s
 Remote plans
 Application Server

 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S


 Consulting Staff
 Consulting Prices
 Help Wanted!


 Oracle Posters
 Oracle Books

 Oracle Scripts

Don Burleson Blog 







PLS-00109: unknown exception name tips

Expert Oracle Database Tips by Donald BurlesonSeptember 14, 2015

Question: (By David Gray)   I'm trying to catch an ORA-01284 error in a stored procedure. Looking around it seems as if I have to define my own exception using the PRAGMA EXCEPTION_INIT key words and then tray the error in a when block.

The problem is I'm getting the following error when compiling:

Error(24,31): PLS-00109: unknown exception name 'FILE_NOT_AVAILABLE' in PRAGMA EXCEPTION_INIT

The procedure is show below with the new code show in bold.

create or replace
p_filename varchar2,
p_recordcount OUT number,
p_errorcode OUT number

cursor c_v_logmnr_contents is
logmnr.logmnr_sequence.nextval as IDX,
v$logmnr_contents V
seg_owner = 'SONICA' and
operation in ('INSERT','UPDATE','DELETE');

output_rec c_v_logmnr_contents%ROWTYPE;
v_idx number;

PRAGMA EXCEPTION_INIT(file_not_available, -1284);


p_recordcount := 0;
p_errorcode := 0;

execute immediate 'truncate table logmnr.logmnr_contents';
execute immediate 'commit';

dbms_logmnr.add_logfile(LogFileName => p_filename, Options => dbms_logmnr.NEW);

dbms_logmnr.start_logmnr(DictFileName => 'G:\dtb1\TURLIVE\utl_dir_file\TURLIVE_DICTIONARY.ORA',
Options => dbms_logmnr.committed_data_only);

open c_v_logmnr_contents;

v_idx := 0;

fetch c_v_logmnr_contents into output_rec;
exit when c_v_logmnr_contents%NOTFOUND;
insert into logmnr.logmnr_contents values output_rec;
v_idx := v_idx + 1;
end loop;

close c_v_logmnr_contents;


dbms_output.put_line('. ');
dbms_output.put_line('Records fetched in cursor loop = ' || TO_CHAR(v_idx));
dbms_output.put_line('. ');

p_recordcount := v_idx;



when file_not_available
then null;

when others then
p_errorcode := sqlcode;


Answer: By Steve Callan:  You need to declare declare file_not_available as a PL/SQL exception:

output_rec c_v_logmnr_contents%ROWTYPE;
v_idx number;

file_not_available exception; --***********************
PRAGMA EXCEPTION_INIT(file_not_available, -1284);

Get the Complete
Oracle SQL Tuning Information 

The landmark book "Advanced Oracle SQL Tuning  The Definitive Reference"  is filled with valuable information on Oracle SQL Tuning. This book includes scripts and tools to hypercharge Oracle 11g performance and you can buy it for 30% off directly from the publisher.



Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


Copyright © 1996 -  2020

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.



Oracle Training at Sea
oracle dba poster

Follow us on Twitter 
Oracle performance tuning software 
Oracle Linux poster