It is set....
utl_file_dir=*


Thanks

Mark


On Tue, Apr 03, 2001 at 03:24:20PM +1000, Steven Baldwin wrote:
> Don't forget you need to have an entry in the init file (utl_file_dir=...)
> to include the directory you are trying to access.
> 
> -----Original Message-----
> From: Sterin, Ilya [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, 3 April 2001 2:07 PM
> To: Mark Wagner; [EMAIL PROTECTED]
> Subject: RE: help needed oracle utl_file access
> 
> 
> Have you tried to run you PL/SQL in sqlplus to see if they work there.  I
> would recommend printing them out than copy and paste to command prompt,
> since after interpolation, etc... it might not come out as you expected.
> 
> Ilya Sterin
> 
> -----Original Message-----
> From: Mark Wagner [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 02, 2001 5:16 PM
> To: '[EMAIL PROTECTED]'
> Subject: help needed oracle utl_file access
> 
> 
> I am having problems trying to do file access....
> 
> Here is my code:
> 
>                 $statement = "ALTER DATABASE BACKUP CONTROLFILE TO TRACE";
>                 $updated=$dbh->do($statement);
>                 if ($updated){
>                         print "Control File Backed up to Trace<br>";
>                         $statement = "select d.value, '\\', 'ora_' || p.spid
> || '.trc' trace_file_name
>                                         from ( select p.spid
>                                             from
>                                               sys.v\$mystat m,
>                                               sys.v\$session s,
>                                               sys.v\$process p
>                                             where
>                                               m.statistic# = 1 and
>                                               s.sid = m.sid and
>                                               p.addr = s.paddr
>                                           ) p, ( select value
>                                             from
>                                               sys.v\$parameter
>                                             where
>                                               name = 'user_dump_dest'
>                                           ) d";
> 
>                         $getlogfile = $dbh->prepare($statement);
>                         $getlogfile->execute();
>                         while (@logfiles = $getlogfile->fetchrow_array ) {
>                                 print " $logfiles[0]$logfiles[1]$logfiles[2]
> <br>";
>                                 $path = $logfiles[0];
>                                 $tracefile = $logfiles[2];
>                         }
>                         $getcontrolfiles->finish;
>                         $statement = "create or replace package perl_global
> as
>                                             fd      utl_file.file_type \;
>                                         end perl_global\;";
>                         $updated=$dbh->do($statement);
> 
>                         $statement = "BEGIN
>                         perl_global.fd := utl_file.fopen ('$path',
> '$tracefile', 'r') \;
>                         END \;";
>                         print $statement;
>                         $csr_open = $dbh -> prepare ($statement);
>                         $csr_open -> execute ;
>                         $statement = "BEGIN
>                                 utl_file.get_line (perl_global.fd, :line) \;
>                                 :more := 'Y' \;
>                             EXCEPTION
>                                 WHEN NO_DATA_FOUND THEN
>                                     :more := 'N' \;
>                             END \;";
> 
>                         print $statement;
> 
>                         $csr_read = $dbh -> prepare ($statement);
> 
>                         $Line = "" ;
>                         $csr_read -> bind_param_inout (":line", \$Line, 256)
> ;
>                         $csr_read -> bind_param_inout (":more", \$More, 5) ;
>                         while ($More eq "Y") {
>                             $csr_read -> execute ;
>                             last if $More eq "N" ;
>                             print $Line . "\n" ;
>                         }
>                  }else{
>                         print "Control File Failed to backup to trace
> file<br>";
>                 }
> 
> 
> 
> Here is my error:
> 
> Control File Backed up to Trace<br>
> E:\Oracle\admin\LLPROD\udump\ora_2828.trc <br>BEGIN
>                         perl_global.fd := utl_file.fopen
> ('E:\Oracle\admin\LLPROD\udump', 'ora_2828.trc', 'r') ;
> DBD::Oracle::st execute failed: ORA-06510: PL/SQL: unhandled user-defined
> exception
> ORA-06512: at "SYS.UTL_FILE", line 98
> ORA-06512: at "SYS.UTL_FILE", line 157
> ORA-06512: at line 2 (DBD ERROR: OCIStmtExecute) at ./documentor.pl line
> 189.
>                         END ;
> 
> 
> 
> Thanks for any help you can give.....
> 
> Mark Wagner

-- 
--------------------------------------------------------------------
Mark Wagner                                   Phone - (510) 683-9681
Database Administrator                             [EMAIL PROTECTED]
*     www.oralinux.org    www.orasolaris.org    www.orant.org      *
*          Dark Oracle of the Sysadmin Sith Darth SYSDBA           *
--------------------------------------------------------------------
the shit ain't over till the last record spins.......

Reply via email to