Call for Oracle support & training (800) 766-1884
Free Oracle Tips

Corporate Oracle Training
Custom Oracle Training
Oracle New Features Training
Advanced Oracle DBA Classes
Oracle Tuning Courses
Oracle Tips & Tricks
Oracle Training Links
Oracle Training Links
Oracle Training Links

We are top for USA Oracle Training Clients


Free Oracle Tips


Free Oracle App Server Tips


Oracle support

Oracle training

Oracle tuning


Remote Oracle

Custom Oracle Training


  Oracle Tips by Burleson

Oracle 10g Steps to Apply a VPD Policy

  1. Grant the appropriate user with privilege to apply policy.

SQL> grant execute on dbms_rls to vpd_admin;

  1. Create a function that implements the VPD policy

Return …  is

  1. Apply the policy to the table by using the dbms_rls package.

dbms_rls.add_policy (
object_schema     => ‘hr’,
object_name       => ‘employees’,
policy_name       => ‘hr_policy’,
function_schema   => ‘hr’,
function_function => ‘dept_policy_func’,
statement_type    => ‘select, update’,
sec_relevant_cols => ‘salary’);

In the example above, assume the policy allows users to view their own salary information and department managers to view all salaries in their own department but not for employees in different departments.  

The following SQL statement will not enforce row-level access control because none of the relevant columns is accessed.  Therefore, all rows will be returned from the employees table.

SQL> select first_name, last_name, phone_number
   2 from   employees;

The following SQL statement will enforce row-level access control because a security relevant column salary is accessed.

SQL> select employee_id, last_name, salary, department_id
   2 from   employees;

 If user Tobias issues the above SQL statement, the query will rewrite as follows, and he will only see one row return with his own information:

Get the complete story:

The above text is an excerpt from "Oracle Database 10g New Features: Reference for Advanced Tuning and Administration", by Rampant TechPress.  Written by top Oracle experts, this book has a complete online code deport with ready to use scripts. 

To get the code instantly, click here:

Need an Oracle Mentor?

BEI is now offering personal mentors for Oracle DBAs where you can have an Oracle expert right at your fingertips, anytime day or night. We work with hundreds of Oracle databases every year, so we know exactly how to quickly assist you with any Oracle question.

Why risk an unplanned outage? You can now get telephone access to Don Burleson or any of his Oracle Certified DBAs with more than 20 years of full-time IT experience. Click here for details:


Oracle performance tuning book



Oracle performance tuning software

Oracle performance tuning software
Oracle performance Tuning 10g reference poster
Oracle training in Linux commands
Oracle training Excel


email BC:

Copyright © 1996 -  2014 by Burleson Inc. All rights reserved.

Oracle® is the registered trademark of Oracle Corporation.