create or replace procedure p_outputdebug(a varchar2,b varchar2,c varchar2)
is
vFileName varchar2(100);
OutputFile UTL_FILE.FILE_TYPE;
begin
select 'alert_'||a.instance_name||'.log'
into vFileName
from v$instance a
;
OutputFile := utl_file.fopen('background_dump_dest',vFileName,'a');
utl_file.putf(OutputFile,a,b,c);
utl_file.fflush(OutputFile);
utl_file.fclose(OutputFile);
end ;