Example: How to Move a RLS Policy Between Databases Using Datapump
(Doc ID 1637312.1)
Last updated on NOVEMBER 29, 2024
Applies to:
Oracle Database - Enterprise Edition - Version 11.2.0.1 to 12.1.0.1 [Release 11.2 to 12.1] Oracle Database Cloud Schema Service - Version N/A and later Gen 1 Exadata Cloud at Customer (Oracle Exadata Database Cloud Machine) - Version N/A and later Oracle Cloud Infrastructure - Database Service - Version N/A and later Oracle Database Cloud Exadata Service - Version N/A and later Information in this document applies to any platform.
Goal
NOTE: In the images and/or the document content below, the user information and environment data used represents fictitious data from the Oracle sample or bulit-in schema(s), Public Documentation delivered with an Oracle database product or other training material. Any similarity to actual environments, actual persons, living or dead, is purely coincidental and not intended in any manner.
The objective is to move the RLS policy between databases with data pump export and import.
This may be best illustrated with an example, where an RLS policy is created in the source database (SOURCEDB), exported with data pump export utility (expdp) and finally imported into the target database (TARGETDB) with the data pump import utility (impdp).
The policy will restrict access to records in the SCOTT.EMP table to rows WHERE ENAME = 'SMITH'. This of course is not a very good policy as it will restrict access to everyone, including SCOTT. But the purpose of this document is to illustrate how to export a policy, not how to write a good policy.
Solution
To view full details, sign in with your My Oracle Support account.
Don't have a My Oracle Support account? Click to get started!