Granting read/write permissions on Oracle Server processes

Hi
I'm trying to set up a BFILE datatype in a table. I have created the directory and the current user has permissions to read and write to that folder. (The current user has the create any directory permission granted). The insert statement does not give an error but when I look at the table the BFILE column contains an error of <Value Error>.
I suspect it may be because the current user does not have server read/write permissions on the directory I'm using. Can anybody help me with a correcting this please?
Here is what I've used so far:
CREATE or replace DIRECTORY pic_dir AS 'c:\temp'
INSERT INTO picture (pic_id, filename)
VALUES (1, bfilename('pic_dir', 'image1.jpg'))

Many thanks for the reply.
I am using the procedure as below (formats better if copied into Notepad). Gives me an error of "ORA-22285: non-existent directory or file for FILEOPEN operation" referring to the line containing the DBMS_LOB.FILEOPEN command.
I suspect there is something wrong with the SELECT statement because I can get the procedure to run fine on the text file if I provide the BFILE location directly into the bfile_loc variable (as opposed to using the SELECT statement to retrieve it from the db).
I created a directory: CREATE OR REPLACE DIRECTORY pic_dir AS 'C:\temp'
I then created a table: CREATE TABLE picture (pic_id NUMBER, filename BFILE)
Next I added a row: INSERT INTO picture VALUES(1, BFILENAME('pic_dir', 'testfile.txt'))
CREATE OR REPLACE PROCEDURE read_bfile IS
sep_char CONSTANT RAW(100) := UTL_RAW.CAST_TO_RAW(CHR(32));      --separating character (space)
end_file CONSTANT RAW(100) := UTL_RAW.CAST_TO_RAW(CHR(10));      --end of file character (new line)
bfile_loc BFILE;                               --pointer to BFILE
cur_pos NUMBER := 1;                          --current position in file
char_read BINARY_INTEGER := 0;                     --number of characters read
read_buff VARCHAR2(500);                          --read buffer
end_word NUMBER;                              --end of current word
ret_val BOOLEAN := FALSE;                         --return value
BEGIN
select filename into bfile_loc from picture where pic_id = 1;
DBMS_LOB.FILEOPEN(bfile_loc, dbms_lob.file_readonly);
LOOP
-- establish end of current word
end_word := DBMS_LOB.INSTR(bfile_loc, sep_char, cur_pos, 1);
-- process end-of-file
IF (end_word = 0) THEN
end_word := DBMS_LOB.INSTR(bfile_loc, end_file, cur_pos, 1);
char_read:= end_word - cur_pos - 1;
DBMS_LOB.READ(bfile_loc, char_read, cur_pos, read_buff);
dbms_output.put_line(UTL_RAW.CAST_TO_VARCHAR2(read_buff));
EXIT;
END IF;
-- read until end-of-file
char_read:= end_word - cur_pos;
DBMS_LOB.READ(bfile_loc, char_read, cur_pos, read_buff);
dbms_output.put_line(UTL_RAW.CAST_TO_VARCHAR2(read_buff));
cur_pos := cur_pos + char_read+ 1;
END LOOP;
DBMS_LOB.CLOSE(bfile_loc);
END;

Similar Messages

  • ATTN Java Gurus: udf.policy - Unable to Grant Read,Write to Specific File

    NOTE: A correct answer to this question will receive the rarely used OTN 25pt <font color="silver" size="3" face="script">Platinum Star</font><font color="silver" size="4" face="script"> &#9733;</font> *
    Essbase 9.3.1
    Using a Java CDF that reads and writes to a file
    I'm trying to grant permission to a specific file in the file system by granting permission in the udf.policy file.
    When I uncomment the line permission java.security.AllPermission; the CDF works fine and interacts with the file correctly. This is just to prove that the CDF works, I need to tighten this up to a single file. I stop and start the app after each edit.(I've also tried bouncing the Essbase server too)
    When I use the following, I get an exception, shown below. Nothing of consequence is being written to the app or essbase logs
    grant {
      permission java.io.FilePermission "C:/test/essbase/CalcProfile.db", "write, read";
    };java.security.AccessControlException: access denied (java.io.FilePermission C:\esstest\Server\PlugIns\Essbase read)
         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
         at java.security.AccessController.checkPermission(AccessController.java:546)
         at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
         at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
         at com.hyperion.essbase.calculator.ESecurityManager.checkRead(ESecurityManager.java:80)
         at java.io.File.exists(File.java:731)
         at org.sqlite.Conn.open(Conn.java:98)
         at org.sqlite.Conn.<init>(Conn.java:57)
         at org.sqlite.JDBC.createConnection(JDBC.java:77)
         at org.sqlite.JDBC.connect(JDBC.java:64)
         at java.sql.DriverManager.getConnection(DriverManager.java:582)
         at java.sql.DriverManager.getConnection(DriverManager.java:207)
         at com.accelatis.essbase.calcprofile.cdf.CalcComment.calcComment(CalcComment.java:16)
    >
    I've tried creating the policy using PolicyTool, same result. However, I have no idea what or if I should put in the "CodeBase" field.
    Has anyone had success creating read & write permissions to a single file using the udf.policy file? What is the magic syntax?
    Regards,
    Robb Salzmann
    * <font face="small" size=".2em" color="silver">right after the platinum star award is created</font>

    Hi Robb,
    Never heard of the OTN 25pt Platinum Star award... It sounds appetizing, but I know I won't get it since I've got no Java experience. :)
    I was just gonna ask if you've thought about posting the same question on one of the Java forums?
    https://forums.oracle.com/forums/category.jspa?categoryID=285
    Cheers,
    Mehmet

  • Grant change(write) permissions to an already existing bulk shares folder

    Hello,
    We had a server crash (Windows 2003) and I had to bring it up on new VM.  I have used net share to create my shares, however after doing so, the share permissions for "Everyone" are only set to read.  What I need to do is modify the current
    folders so "Everyone" has read/write access. 
    net share    SHARENAME$=''\\servername\d$\folder_path\folder_path\FOLDERtoSHARE''   
    Above is the command I used. How would I grant "Everyone" read/write permissions.  I guess now the question is how do I grant CHANGE (write) permissions to "Everyone" since they can all view their folders, but cannot
    add to or edit them.
    Currently I have to go to the properties of each folder, click Sharing, the Permissions and edit "Everyone" permissions to read/change.  I have a lot of folders and this could take awhile doing it manually.  I know I'm close, just cant
    find the right syntax.
    Please help!
    Thanks
    Cheston

    This is the powershell forum; are you looking specifically for a powershell solution? If so, what powershell commands have you tried so far? If not, try a forum more specific to your problem space.
    Al Dunbar -- remember to 'mark or propose as answer' or 'vote as helpful' as appropriate.

  • How do you create default Read/Write Permissions for more than 1 user?

    My wife and I share an iMac, but use separate User accounts for separate mail accounts, etc.
    However, we have a business where we both need to have access to the same files and both have Read/Write permissions on when one of us creates a new file/folder.
    By default new files and folders grant Read/Write to the creator of the new file/folder, and read-only to the Group "Staff" in our own accounts or "Wheel" in the /Users/Public/ folder, and read-only to Everyone.
    We are both administrators on the machine, and I know we can manually override the settings for a particular file/folder by changing the permissions, but I would like to set things up so that the Read/Write persmissions are assigned for both of us in the folder for that holds our business files.
    It is only the 2 of us on the machine, we trust each other and need to have complete access to these many files that we share. I have archiveing programs running so I can get back old versions if we need that, so I'm not worried about us overwriting the file with bad info. I'm more concerned with us having duplicates that are not up to date in our respective user accounts.
    Here is what I have tried so far:
    1. I tried to just set the persmissions of the containing folder with us both having read/write persmissions, and applied that to all containing elements.
    RESULT -> This did nothing for newly created files or folders, they still had the default permissions of Read/Write for the creating User, Read for the default Group, Read for Everyone
    2. I tried using Sandbox ( http://www.mikey-san.net/sandbox/ ) to set the inheritance of the folder using the methods laid out at http://forums.macosxhints.com/showthread.php?t=93742
    RESULT -> Still this did nothing for newly created files or folders, they still had the default permissions of Read/Write for the creating User, Read for the default Group, Read for Everyone
    3. I have set the umask to 002 ( http://support.apple.com/kb/HT2202 ) so that new files and folders have a default permission that gives the default group Read/Write permissions. This unfortunately changes the default for the entire computer, not just a give folder.
    I then had to add wife's user account to the "Staff" group because for some reason her account was not included in that. I think this is due to the fact that her account was ported into the computer when we upgraded, where as mine was created new. I read something about that somewhere, but don't recall where now. I discovered what groups we were each in by using the Terminal and typing in "groups username" where username was the user I was checking on.
    I added my wife to the "Staff" group, and both of us to the "Wheel" group using the procedures I found at
    http://discussions.apple.com/thread.jspa?messageID=8765421&#8765421
    RESULT -> I could create a new file using TextEdit and save it anywhere in my account and it would have the permissions: My Username - Read/Write, "Staff" or "Wheel" (depending on where I saved it) - Read/Write, Everyone - Read Only, as expected from the default umask.
    I could then switch over to my wife's account, open the file, edited it, and save it, but then the permissions changed to: Her Username - Read/Write, (unknown) - Read/Write, Everyone - Read Only.
    And when I switch back to my account, now I can open the file, but I can't save it with my edits.
    I'm at my wits end with this, and I can believe it is impossible to create a common folder that we can both put files in to have Read/Write permissions on like a True Shared Folder. Anyone who has used windows knows what you can do with the Shared folder in that operating system, ie. Anyone with access can do anything with those files.
    So if anyone can provide me some insight on how to accomplish what I really want to do here and help me get my system back to remove the things it seems like I have screwed up, I greatly appreciate it.
    I tried to give as detailed a description of the problem and what I have done as possible, without being to long winded, but if you need to know anything else to help me, please ask, I certainly won't be offended!
    Thanks In Advance!
    Steve

    Thanks again, V.K., for your assistance and especially for the very prompt responses.
    I was unaware that I could create a volume on the HD non-destructively using disk utility. This may then turn out to be the better solution after all, but I will have to free up space on this HD and try that.
    Also, I was obviously unaware of the special treatment of file creation by TextEdit. I have been using this to test my various settings, and so the inheritance of ACLs has probably been working properly, I just have been testing it incorrectly. URGH!
    I created a file from Word in my wife's account, and it properly inherited the permissions of the company folder: barara - Custom, steve - Custom, barara - Read/Write, admin - Read Only, Everyone - Read Only
    I tried doing the chmod commands on $TMPDIR for both of us from each of our accounts, but I still have the same behavior for TextEdit files though.
    I changed the group on your shared folder to admin from wheel as you instructed with chgrp. I had already changed the umask to 002, and I just changed it back to 022 because it didn't seem to help. But now I know my testing was faulty. I will leave it this way though because I don't think it will be necessary to have it set to 002.
    I do apparently still have a problem though, probably as a result of all the things I have tried to get this work while I was testing incorrectly with TextEdit.
    I have just discovered that the "unknown user" only appears when I create the a file from my wife's account. It happens with any file or folder I create in her account, and it exists for very old files and folders that were migrated from the old computer. i.e. new and old files and foders have permissions: barara - Read/Write, unknown user - Read Only, Everyone - Read Only
    Apparently the unknown user gets the default permissions of a group, as the umask is currently set to 022 and unknown user now gets Read Only permissions on new items, but when I had umask set to 002, the unknown user got Read/Write permissions on new items.
    I realize this is now taking this thread in a different direction, but perhaps you know what might be the cause of this and how to correct or at least know where to point me to get the answer.
    Also, do you happen to know how to remove users from groups? I added myself and my wife to the Wheel group because that kept showing up as the default group for folders in /Users/Shared
    Thanks for your help on this, I just don't know how else one can learn these little "gotchas" without assistance from people like you!
    Steve

  • Granting read/write to user for SQL agent

    Hi all, I'm new to SQL, SSMS, TSQL etc. How do I grant read/write permission to a user for SQL agent, so they can see the SQL Server Agent part in object explorer?
    Thanks in advance :)

    Hi all, I'm new to SQL, SSMS, TSQL etc. How do I grant read/write permission to a user for SQL agent, so they can see the SQL Server Agent part in object explorer?
    Thanks in advance :)
    Please refer to below two links
    http://msdn.microsoft.com/en-us/library/ms187901.aspx
    http://msdn.microsoft.com/en-us/library/ms188283.aspx
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it.
    My TechNet Wiki Articles

  • Is it possible to change the read/write permissions on a time machine back-up of iTunes? I need to restore it, but old version is locked....

    Is it possible to change the read/write permissions on a time machine back-up of iTunes? I'm needing to restore it as my phone deleted half our playlists during sync  & am not seeing a way to unlock the permissions. I have the current version unlocked, but can't seem to get the backed-up version. When I click on restore I get a pop-up that says iTunes can't be deleted as it is part of the OS. I'm not even trying to delete, just restore the old version. Any suggestions?

    Hmmm, ok I'll give it a shot. I've always had the iTunes sync w/ my phone set up to only load selected playlists to the phone b/c there's a lot more in iTunes than I have room or desire for on my phone. A few months back I started having trouble w/ trying to sync everything & subsequently adding more to the phone than it could hold. The quickest thing at the time was to unclick the sync music option in iTunes so I could still backup the phone to the computer & not have a problem.
    When I asked about it during one-to-one session shortly after, they advised me to delete the music off my phone & then re-sync it to the computer, run a backup of the phone & redownload the music to the phone. When I tried this it ended up deleting all my playlists (but not my husband's) from iTunes. Irritating, but I've been rebuilding the playlists since. I had also unclicked sync music again & an Apple person told me the most likely best fix was to delete & reload iTunes completely.
    A few days ago I realized I hadn't backed up the phone to the computer in over a month so after deleting & reinstalling iTunes, & w/o changing anything (sync music was STILL unchecked) I ran a backup & my phone went from having 4 GB free space to being 2 GB over capacity due to iTunes trying to download the entire music library to the phone. I made a one-to-one appt again & it was suggested AGAIN that I delete all the music off my phone & then resync it to the computer & redownload the music. We did this (though a few random songs that had previously been purchased somehow remained on the phone), I got home, connected the phone & instead of the music that shows  as 'on my device' disappearing from iTunes it just sat there, so, as the guy had told me I MIGHT have to do, I threw all those songs showing in iTunes as being on my phone, in the trash so that it was completely clear.
    At this point I checked sync music, made sure the options were 'selected playlists only', checked the ones from my own list that I wanted (I usually have one playlist of comedians from my husband's folder that I also have on the phone, but didn't check it at this point). It uploaded all my stuff just fine, but for whatever reason when it saw that I wasn't uploading that comedy playlist any longer, it not only didn't upload it but proceeded to delete my husband's entire folder of playlists from iTunes. -_- I got on the phone w/ an Apple support person right away but he wasn't able to tell me anything .. basically said we'll have to rebuild everything. I asked about the possibility of using time machine, he said he's not qualified to answer that, so that's when I started looking around online & found, among others, the link I referenced a couple replies ago.
    I hope this all makes sense. It's been a long-term issue so I'm trying to go from memory as I figured to begin w/ that I had just made a mistake somewhere, so didn't try to document anything. Now w/ it having happened a 2nd time, I'm not sure if it was 'user error' or something else.......

  • Can't update photos using iPhoto 6 - read/write permissions

    Help!
    Before you think this is the standard "iPhoto 6 permissions problem", please read on.
    Upon installing iPhoto 6 and attempting to update my iPhoto Library, I get the dreaded "There is a problem accessing...files in your iPhoto Library folder...Make sure you have read and write permissions for the folder...all enclosed items." This is the problem noted in:
    http://docs.info.apple.com/article.html?artnum=303135
    However, it doesn't tell me what file(s) have the problem, even though the app note says it would for OS 10.3.9. No matter. I simply first did a get info on the iPhoto Library folder verified that it was not locked and that I had read/write permissions. I also applied that to everything inside the folder. Ran iPhoto again...same error.
    Although I didn't get the "repair permissions" error, I did that too. Ditto for the locked files issue reported at:
    http://docs.info.apple.com/article.html?artnum=303232
    After attempting the update at least a dozen times, I even tried the UNIX chmod command (774) on everything in the iPhoto Library folder just in case the "get info" method didn't take. Still get the same error when updating iPhoto 6. What gives!
    I willing to try any suggestions ya'll might have!
    FYI - I do have my older version of iPhoto available and I have a complete backup of my iPhoto Library.
    Thanks!
    david

    Hi David,
    It's up to you, unless someone else comes along with some more things to try.
    I am assuming you still have a version 5 of the iPhoto Library folder in the Finder.
    Rename it to iPhoto Library_old and drag it to the desktop.
    Do a search in the library for Thumbs. this will find all the Thumb folders which you do not want to import into the new Library. Delete those Thumb folders.
    Now you have to decide if you want to import both the Original and Modified versions of a photo, or just the Originals. The problem is, if you import both, they will no longer be linked but will show up as separate photos in the library.
    Actually it is going to be a big pain unless you have just the photos backed up to reimport.
    If you want, you can check out a page I made showing the manual way to import the photos (#3)
    http://homepage.mac.com/loridilo/iPhoto5help/Personal22.html

  • Can PL/SQL read/write from a database server to another server?

    hi,
    please advise.
    thanks

    what i mean is output text file to other servers using pl/sql through utl_file package.No. utl_file reads/writes only on the server where your pl/sql code is running.
    But maybe you could map a network drive. Haven't tried that.

  • I need to copy a file over to my mac from a CD but it won't let me due to read write permissions. is it possible to get around this?

    i need to copy a file over to my mac from a CD but it won't let me due to read write permissions. does anyone know of a way to get around this?
    any assistance will be much appreciated

    i need to copy a file over to my mac from a CD but it won't let me due to read write permissions. does anyone know of a way to get around this?
    any assistance will be much appreciated

  • How To read/write file on remote server in java

    Hi All,
    How To read/write file on remote server in java? I mean using URL - http://www.xyz.com can I right file to that perticular server.
    Thanks in advance

    If your server support a means of uploading files you can.
    A popular means is [http://en.wikipedia.org/wiki/WebDAV]
    However, by default web server don't allow you upload files, its usually something you need to configure or install.
    I suggest you have a look at your web servers documentation.

  • HT2237 what is Error code -8076 get it when changing read/write permissions on an iTunes music folder. I did google it but could not find

    get it when changing read/write permissions on an iTunes music folder. I did google it but could not find anything???

    get it when changing read/write permissions on an iTunes music folder. I did google it but could not find anything???

  • Essential read/write permissions

    Hi there,
    I hope I don't make a fool out of myself with my first question, but after several hours searching the internet (not sure how to name my problem) for answers I'm just gonna ask:
    In our office we have several computers connected, each user can drop stuff in each others dropbox. ok. The problem starts with the permissions of the documents. For each document you have to set them to read/write for the staff, which is not difficult, but annoying. So here is my question: is there a way to tell programms eg TextEdit, PhotoShop,... to create all documents with read/write permissions for me AND the staff? Hope anyone has an idea.
    littleMissNosy

    Two days have passed since your initial post. Recalling reading something similar in the past, if you click on the link shown below, it should provide you with the technical means to achieve your request. Hope it works for you little Miss.
    http://discussions.apple.com/thread.jspa?messageID=10863288#10863288

  • Get Read/Write permissions of application

    Hi,
    I am developing one application by using FileConnection API. My requirement is,
    Whenever user launch the application, Application will get the properties of user read data/user write data permission. if they set the permission like "Always Ask" then application will close otherwise application will launch.
    For this, how can i get read/write permissions of application?. Please help in this query.
    Thanks & Regards
    Siva

    Hi ,
    As the FileConnection API is restricted and need permission.
    You have to set the FileConnection permission into the JAD file. Depends upon the mobile it might be possible that you have to signed the MIDlet.
    Ashish Garg

  • Can't change read-write permissions on DMG despite ownership

    Hey there! So, I recently followed these instructions to create a 20 megabyte, 128-bit encrypted DMG on my hard drive in order to password-protect some confidential documents. I have had no problems opening the DMG or editing its contents, but today I discovered that I am unable to add, delete, or edit its contents, as I receive the following message: "The document "___" could not be saved as "___". The volume “Encrypted” is read only."
    I'm able to mount the DMG and open the document, but I can't make any changes. First, I tried changing the permissions on the document itslef; I went to "Get Info," but I discovered that the Sharing & Permissions indicates I (the admin) should be able "Read & Write." I wanted to to tinker with this, so I clicked the lock icon at the bottom of Info and entered my password, but--mysteriously--I can't change the permissions settings, even when unlocked. I click, but nothing happens.
    Same thing when I try to change permissions for the whole DMG. It says that I have "Read & Write" permissions, but I can't try messing with these settings even after unlocking.
    Now, it's possible that at some point in the last couple of weeks I may have changed the setting of the document to "locked"--I honestly can't remember--but shouldn't I still be able to "unlock" it given my admin status? And even if I compromised that one file, why can't I save any new documents to the DMG?
    Any ideas as to how I can return my DMG to true read-write status?
    Thanks ever so much!
    embr

    Okay, so I figured it out, and it was an "Oh, duh!" moment. Figured I should explain for anyone else experiencing this problem.
    The DMG was locked, but I couldn't see this or change it while it was mounted. So, if you encounter this problem, simply eject the disk, then navigate to its location in Finder, Get Info, and uncheck the "locked" option. That did the trick for me!
    embr

  • Read/Write Permissions for FAT32 SD card.

    Hi all, after a lot of searching in similar threads I have found no answers to my question.
    I have a MobileLite usb drive that takes various sizes of SD cards. I have inserted into it a 256MB regular sized SD card (that which you would find in cameras). I plugged it in to add a file to a folder I had labeled "apps" and the file was clicked and dragged into the folder on the SD card no problem. I disconnected it (safely) and then reconnected it to add another file. Now it is saying that the SD card is read only.
    1) The switch on the SD card is NOT set to lock so I know thats not the problem.
    2) I backed up all the files onto my desktop, and then went into Disk Utility to see if I could reformat it, but it wont let me.
    3) Under "get info" there are no options to change the read/write permissions.
    It is to my understanding that FAT32 should be native for both PC and MAC so I dont know whats going on here. Further more, its troubling me that I was able to write onto the SD card, and after unplugging and plugging back in, I now only have read access.
    Any takes to this problem? Thanks!

    You see that's the thing, I'm not using it for a picture camera. The camera prob wouldnt read the card anyway. I'm using it as a storage device for my Nintendo Wii, I have files that I put on there to use as channels for my Wii Home Screen.

Maybe you are looking for

  • Day photo in calendar - resize

    I am making a calendar in iPhoto.  I would like to put a photo of a person on their birthday in the lower (calendar) page, and iPhoto allows me to do this... but it doesn't allow the photo to be resized.  It automatically takes up the whole day squar

  • How to install SQL Mgmt Studio on the front end

    SQL 2008 R2 I need to install SSMS on the front end server.  On the SQL Windows Server 2008 R2, When I click on START -->ALL PROGRAMS-->MICROSOFT SQL SERVER 2008 R2 I see the following:    SQL Server Management Studio    Analysis Services    Configur

  • Hand symbol vs an Arrow symbol

    Hi Xcesius experts, Can anybody tell me how keep the mouse pointer to an arrow symbol rather than a hand symbol? In flash, when the Hand symbol appears, the speed at which I can move the cursor around really slows down.  I know that in certain condit

  • Upgrade CE Server from SP0 to SP3

    Hi Everyone, I want to upgrade my CE Server from CE 7.1.1Ehp1 SP0 to SP3. I need the documents that will explain the step by step procedure. Now I am using CE 7.1 Ehp1 SP0 trial version, can i upgrade it to SP3? Regards, Gayathri.

  • Laying out designs in B&W

    I'm curious if there is a way to setup a file so that when building it's displayed in black and white. After an initial Google search I couldn't find anything that was really relevant to my question, which is why I'm posting it here. Thank you for an