SEARCH YOUR SOLUTION HERE  

Virtual Private Database Problem

I am testing Virtual Private database
i want to restrict access test table in hr schema
EMPLOYEE_ID FIRST_NAME SALARY
----------- -------------------- ----------
201 ABC 13000
202 XYZ 6000
203 USER3 6500
204 USER4 10000
205 USER5 12000

For Example when user abc query the test table
he can't see other users record

1-i have created a functtion in hr schema by using the following script
create or replace function policy_funct(owner varchar2,objname varchar2)
return varchar2
is
where_clause varchar2(200);
begin
where_clause:='fisrt_name=sys_context(' 'USERENV' ',' 'SESSION_USER' ')';
return where_clause;
end;

2-Then i had added the policy function
begin
dbms_rls.add_policy(object_schema=>'HR',object_name=>'TEST',
policy_name=>'test_policy',function_schema=>'SYS',
policy_function=>'policy_func',sec_relevant_cols=>'SALARY');
end;

3-Then i connect as ABC user and try to execute the following query
select * from hr.test
*
ERROR at line 1:
ORA-28110: policy function or package HR.POLICY_FUNC has error

Policy Function is valid when i checked its status

Can anybody help me in this regard
thanx in advance

Posted On: Monday 12th of November 2012 01:16:21 AM Total Views:  220
View Complete with Replies




Related Messages:

virtual private database   (73 Views)
I need to set up a row level security and was attempting do it using virtual private databse concept. There I had to use DBMS_SESSION.SET_CONTEXT to setup contexts. I am getting not enough privilege to use this sys package. Do I need to be a sys or system to be able to setup vpd Unfortunately I do not have access to sys or system accounts. Is there any way to setup row level security without using views. Also, is there a way to setup cpd for inserts
virtual column partion on date   (72 Views)
I have a table with approx 60 millions rows and 900 distinct dates. I want to convert this table to a interval partition by day but some people are balking because this will use a system generated partition name. Is there a way I can use a virtual column on a date columne (say create_date) and have that be the partition key. This way I will have no empty partition names and I can make the name of the partition the same as the date value, which will work with my other scripts. I am looking to do something like this: create table t ( create_date date, data varchar2(30) ) ALTER TABLE T ADD (the_date AS to_char(created_date,'yyymmdd')); partition on the_date I have two questions: 1) Will this work 2) If so can somebody show me the syntax
virtual private database   (71 Views)
I need to set up a row level security and was attempting do it using virtual private databse concept. There I had to use DBMS_SESSION.SET_CONTEXT to setup contexts. I am getting not enough privilege to use this sys package. Do I need to be a sys or system to be able to setup vpd Unfortunately I do not have access to sys or system accounts. Is there any way to setup row level security without using views. Also, is there a way to setup cpd for inserts
tuning private SQL area?   (61 Views)
Why does my PARSE times always equal to EXECUTE times when I query data using the same sql statement with SQLPLUS The initiation parameter OPEN_CURSORS equals to 100, is it too small How can I tune it Any suggestions will be appreciated.
how to create virtual host in 10gAS on solaris   (71 Views)
We are trying to create virtual-host on 10gas(on solaris) manually. we just want to access our form-listener by following :- http://c5bms.taj.com/forms90/f90serv...rm=bbstart.fmx instead of traditional one like :- http://10.50.1.101:7778/forms90/f90s...rm=bbstart.fmx SO , 1. We did following in httpd.conf of middle-tier oracle_home DocumentRoot /u02/ora9ias/Apache/Apache/htdocs ServerName c5bms.taj.com 2. and then run the dcmctl updateconfig -ct ohs -v -d to update the settings . 3.After these changes when we tried giving following in our IE-address bar ,nothing happens . http://10.50.1.101:7778/forms90/f90s...rm=bbstart.fmx (The page cannot be displayed) OR http://c5bms.taj.com/forms90/f90serv...rm=bbstart.fmx (it connects to internet instead and trying to find the web-site ) One more thing is that when we tried to look the status of virtual host thru EM web-site ,it shows ---------------------------------------------------------------------- c5bms.taj.com 7778 10.50.1.101 IP-based http Unavailable ---------------------------------------------------------------------- taj.com 4443 default https (SSL) Unavailable ---------------------------------------------------------------------- May be something need to be started after this what is that. Is there any port(7778) related problem. regards anurag vidyarthi
question: virtual global database   (79 Views)
we have a number of databases around the world with identical schemas. Is there anyway of setting up a big virtual database that brings in all the data from each identical schema. Using partitioning perhaps
Relevance of virtual memory for Oracle / NT Server   (127 Views)
How important is it to have pagefile (virtual memory) on NT OS I have my Oracle loaded in C drive but no pagefile there. D drive has 1GB pagefile. Is this right/wrong Nizar
private synonyms-request help   (195 Views)
Hi i have 4 schemas each containing about 800 tables.i am required to create alias users for these schemas and create private synonyms for the corresponding tables.creating the synonyms one by one is nopt practical coz i have oonly one day to do it.i am not familiar with pl/sql.can anyone kindly tell me how to generate the create synonym and grant scripts. i am using oracle 8.1.6 on aix4.3.
virtual private database   (123 Views)
I need to set up a row level security and was attempting do it using virtual private databse concept. There I had to use DBMS_SESSION.SET_CONTEXT to setup contexts. I am getting not enough privilege to use this sys package. Do I need to be a sys or system to be able to setup vpd Unfortunately I do not have access to sys or system accounts. Is there any way to setup row level security without using views. Also, is there a way to setup cpd for inserts
virtual column partion on date   (119 Views)
I have a table with approx 60 millions rows and 900 distinct dates. I want to convert this table to a interval partition by day but some people are balking because this will use a system generated partition name. Is there a way I can use a virtual column on a date columne (say create_date) and have that be the partition key. This way I will have no empty partition names and I can make the name of the partition the same as the date value, which will work with my other scripts. I am looking to do something like this: create table t ( create_date date, data varchar2(30) ) ALTER TABLE T ADD (the_date AS to_char(created_date,'yyymmdd')); partition on the_date I have two questions: 1) Will this work 2) If so can somebody show me the syntax
question: virtual global database   (115 Views)
we have a number of databases around the world with identical schemas. Is there anyway of setting up a big virtual database that brings in all the data from each identical schema. Using partitioning perhaps
virtual directory for asp.net and mysql   (164 Views)
hi friends i have developed a website in asp.net 2.0 with apache server (mysql) as a backend support. This site works fine from Visual studio.net editor but i m not able to create virtual diretory for it. IIS server and Apache server cannot run simultaneously. plz guide me how to create virtual directory on local computer for web application developed in asp.net 2.0 and database created in mysql using apache server
virtual path provider and mysql   (194 Views)
hello i try to create a virtual path provider. all examples use sql server and i want to use mysql. i declare in project references the mysql and i can use it in my pages. but when i try to included in App_Code folder. (eg in VirtualFile.cs file) i get this error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS0246: The type or namespace name 'MySql' could not be found (are you missing a using directive or an assembly reference) Source Error: Line 16: using System.Data.SqlClient;Line 17: using System.Text;Line 18: using MySql.Data.MySqlClient;Line 19: namespace VP Source File: c:\Documents and Settings\dep18495\My Documents\Visual Studio 2008\Projects\VPP\VPP\App_Code\DBVirtualFile.cs Line: 18 why how can i use mysql to create a vpp i found solution. except in the reference folder i must declared in the web.config the mysql driver:
Will an IMPORT fire database triggers?   (85 Views)
Will importing rows into a table fire the triggers on the target table
why must have init.ora in $ORACLE_HOME\database directory?   (80 Views)
Platform: Oracle 8.1.7.3 on Win2k. Why do we have to have init.ora file in the $ORACLE_HOME\database directory This file simply contains a "link" pointing to where the real init.ora is. I tried to start a database with simply "startup" but it complained the file does not exist with LRM-00109 error. Is this for backward compatibility
When do you need to "alter database open resetlogs"?   (137 Views)
This a recovery test. I dropped all control files and all datafiles while the db is up and running. Then, I use rman to do the following restore and recovery. As fas as I know, as long as you have all archived logs and online redo logs, you can recover and open the database without "resetlogs." Why does this one require me to "resetlogs" run { allocate channel tape1 type 'sbt_tape'; allocate channel tape2 type 'sbt_tape'; restore controlfile; alter database mount; restore database; recover database; sql "ALTER DATABASE OPEN"; release channel tape1; release channel tape2; }
vms database startup problem   (84 Views)
Hi , one of our adminstrator copied all binaries , and datafiles from production box to disaster recovery box . but when i was trying to start the database It is prompting TNS prompting during execution of command itself . could anybody tell us what we are missing . [ORACLE8]> svrmgrl Oracle Server Manager Release 3.1.7.0.0 - Production Copyright (c) 1997, 1999, Oracle Corporation. Rights Reserved. ORA-12162: TNS:service name is incorrectly specified SVRMGR> connect internal Password: Password: ORA-12162: TNS:service name is incorrectly specified SVRMGR>