1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Changing ownership with UTL_FILE

Discussion in 'SQL PL/SQL' started by prashant, Jan 5, 2010.

  1. prashant

    prashant Forum Advisor

    Messages:
    85
    Likes Received:
    7
    Trophy Points:
    160
    Location:
    New Delhi, India
    Hi,

    Can anyone please tell me if there is a way to change file 'OWNERSHIP' using UTL_FILE.

    By default the ownership is 'oracle' os user, i would like to change just the owner and not group. Please let me know if this is possible.

    Platform : HPUX/AIX
    DB Version : 10.2.0.4

    Regards,
    Prashant
     
  2. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,347
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    No. it is not possible with UTL_FILE. You might try writing an external procedure to do that.
     
  3. prashant

    prashant Forum Advisor

    Messages:
    85
    Likes Received:
    7
    Trophy Points:
    160
    Location:
    New Delhi, India
    Thank you for your reply Zargon.

    I would also like to know if we can use UTL_FILE for setting permissions on the file.

    Something similar to the following command in Unix:-

    $ chmod 644 file_name

    Regards,
    Prashant
     
  4. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,347
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    No; you cannot change ownership or permissions on a file wth UTL_FILE. Please look at the available procedures and functions in the UTL_FILE package; the utility is written to write to new and existing files, not change ownership or permissions on those files.
     
  5. prashant

    prashant Forum Advisor

    Messages:
    85
    Likes Received:
    7
    Trophy Points:
    160
    Location:
    New Delhi, India
    Thanks Zargon. I just went through note ID 74268.1

    Basically umask setting of Oracle instance user, will have direct impact on the file permissions.

    Thanks once again.

    Regards,
    Prashant
     
  6. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,347
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    Correct and that's a UNIX/Linux setting, NOT a function of UTL_FILE.