Creating and using label components
In this recipe, we will create four users and a table called EMPLOYEES_OLS_TBL
. The users in this recipe will receive rights to select data from the table REG_DATA_TBS
according to their hierarchy level. All steps will be performed using the Oracle labels PL/SQL interface.
Getting ready
As a prerequisite, you must have OLS installed. Details about the installation can be found in the OLS documentation link http://docs.oracle.com/cd/B28359_01/network.111/b28529/getstrtd.htm#CIHBBJFA. Another detailed description can be found on the Oracle Support doc:
How to Install/Deinstall Oracle Label Security [ID 171155.1]
All steps will be performed on the HACKDB
database.
How to do it...
In the following steps, we will create a new table EMPLOYESS_OLS_TBL
and label it according to each user's hierarchical position:
Connect as the
HR
user and create the tableEMPLOYEES_OLS_TBL
as follows:SQL> conn HR Enter password: Connected. SQL> CREATE TABLE EMPLOYEES_OLS_TBL...