Setting Oracle Permissions for file access from a pl/sql function

I have a pl/sql function that calls a java method which moves a
file from a directory to another.
Since we are using Linux, Oracle wants some permissions.
Those permissions are set using:
call dbms_java.grant_permission(USER, 'java.io.FilePermission',
FILE, permission)
OK, i want to use this in my pl/sql function, but it doesn't
work.
My function looks like something like this:
-- some pl/sql code
dbms_java.grant_permission(someUSER, 'java.io.FilePermission',
sourceFILE, 'write');
dbms_java.grant_permission(someUSER, 'java.io.FilePermission',
destFILE, 'write');
flag := move(sourceFILE, destFILE);
-- flag is for 1 -> done and 0 -> error
-- some more code ...
The problem is the lines of
dbms_java.grant_permission(someUSER, 'java.io.FilePermission',
sourceFILE, 'write');
do not work!
When i grant permissions manually in sql plus it works great,
but when i do it from the function it does not work!
Any ideas anyone?
Any help would be appreciated.

The command :
dbms_java.grant_permission
(someUSER, 'java.io.FilePermission',sourceFILE, 'write');
is right.
Open sqlplus
Connect as sys or system
type :
execute dbms_java.grant_permission
(someUSER, 'java.io.FilePermission',sourceFILE, 'write');
commit;
try to compile again your procedure...does it work now ?
bye
Giovanni Regola

Similar Messages

  • Setting up permissions for shared access

    I'm at work as we have 2 macs set up
    I'm on Mac_A and my collegue is on MAC_B
    He edits the work on MAC_B and once he has finished he Saves it across to MAC_A Desktop
    This was all working fine until I did a reinstall of MAC_A. Now when he copies the data across it copies it in and leaves the no entry sign up and I have to go in and change the permissions. How can I set this up to avoid changing it everytime.
    I obviously set it up with no problems in the beginning, just can't remember.
    Many thanks
    Matt

    I've worked it out, I need to avoid all the accounts sharing.
    In System preferences enable file sharing. Then use the
    afp://172.0.1...... that is given.
    On the other computer go to Finder connect to server it will ask for a password and then the user has full access.
    When they drop it on the desktop the other user will have full control.

  • How to set default permissions for files and folders

    We have mac and windows computers on a network where we use Mac OSX Server 10.4 to share files. When files are created on windows computer, no problem, all users can read/write these files. However on our 2 macs (1 10.3 and 1 10.4), other users are blocked from using the files, only the owner has "read/write", group and others are "read only". As far as I can tell, file sharing is turned on ok in Workgroup Manager for the folders we share files from. How can we establish sharing for all users on our network?

    Niel's suggestion is good. You might also try posting your question in the Tiger Server forums. I'm sure Tiger Server has several ways of dealing with this.

  • When setting up permissions for application files--URGENT

    Hello All,
    when setting up permissions for application files,
    Is this following permisson appropriate?
    If application files are owned by a single owner,
    that owner should be the oracle user.
    DN

    Here is my question again.
    when setting up permission for application file, which permission is
    appropriate?
    a) If application files are owned by a sigle owner,that owner should be oracle
    user.
    b) Application files should be owned by oracle user
    c) Application files should be owned by single user.

  • I have a mac mini server which I want to set up for remote access from windows and mac pcs.  How do I do this.  I can access it form my home network OK

    I have a mac mini server which I want to set up for remote access from windows and mac pcs.  How do I do this.  I can access it form my home network OK

    Posted in error.

  • Set windows permissions for folder

    My labview app is being installed to the prog files dir for the app by an installer created by the LV Dev System.  i encounter a problem when trying to store a config file for the app to the directory during user customization of settings after app installation because the file I am trying to update is read only due to win 7 defaults.  I try to set the permissions for the folder programmatically, but it does not change the folder to a NOT read only one.  What is the trick here?  Do I need to put my config files in another directory somewhere or is ther a way to change the folder settings so I can create temp files in that folder?

    Creating temporary config files in Program Files is not very good practice. I would do it in the public user folder.
    How are you setting the parameters?
    Did you use the following?
    http://zone.ni.com/reference/en-XX/help/371361J-01/glang/set_permissions/
    http://zone.ni.com/reference/en-XX/help/371361J-01/glang/setting_permissions/
    Excerpt from the link above:
    You can use permissions to change only write permissions for users (bit 7); the operating system ignores all other changes to the bits.
    Beginner? Try LabVIEW Basics
    Sharing bits of code? Try Snippets or LAVA Code Capture Tool
    Have you tried Quick Drop?, Visit QD Community.

  • JAAS - How to set up permissions for a specific code?

    I would like to set up permissions for specific code in JAAS policy files.
    In other words, let's say I have the followiong entry:
    permission java.util.PropertyPermission "java.home", "read";
    Then, when I do Subject.doAsPrivileged(..., MyAction), if this permission is absent, I will not be able to access the "java.home" property in my MyAction.
    If I, let's say, set up a file permission, I will not be able to read certain files if the permission is absent.
    I want something simpler. I want to be able to specify that the whole class MyAction cannot be executed if the permission is absent - I do not want the code to even go there. Basically, if the necessary entry in the Policy file is not present, I do not want the calling code to have access to class com.mypackage.MyAction.
    This must be really straight-forward, what am I missing?

    Thank you for your input.
    My case is a little bit more complex.
    There is a request and approval process attached to the provision to this target system.
    The approval process has a first level of approval (including 1 to many approval steps) and the user gets the basic access to this target system. The user can then access the target system but is limited to what he/she can do.
    Then the approval goes to a second level of approval (including many approval steps) and if approved the user gets the elevated access to this target system.
    To accomplish this, the previous implementer created 2 resources for the same target. After the first level of approval, he provisioned resource A to the user. After the second level of approval, he provisioned resource B to the user, revoked resource B, and updated resource A.
    This is very confusing because we are dealing with 2 resources for the same target.
    I am looking for way to take advantage of the GTC to provision and reconcile with a system that takes a flat file and can write a flat file. But I also need to make it work with this approval nightmare.
    Do you have any ideas on how to make this better and simpler?
    Thanks
    Khanh

  • [SOLVED] setting up permissions for mounted usb devices

    Hi all,
    I've been having the following problem when mounting my external hd: in order to mount the external hd I created a folder /mnt/usbstick/ giving permissions to a non-root user to read the files/directories in this folder (using chmod); however, after I mount the external hd, the set of permissions for /mnt/usbstick/ change so that a non-root user cannot  read the mounted files in /mnt/usbstick. This is a problem for me because, when I copy a file from the external hd to the non-root home folder, the copied file can only be read by the root user.   
    Do you know how I can solve this problem? Should I write a udev rule and place it at /etc/udev/rules.d/? Or should I simply add the non-root user to a specific group from /etc/group? Any ideas?
    Thanks!
    Last edited by falsum (2010-05-08 09:21:59)

    You could try adding an entry for your usb device in /etc/fstab and specify the option user to let non-superusers mount it.
    Here's an example of an entry for my external HD. I'm sure there are probably other (and better) ways to do this but it works for me.
    UUID=4376-0BFB /media/FIRELITE vfat rw,user,noauto,async 0 0
    Nice howto found on the wiki: http://wiki.archlinux.org/index.php/Fstab

  • How do we set the permissions for....

    Using Acrobat 9, Setting permissions is very confusing!
    How do we set the permissions for document so that:
    -- the end user needs no password
    -- Printing: Allowed
    -- Changing the Document: Not Allowed
    -- Doument Assembly: Not Allowed
    -- Content Copying: Not Allowed
    -- Content Copying for Accessability: Not Allowed
    -- Page Extraction: Not Allowed
    -- Commenting: Allowed
    -- Filling of Form Fields: Allowed
    -- Signing: Not Allowed
    -- Dreating of Template Pages: Not Allowed

    Not possible. If you allow filling in forms you must allow signing. BTW, while it is nice to be able to set permissions anything that depends upon passwords that you set is easily overcome by third party utilities. Don't do anything that really depends upon these permissions. If you want to set permissions using the Document Properties Dialog box (control D), then click on the Security button. In the Security Method Dialog box, select password security and fill it out as you need.

  • Setting archive attribute for files

    Hi,
    I've written a program to make backups from files. I'd like to set archive attributes for files so the program knows which files have changed since the last backup.
    Is there any way to do that?

    nope,
    unless you write your own dll with VB or C++ and call this through native methods.
    Try to find a workaround.

  • Is there a way I can set iTunes to add files automatically from a folder in my Windows PC?

    Is there a way I can set iTunes to add files automatically from a folder in my Windows PC and ensure that it is synced automatically? For example, if I add or modify a file in that folder it should be added to iTunes automatically. At the same time the original files in the folder should not be re-organized. That is can I just point to a music folder in my hard drive and sit back for iTunes to do the rest?

    Rishitani wrote:
    ..is there a way i can get it to start apart from restoring...
    Nope.
    Restore “...
    http://support.apple.com/kb/HT1414
    If necessary Place the Device into Recovery mode...
    http://support.apple.com/kb/HT1808
    Note on Recovery Mode.
    You may need to try this More than Once...
    Be sure to Follow ALL the Steps...
    Once you have Recovered your Device...
    Re-Sync your Content or Restore from the most recent Backup...
    Restore from Backup
    http://support.apple.com/kb/ht1766

  • Read-only file access from network volume

    I get an read-only file access from network volume problem while sharing a drive from Snow Leopard to a Tiger install. Most of files were opening well, but *.fp7 (FileMaker) and *.xls (Excel) files won't open dealing with a read-only error.
    As descibed in the last post of http://discussions.apple.com/thread.jspa?threadID=1406977 the client have the same share name of the server. Renomming it resolved the error!
    Thanks!

    right then, as it looks like I'm talking to myself....
    I have just wiped clean the Macbook Pro.
    I installed Leopard from scratch, then installed Office 2008.
    Logged back onto the network share, and the read-only error came up again, ONLY in Excel.
    bugger.
    Did the same thing with my Macbook and all is fine.
    Copy the file to the local hard drive, opens ok.
    I then copied the file to another Mac on the network.
    mmmm, opens fine.
    what's the difference....
    mmmm, the machine it opens fine from is running 10.4
    the machine which hosts all the data is running 10.3.9
    could this be the problem.
    Just done a software update check on the 10.3 machine and there are some security updates that need doing.
    Going to run that now and see what happens, otherwise I think the iMac running 10.3.9 is going to need to come up to 10.4 and fingers crossed this will solve it.

  • [New_Feature_Requirement] [iOS 8] Detecting permissions for camera access

    Here is the feature request: Feature#3837401 - [New_Feature_Requirement] [iOS 8] Detecting permissions for camera access
    Problem: The camera privacy control is now required by iOS 8 for all regions. With iOS 8 any application that use camera encountered with a dialog asking for permission.
    http://useyourloaf.com/blog/2014/07/16/ios-8-camera-privacy-settings.html
    But we cannot detect permission for camera access by AIR.
    StatusEvent event not firing by AIR: "Note: This event is not dispatched on the AIR platform. It is used only in Flash Player."
    Camera - Adobe ActionScript® 3 (AS3 ) API Reference
    So, if user don't allow use camera our application even cannot detect that. It could make application useless. Also it could cause problems with our applications in AppStore.
    Please consider to provide some way to handle camera access. It could be StatusEvent like with Flash Player.

    "Do Not Put iOS8 on an iPhone 4S"
    http://gizmodo.com/dont-put-ios-8-on-your-iphone-4s-1635763610?utm_medium=referr al&utm_source=pulsenews

  • Control/set a limit for file attachment

    Hello,
    I would like to know if there is a way to control/set a limit for file attachment in Workbench ES. e.g. Assign Task > Attachments & Notes.
    Can you please advise.
    Thanks,
    Han Dao

    No. You would have to customize Workspace to do that.
    Jasmin

  • Pass a value from a PL/SQL function to a javascript (html header) ? ?

    Hey Guys,
    Have a question regarding how to pass a value from a PL/SQL function to a javascript in the HTML Header.
    I have created a PL/SQL function in my database, which does looping.
    The reason for this is:  On my apex page when the user selects a code, it should display(or highlight buttons) the different project id's present for that particular code.
    example= code 1
    has project id's = 5, 6, 7
    code 2
    has project id's = 7,8
    Thank you for your Help or Suggestions
    Jesh
    The PL/SQL function :
    CREATE OR REPLACE FUNCTION contact_details(ACT_CODE1 IN NUMBER) RETURN VARCHAR2 IS
    Project_codes varchar2(10);
    CURSOR contact_cur IS
    SELECT ACT_CODE,PROJECT_ID
    FROM ACTASQ.ASQ_CONTACT where ACT_CODE = ACT_CODE1;
    currec contact_cur%rowtype;
    NAME: contact_details
    PURPOSE:
    REVISIONS:
    Ver Date Author Description
    1.0 6/25/2009 1. Created this function.
    BEGIN
    FOR currec in contact_cur LOOP
         dbms_output.put_line(currec.PROJECT_ID || '|');
         Project_codes := currec.PROJECT_ID|| '|' ||Project_codes;
    END LOOP;
    RETURN Project_codes;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    NULL;
    WHEN OTHERS THEN
    -- Consider logging the error and then re-raise
    RAISE;
    END contact_details;
    /

    Jesh:
    I have made the following modifications to your app to get it to work as I thing you need it to.
    1) Changed the source for the HTML Buttons Region(note use of id vs name for the Buttons)
    <script>
    function hilitebtn(val) {
    //gray buttons
    $x('graduate').style.backgroundColor='gray'
    $x('distance').style.backgroundColor='gray'
    $x('career').style.backgroundColor='gray'
    $x('photo').style.backgroundColor='gray'
    //AJAX call to get project-ids
    var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=GETPROJECTS',0);
    get.addParam('x01',val)
    gReturn = get.get();
    var arr=gReturn.split(':');  //dump into array
    get = null;
    for (i=0;i<arr.length;i++) {
    // alert('val=' + arr);
    if ( arr[i]==5)
    $x('graduate').style.backgroundColor='red';
    if ( arr[i]==6)
    $x('distance').style.backgroundColor='red';
    if ( arr[i]==7)
    $x('career').style.backgroundColor='red';
    if ( arr[i]==8)
    $x('photo').style.backgroundColor='red';
    </script>
    <table cellpadding='0' cellspacing='0' border='0'>
    <tr><td>
    <input type='button' id='graduate' value='Graduate'>
    </td>
    <td>
    <input type='button' id='distance' value='Distance'>
    </td>
    <td>
    <input type='button' id='career' value='Career/Tech'>
    </td>
    <td>
    <input type='button' id='photo' value='Photos'>
    </td>
    </tr></table>
    2) Defined the application process  GETPROJECTS as DECLARE
    IDS varchar2(1000);
    l_act_code varchar2(100) :=4;
    begin
    IDS:='';
    l_act_code := wwv_flow.g_x01;
    for x in(
    SELECT ACT_CODE,PROJECT_ID
    FROM ASQ_CONTACT
    where ACT_CODE = l_act_code)
    LOOP
    IDS := IDS || X.PROJECT_ID|| ':' ;
    END LOOP;
    HTP.PRN(IDS);
    END;
    3) Changed the 'onchange' event-handler on p1_act_code to be 'onchange=hilitebtn(this.value)'
    4) Added the JS to the HTML Page Footer <script>
    hilitebtn($v('P1_ACT_CODE'));
    </SCRIPT>

Maybe you are looking for

  • Problem configure WSDL destination for web services metadata gen and exec

    Hello, First question: Is WSIL supported by an R/3 4.7 ABAP system? If yes I'd like to consume web services from it (Function Modules remote-enabled), through WSIL. I need thus to configure 2 WSDL destinations on the SLD for metadata generation and e

  • Motion with Avid

    I need help badly! I'm on this project that has a tight deadline. I've used motion with FCP in the past with no problem. But for the life of me I can not get the alpha channel to work with Avid. I'm not real knowledgeable in this field. Could someone

  • Migration Workbench Compatability

    Hello, Is Oracle Migration Workbench 1.2.1 is compatable with Oracle Server8 release 8.0.5 or only with Oracle Server release 8i version 8.1.5. When I tried to install Workbench into Oracle8 ver. 8.0.5 home I am getting an error as Installers in the

  • Mac is in warranty please help me wid this issue .

    my mouse is'nt working but it is clicking the cursor is not moving and my imac is in warranty please help me wid this issue. <Edited By Host>

  • No Audio on Youtube ONLY if Video Finishes Loading - Help

    Hi All, I recently upgraded my PC (new everything), and am running Windows 7 Home 64-Bit (w/ all recommended Windows Updates), with the latest version of Firefox (19.0). So if I go to Youtube and try and watch a Video (Flash Player), I get Audio ONLY