Using VPD -- Very Confused!

Hey,
I'm trying to write a small amount of code that will generate the PL/SQL that I'll need to implement simple policies like:
Column ________ in table ________ should only be visible by ________ and ________
I've been reading the Oracle Security Guide for a few hours but am so confused by everything that needs to be done!
This is what I'm thinking so far:
* STEP 1: SET SECURE CONTEXT:
* CREATE OR REPLACE PACKAGE $pol_name AS
* PROCEDURE set_user;
* END;
* CREATE OR REPLACE PACKAGE BODY $pol_name AS
* PROCEDURE set_user IS
* user VARCHAR;
* BEGIN
*      user = SYS_CONTEXT('USERENV', 'SESSION_USER');
*      DBMS_SESSION.SET_CONTEXT('app_context', 'user', user);
* END;
* END;
* STEP 2: CREATE A UNIQUE SECURE CONTEXT:
* CREATE CONTEXT user_entry USING $pol_name ;
* STEP 3: SET THE SECURE CONTEXT BEFORE THE USER RETRIEVES DATA (TRIGGERS!):
Obviously I'm not done yet, but I'm just not sure if I'm on the right track!
Any ideas?
Thanks!

Hey, thanks for replying!
I'm using 10g R2 and the documentation talks about column level restriction and a nice new feature called column masking--both of which I'm trying to implement. But those are implemented when adding the policy, I'm most confused by the first few steps, setting up the procedures and what not.
Thanks again!

Similar Messages

  • Have just bought an ipad but have forgotten my gmail password.  I have used this gmail account for my apple id, if I set up a new email account on the ipad , do I have to change this apple id.  Am a very confused novice!!!

    I have recently bought an Ipad but have forgotten my gmail password that I use on my Mac.  I have used this email as my apple ID.  If I now set up a new email account on my Ipad, do I have to change my apple ID as well as my apple password!  HELP A VERY CONFUSED NOVICE!!!

    On your Mac, try to access your gmail account. There should be a link you click for "Forgot My Password". Click it and try to retrieve your password.
     Cheers, Tom

  • I have installed the new up to date itunes which i can open on my PC, however when i connect my ipad or iphone i get an error saying i cannot use the device as the require software isn't installed?? I'm very confused please help......

    I have installed the new up to date itunes which i can open on my PC, however when i connect my ipad or iphone i get an error saying i cannot use the device as the require software isn't installed?? I'm very confused please help......

    Let's try a standalone Apple Mobile Device Support install. It still might not install, but fingers crossed any error messages will give us a better idea of the underlying cause of why it's not installing under normal conditions.
    Download and save a copy of the iTunesSetup.exe (or iTunes64setup.exe) installer file to your hard drive:
    http://www.apple.com/itunes/download/
    Download and install the free trial version of WinRAR:
    http://www.rarlab.com/
    Right-click the iTunesSetup.exe (or iTunes64setup.exe), and select "Extract to iTunesSetup" (or "Extract to iTunes64Setup"). WinRAR will expand the contents of the file into a folder called "iTunesSetup" (or "iTunes64Setup").
    Go into the folder and doubleclick the AppleMobileDeviceSupport.msi (or AppleMobileDeviceSupport64.msi) to do a standalone AMDS install.
    (If it offers you the choice to remove or repair, choose "Remove", and if the uninstall goes through successfully, see if you can reinstall by doubleclicking the AppleMobileDeviceSupport.msi again.)
    Does it install (or uninstall and then reinstall) properly for you? If so, can you get a normal iTunes install to go through properly now?
    If instead you get an error message during the install (or uninstall), let us know what it says. (Precise text, please.)

  • I found the operating system very confusing and hard to use. No tutorial. Manual and online help were outdated.  Tool bars, programs and documents randomly appeared and disappeared. Programs I installed completely disappeared. Anyone else experience this?

    I found the operating system very confusing and hard to use. No tutorial. Manual and online help were outdated.  Tool bars, programs and documents randomly appeared and disappeared. Programs I installed completely disappeared. Anyone else experience this?

    No need to apologize, Jim.  I think your rant was justified.  For years people have been telling me how easy the Mac was to use.  Imagine my frustration when I finally learned from friends and users that it takes weeks or months to make the transition from Windows to Mac.
    Still, I agree that I acted to too hastily when I returned my mini-mac to the store only three days after I bought it.
    I'm going to try again, this time with an iMac.  This time I'll keep it.  Since this thread is for the mini-Mac only, I'll probably be starting a new one for the iMac.
    Why did I decide to try again?  Well, I do like the faster speed and compact hardware of the Macs.  I also like the fact that I can install Windows and use that for my programs until I transition completely to Mac, IF I make the complete transition.
    Thank you all for your suggestions and advice.  I have paid attention to what you said.
    Andy

  • Using G42-360TX is very confuse..when I play the movie with media player the notebook will shutdown

    using G42-360TX is very confuse..when I play the movie with media player the notebook will shutdown

    Whoops, I responded on the wrong thread.  I don't see a way to delete.

  • How to use vpd to restrict rows by application and schema_name?

    We have a need to reuse a schema name many times in a test/dev. environment. Normally we just create a new instance so development can test their apps. using the same schema_name, let's call it test_user. This is very tedious and time consuming to create many db's and sometimes we don't have the hardware to support so many db's. So I was wondering if I could use vpd and an application_context to restrict the rows & columns that can be seen. But instead of restricting it by schema_name I want to restrict it by schema_name and another env. variable like app_name or something similar. So when the middle layer connects with test_user user name and the app is called accts_payable they see parts of the rows that pertain to them. But if the middle layer connects with the test_user user name and the app is called accts_payable2 they see completely different rows. Any help would be appreciated.
    Thanks,
    George

    I was hoping someone else had already been down this path so I don't have to re-invent the wheel. But it looks like I'm going to go down that path. I did find something in the manual that may help but again it's not exactly what I was hoping for so I will have to test it. It mentions using dbms_session to set the application name in the environment like this:
    Consider the application server, AppSvr, that has assigned the client identifier 12345 to client SCOTT. It then issues the following statement to indicate that, for this client identifier, there is an application context called RESPONSIBILITY with a value of 13 in the HR namespace.
    DBMS_SESSION.SET_CONTEXT( 'HR', 'RESPONSIBILITY' , '13', 'SCOTT', '12345' );
    Thanks for your help on this. If anyone else has been through a similar situation please reply.
    Thanks,
    George

  • I am very confused. When I wanna to update my apps in app store, it shows the account which is my iPhone one is not my iPad one. how can I reset to my iPad account?

    I am very confused. When I wanna to update my apps in app store, it shows the account which is my iPhone one is not my iPad one. how can I reset to my iPad account?

    And I am very confused by your query. Your iTunes account is the same on all devices - unless of course you have multiple accounts to begin with.
    If you do have another Apple ID that you use for the iPad purchases, you can sign out of the account that is on the iPad in Settings>Store.
    Perhaps a few more details from you could clear up the confusion???

  • Converting a delete statement using VPD policies and context

    Hello,
    I'm trying to convert a delete statement in a update statement using VPD policies and context.
    +/* Supose the user 'user1' already exists. This is an application user */+
    conn user1/pwd
    create table user1.test_a (
    id                number(4),
    description       varchar2(100),
    deleted           number(1)
    +);+
    alter table user1.test_a add constraint test_a_pk primary key (id);
    insert into user1.test_a (1, 'abc', 0);
    insert into user1.test_a (2, 'def', 0);
    commit;
    I'd like to convert each physical deletion into a logical deletion: statements like "delete from user1.test_a where id = 1" must be converted into "update user1.test_a set deleted = 1 where id = 1".
    I've found the following way: I will create a policy to avoid physical deletion. Additionally, the policy function should update the deletion flag too.
    conn user1/pwd
    +/* Create context package */+
    create or replace package user1.pkg_security_context is
    procedure p_set_ctx(
    i_test_a_id      in   user1.test_a.id   %type
    +);+
    end;
    +/+
    create or replace package body user1.pkg_security_context is
    procedure p_set_ctx (
    i_test_a_id      in   user1.test_a.id   %type
    +) is+
    begin
    dbms_session.set_context( 'user1_ctx', 'test_a_id', i_test_a_id );
    end;
    end;
    +/+
    show errors
    +/* Create trigger to set the context before deletion */+
    create or replace trigger user1.test_a_bef_trg
    before delete on user1.test_a
    for each row
    declare
    pragma autonomous_transaction;
    begin
    -- only commits the preceding update, not the delete that fired the trigger.
    commit;
    user1.pkg_security_context.p_set_ctx( :old.id );
    end;
    +/+
    show errors
    create context user1_ctx using user1.pkg_security_context;
    +/* Policy function */+
    create or replace function user1.f_policy_chk_dels (
    object_schema in   varchar2,
    object_name   in   varchar2
    +) return varchar2+
    is
    out_string                 varchar2(400)   default '1=2 ';
    +/*+
    * out_string is the return value.
    *  - 'WHERE 1=2' means 'nothing to access'
    begin
    if ( loc_logged_usr_authorized > 0 ) then
    +/*+
    * Set the flag deleted to 1
    update user1.test_a set deleted = 1 where id = sys_context( 'user1_ctx', 'test_a_id' );
    out_string := out_string || 'or 1=1 ';
    end if;
    return out_string;
    end;
    +/+
    show errors
    +/*+
    * Create policy
    begin
    dbms_rls.add_policy(
    object_schema   => 'user1'                   ,
    object_name     => 'test_a'                  ,
    policy_name     => 'policy_chk_dels'         ,
    function_schema => 'user1'                   , -- function schema
    policy_function => 'f_policy_chk_dels'       , -- policy function
    statement_types => 'DELETE'
    +);+
    end;
    +/+
    When I try to delete a record of the table test_a:
    conn user1/pwd
    SQL> delete from ilogdia.oplsimulaciones sim       where sim.id = 9999;
    +0 rows deleted+
    No rows has been deleted, but the update stmt does not work. That means, the "deleted" flag has not been updated.
    Any ideas?
    Thank you in advance.
    Marco A. Serrano
    Edited by: albrotar on Oct 15, 2012 8:42 AM
    Edited by: albrotar on Oct 15, 2012 8:42 AM
    Edited by: albrotar on Oct 15, 2012 8:43 AM

    The policy function is applied once per statement execution. The policy function executes first and the UPDATE statement, presumably, updates no rows because the context is not yet populated. The row-level populates the context (I'm assuming that your session can even see context values populated by an autonomous transaction-- I would guess it could but I'd have to test that) after the UPDATE statement is already complete. The COMMIT in the row-level trigger is also pointless-- it only applies to changes made by the current autonomous transaction, of which there are none-- it cannot apply to changes made in other autonomous transactions. Declaring the row-level trigger to use autonomous transactions doesn't seem to accomplish anything other than to open the question of whether the values set in the context by the autonomous transaction are visible in the caller's transaction.
    Even if this, somehow, did work, using autonomous transactions would be a very bad idea since Oracle is free to roll-back a partially executed statement (and the work done by its triggers) and re-execute it. Oracle does that with some regularity to maintain write consistency.
    Justin

  • What exactly is the difference between the new photos app for mac and iPhoto? i'm very confused...

    Ever since i've bought my macbook pro i used iPhoto to organize my photos. Now apple added this new photos app and i don't really understand what is it meant for? can someone please explain me the difference? I'm very confused about the purposes of both apps....

    Now apple added this new photos app and i don't really understand what is it meant for? can someone please explain me the difference? I'm very confused about the purposes of both apps....
    Photos is a completely new designed photo application, designed for Yosemite and the MacOS X versions to come. Many differences are under the hood. It uses the new system libraries and frameworks for more efficient image processing on the new powerful macs, like the mac pro, it is extensible by app extensions, if other developers will add functionality, and most important, it brings integration with iCloud Photo Library. With Photos you can store your photo library in iCloud and sync it across all devices.
    Some features are still missing however, and you can continue to use iPhoto, if you like. Or create a small Photos library for testing and explore Photos, while keeping your main libraries in iPhoto.

  • Error executing a query using VPD and BC4J

    Hi all,
    Our team is developing an application using an Oracle DB 9.2.0.4 and BC4J 10g (9.0.5.16.0) as persistence layer.
    We also are using the VPD (virtual private database) to have security in the database at row level.
    The problem we are facing is that every some time (days) we get a jdbc error when a query (see below) that uses VPD policies is executed. Once the error occurs I execute it from sqlplus without getting any error .. it only occurs from our java application.
    To temporary solve this problem, we delete and recreate the VPD policies, then the application continue working fine for some time ...
    I'll appreciate any comment / suggestions
    Thank in advance.
    Eduardo.
    ERROR LOG:
    oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT * FROM (SELECT CalLocation.ID,
    CalLocation.CODE, eo
    CalLocation.NAME,
    CalLocation.ZIP,
    CalLocation.PHONE,
    CalLocation.FAX,
    CalLocation.ADDRESS1,
    CalLocation.ADDRESS2,
    CalLocation.URL,
    CalLocation.OWNER,
    CalLocation.CTY_ID,
    CalLocation.DESCRIPTION,
    ORefCity.CODE CTY_CODE,
    ORefCountry.ID CTR_ID,
    ORefCountry.CODE CTR_CODE,
    ORefRegion.ID REG_ID,
    ORefRegion.CODE REG_CODE
    FROM CAL_LOCATIONS CalLocation,
    OREF_CITIES ORefCity,
    OREF_COUNTRIES ORefCountry,
    OREF_REGIONS ORefRegion
    WHERE ORefCity.ID = CalLocation.CTY_ID
    and ORefCountry.ID = ORefCity.CTR_ID
    and ORefRegion.ID = ORefCountry.REG_ID) QRSLT WHERE ( ( (CTY_ID = 867) ) )
    ## Detail 0 ##
    java.sql.SQLException: Io exception: Broken pipe
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:189)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:231)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:345)
         at oracle.jdbc.driver.OracleStatement.open(OracleStatement.java:717)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2605)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:457)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:387)

    The symptoms we have been getting are quite similar to the bug 3662364 .
    I'm going to implement the patch for that bug and see what happend then.
    Thank you very much for your help.
    Regards,
    Eduardo.

  • Using VPD (Virtual Private Database) with Discoverer for Dummies

    Firstly could you please excuse me for the title of the thread, but it’s all I could come up with. For those of you who are looking at me with a strange look of disgust, please view thread that started it all: BIS vs DBI vs Noetix .
    Otherwise I’m hoping to gain a greater understanding of how VPD can be used to enhance Discoverer and it’s performance. I've just read that :
    “Oracle 8i introduced the notion of a Virtual Private Database (VPD). A VPD offers Fine-Grained Access Control (FGAC) for secure separation of data. This ensures that users only have access to data that pertains to them. Using this option, one could even store multiple companies' data within the same schema, without them knowing about it.
    VPD configuration is done via the DBMS_RLS (Row Level Security) package. Select from SYS.V$VPD_POLICY to see existing VPD configuration.”
    With Regards to Discoverer, I would like to ask the following:
    -When would be best to use VPD in Discoverer?
    -Pro’s and Con’s of VPD?
    -Tips / Tricks?
    -and anything else Michael would like to add (I don’t believe there is a post limit, although this could change in the future)
    I've found a few handy links:
    http://www.adp-gmbh.ch/ora/security/vpd/index.html
    http://www.oracle.com/technology/oramag/oracle/04-mar/o24tech_security.html
    As Metalink support would say : I Looking forward to your ‘Positive’ comments. ;-)
    Lance

    Lance,
    You sure do raise some interesting questions here.
    I've noticed from some of your previous posts that you are using views to link Discoverer through to apps. I have found this very interesting document that may help with your queries; http://www.oracle.com/technology/deploy/security/oracle9ir2/pdf/VPD9ir2twp.pdf
    If you scroll down to the section "Additional VPD Capabilities" and read the following sub-topics, this might enable you to base your Discoverer reports on views that contain VPD policies.
    I trust "My Positive Comment" may help!!
    Merry Christmas
    Si ;-)
    P.s This also may come in handy if running 10g http://www.stanford.edu/dept/itss/docs/oracle/10g/network.101/b10773/apdvpoli.htm
    Message was edited by:
    Simon Pittaway

  • The TOC is very confusing. How can I see the page showing the list of chapters and accompanying pages?

    The TOC is very confusing. How can I see the whole list of all the chapters, as it would appear in a book? I only can see a vague image of the chapter title, and only from one chapter at a time; the chapter I am on. In the instruction example it shows also only the "title" of the chapter it pertains to, but it is all in legeable text. The inspector gives options, but it does not explain how to apply it, and I cannot see what my option will look like and to what part of the "text" it is referring.

    The "lower rectangles" are thumbnails of the actual pages in your book... the text was presumably the content of your book. IF you did as I suggested to keep the TOC listing of a full book.. but removed content on all except the three chapters you want to send off to XXXXX -  then the "rectangles are showing blank pages. Which is normal.
    You need to understand that Apple created iBooks Author to create a book which can be obtained from their iBooks store. The application is flexible for customisation to a large extent and the innovative make use of that flexibility. The TOC basically replaces the old Index in printed books to advise readers what content is available.
    On an iPad, or Mac now, Insterad of using  "hyperlinks" from a written index page... which is basic web page navigation - Apple chose  to have a visual TOC.
    Basically you  have to decide - create a three chapter sample which you seem to require - which will show the TOC as it is, or  if you the whole TOC of the finished book is required to show... but  not the content, you end  up with blank "rectangles".  
    Screenshots oniPads... press the  top right start button and the  lower centre,  home buttom together and it  makes a screenshot. Transfer to your computer ( email or Dropbox type cloud) and  add to your post.

  • Very confused with iTunes Store issues

    Dear all,
    I am a Mac user who owns several mac computers and several iOS devices.
    I have become very confused over my rights concerning my specific Apple iD.
    I understand that when purchasing DRM free music from iTunes (256 bit - it appears as Purchased AAC audio file) on my main Mac computer, then I can play this music to as many computers I have, not only 5. Is this correct?
    I remember at some point that on one of my other Mac computers ( my secondary computer - a Mac Mini) I was able to listen to my music purchased, in the past, on my main computer, by having it streamed (not downloaded) from the iCloud onto my secondary computer. Somehow this has been lost recently. Now I am faced with the task to authorise my secondary computer, which I cannot do, because I have 5 computers already authorised.
    What am I doing wrong?
    Has iTunes 11 changed anything in this respect?
    Any help will be most appreciated.
    Merry Christmas and best regards
    Andreas

    Limnos wrote:
    err = -50 when downloading from store - https://discussions.apple.com/thread/3697501 - delete incomplete downloads from downloads folder as per http://support.apple.com/kb/TS3297
    iTunes Store: "Error (-50)" when downloading purchased content - http://support.apple.com/kb/TS1583
    iTunes Customer Service Contact - http://www.apple.com/support/itunes/contact.html
    I had tried all these, deleting 'Downloads' folder in 'iTunes Media', creating a new user (administrator) account and downloading movie with the new account, following error -50 trouble shooting steps, but none of them worked. I did contact iTunes customer service. In addition to what listed above, they also suggested I download the movie using another computer and transfer the file to my macbook air, which has nothing to do with my problem at all.

  • Sequencing pages for me is very confusing.

    Sequencing pages for me is very confusing.
    Are there any step by step instructions somewhere that give detailed instructions on how to sequence pages for Indesign in the "correct" order?
    1) Saddle stitch (CD booklet stapled in the middle) This is the kind where the page order gets shuffled and I'm not sure how InDesign wants to "see" the layout of pages so I can let Indesign do the correct page order.
    2) Spiral Bound (no shuffling of page order here, just front and back 1-2, 3-4, 5-6, etc.) This one is easier, so I succeeded in accomplishing it once, but I still had to do a lot of reordering of the pages, for example, whenever I had to "insert" a new page between other pages that were already numbered in the correct sequence.
    I hope that I was clear. Basically, I get very confused if I cannot physically organize a real paper copy of the pages. My goal is to master the Saddle Stitch and stick with that since I dislike anything spiral bound.
    I was told that I should either let the printer people handle page signature (which in my opinuion would severely confuse things) or that maybe, if I want to sequence pages correctly, InDesign has a feature which just automatically sequence the pages. Thanks for any help!

    I'll repond to everybody's post in one big paragraph, lumping everyone together:
    (My InDesign version is CS3)
    Sorry, I meant to say 'imposition' instead of 'signature', and I was using the term 'page order', because even people who use InDesign and know what I'm talking about, they might not be familiar with creating saddle stitch pages. Mike Trout, the link you provided didn't work!
    Mike Gianino, are you saying i must TELL indesign to use reader spreads, and then when i am finished, tell it to organize everything into 'printer speads' automatically? Is that option a one step process found in the InDesign menu? Because even if I do what you say.. I will still have to visually organize the pages in a way that Heather mentioned (numerically, but shuffled) This is where the battle between visual layout and numerical page order can get confusing if you have InDesign doing some work automatically with one click of the button. ("printer speads")
    Now, I realize that it is wise to ask your printer what they need,
    but I plan on doing a lot of this on my own at home at some point. And so, I will have to be "on my own" in regards to not wasting all that precious paper and ink.
    Heather, I;ll check out InBooklet.
    Now, in other words, to clarify what you said..
    if my saddle stitch book was, say 18 pages, instead of 16,
    it would go like this?
    18/1
    2/17
    16/3
    4/15
    14/5
    6/13
    12/7
    8/11
    10/9...??
    For some reason, it looks like my page 10 comes before my page 9!
    Also, if i want to add a cover to those pages, should i
    put it on a separate document? Because it looks like that
    part of the book will not be numbered!

  • I have a iphone 5 and I can login with my apple id to purchase music. However, when I try to login into icloud using the very same username and password that I use in the apple store it does not work to enter icloud, so what what gives???

    I have a iphone 5 and I can login with my apple id to purchase music. However, when I try to login into icloud using the very same username and password that I use in the apple store it does not work to enter icloud, so what what gives???

    I could do that, however when I select the icloud button (or whatever the heck it is) I am asked to enter the apple id and password. So if you are suppose to create another one for icloud you'd think it would give you the option at this point which would be logical.

Maybe you are looking for