# Database Discussions > Oracle >  Ora-06502: Pl/sql

## dngaya

Hello,
I have a oracle9.2.0.6 installed in windows 2000. Now, i want to test the package  that_darn_alert_log  for the author James Koopmann
who is in the site :http://www.databasejournal.com/featu...0893_3295321_3 




> CREATE OR REPLACE PACKAGE 
>           that_darn_alert_log 
> 	  AS
> 
>  PROCEDURE bdump_dir_setup;
>  PROCEDURE build_possible_alert_log_names;
>  PROCEDURE build_alertlog_name;
>  PROCEDURE check_alertlog_name;
>  PROCEDURE read   (in_date_offset IN NUMBER);
> ...


this package install succefull but when i want to execute the procedure:

exec that_darn_alert_log.list(30);

i receive the error message follow:


BEGIN that_darn_alert_log.list(30); END;

*
ERREUR Ó la ligne 1 :
ORA-06502: PL/SQL : erreur numÚrique ou erreur sur une valeur: invalid LOB locat
275
ORA-06512: Ó "SYS.DBMS_LOB", ligne 485
ORA-06512: Ó "SYS.THAT_DARN_ALERT_LOG", ligne 78
ORA-06512: Ó "SYS.THAT_DARN_ALERT_LOG", ligne 181
ORA-06512: Ó ligne 1


how i can to resolve it ?.

thank you for your assistance.

----------


## jkoopmann

hello dngaya,
this error is typically seen because the directory object has not been setup (step 4) of the following steps that were in the article.

It may be that you do not have privileges to create a directory so you may need to check that.
How to Use

1.      log into your database of choice as the SYS user

2.      compile the package

SQL> @that_darn_alert_log

3.      set serveroutput on

SQL> set serveroutput on

4.      initial setup of directory object

SQL> exec that_darn_alert_log.bdump_dir_setup

5.      to read and display the current alert log

SQL> exec that_darn_alert_log.read(0)

6.      to archive the current alert log

SQL> exec that darn_alert_log.archive

7.      to list all archived logs starting 30 days from current date

SQL> exec that_darn_alert_log.list(30)

8.      to remove a single archived log with date offset of 45

SQL> exec that_darn_alert_log.remove(45,0)

9.      to remove all archived logs from the last week

SQL> exec that_darn_alert_log.remove(14,6)

----------


## dngaya

Hello,
thank you for your response.
i log into my database as the SYS user
2. compile the package

SQL> @that_darn_alert_log

3. set serveroutput on
SQL> set serveroutput on

SQL> exec that_darn_alert_log.bdump_dir_setup;
 but when i want to read and display the current alert log
SQL> exec that_darn_alert_log.read(0);

i receive always the error message:

SQL> exec that_darn_alert_log.read(0);
BEGIN that_darn_alert_log.read(0); END;

*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: invalid LOB locator specified:
ORA-22275
ORA-06512: at "SYS.DBMS_LOB", line 485
ORA-06512: at "SYS.THAT_DARN_ALERT_LOG", line 78
ORA-06512: at "SYS.THAT_DARN_ALERT_LOG", line 105
ORA-06512: at line 1

How i can to resolve this problem ?
thank you for your assistance.

----------


## jkoopmann

i would really like to see the output after you issue:

exec that_darn_alert_log.bdump_dir_setup

and see that it did/did not create the directory. you should get :

PL/SQL procedure successfully completed.

also, issue the following SQL to show the directory was created:

select * from dba_directories where directory_name = 'BDUMP_DIR';

please provide the output

----------


## dngaya

hi,
when i execute exec that_darn_alert_log.bdump_dir_setup
and the request:
select * from dba_directories where directory_name = 'BDUMP_DIR';

i get :

SQL> select * from dba_directories where directory_name = 'BDUMP_DIR';

OWNER                          DIRECTORY_NAME
------------------------------ ------------------------------
DIRECTORY_PATH
--------------------------------------------------------------------------------
SYS                            BDUMP_DIR
/data/ora_bd.AIARCT/admin/bdump


thank you.

----------

