Home » SQL & PL/SQL » SQL & PL/SQL » what is the valid parameter to utl_file (pl/sql)
what is the valid parameter to utl_file [message #428715] Thu, 29 October 2009 11:14 Go to next message
sivaora
Messages: 119
Registered: October 2009
Location: Hyderabad
Senior Member
i have grant prvillage to scott from sysdba to access utl_file package by doing this
>grant execute on utl_file to scott;
grant succeeded.

- then in first argument i have given several file paths but it always displays the error message like this.

ORA-29280: invalid directory path
ORA-06512: at "SYS.UTL_FILE",

what is the valid path to give and how to know it, if any one knows
please reply me.
Re: what is the valid parameter to utl_file [message #428716 is a reply to message #428715] Thu, 29 October 2009 11:24 Go to previous messageGo to next message
Its_me_ved
Messages: 979
Registered: October 2009
Location: India
Senior Member
You need to have the privilige to create a DIRECTORY on the server.

Quote:

ORA-29280: invalid directory path

Cause: A corresponding directory object does not exist.

Action: Correct the directory object parameter, or create a corresponding directory object with the CREATE DIRECTORY command.

This error is common when a fully-qualified path name cannot be determined, and the most common cause of the ORA-29280 error is a missing directory declaration. The utl_file_fcopy procedure accepts these arguments (location, filename, dest_dir, dest_file, start_line, end_line).
create directory alert_dir as '/u01/app/oracle/mysid/pfile';

create directory tempdir as '/tmp';

utl_file.fcopy(
   src_location      => 'alert_dir',
   src_filename      => 'alert_log',
   dest_location     => 'tempdir',
   dest_filename     => 'alert_keep',
   start_line        => 1,
   end_line          => 50
   );

[Updated on: Thu, 29 October 2009 11:28] by Moderator

Report message to a moderator

Re: what is the valid parameter to utl_file [message #428718 is a reply to message #428715] Thu, 29 October 2009 11:32 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
In addition CREATE DIRECTORY is a DBA level statement.
Ask your DBA to create it for you and ask him/her to grant you access to this directory.

Regards
Michel
Re: what is the valid parameter to utl_file [message #428723 is a reply to message #428718] Thu, 29 October 2009 11:43 Go to previous messageGo to next message
sivaora
Messages: 119
Registered: October 2009
Location: Hyderabad
Senior Member
i have the sysdba username and password.
i can connect as sysdba.
then what i have to do.
Re: what is the valid parameter to utl_file [message #428725 is a reply to message #428723] Thu, 29 October 2009 11:53 Go to previous message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
- Never ever use SYS (or SYSDBA) but for maintenance purpose (startup, shutdown, backup, recover)
- SYS/SYSDBA is special
- SYS/SYSDBA is Oracle proprietary (try to open a SR/TAR starting with "i did that with SYS/SYSDBA" and you'll see the immediate answer)
- SYS/SYSDBA does not act like any other user
- When you use SYS/SYSDBA Oracle deactivates some code path and activates others
- Whatever you do with SYS/SYSDBA will neither validate nor invalidate the same thing with any other user.

NEVER EVER use SYS/SYSDBA for anything that can be done by another user.
Use SYS/SYSDBA ONLY for something that can't be done by someone else.


Regards
Michel
Previous Topic: simultaneous multi-user application
Next Topic: Update Problem
Goto Forum:
  


Current Time: Sat Dec 10 17:00:38 CST 2016

Total time taken to generate the page: 0.19890 seconds