I'm developing an Apex application that uses database Contexts in conjunction with Row Level Security. I'd like to install a second copy of the schema and workspace on the same instance; this works except for the Context, which is a global thing.
For example, in schema "DEV", I create the context:
CREATE OR REPLACE CONTEXT myapp_ctx USING myapp_pkg;
When I query dba_context, I see my context has been created:
NAMESPACE SCHEMA PACKAGE TYPE
========= ====== ========= ================
MYAPP_CTX DEV MYAPP_PKG ACCESSED LOCALLY
In schema "TEST", I create the context as before:
CREATE OR REPLACE CONTEXT myapp_ctx USING myapp_pkg;
This has the effect of removing the dev context and replacing it with the test one:
NAMESPACE SCHEMA PACKAGE TYPE
========= ====== ========= ================
MYAPP_CTX TEST MYAPP_PKG ACCESSED LOCALLY
I've got the context name hardcoded in various parts of the application (e.g. views, packages, etc) and would rather not have it differ between environments if I can help it.
At the moment my only idea is to parameterize the namespace name in the deployment scripts - so that the namespace will be e.g. MYAPP_CTX_DEV or MYAPP_CTX_TEST depending on a configuration option in the deployment scripts.
Are there any better alternatives that allow me to install multiple versions of my application on the one instance?
Oracle version 11.1.0.7
