Tuesday 5 March 2024

Oracle Apps Custom Table with ORG Access Control policy

 Step-1: Create Table & Insert data

create table xxcus.xx_tmp_all(id number, name varchar2(100), org_id number);

Replace XXCUS is with your custom schema name. Also make sure to have ORG_ID column and table name suffix as _ALL.

insert into xxcus.xx_tmp_all values (2,’b’,204);

COMMIT;

Step-2: Create synonyms

CREATE OR REPLACE SYNONYM apps.xx_tmp FOR xxcus.xx_tmp_all;

Step-3: Create Policy


Step-4: Query Data

EXEC MO_GLOBAL.SET_POLICY_CONTEXT(‘S’,201);

select * from apps.xx_tmp; — 201 record retrieved

EXEC MO_GLOBAL.SET_POLICY_CONTEXT(‘S’,204);

select * from apps.xx_tmp; — 204 record retrieved

We can drop by policy with the below command.

Additional Information

Check session org access

No comments:

Post a Comment